wined3d: Remove dead code.
[wine.git] / dlls / cryptdlg / main.c
blob2447c3887b386b7ca055d272c7ab9e4ab3aede55
1 /*
2 * Copyright 2008 Maarten Lankhorst
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "config.h"
21 #include <stdarg.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "wincrypt.h"
26 #include "wintrust.h"
27 #include "winuser.h"
28 #include "cryptdlg.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(cryptdlg);
33 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
35 TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
37 switch (fdwReason)
39 case DLL_WINE_PREATTACH:
40 return FALSE; /* prefer native version */
41 case DLL_PROCESS_ATTACH:
42 DisableThreadLibraryCalls(hinstDLL);
43 break;
44 case DLL_PROCESS_DETACH:
45 break;
46 default:
47 break;
49 return TRUE;
52 /***********************************************************************
53 * GetFriendlyNameOfCertA (CRYPTDLG.@)
55 DWORD WINAPI GetFriendlyNameOfCertA(PCCERT_CONTEXT pccert, LPSTR pchBuffer,
56 DWORD cchBuffer)
58 return CertGetNameStringA(pccert, CERT_NAME_FRIENDLY_DISPLAY_TYPE, 0, NULL,
59 pchBuffer, cchBuffer);
62 /***********************************************************************
63 * GetFriendlyNameOfCertW (CRYPTDLG.@)
65 DWORD WINAPI GetFriendlyNameOfCertW(PCCERT_CONTEXT pccert, LPWSTR pchBuffer,
66 DWORD cchBuffer)
68 return CertGetNameStringW(pccert, CERT_NAME_FRIENDLY_DISPLAY_TYPE, 0, NULL,
69 pchBuffer, cchBuffer);
72 /***********************************************************************
73 * CertTrustInit (CRYPTDLG.@)
75 HRESULT WINAPI CertTrustInit(CRYPT_PROVIDER_DATA *pProvData)
77 FIXME("(%p)\n", pProvData);
78 return E_NOTIMPL;
81 /***********************************************************************
82 * CertTrustCertPolicy (CRYPTDLG.@)
84 BOOL WINAPI CertTrustCertPolicy(CRYPT_PROVIDER_DATA *pProvData, DWORD idxSigner, BOOL fCounterSignerChain, DWORD idxCounterSigner)
86 FIXME("(%p, %d, %s, %d)\n", pProvData, idxSigner, fCounterSignerChain ? "TRUE" : "FALSE", idxCounterSigner);
87 return FALSE;
90 /***********************************************************************
91 * CertTrustCleanup (CRYPTDLG.@)
93 HRESULT WINAPI CertTrustCleanup(CRYPT_PROVIDER_DATA *pProvData)
95 FIXME("(%p)\n", pProvData);
96 return E_NOTIMPL;
99 /***********************************************************************
100 * CertTrustFinalPolicy (CRYPTDLG.@)
102 HRESULT WINAPI CertTrustFinalPolicy(CRYPT_PROVIDER_DATA *pProvData)
104 FIXME("(%p)\n", pProvData);
105 return E_NOTIMPL;
108 /***********************************************************************
109 * CertViewPropertiesA (CRYPTDLG.@)
111 BOOL WINAPI CertViewPropertiesA(CERT_VIEWPROPERTIES_STRUCT_A *info)
113 FIXME("(%p): stub\n", info);
114 return FALSE;
117 /***********************************************************************
118 * CertViewPropertiesW (CRYPTDLG.@)
120 BOOL WINAPI CertViewPropertiesW(CERT_VIEWPROPERTIES_STRUCT_W *info)
122 FIXME("(%p): stub\n", info);
123 return FALSE;
126 /***********************************************************************
127 * DllRegisterServer (CRYPTDLG.@)
129 HRESULT WINAPI DllRegisterServer(void)
131 static WCHAR cryptdlg[] = { 'c','r','y','p','t','d','l','g','.',
132 'd','l','l',0 };
133 static WCHAR wintrust[] = { 'w','i','n','t','r','u','s','t','.',
134 'd','l','l',0 };
135 static WCHAR certTrustInit[] = { 'C','e','r','t','T','r','u','s','t',
136 'I','n','i','t',0 };
137 static WCHAR wintrustCertificateTrust[] = { 'W','i','n','t','r','u','s','t',
138 'C','e','r','t','i','f','i','c','a','t','e','T','r','u','s','t',0 };
139 static WCHAR certTrustCertPolicy[] = { 'C','e','r','t','T','r','u','s','t',
140 'C','e','r','t','P','o','l','i','c','y',0 };
141 static WCHAR certTrustFinalPolicy[] = { 'C','e','r','t','T','r','u','s','t',
142 'F','i','n','a','l','P','o','l','i','c','y',0 };
143 static WCHAR certTrustCleanup[] = { 'C','e','r','t','T','r','u','s','t',
144 'C','l','e','a','n','u','p',0 };
145 CRYPT_REGISTER_ACTIONID reg;
146 GUID guid = CERT_CERTIFICATE_ACTION_VERIFY;
147 HRESULT hr = S_OK;
149 memset(&reg, 0, sizeof(reg));
150 reg.cbStruct = sizeof(reg);
151 reg.sInitProvider.cbStruct = sizeof(CRYPT_TRUST_REG_ENTRY);
152 reg.sInitProvider.pwszDLLName = cryptdlg;
153 reg.sInitProvider.pwszFunctionName = certTrustInit;
154 reg.sCertificateProvider.cbStruct = sizeof(CRYPT_TRUST_REG_ENTRY);
155 reg.sCertificateProvider.pwszDLLName = wintrust;
156 reg.sCertificateProvider.pwszFunctionName = wintrustCertificateTrust;
157 reg.sCertificatePolicyProvider.cbStruct = sizeof(CRYPT_TRUST_REG_ENTRY);
158 reg.sCertificatePolicyProvider.pwszDLLName = cryptdlg;
159 reg.sCertificatePolicyProvider.pwszFunctionName = certTrustCertPolicy;
160 reg.sFinalPolicyProvider.cbStruct = sizeof(CRYPT_TRUST_REG_ENTRY);
161 reg.sFinalPolicyProvider.pwszDLLName = cryptdlg;
162 reg.sFinalPolicyProvider.pwszFunctionName = certTrustFinalPolicy;
163 reg.sCleanupProvider.cbStruct = sizeof(CRYPT_TRUST_REG_ENTRY);
164 reg.sCleanupProvider.pwszDLLName = cryptdlg;
165 reg.sCleanupProvider.pwszFunctionName = certTrustCleanup;
166 if (!WintrustAddActionID(&guid, WT_ADD_ACTION_ID_RET_RESULT_FLAG, &reg))
167 hr = GetLastError();
168 return hr;
171 /***********************************************************************
172 * DllUnregisterServer (CRYPTDLG.@)
174 HRESULT WINAPI DllUnregisterServer(void)
176 GUID guid = CERT_CERTIFICATE_ACTION_VERIFY;
178 WintrustRemoveActionID(&guid);
179 return S_OK;