2006-06-28 16:51:41 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2006 Maarten Lankhorst
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2007-05-04 12:08:15 +02:00
|
|
|
* Lesser General Public License for more details.
|
2006-06-28 16:51:41 +02:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "windef.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winnt.h"
|
2007-10-18 19:18:31 +02:00
|
|
|
#include "wincrypt.h"
|
2006-06-28 16:51:41 +02:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(cryptnet);
|
|
|
|
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|
|
|
{
|
2006-09-29 01:19:00 +02:00
|
|
|
TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
|
2006-06-28 16:51:41 +02:00
|
|
|
|
|
|
|
switch (fdwReason) {
|
|
|
|
case DLL_WINE_PREATTACH:
|
|
|
|
return FALSE; /* prefer native version */
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
|
|
|
break;
|
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
/* Do uninitialisation here */
|
|
|
|
break;
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2007-10-18 19:18:31 +02:00
|
|
|
static const WCHAR cryptNet[] = { 'c','r','y','p','t','n','e','t','.',
|
|
|
|
'd','l','l',0 };
|
|
|
|
static const WCHAR ldapProvOpenStore[] = { 'L','d','a','p','P','r','o','v',
|
|
|
|
'O','p','e','S','t','o','r','e',0 };
|
|
|
|
|
2006-06-28 16:51:41 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* DllRegisterServer (CRYPTNET.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllRegisterServer(void)
|
|
|
|
{
|
2007-10-18 19:18:31 +02:00
|
|
|
TRACE("\n");
|
|
|
|
CryptRegisterDefaultOIDFunction(X509_ASN_ENCODING,
|
|
|
|
CRYPT_OID_VERIFY_REVOCATION_FUNC, 0, cryptNet);
|
|
|
|
CryptRegisterOIDFunction(0, CRYPT_OID_OPEN_STORE_PROV_FUNC, "Ldap",
|
|
|
|
cryptNet, "LdapProvOpenStore");
|
|
|
|
CryptRegisterOIDFunction(0, CRYPT_OID_OPEN_STORE_PROV_FUNC,
|
|
|
|
CERT_STORE_PROV_LDAP_W, cryptNet, "LdapProvOpenStore");
|
2006-06-28 16:51:41 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllUnregisterServer (CRYPTNET.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllUnregisterServer(void)
|
|
|
|
{
|
2007-10-18 19:18:31 +02:00
|
|
|
TRACE("\n");
|
|
|
|
CryptUnregisterDefaultOIDFunction(X509_ASN_ENCODING,
|
|
|
|
CRYPT_OID_VERIFY_REVOCATION_FUNC, cryptNet);
|
|
|
|
CryptUnregisterOIDFunction(0, CRYPT_OID_OPEN_STORE_PROV_FUNC, "Ldap");
|
|
|
|
CryptUnregisterOIDFunction(0, CRYPT_OID_OPEN_STORE_PROV_FUNC,
|
|
|
|
CERT_STORE_PROV_LDAP_W);
|
2006-06-28 16:51:41 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|