[ADVAPI32]

- Account for RegQueryInfoKey no longer including the null terminator in EnumHKCRKey/EnumHKCRValue
CORE-6976

svn path=/trunk/; revision=67426
This commit is contained in:
Thomas Faber 2015-04-25 20:34:35 +00:00
parent 541f7f43ec
commit 1b7b922cb0
2 changed files with 4 additions and 3 deletions

View file

@ -711,11 +711,12 @@ EnumHKCRKey(
goto Exit; goto Exit;
} }
MaxFallbackSubKeyLen++;
TRACE("Maxfallbacksubkeylen: %d\n", MaxFallbackSubKeyLen); TRACE("Maxfallbacksubkeylen: %d\n", MaxFallbackSubKeyLen);
/* Allocate our buffer */ /* Allocate our buffer */
FallbackSubKeyName = RtlAllocateHeap( FallbackSubKeyName = RtlAllocateHeap(
RtlGetProcessHeap(), 0, (MaxFallbackSubKeyLen + 1) * sizeof(WCHAR)); RtlGetProcessHeap(), 0, MaxFallbackSubKeyLen * sizeof(WCHAR));
if (!FallbackSubKeyName) if (!FallbackSubKeyName)
{ {
ErrorCode = ERROR_NOT_ENOUGH_MEMORY; ErrorCode = ERROR_NOT_ENOUGH_MEMORY;
@ -925,11 +926,12 @@ EnumHKCRValue(
goto Exit; goto Exit;
} }
MaxFallbackValueNameLen++;
TRACE("Maxfallbacksubkeylen: %d\n", MaxFallbackValueNameLen); TRACE("Maxfallbacksubkeylen: %d\n", MaxFallbackValueNameLen);
/* Allocate our buffer */ /* Allocate our buffer */
FallbackValueName = RtlAllocateHeap( FallbackValueName = RtlAllocateHeap(
RtlGetProcessHeap(), 0, (MaxFallbackValueNameLen + 1) * sizeof(WCHAR)); RtlGetProcessHeap(), 0, MaxFallbackValueNameLen * sizeof(WCHAR));
if (!FallbackValueName) if (!FallbackValueName)
{ {
ErrorCode = ERROR_NOT_ENOUGH_MEMORY; ErrorCode = ERROR_NOT_ENOUGH_MEMORY;

View file

@ -3789,7 +3789,6 @@ RegQueryInfoKeyW(HKEY hKey,
lpftLastWriteTime->dwHighDateTime = FullInfo->LastWriteTime.u.HighPart; lpftLastWriteTime->dwHighDateTime = FullInfo->LastWriteTime.u.HighPart;
} }
ErrorCode = ERROR_SUCCESS;
if (lpClass != NULL) if (lpClass != NULL)
{ {
if (*lpcClass == 0) if (*lpcClass == 0)