[PATCH 1/3] ntoskrnl.exe: Fix handling of reference string in IoRegisterDeviceInterface().
Zebediah Figura
zfigura at codeweavers.com
Tue Jun 4 09:51:03 CDT 2019
From: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
dlls/ntoskrnl.exe/pnp.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/dlls/ntoskrnl.exe/pnp.c b/dlls/ntoskrnl.exe/pnp.c
index 85bb9f4..23ae4ca 100644
--- a/dlls/ntoskrnl.exe/pnp.c
+++ b/dlls/ntoskrnl.exe/pnp.c
@@ -613,26 +613,22 @@ static NTSTATUS get_instance_id(DEVICE_OBJECT *device, WCHAR **instance_id)
* IoRegisterDeviceInterface (NTOSKRNL.EXE.@)
*/
NTSTATUS WINAPI IoRegisterDeviceInterface(DEVICE_OBJECT *device, const GUID *class_guid,
- UNICODE_STRING *reference_string, UNICODE_STRING *symbolic_link)
+ UNICODE_STRING *refstr, UNICODE_STRING *symbolic_link)
{
SP_DEVICE_INTERFACE_DATA sp_iface = {sizeof(sp_iface)};
SP_DEVINFO_DATA sp_device = {sizeof(sp_device)};
SP_DEVICE_INTERFACE_DETAIL_DATA_W *data;
NTSTATUS status = STATUS_SUCCESS;
struct device_interface *iface;
- WCHAR *referenceW = NULL;
WCHAR *instance_id;
DWORD required;
HDEVINFO set;
BOOL rc;
- TRACE("device %p, class_guid %s, reference_string %s, symbolic_link %p.\n",
- device, debugstr_guid(class_guid), debugstr_us(reference_string), symbolic_link);
+ TRACE("device %p, class_guid %s, refstr %s, symbolic_link %p.\n",
+ device, debugstr_guid(class_guid), debugstr_us(refstr), symbolic_link);
- if (reference_string != NULL)
- referenceW = reference_string->Buffer;
-
- set = SetupDiGetClassDevsW( class_guid, referenceW, NULL, DIGCF_DEVICEINTERFACE );
+ set = SetupDiGetClassDevsW( class_guid, NULL, NULL, DIGCF_DEVICEINTERFACE );
if (set == INVALID_HANDLE_VALUE) return STATUS_UNSUCCESSFUL;
status = get_instance_id( device, &instance_id );
@@ -674,7 +670,7 @@ NTSTATUS WINAPI IoRegisterDeviceInterface(DEVICE_OBJECT *device, const GUID *cla
}
HeapFree( GetProcessHeap(), 0, instance_id );
- if (!SetupDiCreateDeviceInterfaceW( set, &sp_device, class_guid, NULL, 0, &sp_iface ))
+ if (!SetupDiCreateDeviceInterfaceW( set, &sp_device, class_guid, refstr ? refstr->Buffer : NULL, 0, &sp_iface ))
return STATUS_UNSUCCESSFUL;
required = 0;
--
2.7.4
More information about the wine-devel
mailing list