Paul Vriens : crypt32: Set last error on registry errors.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Sep 7 07:12:15 CDT 2006
Module: wine
Branch: master
Commit: 063f3e9c2fb8c5f258c0ed956711523046917a6a
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=063f3e9c2fb8c5f258c0ed956711523046917a6a
Author: Paul Vriens <Paul.Vriens at xs4all.nl>
Date: Wed Sep 6 15:48:00 2006 +0200
crypt32: Set last error on registry errors.
---
dlls/crypt32/oid.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/crypt32/oid.c b/dlls/crypt32/oid.c
index c1d3bc6..a993478 100644
--- a/dlls/crypt32/oid.c
+++ b/dlls/crypt32/oid.c
@@ -449,15 +449,24 @@ BOOL WINAPI CryptRegisterOIDFunction(DWO
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;
More information about the wine-cvs
mailing list