Module: wine Branch: master Commit: 91ac8eb00ab85bc5d7bfaae1a32c9a8cc08c8a19 URL: https://source.winehq.org/git/wine.git/?a=commit;h=91ac8eb00ab85bc5d7bfaae1a...
Author: Zebediah Figura zfigura@codeweavers.com Date: Thu Aug 16 18:37:42 2018 -0500
hidclass.sys: Update the interface state when a device is added or removed.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com Signed-off-by: Aric Stewart aric@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/hidclass.sys/device.c | 3 +++ dlls/hidclass.sys/pnp.c | 12 ++++++++++++ 2 files changed, 15 insertions(+)
diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index a5cbee9..3364eb3 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -32,6 +32,7 @@ #include "wine/debug.h" #include "ddk/hidsdi.h" #include "ddk/hidtypes.h" +#include "ddk/wdm.h"
#include "initguid.h" #include "devguid.h" @@ -166,6 +167,8 @@ void HID_DeleteDevice(HID_MINIDRIVER_REGISTRATION *driver, DEVICE_OBJECT *device TRACE("Delete link %s\n", debugstr_w(ext->link_name)); RtlInitUnicodeString(&linkW, ext->link_name);
+ IoSetDeviceInterfaceState(&linkW, FALSE); + status = IoDeleteSymbolicLink(&linkW); if (status != STATUS_SUCCESS) ERR("Delete Symbolic Link failed (%x)\n",status); diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index 6ee89c1..34bd944 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -23,6 +23,7 @@ #include <stdarg.h> #include "hid.h" #include "ddk/hidtypes.h" +#include "ddk/wdm.h" #include "regstr.h" #include "wine/debug.h" #include "wine/unicode.h" @@ -282,6 +283,17 @@ NTSTATUS WINAPI HID_PNP_Dispatch(DEVICE_OBJECT *device, IRP *irp) } break; } + case IRP_MN_START_DEVICE: + { + BASE_DEVICE_EXTENSION *ext = device->DeviceExtension; + UNICODE_STRING linkU; + + rc = minidriver->PNPDispatch(device, irp); + + RtlInitUnicodeString(&linkU, ext->link_name); + IoSetDeviceInterfaceState(&linkU, TRUE); + return rc; + } case IRP_MN_REMOVE_DEVICE: { return PNP_RemoveDevice(minidriver, device, irp);