private SetupDiGetClassDevs ( System.Guid &classGuid, int enumerator, |
||
classGuid | System.Guid | |
enumerator | int | |
hwndParent | ||
flags | int | |
리턴 |
/// <summary> /// Initializes a new instance of the DeviceClass class. /// </summary> /// <param name="classGuid">A device class Guid.</param> /// <param name="hwndParent">The handle of the top-level window to be used for any user interface or IntPtr.Zero for no handle.</param> protected DeviceClass(Guid classGuid, IntPtr hwndParent) { _classGuid = classGuid; _deviceInfoSet = Native.SetupDiGetClassDevs(ref _classGuid, 0, hwndParent, Native.DIGCF_DEVICEINTERFACE | Native.DIGCF_PRESENT); if (_deviceInfoSet.ToInt32() == Native.INVALID_HANDLE_VALUE) { throw new Win32Exception(Marshal.GetLastWin32Error()); } }