Merging r37219

svn path=/trunk/; revision=37220
This commit is contained in:
KJK::Hyperion 2008-11-06 00:24:40 +00:00
parent 18640a8731
commit 7eff87cf56
4 changed files with 17 additions and 8 deletions

View file

@ -109,6 +109,9 @@ InitiateSystemShutdownA(LPSTR lpMachineName,
INT LastError;
BOOL rv;
MachineNameW.Buffer = NULL;
MessageW.Buffer = NULL;
if (lpMachineName)
{
RtlInitAnsiString(&MachineNameA, lpMachineName);
@ -126,7 +129,7 @@ InitiateSystemShutdownA(LPSTR lpMachineName,
Status = RtlAnsiStringToUnicodeString(&MessageW, &MessageA, TRUE);
if (STATUS_SUCCESS != Status)
{
if (MachineNameW.Length)
if (MachineNameW.Buffer)
{
RtlFreeUnicodeString(&MachineNameW);
}

View file

@ -917,6 +917,8 @@ CreateNestedKey(PHKEY KeyHandle,
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 @@ CreateNestedKey(PHKEY KeyHandle,
Length = wcslen (LocalKeyName.Buffer);
while (TRUE)
{
NtClose (LocalKeyHandle);
if (LocalKeyHandle)
NtClose (LocalKeyHandle);
LocalKeyName.Buffer[Length] = L'\\';
Length = wcslen (LocalKeyName.Buffer);
@ -2544,7 +2547,7 @@ RegEnumKeyExA (HKEY hKey,
}
}
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,13 +4688,14 @@ RegSetValueExA (HKEY hKey,
{
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) ||
(dwType == REG_EXPAND_SZ)) &&

View file

@ -1252,6 +1252,8 @@ LookupPrivilegeValueA(LPCSTR lpSystemName,
RtlCreateUnicodeStringFromAsciiz(&SystemName,
(LPSTR)lpSystemName);
}
else
SystemName.Buffer = NULL;
/* Check the privilege name is not NULL */
if (lpName == NULL)
@ -1263,14 +1265,14 @@ LookupPrivilegeValueA(LPCSTR lpSystemName,
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);
}

View file

@ -872,7 +872,7 @@ ReportEventA(IN HANDLE hEventLog,
HeapFree(GetProcessHeap(),
0,
wideStrArray);
(PVOID)wideStrArray);
return ret;
}