diff --git a/drivers/hid/hidclass/hidclass.c b/drivers/hid/hidclass/hidclass.c index 107368f02e1..9b3c3610d77 100644 --- a/drivers/hid/hidclass/hidclass.c +++ b/drivers/hid/hidclass/hidclass.c @@ -128,6 +128,8 @@ HidClass_Create( { UNIMPLEMENTED ASSERT(FALSE); + Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; + IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_NOT_IMPLEMENTED; } @@ -139,6 +141,8 @@ HidClass_Close( { UNIMPLEMENTED ASSERT(FALSE); + Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; + IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_NOT_IMPLEMENTED; } @@ -150,6 +154,8 @@ HidClass_Read( { UNIMPLEMENTED ASSERT(FALSE); + Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; + IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_NOT_IMPLEMENTED; } @@ -161,6 +167,8 @@ HidClass_Write( { UNIMPLEMENTED ASSERT(FALSE); + Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; + IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_NOT_IMPLEMENTED; } diff --git a/drivers/hid/hidclass/pdo.c b/drivers/hid/hidclass/pdo.c index c60d338e9ad..469e37a57f3 100644 --- a/drivers/hid/hidclass/pdo.c +++ b/drivers/hid/hidclass/pdo.c @@ -422,13 +422,27 @@ HidClassPDO_PnP( } case IRP_MN_START_DEVICE: { - DPRINT1("[HIDCLASS] PDO PnP not implemented %x\n", IoStack->MinorFunction); - ASSERT(FALSE); + // + // FIXME: support polled devices + // + ASSERT(PDODeviceExtension->Common.DriverExtension->DevicesArePolled == FALSE); // - // do nothing + // now register the device interface + // + Status = IoRegisterDeviceInterface(PDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject, &GUID_DEVINTERFACE_HID, NULL, &PDODeviceExtension->DeviceInterface); + if (NT_SUCCESS(Status)) + { + // + // enable device interface + // + Status = IoSetDeviceInterfaceState(&PDODeviceExtension->DeviceInterface, TRUE); + } + ASSERT(Status == STATUS_SUCCESS); + + // + // break // - Status = Irp->IoStatus.Status; break; } case IRP_MN_REMOVE_DEVICE: @@ -528,7 +542,7 @@ HidClassPDO_CreatePDO( // PDODeviceExtension->Common.HidDeviceExtension.MiniDeviceExtension = FDODeviceExtension->Common.HidDeviceExtension.MiniDeviceExtension; PDODeviceExtension->Common.HidDeviceExtension.NextDeviceObject = FDODeviceExtension->Common.HidDeviceExtension.NextDeviceObject; - PDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject = NULL; + PDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject = FDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject; PDODeviceExtension->Common.IsFDO = FALSE; PDODeviceExtension->Common.DriverExtension = FDODeviceExtension->Common.DriverExtension; RtlCopyMemory(&PDODeviceExtension->Attributes, &FDODeviceExtension->Attributes, sizeof(HID_DEVICE_ATTRIBUTES)); diff --git a/drivers/hid/hidclass/precomp.h b/drivers/hid/hidclass/precomp.h index 22c77fd529e..6babfb75fdc 100644 --- a/drivers/hid/hidclass/precomp.h +++ b/drivers/hid/hidclass/precomp.h @@ -2,10 +2,10 @@ #define _HIDPI_NO_FUNCTION_MACROS_ #include +#include #include #include #include -#include #include #include @@ -108,6 +108,10 @@ typedef struct // ULONG CollectionIndex; + // + // device interface + // + UNICODE_STRING DeviceInterface; }HIDCLASS_PDO_DEVICE_EXTENSION, *PHIDCLASS_PDO_DEVICE_EXTENSION;