@@ -1322,6 +1322,20 @@ public enum WindowShowCommand : int {
13221322 public long Luid ;
13231323 public uint Attr ;
13241324 }
1325+ [ StructLayout ( LayoutKind . Sequential ) ] public struct SP_DEVINFO_DATA {
1326+ public int cbSize ;
1327+ public Guid ClassGuid ;
1328+ public int DevInst ;
1329+ public IntPtr Reserved ;
1330+ }
1331+ [ StructLayout ( LayoutKind . Sequential ) ] public struct DEVPROPKEY {
1332+ public DEVPROPKEY ( string strGuid , int pid ) {
1333+ fmtid = new Guid ( strGuid ) ;
1334+ this . pid = pid ;
1335+ }
1336+ public Guid fmtid ;
1337+ public int pid ;
1338+ }
13251339 #endregion
13261340
13271341 [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "user32.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
@@ -1547,4 +1561,33 @@ public enum WindowShowCommand : int {
15471561 [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "kernel32.dll" , CharSet = CharSet . Unicode , SetLastError = true ) ]
15481562 public static extern unsafe bool GetBinaryType ( string lpApplicationName , ref BINARY_TYPE lpBinaryType ) ;
15491563
1564+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "setupapi.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
1565+ public static extern unsafe IntPtr SetupDiGetClassDevs ( IntPtr ClassGuid , [ MarshalAs ( UnmanagedType . LPWStr ) ] string ? Enumerator , IntPtr hwndParent , TaskManagerDeviceFilter Flags ) ;
1566+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "setupapi.dll" , SetLastError = true ) ]
1567+ public static extern unsafe bool SetupDiEnumDeviceInfo ( IntPtr DeviceInfoSet , int MemberIndex , ref SP_DEVINFO_DATA DeviceInfoData ) ;
1568+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "setupapi.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
1569+ public static extern unsafe bool SetupDiGetDeviceProperty ( IntPtr DeviceInfoSet , ref SP_DEVINFO_DATA DeviceInfoData , ref DEVPROPKEY PropertyKey , out int PropertyType , IntPtr PropertyBuffer , int PropertyBufferSize , out int RequiredSize , int Flags ) ;
1570+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "setupapi.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
1571+ public static extern unsafe bool SetupDiGetDeviceProperty ( IntPtr DeviceInfoSet , ref SP_DEVINFO_DATA DeviceInfoData , ref DEVPROPKEY PropertyKey , out int PropertyType , out Guid PropertyBuffer , int PropertyBufferSize , out int RequiredSize , int Flags ) ;
1572+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "setupapi.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
1573+ public static extern unsafe bool SetupDiGetClassDescription ( ref Guid ClassGuid , IntPtr ClassDescription , int ClassDescriptionSize , out int RequiredSize ) ;
1574+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "setupapi.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
1575+ public static extern unsafe bool SetupDiGetClassProperty ( Guid ClassGuid , ref DEVPROPKEY PropertyKey , out int PropertyType , IntPtr PropertyBuffer , int PropertyBufferSize , out int RequiredSize , int Flags ) ;
1576+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "setupapi.dll" , SetLastError = true ) ]
1577+ public static extern unsafe bool SetupDiLoadDeviceIcon ( IntPtr DeviceInfoSet , ref SP_DEVINFO_DATA DeviceInfoData , int cxIcon , int cyIcon , int Flags , out IntPtr hIcon ) ;
1578+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "setupapi.dll" , SetLastError = true ) ]
1579+ public static extern unsafe bool SetupDiDestroyDeviceInfoList ( IntPtr DeviceInfoSet ) ;
1580+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "cfgmgr32.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
1581+ public static extern unsafe int CM_Locate_DevNode ( out IntPtr pdnDevInst , string pDeviceID , ulong ulFlags ) ;
1582+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "cfgmgr32.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
1583+ public static extern unsafe int CM_Enable_DevNode ( IntPtr dnDevInst , uint ulFlags ) ;
1584+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "cfgmgr32.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
1585+ public static extern unsafe int CM_Disable_DevNode ( IntPtr dnDevInst , uint ulFlags ) ;
1586+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "cfgmgr32.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
1587+ public static extern unsafe int CM_Uninstall_DevNode ( IntPtr dnDevInst , uint ulFlags ) ;
1588+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "cfgmgr32.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
1589+ public static extern unsafe uint CM_Open_DevNode_Key ( IntPtr dnDevNode , uint samDesired , uint ulHardwareProfile , int Disposition , out IntPtr phkDevice , uint ulFlags ) ;
1590+ [ System . Security . SuppressUnmanagedCodeSecurity ( ) ] [ DllImport ( "ntdll.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
1591+ public static extern unsafe uint NtQueryKey ( IntPtr KeyHandle , uint KeyInformationClass , IntPtr KeyInformation , uint Length , out uint ResultLength ) ;
1592+
15501593}
0 commit comments