[PATCH] hidclass.sys: Unload all devices before unloading a minidriver
Zhiyi Zhang
zzhang at codeweavers.com
Sat Aug 4 22:43:29 CDT 2018
> +NTSTATUS PNP_RemoveDevice(minidriver *minidriver, DEVICE_OBJECT *device, IRP* irp)
Hi Aric,
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;
> +}
在 2018/7/24 21:16, Aric Stewart 写道:
> Signed-off-by: Aric Stewart <aric at 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(-)
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20180805/29d7d2ff/attachment-0001.html>
More information about the wine-devel
mailing list