Hi Aric,+NTSTATUS PNP_RemoveDevice(minidriver *minidriver, DEVICE_OBJECT *device, IRP* irp)
It would be better if * is close to variable name consistantly.
Also in the declaration.
+{
+ hid_device *hiddev;
+ NTSTATUS rc = STATUS_NOT_SUPPORTED;
+
+ if (irp)
+ rc = minidriver->PNPDispatch(device, irp);
+ HID_DeleteDevice(&minidriver->minidriver, device);
+ LIST_FOR_EACH_ENTRY(hiddev, &minidriver->device_list, hid_device, entry)
Since we're removing the entry, shouldn't LIST_FOR_EACH_ENTRY_SAFE
be used?
Thanks,
Zhiyi
+ {
+ if (hiddev->device == device)
+ {
+ list_remove(&hiddev->entry);
+ HeapFree(GetProcessHeap(), 0, hiddev);
+ break;
+ }
+ }
+ return rc;
+}
Signed-off-by: Aric Stewart <aric@codeweavers.com> --- dlls/hidclass.sys/hid.h | 8 ++++++++ dlls/hidclass.sys/main.c | 8 ++++++++ dlls/hidclass.sys/pnp.c | 35 +++++++++++++++++++++++++++++++---- 3 files changed, 47 insertions(+), 4 deletions(-)