[KBDCLASS] Set the device interface state on device start and device remove

This commit is contained in:
Eric Kohl 2025-05-04 17:27:23 +02:00
parent cc16769179
commit 5414600e1e

View file

@ -873,6 +873,8 @@ ClassPnp(
}
else
DeviceExtension->FileHandle = NULL;
if (DeviceExtension->InterfaceName.Length != 0)
IoSetDeviceInterfaceState(&DeviceExtension->InterfaceName, TRUE);
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
@ -887,6 +889,8 @@ ClassPnp(
break;
case IRP_MN_REMOVE_DEVICE:
if (DeviceExtension->InterfaceName.Length != 0)
IoSetDeviceInterfaceState(&DeviceExtension->InterfaceName, FALSE);
if (DeviceExtension->FileHandle)
{
ZwClose(DeviceExtension->FileHandle);