mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-05 17:09:37 +00:00
crypt32: Set last error on registry errors.
This commit is contained in:
parent
6e38461019
commit
063f3e9c2f
|
@ -449,15 +449,24 @@ BOOL WINAPI CryptRegisterOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName,
|
|||
|
||||
r = RegCreateKeyA(HKEY_LOCAL_MACHINE, szKey, &hKey);
|
||||
CryptMemFree(szKey);
|
||||
|
||||
/* Testing on native shows that registry errors are reported */
|
||||
if(r != ERROR_SUCCESS)
|
||||
{
|
||||
SetLastError(r);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* write the values */
|
||||
if (pszOverrideFuncName)
|
||||
RegSetValueExA(hKey, "FuncName", 0, REG_SZ,
|
||||
(const BYTE*)pszOverrideFuncName, lstrlenA(pszOverrideFuncName) + 1);
|
||||
RegSetValueExW(hKey, DllW, 0, REG_SZ, (const BYTE*) pwszDll,
|
||||
(lstrlenW(pwszDll) + 1) * sizeof (WCHAR));
|
||||
{
|
||||
r = RegSetValueExA(hKey, "FuncName", 0, REG_SZ,
|
||||
(const BYTE*)pszOverrideFuncName, lstrlenA(pszOverrideFuncName) + 1);
|
||||
if (r != ERROR_SUCCESS) SetLastError(r);
|
||||
}
|
||||
r = RegSetValueExW(hKey, DllW, 0, REG_SZ, (const BYTE*) pwszDll,
|
||||
(lstrlenW(pwszDll) + 1) * sizeof (WCHAR));
|
||||
if (r != ERROR_SUCCESS) SetLastError(r);
|
||||
|
||||
RegCloseKey(hKey);
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue