-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDeviceChangeNotification.cs
More file actions
53 lines (42 loc) · 1.21 KB
/
Copy pathDeviceChangeNotification.cs
File metadata and controls
53 lines (42 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Runtime.InteropServices;
namespace MarvinsAIRA
{
class DeviceChangeNotification
{
#region Constants
public static readonly Guid USB_HID_GUID = new( "4d1e55b2-f16f-11cf-88cb-001111000030" );
public const ushort DBT_DEVICEARRIVAL = 0x8000;
public const ushort DBT_DEVICEREMOVECOMPLETE = 0x8004;
public const ushort DBT_DEVTYP_DEVICEINTERFACE = 0x0005;
public const int DEVICE_NOTIFY_WINDOW_HANDLE = 0x0000;
#endregion
#region Device Change Structures
[StructLayout( LayoutKind.Sequential )]
public class DEV_BROADCAST_DEVICEINTERFACE
{
public int dbcc_size;
public int dbcc_devicetype;
public int dbcc_reserved;
public Guid dbcc_classguid;
public char dbcc_name;
}
[StructLayout( LayoutKind.Sequential, CharSet = CharSet.Unicode )]
public class DEV_BROADCAST_DEVICEINTERFACE_1
{
public int dbcc_size;
public int dbcc_devicetype;
public int dbcc_reserved;
public Guid dbcc_classguid;
[MarshalAs( UnmanagedType.ByValArray, SizeConst = 255 )]
public char[] dbcc_name;
}
[StructLayout( LayoutKind.Sequential )]
public class DEV_BROADCAST_HDR
{
public int dbch_size;
public int dbch_devicetype;
public int dbch_reserved;
}
#endregion
}
}