RegistryQuerySzValue(
IN HANDLE Key,
IN PCHAR Name,
+ OUT PULONG Type OPTIONAL,
OUT PANSI_STRING *Array
)
{
if (*Array == NULL)
goto fail5;
+ if (Type != NULL)
+ *Type = Value->Type;
+
__RegistryFree(Value);
RtlFreeUnicodeString(&Unicode);
if (!NT_SUCCESS(status))
goto fail1;
- status = RegistryQuerySzValue(Key, "SystemStartOptions", &Ansi);
+ status = RegistryQuerySzValue(Key, "SystemStartOptions", NULL, &Ansi);
if (!NT_SUCCESS(status))
goto fail2;
if (!NT_SUCCESS(status))
goto fail1;
- status = RegistryQuerySzValue(Key, "SystemStartOptions", &Ansi);
+ status = RegistryQuerySzValue(Key, "SystemStartOptions", NULL, &Ansi);
if (!NT_SUCCESS(status))
goto fail2;
status = RegistryQuerySzValue(SoftwareKey,
"DriverDesc",
+ NULL,
&DriverDesc);
if (!NT_SUCCESS(status))
goto fail3;
status = RegistryQuerySzValue(ParametersKey,
"SyntheticClasses",
+ NULL,
&SyntheticClasses);
if (!NT_SUCCESS(status))
SyntheticClasses = NULL;
if (ParametersKey != NULL) {
status = RegistryQuerySzValue(ParametersKey,
"SupportedClasses",
+ NULL,
&SupportedClasses);
if (!NT_SUCCESS(status))
SupportedClasses = NULL;
HANDLE ClassKey;
UNICODE_STRING Unicode;
HANDLE Key;
+ ULONG Type;
ULONG Count;
PANSI_STRING Old;
ULONG Index;
Count = 0;
- status = RegistryQuerySzValue(Key, "UpperFilters", &Old);
+ status = RegistryQuerySzValue(Key, "UpperFilters", &Type, &Old);
if (NT_SUCCESS(status)) {
+ status = STATUS_INVALID_PARAMETER;
+ if (Type != REG_MULTI_SZ)
+ goto fail4;
+
for (Index = 0; Old[Index].Buffer != NULL; Index++) {
if (_stricmp(Old[Index].Buffer, DriverName) == 0)
goto done;
status = STATUS_NO_MEMORY;
if (New == NULL)
- goto fail4;
+ goto fail5;
Index = 0;
while (Index < Count) {
REG_MULTI_SZ,
New);
if (!NT_SUCCESS(status))
- goto fail5;
+ goto fail6;
__FiltersFree(New);
return STATUS_SUCCESS;
-fail5:
- Error("fail5\n");
+fail6:
+ Error("fail6\n");
__FiltersFree(New);
-fail4:
- Error("fail4\n");
+fail5:
+ Error("fail5\n");
if (Old != NULL)
RegistryFreeSzValue(Old);
+fail4:
+ Error("fail4\n");
+
RegistryCloseKey(Key);
fail3:
HANDLE ClassKey;
UNICODE_STRING Unicode;
HANDLE Key;
+ ULONG Type;
ULONG Count;
PANSI_STRING Old;
ULONG Index;
if (!NT_SUCCESS(status))
goto fail3;
- status = RegistryQuerySzValue(Key, "UpperFilters", &Old);
+ status = RegistryQuerySzValue(Key, "UpperFilters", &Type, &Old);
if (NT_SUCCESS(status)) {
+ status = STATUS_INVALID_PARAMETER;
+ if (Type != REG_MULTI_SZ)
+ goto fail4;
+
for (Index = 0; Old[Index].Buffer != NULL; Index++) {
if (_stricmp(Old[Index].Buffer, DriverName) == 0)
goto found;
status = STATUS_NO_MEMORY;
if (New == NULL)
- goto fail4;
+ goto fail5;
Count = 0;
for (Index = 0; Old[Index].Buffer != NULL; Index++) {
REG_MULTI_SZ,
New);
if (!NT_SUCCESS(status))
- goto fail5;
+ goto fail6;
__FiltersFree(New);
return STATUS_SUCCESS;
-fail5:
- Error("fail5\n");
+fail6:
+ Error("fail6\n");
__FiltersFree(New);
-fail4:
- Error("fail4\n");
+fail5:
+ Error("fail5\n");
if (Old != NULL)
RegistryFreeSzValue(Old);
+fail4:
+ Error("fail4\n");
+
RegistryCloseKey(Key);
fail3: