Author: hyperion
Date: Wed Nov 5 18:24:40 2008
New Revision: 37220
URL:
http://svn.reactos.org/svn/reactos?rev=37220&view=rev
Log:
Merging r37219
Modified:
trunk/reactos/dll/win32/advapi32/misc/shutdown.c
trunk/reactos/dll/win32/advapi32/reg/reg.c
trunk/reactos/dll/win32/advapi32/sec/misc.c
trunk/reactos/dll/win32/advapi32/service/eventlog.c
Modified: trunk/reactos/dll/win32/advapi32/misc/shutdown.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/sh…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/misc/shutdown.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/misc/shutdown.c [iso-8859-1] Wed Nov 5 18:24:40
2008
@@ -109,6 +109,9 @@
INT LastError;
BOOL rv;
+ MachineNameW.Buffer = NULL;
+ MessageW.Buffer = NULL;
+
if (lpMachineName)
{
RtlInitAnsiString(&MachineNameA, lpMachineName);
@@ -126,7 +129,7 @@
Status = RtlAnsiStringToUnicodeString(&MessageW, &MessageA, TRUE);
if (STATUS_SUCCESS != Status)
{
- if (MachineNameW.Length)
+ if (MachineNameW.Buffer)
{
RtlFreeUnicodeString(&MachineNameW);
}
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] Wed Nov 5 18:24:40 2008
@@ -917,6 +917,8 @@
LocalObjectAttributes.ObjectName = &LocalKeyName;
FullNameLength = LocalKeyName.Length / sizeof(WCHAR);
+ LocalKeyHandle = NULL;
+
/* Remove the last part of the key name and try to create the key again. */
while (Status == STATUS_OBJECT_NAME_NOT_FOUND)
{
@@ -949,7 +951,8 @@
Length = wcslen (LocalKeyName.Buffer);
while (TRUE)
{
- NtClose (LocalKeyHandle);
+ if (LocalKeyHandle)
+ NtClose (LocalKeyHandle);
LocalKeyName.Buffer[Length] = L'\\';
Length = wcslen (LocalKeyName.Buffer);
@@ -2544,7 +2547,7 @@
}
}
- TRACE("Key Namea0 Length %d\n", StringU.Length);
+ /*TRACE("Key Namea0 Length %d\n", StringU.Length);*/ /* BUGBUG could be
uninitialized */
TRACE("Key Namea1 Length %d\n", NameLength);
TRACE("Key Namea Length %d\n", *lpcbName);
TRACE("Key Namea %s\n", lpName);
@@ -4685,12 +4688,13 @@
{
RtlCreateUnicodeStringFromAsciiz (&ValueName,
(PSTR)lpValueName);
- pValueName = (LPWSTR)ValueName.Buffer;
}
else
{
- pValueName = NULL;
- }
+ ValueName.Buffer = NULL;
+ }
+
+ pValueName = (LPWSTR)ValueName.Buffer;
if (((dwType == REG_SZ) ||
(dwType == REG_MULTI_SZ) ||
Modified: trunk/reactos/dll/win32/advapi32/sec/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/mis…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/misc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/sec/misc.c [iso-8859-1] Wed Nov 5 18:24:40 2008
@@ -1252,6 +1252,8 @@
RtlCreateUnicodeStringFromAsciiz(&SystemName,
(LPSTR)lpSystemName);
}
+ else
+ SystemName.Buffer = NULL;
/* Check the privilege name is not NULL */
if (lpName == NULL)
@@ -1263,14 +1265,14 @@
RtlCreateUnicodeStringFromAsciiz(&Name,
(LPSTR)lpName);
- Result = LookupPrivilegeValueW((lpSystemName != NULL) ? SystemName.Buffer : NULL,
+ Result = LookupPrivilegeValueW(SystemName.Buffer,
Name.Buffer,
lpLuid);
RtlFreeUnicodeString(&Name);
/* Remote system? */
- if (lpSystemName != NULL)
+ if (SystemName.Buffer != NULL)
{
RtlFreeUnicodeString(&SystemName);
}
Modified: trunk/reactos/dll/win32/advapi32/service/eventlog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/service/eventlog.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/service/eventlog.c [iso-8859-1] Wed Nov 5 18:24:40
2008
@@ -872,7 +872,7 @@
HeapFree(GetProcessHeap(),
0,
- wideStrArray);
+ (PVOID)wideStrArray);
return ret;
}