mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
[NTOS:PNP] Map device capabilities to capability flags
This fixes a devices Capabilities value in the registry.
This commit is contained in:
parent
bac4e185fb
commit
a8846037e1
1 changed files with 31 additions and 1 deletions
|
@ -1011,7 +1011,37 @@ IopQueryDeviceCapabilities(PDEVICE_NODE DeviceNode,
|
|||
return Status;
|
||||
}
|
||||
|
||||
DeviceNode->CapabilityFlags = *(PULONG)((ULONG_PTR)&DeviceCaps->Version + sizeof(DeviceCaps->Version));
|
||||
/* Map device capabilities to capability flags */
|
||||
DeviceNode->CapabilityFlags = 0;
|
||||
if (DeviceCaps->LockSupported)
|
||||
DeviceNode->CapabilityFlags |= 0x00000001; // CM_DEVCAP_LOCKSUPPORTED
|
||||
|
||||
if (DeviceCaps->EjectSupported)
|
||||
DeviceNode->CapabilityFlags |= 0x00000002; // CM_DEVCAP_EJECTSUPPORTED
|
||||
|
||||
if (DeviceCaps->Removable)
|
||||
DeviceNode->CapabilityFlags |= 0x00000004; // CM_DEVCAP_REMOVABLE
|
||||
|
||||
if (DeviceCaps->DockDevice)
|
||||
DeviceNode->CapabilityFlags |= 0x00000008; // CM_DEVCAP_DOCKDEVICE
|
||||
|
||||
if (DeviceCaps->UniqueID)
|
||||
DeviceNode->CapabilityFlags |= 0x00000010; // CM_DEVCAP_UNIQUEID
|
||||
|
||||
if (DeviceCaps->SilentInstall)
|
||||
DeviceNode->CapabilityFlags |= 0x00000020; // CM_DEVCAP_SILENTINSTALL
|
||||
|
||||
if (DeviceCaps->RawDeviceOK)
|
||||
DeviceNode->CapabilityFlags |= 0x00000040; // CM_DEVCAP_RAWDEVICEOK
|
||||
|
||||
if (DeviceCaps->SurpriseRemovalOK)
|
||||
DeviceNode->CapabilityFlags |= 0x00000080; // CM_DEVCAP_SURPRISEREMOVALOK
|
||||
|
||||
if (DeviceCaps->HardwareDisabled)
|
||||
DeviceNode->CapabilityFlags |= 0x00000100; // CM_DEVCAP_HARDWAREDISABLED
|
||||
|
||||
if (DeviceCaps->NonDynamic)
|
||||
DeviceNode->CapabilityFlags |= 0x00000200; // CM_DEVCAP_NONDYNAMIC
|
||||
|
||||
if (DeviceCaps->NoDisplayInUI)
|
||||
DeviceNode->UserFlags |= DNUF_DONT_SHOW_IN_UI;
|
||||
|
|
Loading…
Reference in a new issue