Enable ERROR_MORE_DATA to be set in CryptGetDefaultProvider.

This commit is contained in:
James Hawkins 2004-08-20 19:25:35 +00:00 committed by Alexandre Julliard
parent e02eb90509
commit 1a6fa44658
1 changed files with 9 additions and 2 deletions

View File

@ -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;
}