Author: cgutman Date: Fri Aug 19 03:56:28 2011 New Revision: 53312
URL: http://svn.reactos.org/svn/reactos?rev=53312&view=rev Log: [PNPMGR] - Fix multiple REG_MULTI_SZ termination issues - HardwareID is a REG_MULTI_SZ entry not REG_SZ
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnprepor... ============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c [iso-8859-1] Fri Aug 19 03:56:28 2011 @@ -259,16 +259,16 @@ L"DETECTED%ls\%wZ", IfString, &ServiceName); - HardwareId[IdLength++] = UNICODE_NULL; + IdLength++;
/* Add DETECTED\DriverName */ IdLength += swprintf(&HardwareId[IdLength], L"DETECTED\%wZ", &ServiceName); + IdLength++; + + /* Terminate the string with another null */ HardwareId[IdLength++] = UNICODE_NULL; - - /* Terminate the string with another null */ - HardwareId[IdLength] = UNICODE_NULL;
/* Store the value for CompatibleIDs */ RtlInitUnicodeString(&ValueName, L"CompatibleIDs"); @@ -290,10 +290,12 @@ L"DETECTED%ls\%wZ", IfString, &ServiceName); - HardwareId[++IdLength] = UNICODE_NULL; + IdLength++; + + HardwareId[IdLength++] = UNICODE_NULL;
/* Write the value to the registry */ - Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_SZ, HardwareId, IdLength * sizeof(WCHAR)); + Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_MULTI_SZ, HardwareId, IdLength * sizeof(WCHAR)); if (!NT_SUCCESS(Status)) { DPRINT("Failed to write the hardware ID: 0x%x\n", Status);