コード例 #1
0
 public DeviceInfo(string deviceId, string manufacturer, string description, Guid classGuid, string classDescription, Win32.DeviceNodeStatus status, uint vid, uint pid, uint rev)
 {
     _DeviceId = deviceId ?? "";
     _Description = description ?? "";
     _Manufacturer = manufacturer ?? "";
     _ClassGuid = classGuid;
     _ClassDescription = classDescription ?? "";
     _Status = status;
     _VendorId = vid;
     _ProductId = pid;
     _Revision = rev;
 }
コード例 #2
0
 public DeviceInfo(string deviceId, string manufacturer, string description, Guid classGuid, string classDescription, Win32.DeviceNodeStatus status, uint vid, uint pid, uint rev)
 {
     _DeviceId         = deviceId ?? "";
     _Description      = description ?? "";
     _Manufacturer     = manufacturer ?? "";
     _ClassGuid        = classGuid;
     _ClassDescription = classDescription ?? "";
     _Status           = status;
     _VendorId         = vid;
     _ProductId        = pid;
     _Revision         = rev;
 }
コード例 #3
0
ファイル: DeviceInfo.cs プロジェクト: HsuSE/x360ce
 public DeviceInfo(string deviceId, uint handle, string parentDeviceId, string devicePath, string hardwareId, string manufacturer, string description, Guid classGuid, string classDescription, Win32.DeviceNodeStatus status, uint vid, uint pid, uint rev)
 {
     _DeviceId         = deviceId ?? "";
     _DeviceHandle     = handle;
     _ParentDeviceId   = parentDeviceId ?? "";
     _HardwareId       = hardwareId ?? "";
     _Description      = description ?? "";
     _Manufacturer     = manufacturer ?? "";
     _ClassGuid        = classGuid;
     _ClassDescription = classDescription ?? "";
     _Status           = status;
     _VendorId         = vid;
     _ProductId        = pid;
     _Revision         = rev;
     _DevicePath       = devicePath ?? "";
 }
コード例 #4
0
        static bool GetDeviceNodeStatus(UInt32 dnDevInst, IntPtr hMachine, out Win32.DeviceNodeStatus status)
        {
            // c:\Program Files\Microsoft SDKs\Windows\v7.1\Include\cfg.h
            uint Status;
            uint ProblemNumber;
            bool success = false;
            // http://msdn.microsoft.com/en-gb/library/windows/hardware/ff538517%28v=vs.85%29.aspx
            var cr = CM_Get_DevNode_Status_Ex(out Status, out ProblemNumber, dnDevInst, 0, hMachine);

            status = 0;
            if (cr == CR.CR_SUCCESS)
            {
                status  = (Win32.DeviceNodeStatus)Status;
                success = true;
            }
            return(success);
        }