From 2faaf2265d0852633615103e2eabb7430d27f839 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Mon, 1 Mar 2004 21:20:33 +0000 Subject: [PATCH] Make rsabase.dll self-register. --- dlls/rsabase/Makefile.in | 2 +- dlls/rsabase/main.c | 34 ++++++++++++++++++++++++++++++++-- tools/wine.inf | 6 +----- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/dlls/rsabase/Makefile.in b/dlls/rsabase/Makefile.in index 75763d6d385..f2cd73073e7 100644 --- a/dlls/rsabase/Makefile.in +++ b/dlls/rsabase/Makefile.in @@ -4,7 +4,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = rsabase.dll -IMPORTS = kernel32 +IMPORTS = advapi32 kernel32 C_SRCS = \ main.c diff --git a/dlls/rsabase/main.c b/dlls/rsabase/main.c index 2f0b313fab4..f4b3264571a 100644 --- a/dlls/rsabase/main.c +++ b/dlls/rsabase/main.c @@ -32,6 +32,7 @@ #include "windef.h" #include "winbase.h" +#include "winreg.h" #include "wincrypt.h" #ifdef HAVE_OPENSSL_SSL_H @@ -291,12 +292,41 @@ BOOL WINAPI RSA_CPVerifySignature(HCRYPTPROV hProv, HCRYPTHASH hHash, CONST BYTE return FALSE; } +static const WCHAR szRSAKey[] = { 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\','C','r','y','p','t','o','g','r', + 'a','p','h','y','\\','D','e','f','a','u','l','t','s','\\','P','r','o','v', + 'i','d','e','r','\\','M','i','c','r','o','s','o','f','t',' ','B','a','s', + 'e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r', + 'o','v','i','d','e','r',' ','v','1','.','0',0 }; + /*********************************************************************** * DllRegisterServer (RSABASE.@) */ HRESULT WINAPI RSABASE_DllRegisterServer() { - FIXME("\n"); + HKEY key; + DWORD dp; + long apiRet = RegCreateKeyExW(HKEY_LOCAL_MACHINE, szRSAKey, 0, NULL, + REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &key, &dp); + + if (apiRet == ERROR_SUCCESS) + { + if (dp == REG_CREATED_NEW_KEY) + { + static const WCHAR szImagePath[] = { 'I','m','a','g','e','P','a', + 't','h',0 }; + static const WCHAR szRSABase[] = { 'r','s','a','b','a','s','e','.', + 'd','l','l',0 }; + static const WCHAR szType[] = { 'T','y','p','e',0 }; + DWORD type = 1; + + RegSetValueExW(key, szImagePath, 0, REG_SZ, (LPBYTE)szRSABase, + (lstrlenW(szRSABase) + 1) * sizeof(WCHAR)); + RegSetValueExW(key, szType, 0, REG_DWORD, (LPBYTE)&type, + sizeof(type)); + } + RegCloseKey(key); + } return S_OK; } @@ -305,6 +335,6 @@ HRESULT WINAPI RSABASE_DllRegisterServer() */ HRESULT WINAPI RSABASE_DllUnregisterServer() { - FIXME("\n"); + RegDeleteKeyW(HKEY_LOCAL_MACHINE, szRSAKey); return S_OK; } diff --git a/tools/wine.inf b/tools/wine.inf index f211fc5525d..ea62697d73b 100644 --- a/tools/wine.inf +++ b/tools/wine.inf @@ -30,7 +30,6 @@ RegisterDlls=RegisterDllsSection UpdateInis=SystemIni AddReg=\ Classes,\ - Crypto,\ CurrentVersion,\ Debugger,\ Desktop,\ @@ -76,10 +75,6 @@ HKCR,TypeLib\{00020430-0000-0000-C000-000000000046}\2.0,,,"OLE Automation" HKCR,TypeLib\{00020430-0000-0000-C000-000000000046}\2.0\0\win32,,,"stdole2.tlb" HKCR,TypeLib\{00020430-0000-0000-C000-000000000046}\2.0\FLAGS,,,"0" -[Crypto] -HKLM,Software\Microsoft\Cryptography\Defaults\Provider\Microsoft Base Cryptographic Provider v1.0,Image Path,,rsabase.dll -HKLM,Software\Microsoft\Cryptography\Defaults\Provider\Microsoft Base Cryptographic Provider v1.0,Type,0x10001,1 - [CurrentVersion] HKLM,%CurrentVersion%,"CommonFilesDir",,"c:\Program Files\Common Files" HKLM,%CurrentVersion%,"FirstInstallDateTime",1,21,81,7c,23 @@ -1991,6 +1986,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,ole32.dll,1 11,,oleaut32.dll,1 11,,quartz.dll,1 +11,,rsabase.dll,1 11,,shdocvw.dll,1 11,,shell32.dll,1 11,,urlmon.dll,1 -- 2.11.4.GIT