[HIDCLASS] Override hid device capabilities

- Disable the Removable capability
- Enable the SilentInstall and SurpriseRemovalOK capabilities

This keeps the remove device icon from showing in the notification area whenever you plug in a mouse or a keyboard.
This commit is contained in:
Eric Kohl 2025-05-19 00:29:10 +02:00
parent 5d40ec3e8c
commit c477928b0e

View file

@ -460,6 +460,14 @@ HidClassPDO_PnP(
RtlCopyMemory(IoStack->Parameters.DeviceCapabilities.Capabilities,
&PDODeviceExtension->Capabilities,
sizeof(DEVICE_CAPABILITIES));
//
// override some capabilities
//
IoStack->Parameters.DeviceCapabilities.Capabilities->Removable = FALSE;
IoStack->Parameters.DeviceCapabilities.Capabilities->SilentInstall = TRUE;
IoStack->Parameters.DeviceCapabilities.Capabilities->SurpriseRemovalOK = TRUE;
Status = STATUS_SUCCESS;
break;
}