Aric Stewart : hidclass.sys: Move IoSetDeviceInterfaceState to PNP_RemoveDevice.
Alexandre Julliard
julliard at winehq.org
Tue Nov 20 15:39:51 CST 2018
Module: wine
Branch: master
Commit: 72298934933d222d08b50abe2046c61266b433f2
URL: https://source.winehq.org/git/wine.git/?a=commit;h=72298934933d222d08b50abe2046c61266b433f2
Author: Aric Stewart <aric at codeweavers.com>
Date: Tue Nov 13 20:48:18 2018 -0600
hidclass.sys: Move IoSetDeviceInterfaceState to PNP_RemoveDevice.
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/hidclass.sys/device.c | 11 -----------
dlls/hidclass.sys/pnp.c | 8 ++++++++
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c
index a841575..547c355 100644
--- a/dlls/hidclass.sys/device.c
+++ b/dlls/hidclass.sys/device.c
@@ -130,23 +130,12 @@ error:
void HID_DeleteDevice(HID_MINIDRIVER_REGISTRATION *driver, DEVICE_OBJECT *device)
{
- NTSTATUS status;
BASE_DEVICE_EXTENSION *ext;
LIST_ENTRY *entry;
IRP *irp;
ext = device->DeviceExtension;
- if (ext->link_name.Buffer)
- {
- TRACE("Delete link %s\n", debugstr_w(ext->link_name.Buffer));
-
- IoSetDeviceInterfaceState(&ext->link_name, FALSE);
- status = IoDeleteSymbolicLink(&ext->link_name);
- if (status != STATUS_SUCCESS)
- ERR("Delete Symbolic Link failed (%x)\n",status);
- }
-
if (ext->thread)
{
SetEvent(ext->halt_event);
diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c
index 47bd443..08aae15 100644
--- a/dlls/hidclass.sys/pnp.c
+++ b/dlls/hidclass.sys/pnp.c
@@ -212,9 +212,17 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
NTSTATUS PNP_RemoveDevice(minidriver *minidriver, DEVICE_OBJECT *device, IRP *irp)
{
+ BASE_DEVICE_EXTENSION *ext = device->DeviceExtension;
hid_device *hiddev;
NTSTATUS rc = STATUS_NOT_SUPPORTED;
+ rc = IoSetDeviceInterfaceState(&ext->link_name, FALSE);
+ if (rc)
+ {
+ FIXME("failed to disable interface %x\n", rc);
+ return rc;
+ }
+
if (irp)
rc = minidriver->PNPDispatch(device, irp);
HID_DeleteDevice(&minidriver->minidriver, device);
More information about the wine-cvs
mailing list