Commit 092a2b3e authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

advapi32: Avoid giving variables same name as library functions.

parent aac5fa34
...@@ -1196,23 +1196,23 @@ BOOL WINAPI CryptEnumProvidersA (DWORD dwIndex, DWORD *pdwReserved, ...@@ -1196,23 +1196,23 @@ BOOL WINAPI CryptEnumProvidersA (DWORD dwIndex, DWORD *pdwReserved,
DWORD dwFlags, DWORD *pdwProvType, LPSTR pszProvName, DWORD *pcbProvName) DWORD dwFlags, DWORD *pdwProvType, LPSTR pszProvName, DWORD *pcbProvName)
{ {
PWSTR str = NULL; PWSTR str = NULL;
DWORD strlen; DWORD bufsize;
BOOL ret; /* = FALSE; */ BOOL ret; /* = FALSE; */
TRACE("(%d, %p, %08x, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, TRACE("(%d, %p, %08x, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags,
pdwProvType, pszProvName, pcbProvName); pdwProvType, pszProvName, pcbProvName);
if(!CryptEnumProvidersW(dwIndex, pdwReserved, dwFlags, pdwProvType, NULL, &strlen)) if(!CryptEnumProvidersW(dwIndex, pdwReserved, dwFlags, pdwProvType, NULL, &bufsize))
return FALSE; return FALSE;
if ( pszProvName && !(str = CRYPT_Alloc(strlen)) ) if ( pszProvName && !(str = CRYPT_Alloc(bufsize)) )
{ {
SetLastError(ERROR_NOT_ENOUGH_MEMORY); SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE; return FALSE;
} }
ret = CryptEnumProvidersW(dwIndex, pdwReserved, dwFlags, pdwProvType, str, &strlen); ret = CryptEnumProvidersW(dwIndex, pdwReserved, dwFlags, pdwProvType, str, &bufsize);
if (str) if (str)
CRYPT_UnicodeToANSI(str, &pszProvName, *pcbProvName); CRYPT_UnicodeToANSI(str, &pszProvName, *pcbProvName);
*pcbProvName = strlen / sizeof(WCHAR); /* FIXME: not correct */ *pcbProvName = bufsize / sizeof(WCHAR); /* FIXME: not correct */
if (str) if (str)
{ {
CRYPT_Free(str); CRYPT_Free(str);
...@@ -1325,23 +1325,23 @@ BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved, ...@@ -1325,23 +1325,23 @@ BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved,
DWORD dwFlags, DWORD *pdwProvType, LPSTR pszTypeName, DWORD *pcbTypeName) DWORD dwFlags, DWORD *pdwProvType, LPSTR pszTypeName, DWORD *pcbTypeName)
{ {
PWSTR str = NULL; PWSTR str = NULL;
DWORD strlen; DWORD bufsize;
BOOL ret; BOOL ret;
TRACE("(%d, %p, %08x, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, TRACE("(%d, %p, %08x, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags,
pdwProvType, pszTypeName, pcbTypeName); pdwProvType, pszTypeName, pcbTypeName);
if(!CryptEnumProviderTypesW(dwIndex, pdwReserved, dwFlags, pdwProvType, NULL, &strlen)) if(!CryptEnumProviderTypesW(dwIndex, pdwReserved, dwFlags, pdwProvType, NULL, &bufsize))
return FALSE; return FALSE;
if ( pszTypeName && !(str = CRYPT_Alloc(strlen)) ) if ( pszTypeName && !(str = CRYPT_Alloc(bufsize)) )
{ {
SetLastError(ERROR_NOT_ENOUGH_MEMORY); SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE; return FALSE;
} }
ret = CryptEnumProviderTypesW(dwIndex, pdwReserved, dwFlags, pdwProvType, str, &strlen); ret = CryptEnumProviderTypesW(dwIndex, pdwReserved, dwFlags, pdwProvType, str, &bufsize);
if (str) if (str)
CRYPT_UnicodeToANSI(str, &pszTypeName, *pcbTypeName); CRYPT_UnicodeToANSI(str, &pszTypeName, *pcbTypeName);
*pcbTypeName = strlen / sizeof(WCHAR); *pcbTypeName = bufsize / sizeof(WCHAR);
if (str) if (str)
{ {
CRYPT_Free(str); CRYPT_Free(str);
...@@ -1525,21 +1525,21 @@ BOOL WINAPI CryptGetDefaultProviderA (DWORD dwProvType, DWORD *pdwReserved, ...@@ -1525,21 +1525,21 @@ BOOL WINAPI CryptGetDefaultProviderA (DWORD dwProvType, DWORD *pdwReserved,
DWORD dwFlags, LPSTR pszProvName, DWORD *pcbProvName) DWORD dwFlags, LPSTR pszProvName, DWORD *pcbProvName)
{ {
PWSTR str = NULL; PWSTR str = NULL;
DWORD strlen; DWORD bufsize;
BOOL ret = FALSE; BOOL ret = FALSE;
TRACE("(%d, %p, %08x, %p, %p)\n", dwProvType, pdwReserved, dwFlags, pszProvName, pcbProvName); TRACE("(%d, %p, %08x, %p, %p)\n", dwProvType, pdwReserved, dwFlags, pszProvName, pcbProvName);
CryptGetDefaultProviderW(dwProvType, pdwReserved, dwFlags, NULL, &strlen); CryptGetDefaultProviderW(dwProvType, pdwReserved, dwFlags, NULL, &bufsize);
if ( pszProvName && !(str = CRYPT_Alloc(strlen)) ) if ( pszProvName && !(str = CRYPT_Alloc(bufsize)) )
{ {
SetLastError(ERROR_NOT_ENOUGH_MEMORY); SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE; return FALSE;
} }
ret = CryptGetDefaultProviderW(dwProvType, pdwReserved, dwFlags, str, &strlen); ret = CryptGetDefaultProviderW(dwProvType, pdwReserved, dwFlags, str, &bufsize);
if (str) if (str)
CRYPT_UnicodeToANSI(str, &pszProvName, *pcbProvName); CRYPT_UnicodeToANSI(str, &pszProvName, *pcbProvName);
*pcbProvName = strlen / sizeof(WCHAR); *pcbProvName = bufsize / sizeof(WCHAR);
if (str) if (str)
{ {
CRYPT_Free(str); CRYPT_Free(str);
......
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