-- v2: ntoskrnl.exe: Create keys for devices in HKEY_DYN_DATA\Config Manager\Enum. wineusb.sys: Silently pass down IRP_MN_QUERY_ID to the PDO. winebus.sys: Silently pass down IRP_MN_QUERY_ID to the PDO. winebth.sys: Silently pass down IRP_MN_QUERY_ID to the PDO.
From: Elizabeth Figura zfigura@codeweavers.com
As FDOs are expected to do. This simply removes the FIXME. --- dlls/winebth.sys/winebth.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/winebth.sys/winebth.c b/dlls/winebth.sys/winebth.c index 32cc6300958..07d22f65e9c 100644 --- a/dlls/winebth.sys/winebth.c +++ b/dlls/winebth.sys/winebth.c @@ -1515,6 +1515,10 @@ static NTSTATUS WINAPI fdo_pnp( DEVICE_OBJECT *device_obj, IRP *irp ) IoDeleteDevice( bus_fdo ); return ret; } + + case IRP_MN_QUERY_ID: + break; + default: FIXME( "Unhandled minor function %s.\n", debugstr_minor_function_code( stack->MinorFunction ) ); }
From: Elizabeth Figura zfigura@codeweavers.com
As FDOs are expected to do. This simply removes the FIXME. --- dlls/winebus.sys/main.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index fc4ef81985f..4e2227bb636 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -1313,6 +1313,8 @@ static NTSTATUS fdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp)
bus_options_cleanup(); return ret; + case IRP_MN_QUERY_ID: + break; default: FIXME("Unhandled minor function %#x.\n", irpsp->MinorFunction); }
From: Elizabeth Figura zfigura@codeweavers.com
As FDOs are expected to do. This simply removes the FIXME. --- dlls/wineusb.sys/wineusb.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/wineusb.sys/wineusb.c b/dlls/wineusb.sys/wineusb.c index a56d4c1a0c7..4d86fb1cdd4 100644 --- a/dlls/wineusb.sys/wineusb.c +++ b/dlls/wineusb.sys/wineusb.c @@ -315,6 +315,9 @@ static NTSTATUS fdo_pnp(IRP *irp) return ret; }
+ case IRP_MN_QUERY_ID: + break; + default: FIXME("Unhandled minor function %#x.\n", stack->MinorFunction); }
From: Elizabeth Figura zfigura@codeweavers.com
And populate their HardWareKey values.
This emulates Windows 9x architecture.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=7115 --- dlls/ntoskrnl.exe/ntoskrnl_private.h | 1 + dlls/ntoskrnl.exe/pnp.c | 47 ++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl_private.h b/dlls/ntoskrnl.exe/ntoskrnl_private.h index 472dc46fde3..d9db6f600ff 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl_private.h +++ b/dlls/ntoskrnl.exe/ntoskrnl_private.h @@ -121,5 +121,6 @@ struct wine_device { DEVICE_OBJECT device_obj; DEVICE_RELATIONS *children; + HKEY dyn_data_key; }; #endif diff --git a/dlls/ntoskrnl.exe/pnp.c b/dlls/ntoskrnl.exe/pnp.c index 1824fb28cab..9454d94fa3f 100644 --- a/dlls/ntoskrnl.exe/pnp.c +++ b/dlls/ntoskrnl.exe/pnp.c @@ -333,6 +333,42 @@ static BOOL install_device_driver( DEVICE_OBJECT *device, HDEVINFO set, SP_DEVIN return TRUE; }
+static void create_dyn_data_key( DEVICE_OBJECT *device ) +{ + struct wine_device *wine_device = CONTAINING_RECORD(device, struct wine_device, device_obj); + WCHAR device_instance_id[MAX_DEVICE_ID_LEN]; + static unsigned int counter; + WCHAR key_path[29]; + DWORD disposition; + LSTATUS ret; + HKEY key; + + if (get_device_instance_id( device, device_instance_id )) + return; + + for (;;) + { + swprintf( key_path, ARRAY_SIZE(key_path), L"Config Manager\Enum\%08x", counter++ ); + + if ((ret = RegCreateKeyExW( HKEY_DYN_DATA, key_path, 0, NULL, + REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &key, &disposition ))) + { + ERR( "Failed to create %s, error %lu.\n", debugstr_w(key_path), GetLastError() ); + return; + } + + if (disposition == REG_CREATED_NEW_KEY) + { + RegSetValueExW( key, L"HardWareKey", 0, REG_SZ, (BYTE *)device_instance_id, + wcslen( device_instance_id ) * sizeof(WCHAR) ); + wine_device->dyn_data_key = key; + break; + } + + RegCloseKey( key ); + } +} + /* Load the function driver for a newly created PDO, if one is present, and * send IRPs to start the device. */ static void start_device( DEVICE_OBJECT *device, HDEVINFO set, SP_DEVINFO_DATA *sp_device ) @@ -340,6 +376,8 @@ static void start_device( DEVICE_OBJECT *device, HDEVINFO set, SP_DEVINFO_DATA * load_function_driver( device, set, sp_device ); if (device->DriverObject) send_pnp_irp( device, IRP_MN_START_DEVICE ); + + create_dyn_data_key( device ); }
static void enumerate_new_device( DEVICE_OBJECT *device, HDEVINFO set ) @@ -424,6 +462,15 @@ static void send_remove_device_irp( DEVICE_OBJECT *device, UCHAR code )
static void remove_device( DEVICE_OBJECT *device ) { + struct wine_device *wine_device = CONTAINING_RECORD(device, struct wine_device, device_obj); + + if (wine_device->dyn_data_key) + { + RegDeleteKeyW( wine_device->dyn_data_key, L"" ); + RegCloseKey( wine_device->dyn_data_key ); + wine_device->dyn_data_key = 0; + } + send_remove_device_irp( device, IRP_MN_SURPRISE_REMOVAL ); send_remove_device_irp( device, IRP_MN_REMOVE_DEVICE ); }
Thanks. Those are essentially harmless, so I've pushed extra patches to "handle" them.