Author: sginsberg
Date: Sun Sep 7 03:38:15 2008
New Revision: 36018
URL:
http://svn.reactos.org/svn/reactos?rev=36018&view=rev
Log:
- Fix RegQueryValueA. Now Winetests are causing the CM crash again.
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] Sun Sep 7 03:38:15 2008
@@ -4084,17 +4084,24 @@
&ValueSize);
if (ErrorCode == ERROR_SUCCESS)
{
- Value.Length = ValueSize;
- RtlInitAnsiString (&AnsiString,
- NULL);
- AnsiString.Buffer = lpValue;
- AnsiString.MaximumLength = *lpcbValue;
- RtlUnicodeStringToAnsiString (&AnsiString,
- &Value,
- FALSE);
- }
-
- *lpcbValue = ValueSize;
+ if (lpValue != NULL)
+ {
+ Value.Length = ValueSize;
+ RtlInitAnsiString (&AnsiString,
+ NULL);
+ AnsiString.Buffer = lpValue;
+ AnsiString.MaximumLength = *lpcbValue;
+ RtlUnicodeStringToAnsiString (&AnsiString,
+ &Value,
+ FALSE);
+ *lpcbValue = ValueSize;
+ }
+ else if (lpcbValue != NULL)
+ {
+ *lpcbValue = ValueSize;
+ }
+ }
+
if (Value.Buffer != NULL)
{
RtlFreeHeap (ProcessHeap,