Commit 1a6fa446 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

Enable ERROR_MORE_DATA to be set in CryptGetDefaultProvider.

parent e02eb905
......@@ -1247,6 +1247,7 @@ BOOL WINAPI CryptGetDefaultProviderA (DWORD dwProvType, DWORD *pdwReserved,
{
HKEY hKey;
PSTR keyname;
DWORD result;
if (pdwReserved || !pcbProvName)
CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER);
......@@ -1262,12 +1263,18 @@ BOOL WINAPI CryptGetDefaultProviderA (DWORD dwProvType, DWORD *pdwReserved,
CRYPT_ReturnLastError(NTE_PROV_TYPE_NOT_DEF);
}
CRYPT_Free(keyname);
if (RegQueryValueExA(hKey, "Name", NULL, NULL, pszProvName, pcbProvName))
result = RegQueryValueExA(hKey, "Name", NULL, NULL, pszProvName, pcbProvName);
if (result)
{
if (GetLastError() != ERROR_MORE_DATA)
if (result != ERROR_MORE_DATA)
SetLastError(NTE_PROV_TYPE_ENTRY_BAD);
else
SetLastError(result);
return FALSE;
}
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