Commit a26b7e30 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

If pszTypeName is too small to hold the type name in

CryptEnumProviderTypes, return ERROR_MORE_DATA.
parent 94536475
......@@ -1077,6 +1077,7 @@ BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved,
HKEY hKey, hSubkey;
DWORD keylen, numkeys, dwType;
PSTR keyname, ch;
DWORD result;
TRACE("(%ld, %p, %08ld, %p, %p, %p)\n", dwIndex, pdwReserved,
dwFlags, pdwProvType, pszTypeName, pcbTypeName);
......@@ -1105,7 +1106,11 @@ BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved,
*pdwProvType += (*(--ch) - '0') * 10;
*pdwProvType += (*(--ch) - '0') * 100;
CRYPT_Free(keyname);
RegQueryValueExA(hSubkey, "TypeName", NULL, &dwType, pszTypeName, pcbTypeName);
result = RegQueryValueExA(hSubkey, "TypeName", NULL, &dwType, pszTypeName, pcbTypeName);
if (result)
CRYPT_ReturnLastError(result);
RegCloseKey(hSubkey);
RegCloseKey(hKey);
return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment