For instance, the UpperFilters key needs to be a REG_MULTI_SZ
even if it contains only one string. Thus the type needs to be
passed explicitly to RegistryUpdateSzValue.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
RegistryUpdateSzValue(
IN HANDLE Key,
IN PCHAR Name,
+ IN ULONG Type,
IN PANSI_STRING Array
)
{
ANSI_STRING Ansi;
UNICODE_STRING Unicode;
- ULONG Type;
PKEY_VALUE_PARTIAL_INFORMATION Partial;
NTSTATUS status;
if (!NT_SUCCESS(status))
goto fail1;
- Type = (Array[1].Buffer != NULL) ? REG_MULTI_SZ : REG_SZ;
-
switch (Type) {
case REG_SZ:
status = STATUS_NO_MEMORY;
RegistryUpdateSzValue(
IN HANDLE Key,
IN PCHAR Name,
+ IN ULONG Type,
IN PANSI_STRING Array
);
status = RegistryUpdateSzValue(HardwareKey,
"FriendlyName",
+ REG_SZ,
FriendlyName);
if (!NT_SUCCESS(status))
goto fail5;
RtlInitAnsiString(&New[Index], DriverName);
- status = RegistryUpdateSzValue(Key, "UpperFilters", New);
+ status = RegistryUpdateSzValue(Key,
+ "UpperFilters",
+ REG_MULTI_SZ,
+ New);
if (!NT_SUCCESS(status))
goto fail5;
Count++;
}
- status = RegistryUpdateSzValue(Key, "UpperFilters", New);
+ status = RegistryUpdateSzValue(Key,
+ "UpperFilters",
+ REG_MULTI_SZ,
+ New);
if (!NT_SUCCESS(status))
goto fail5;
status = RegistryUpdateSzValue(ParametersKey,
"ActiveDeviceID",
+ REG_SZ,
Ansi);
if (!NT_SUCCESS(status))
goto fail2;
status = RegistryUpdateSzValue(ParametersKey,
"ActiveInstanceID",
+ REG_SZ,
Ansi);
if (!NT_SUCCESS(status))
goto fail3;