Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Commit

Permalink
Move types up to Windows.Core
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzhandler committed Jul 4, 2020
1 parent 1cc0ac8 commit 20d6462
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 125 deletions.
20 changes: 1 addition & 19 deletions src/User32/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ PInvoke.User32.DIALOG_DPI_CHANGE_BEHAVIORS.DDC_DEFAULT = 0 -> PInvoke.User32.DIA
PInvoke.User32.DIALOG_DPI_CHANGE_BEHAVIORS.DDC_DISABLE_ALL = 1 -> PInvoke.User32.DIALOG_DPI_CHANGE_BEHAVIORS
PInvoke.User32.DIALOG_DPI_CHANGE_BEHAVIORS.DDC_DISABLE_CONTROL_RELAYOUT = PInvoke.User32.DIALOG_DPI_CHANGE_BEHAVIORS.DDC_DISABLE_ALL | PInvoke.User32.DIALOG_DPI_CHANGE_BEHAVIORS.DDC_DISABLE_RESIZE -> PInvoke.User32.DIALOG_DPI_CHANGE_BEHAVIORS
PInvoke.User32.DIALOG_DPI_CHANGE_BEHAVIORS.DDC_DISABLE_RESIZE = 2 -> PInvoke.User32.DIALOG_DPI_CHANGE_BEHAVIORS
PInvoke.User32.DISPLAY_DEVICE
PInvoke.User32.DISPLAY_DEVICE.DISPLAY_DEVICE() -> void
PInvoke.User32.DISPLAY_DEVICE.DeviceID -> char*
PInvoke.User32.DISPLAY_DEVICE.DeviceKey -> char*
PInvoke.User32.DISPLAY_DEVICE.DeviceName -> char*
PInvoke.User32.DISPLAY_DEVICE.DeviceString -> char*
PInvoke.User32.DISPLAY_DEVICE.StateFlags -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DISPLAY_DEVICE.cb -> uint
PInvoke.User32.DPI_AWARENESS
PInvoke.User32.DPI_AWARENESS.DPI_AWARENESS_INVALID = -1 -> PInvoke.User32.DPI_AWARENESS
PInvoke.User32.DPI_AWARENESS.DPI_AWARENESS_PER_MONITOR_AWARE = 2 -> PInvoke.User32.DPI_AWARENESS
Expand All @@ -51,13 +43,6 @@ PInvoke.User32.DPI_HOSTING_BEHAVIOR
PInvoke.User32.DPI_HOSTING_BEHAVIOR.DPI_HOSTING_BEHAVIOR_DEFAULT = 0 -> PInvoke.User32.DPI_HOSTING_BEHAVIOR
PInvoke.User32.DPI_HOSTING_BEHAVIOR.DPI_HOSTING_BEHAVIOR_INVALID = -1 -> PInvoke.User32.DPI_HOSTING_BEHAVIOR
PInvoke.User32.DPI_HOSTING_BEHAVIOR.DPI_HOSTING_BEHAVIOR_MIXED = 1 -> PInvoke.User32.DPI_HOSTING_BEHAVIOR
PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DisplayDeviceFlags.DISPLAY_DEVICE_ACTIVE = 1 -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DisplayDeviceFlags.DISPLAY_DEVICE_MIRRORING_DRIVER = 8 -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DisplayDeviceFlags.DISPLAY_DEVICE_MODESPRUNED = 134217728 -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DisplayDeviceFlags.DISPLAY_DEVICE_PRIMARY_DEVICE = 4 -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DisplayDeviceFlags.DISPLAY_DEVICE_REMOVABLE = 32 -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DisplayDeviceFlags.DISPLAY_DEVICE_VGA_COMPATIBLE = 16 -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.EnumDisplayDevicesFlags
PInvoke.User32.EnumDisplayDevicesFlags.EDD_GET_DEVICE_INTERFACE_NAME = 1 -> PInvoke.User32.EnumDisplayDevicesFlags
PInvoke.User32.GetMenuDefaultItemFlags
Expand Down Expand Up @@ -196,9 +181,6 @@ static PInvoke.User32.CreateCursor(System.IntPtr hInst, int xHotspot, int yHotSp
static PInvoke.User32.CreateCursor(System.IntPtr hInst, int xHotspot, int yHotSpot, int nWidth, int nHeight, byte[] pvANDPlane, byte[] pvXORPlane) -> PInvoke.User32.SafeCursorHandle
static PInvoke.User32.CreateWindowEx(PInvoke.User32.WindowStylesEx dwExStyle, short lpClassName, string lpWindowName, PInvoke.User32.WindowStyles dwStyle, int x, int y, int nWidth, int nHeight, System.IntPtr hWndParent, System.IntPtr hMenu, System.IntPtr hInstance, System.IntPtr lpParam) -> System.IntPtr
static PInvoke.User32.CreateWindowEx(PInvoke.User32.WindowStylesEx dwExStyle, short lpClassName, string lpWindowName, PInvoke.User32.WindowStyles dwStyle, int x, int y, int nWidth, int nHeight, System.IntPtr hWndParent, System.IntPtr hMenu, System.IntPtr hInstance, void* lpParam) -> System.IntPtr
static PInvoke.User32.DISPLAY_DEVICE.Create() -> PInvoke.User32.DISPLAY_DEVICE
static PInvoke.User32.EnumDisplayDevices(string lpDevice, uint iDevNum, System.IntPtr lpDisplayDevice, PInvoke.User32.EnumDisplayDevicesFlags dwFlags) -> bool
static PInvoke.User32.EnumDisplayDevices(string lpDevice, uint iDevNum, ref PInvoke.User32.DISPLAY_DEVICE lpDisplayDevice, PInvoke.User32.EnumDisplayDevicesFlags dwFlags) -> bool
static PInvoke.User32.GetCursorInfo(System.IntPtr pci) -> bool
static PInvoke.User32.GetCursorInfo(out PInvoke.User32.CURSORINFO pci) -> bool
static PInvoke.User32.GetMenuBarInfo(System.IntPtr hwnd, PInvoke.User32.MenuObject idObject, int idItem, System.IntPtr pmbi) -> bool
Expand Down Expand Up @@ -229,7 +211,7 @@ static extern PInvoke.User32.AreDpiAwarenessContextsEqual(System.IntPtr dpiConte
static extern PInvoke.User32.CreateCursor(System.IntPtr hInst, int xHotspot, int yHotSpot, int nWidth, int nHeight, byte* pvANDPlane, byte* pvXORPlane) -> PInvoke.User32.SafeCursorHandle
static extern PInvoke.User32.DestroyWindow(System.IntPtr hWnd) -> bool
static extern PInvoke.User32.EnableNonClientDpiScaling(System.IntPtr hwnd) -> bool
static extern PInvoke.User32.EnumDisplayDevices(string lpDevice, uint iDevNum, PInvoke.User32.DISPLAY_DEVICE* lpDisplayDevice, PInvoke.User32.EnumDisplayDevicesFlags dwFlags) -> bool
static extern PInvoke.User32.EnumDisplayDevices(string lpDevice, uint iDevNum, PInvoke.DISPLAY_DEVICE* lpDisplayDevice, PInvoke.User32.EnumDisplayDevicesFlags dwFlags) -> bool
static extern PInvoke.User32.GetAwarenessFromDpiAwarenessContext(System.IntPtr dpiAwarenessContext) -> PInvoke.User32.DPI_AWARENESS
static extern PInvoke.User32.GetCursor() -> PInvoke.User32.SafeCursorHandle
static extern PInvoke.User32.GetCursorInfo(PInvoke.User32.CURSORINFO* pci) -> bool
Expand Down
58 changes: 0 additions & 58 deletions src/User32/User32+DISPLAY_DEVICE.cs

This file was deleted.

47 changes: 0 additions & 47 deletions src/User32/User32+DisplayDeviceFlags.cs

This file was deleted.

41 changes: 41 additions & 0 deletions src/Windows.Core/DISPLAY_DEVICE+DisplayDeviceFlags.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright © .NET Foundation and Contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace PInvoke
{
using System;

/// <summary>
/// Device state flags.
/// </summary>
[Flags]
public enum DisplayDeviceFlags : uint
{
/// <summary>
/// Specifies whether a monitor is presented as being "on" by the respective GDI view.
/// Windows Vista: EnumDisplayDevices will only enumerate monitors that can be presented as being "on".
/// </summary>
DISPLAY_DEVICE_ACTIVE = 0x00000001,

/// <summary>
/// Represents a pseudo device used to mirror application drawing for remoting or other purposes. An invisible pseudo monitor is associated with this device.
/// For example, NetMeeting uses it. Note that <c>User32.GetSystemMetrics</c> (<c>SM_MONITORS</c>) only accounts for visible display monitors.
/// </summary>
DISPLAY_DEVICE_MIRRORING_DRIVER = 0x00000008,

/// <summary>The device has more display modes than its output devices support.</summary>
DISPLAY_DEVICE_MODESPRUNED = 0x08000000,

/// <summary>
/// The primary desktop is on the device. For a system with a single display card, this is always set.
/// For a system with multiple display cards, only one device can have this set.
/// </summary>
DISPLAY_DEVICE_PRIMARY_DEVICE = 0x00000004,

/// <summary>The device is removable; it cannot be the primary display.</summary>
DISPLAY_DEVICE_REMOVABLE = 0x00000020,

/// <summary>The device is VGA compatible.</summary>
DISPLAY_DEVICE_VGA_COMPATIBLE = 0x00000010,
}
}
52 changes: 52 additions & 0 deletions src/Windows.Core/DISPLAY_DEVICE.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright © .NET Foundation and Contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace PInvoke
{
using System.Runtime.InteropServices;

/// <summary>
/// Receives information about the display device specified by the <c>iDevNum</c> parameter of the <c>User32.EnumDisplayDevices</c> function.
/// </summary>
public unsafe struct DISPLAY_DEVICE
{
/// <summary>
/// Size, in bytes, of the DISPLAY_DEVICE structure. This must be initialized prior to calling <c>User32.EnumDisplayDevices</c>.
/// </summary>
public uint cb;

/// <summary>
/// An array of characters identifying the device name. This is either the adapter device or the monitor device.
/// </summary>
public fixed char DeviceName[32];

/// <summary>
/// An array of characters containing the device context string. This is either a description of the display adapter or of the display monitor.
/// </summary>
public fixed char DeviceString[128];

/// <summary>
/// Device state flags.
/// </summary>
public DisplayDeviceFlags StateFlags;

/// <summary>
/// Not used.
/// </summary>
public fixed char DeviceID[128];

/// <summary>
/// Reserved.
/// </summary>
public fixed char DeviceKey[128];

/// <summary>
/// Initializes a new instance of the <see cref="DISPLAY_DEVICE"/> struct
/// with the <see cref="cb" /> field initialized.
/// </summary>
/// <returns>
/// An instance of the structure.
/// </returns>
public static DISPLAY_DEVICE Create() => new DISPLAY_DEVICE { cb = (uint)sizeof(DISPLAY_DEVICE) };
}
}
18 changes: 17 additions & 1 deletion src/Windows.Core/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
PInvoke.DISPLAY_DEVICE
PInvoke.DISPLAY_DEVICE.DISPLAY_DEVICE() -> void
PInvoke.DISPLAY_DEVICE.DeviceID -> char*
PInvoke.DISPLAY_DEVICE.DeviceKey -> char*
PInvoke.DISPLAY_DEVICE.DeviceName -> char*
PInvoke.DISPLAY_DEVICE.DeviceString -> char*
PInvoke.DISPLAY_DEVICE.StateFlags -> PInvoke.DisplayDeviceFlags
PInvoke.DISPLAY_DEVICE.cb -> uint
PInvoke.DisplayDeviceFlags
PInvoke.DisplayDeviceFlags.DISPLAY_DEVICE_ACTIVE = 1 -> PInvoke.DisplayDeviceFlags
PInvoke.DisplayDeviceFlags.DISPLAY_DEVICE_MIRRORING_DRIVER = 8 -> PInvoke.DisplayDeviceFlags
PInvoke.DisplayDeviceFlags.DISPLAY_DEVICE_MODESPRUNED = 134217728 -> PInvoke.DisplayDeviceFlags
PInvoke.DisplayDeviceFlags.DISPLAY_DEVICE_PRIMARY_DEVICE = 4 -> PInvoke.DisplayDeviceFlags
PInvoke.DisplayDeviceFlags.DISPLAY_DEVICE_REMOVABLE = 32 -> PInvoke.DisplayDeviceFlags
PInvoke.DisplayDeviceFlags.DISPLAY_DEVICE_VGA_COMPATIBLE = 16 -> PInvoke.DisplayDeviceFlags
PInvoke.HResult.Code.CO_E_CANCEL_DISABLED = 2147549504 -> PInvoke.HResult.Code
PInvoke.HResult.Code.RPC_E_CALL_CANCELED = 2147549186 -> PInvoke.HResult.Code
PInvoke.HResult.Code.RPC_E_CALL_COMPLETE = 2147549463 -> PInvoke.HResult.Code
const PInvoke.ApiSets.api_ms_win_core_errorhandling_l1_1_1 = "api-ms-win-core-errorhandling-l1-1-1.dll" -> string
const PInvoke.ApiSets.api_ms_win_core_registry_l1_1_0 = "api-ms-win-core-registry-l1-1-0.dll" -> string
const PInvoke.ApiSets.api_ms_win_security_sddl_l1_1_0 = "api-ms-win-security-sddl-l1-1-0.dll" -> string
static PInvoke.DISPLAY_DEVICE.Create() -> PInvoke.DISPLAY_DEVICE
static PInvoke.POINT.implicit operator PInvoke.POINT(System.Drawing.Point point) -> PInvoke.POINT
static PInvoke.POINT.implicit operator System.Drawing.Point(PInvoke.POINT point) -> System.Drawing.Point
static PInvoke.POINT.implicit operator System.Drawing.Point(PInvoke.POINT point) -> System.Drawing.Point

0 comments on commit 20d6462

Please sign in to comment.