Author: cwittich
Date: Mon May 25 17:10:58 2009
New Revision: 41116
URL:
http://svn.reactos.org/svn/reactos?rev=41116&view=rev
Log:
some small reg fixes
Modified:
trunk/reactos/dll/win32/advapi32/reg/reg.c
Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] Mon May 25 17:10:58 2009
@@ -4025,10 +4025,6 @@
if (ErrorCode == ERROR_SUCCESS ||
ErrorCode == ERROR_MORE_DATA)
{
- if (lpType != NULL)
- {
- *lpType = Type;
- }
if ((Type == REG_SZ) || (Type == REG_MULTI_SZ) || (Type == REG_EXPAND_SZ))
{
@@ -4062,6 +4058,11 @@
}
}
+ if (lpType != NULL)
+ {
+ *lpType = Type;
+ }
+
if (ValueData.Buffer != NULL)
{
RtlFreeHeap(ProcessHeap, 0, ValueData.Buffer);
@@ -4114,6 +4115,9 @@
if (count) *count = 0;
}
+ /* this matches Win9x behaviour - NT sets *type to a random value */
+ if (type) *type = REG_NONE;
+
status = NtQueryValueKey( hkey, &name_str, KeyValuePartialInformation,
buffer, total_size, &total_size );
if (status && status != STATUS_BUFFER_OVERFLOW) goto done;
@@ -4125,7 +4129,10 @@
{
if (buf_ptr != buffer) HeapFree( GetProcessHeap(), 0, buf_ptr );
if (!(buf_ptr = HeapAlloc( GetProcessHeap(), 0, total_size )))
+ {
+ ClosePredefKey(hkey);
return ERROR_NOT_ENOUGH_MEMORY;
+ }
info = (KEY_VALUE_PARTIAL_INFORMATION *)buf_ptr;
status = NtQueryValueKey( hkey, &name_str, KeyValuePartialInformation,
buf_ptr, total_size, &total_size );