[MOUCLASS] Only set the device interface state if we have an interface name

This commit is contained in:
Eric Kohl 2025-05-04 17:28:37 +02:00
parent 5414600e1e
commit 9638666d84

View file

@ -840,6 +840,7 @@ ClassPnp(
} }
else else
DeviceExtension->FileHandle = NULL; DeviceExtension->FileHandle = NULL;
if (DeviceExtension->InterfaceName.Length != 0)
IoSetDeviceInterfaceState(&DeviceExtension->InterfaceName, TRUE); IoSetDeviceInterfaceState(&DeviceExtension->InterfaceName, TRUE);
Irp->IoStatus.Status = Status; Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT); IoCompleteRequest(Irp, IO_NO_INCREMENT);
@ -855,6 +856,7 @@ ClassPnp(
break; break;
case IRP_MN_REMOVE_DEVICE: case IRP_MN_REMOVE_DEVICE:
if (DeviceExtension->InterfaceName.Length != 0)
IoSetDeviceInterfaceState(&DeviceExtension->InterfaceName, FALSE); IoSetDeviceInterfaceState(&DeviceExtension->InterfaceName, FALSE);
if (DeviceExtension->FileHandle) if (DeviceExtension->FileHandle)
{ {