Commit 7fa80077 authored by Michael Jung's avatar Michael Jung Committed by Alexandre Julliard

Always set ERROR_SUCCESS in case of success in CPAcquireContext.

parent 2e51a04a
...@@ -1004,8 +1004,6 @@ BOOL WINAPI RSAENH_CPAcquireContext(HCRYPTPROV *phProv, LPSTR pszContainer, ...@@ -1004,8 +1004,6 @@ BOOL WINAPI RSAENH_CPAcquireContext(HCRYPTPROV *phProv, LPSTR pszContainer,
TRACE("(phProv=%p, pszContainer=%s, dwFlags=%08lx, pVTable=%p)\n", phProv, TRACE("(phProv=%p, pszContainer=%s, dwFlags=%08lx, pVTable=%p)\n", phProv,
debugstr_a(pszContainer), dwFlags, pVTable); debugstr_a(pszContainer), dwFlags, pVTable);
SetLastError(ERROR_SUCCESS);
if (pszContainer ? strlen(pszContainer) : 0) if (pszContainer ? strlen(pszContainer) : 0)
{ {
strncpy(szKeyContainerName, pszContainer, MAX_PATH); strncpy(szKeyContainerName, pszContainer, MAX_PATH);
...@@ -1029,6 +1027,7 @@ BOOL WINAPI RSAENH_CPAcquireContext(HCRYPTPROV *phProv, LPSTR pszContainer, ...@@ -1029,6 +1027,7 @@ BOOL WINAPI RSAENH_CPAcquireContext(HCRYPTPROV *phProv, LPSTR pszContainer,
return FALSE; return FALSE;
} else { } else {
RegDeleteKeyA(HKEY_CURRENT_USER, szRegKey); RegDeleteKeyA(HKEY_CURRENT_USER, szRegKey);
SetLastError(ERROR_SUCCESS);
return TRUE; return TRUE;
} }
break; break;
...@@ -1058,7 +1057,12 @@ BOOL WINAPI RSAENH_CPAcquireContext(HCRYPTPROV *phProv, LPSTR pszContainer, ...@@ -1058,7 +1057,12 @@ BOOL WINAPI RSAENH_CPAcquireContext(HCRYPTPROV *phProv, LPSTR pszContainer,
return FALSE; return FALSE;
} }
return *phProv != (unsigned int)INVALID_HANDLE_VALUE; if (*phProv != (unsigned int)INVALID_HANDLE_VALUE) {
SetLastError(ERROR_SUCCESS);
return TRUE;
} else {
return FALSE;
}
} }
/****************************************************************************** /******************************************************************************
......
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