goto fail1;
Length = 0;
- (VOID) ZwQueryKey(SubKey,
- KeyNameInformation,
- NULL,
- 0,
- &Length);
-
- status = STATUS_INVALID_PARAMETER;
- if (Length == 0)
+ status = ZwQueryKey(SubKey,
+ KeyNameInformation,
+ NULL,
+ 0,
+ &Length);
+ if (status != STATUS_BUFFER_OVERFLOW &&
+ status != STATUS_BUFFER_TOO_SMALL)
goto fail2;
-
+
+#pragma prefast(suppress:6102)
Info = __RegistryAllocate(Length + sizeof (WCHAR));
status = STATUS_NO_MEMORY;
NULL,
0,
&Size);
- if (status != STATUS_BUFFER_TOO_SMALL)
+ if (status != STATUS_BUFFER_OVERFLOW &&
+ status != STATUS_BUFFER_TOO_SMALL)
goto fail1;
+#pragma prefast(suppress:6102)
Full = __RegistryAllocate(Size);
status = STATUS_NO_MEMORY;
NULL,
0,
&Size);
- if (status != STATUS_BUFFER_TOO_SMALL)
+ if (status != STATUS_BUFFER_OVERFLOW &&
+ status != STATUS_BUFFER_TOO_SMALL)
goto fail1;
+#pragma prefast(suppress:6102)
Full = __RegistryAllocate(Size);
status = STATUS_NO_MEMORY;
NULL,
0,
&Size);
- if (status != STATUS_BUFFER_TOO_SMALL)
+ if (status != STATUS_BUFFER_OVERFLOW &&
+ status != STATUS_BUFFER_TOO_SMALL)
goto fail2;
+#pragma prefast(suppress:6102)
Partial = __RegistryAllocate(Size);
status = STATUS_NO_MEMORY;
NULL,
0,
&Size);
- if (status != STATUS_BUFFER_TOO_SMALL)
+ if (status != STATUS_BUFFER_OVERFLOW &&
+ status != STATUS_BUFFER_TOO_SMALL)
goto fail2;
+#pragma prefast(suppress:6102)
Value = __RegistryAllocate(Size);
status = STATUS_NO_MEMORY;
NULL,
0,
&Size);
- if (status != STATUS_BUFFER_TOO_SMALL)
+ if (status != STATUS_BUFFER_OVERFLOW &&
+ status != STATUS_BUFFER_TOO_SMALL)
goto fail1;
// Name information is not intrinsically NULL terminated
+#pragma prefast(suppress:6102)
Value = __RegistryAllocate(Size + sizeof (WCHAR));
status = STATUS_NO_MEMORY;