On 7/14/22 02:50, Claire Girka wrote:
From: Claire Girka claire@sitedethib.com
Using SetupDiGetDeviceRegistryPropertyW rather than SetupDiGetDeviceRegistryPropertyA in the test, because games use the former, and Windows returns the Container ID as a WCHAR string either way.
dlls/ntoskrnl.exe/pnp.c | 8 ++++++++ dlls/ntoskrnl.exe/tests/ntoskrnl.c | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/pnp.c b/dlls/ntoskrnl.exe/pnp.c index 71c03586897..e5c9b441b87 100644 --- a/dlls/ntoskrnl.exe/pnp.c +++ b/dlls/ntoskrnl.exe/pnp.c @@ -318,6 +318,7 @@ static void enumerate_new_device( DEVICE_OBJECT *device, HDEVINFO set ) BOOL need_driver = TRUE; NTSTATUS status; HKEY key;
WCHAR *id;
if (get_device_instance_id( device, device_instance_id )) return;
@@ -353,6 +354,13 @@ static void enumerate_new_device( DEVICE_OBJECT *device, HDEVINFO set ) return; }
- if (!get_device_id(device, BusQueryContainerID, &id) && id)
- {
SetupDiSetDeviceRegistryPropertyW( set, &sp_device, SPDRP_BASE_CONTAINERID, (BYTE *)id,
(lstrlenW( id ) + 1) * sizeof(WCHAR) );
ExFreePool( id );
- }
}start_device( device, set, &sp_device );
This test [1] and MSDN documentation [2] imply we probably should be querying ContainerID before installing the function driver, though.
[1] https://testbot.winehq.org/JobDetails.pl?Key=119104
[2] https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/adding-a-pn...