blob: 044722cfe0f3c5a5400fb0d2b1214abe15d80243 [file] [log] [blame]
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00001/*
2 * Copyright 2001 Rein Klazes
3 *
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.
8 *
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.
13 *
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
Rein Klazes2a4c68b2001-04-16 19:36:12 +000019#include "config.h"
20
Alexandre Julliarde37c6e12003-09-05 23:08:26 +000021#include <stdarg.h>
22
Rein Klazes2a4c68b2001-04-16 19:36:12 +000023#include "windef.h"
Alexandre Julliarde37c6e12003-09-05 23:08:26 +000024#include "winbase.h"
Rein Klazes2a4c68b2001-04-16 19:36:12 +000025#include "winerror.h"
26#include "guiddef.h"
Francois Gouget85ae2552004-10-21 21:00:29 +000027#include "wintrust.h"
Mike McCormackee069f22006-03-22 13:46:02 +090028#include "softpub.h"
Francois Gouget85ae2552004-10-21 21:00:29 +000029#include "mscat.h"
Vincent BĂ©rond52dafb2005-12-07 12:51:39 +010030#include "objbase.h"
Rein Klazes2a4c68b2001-04-16 19:36:12 +000031
Alexandre Julliard0799c1a2002-03-09 23:29:33 +000032#include "wine/debug.h"
Rein Klazes2a4c68b2001-04-16 19:36:12 +000033
Dimitrie O. Paun475cdcb2004-02-26 05:30:54 +000034WINE_DEFAULT_DEBUG_CHANNEL(wintrust);
Rein Klazes2a4c68b2001-04-16 19:36:12 +000035
Alexandre Julliardc39a5f02006-03-21 16:18:24 +010036
37/***********************************************************************
38 * DllMain (WINTRUST.@)
39 */
40BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
41{
42 switch(reason)
43 {
44 case DLL_WINE_PREATTACH:
45 return FALSE; /* prefer native version */
46 case DLL_PROCESS_ATTACH:
47 DisableThreadLibraryCalls( inst );
48 break;
49 }
50 return TRUE;
51}
52
Patrik Stridvallb3086a72001-04-25 19:54:21 +000053/***********************************************************************
Stefan Leichter63289cd2004-10-18 21:19:46 +000054 * CryptCATAdminAcquireContext (WINTRUST.@)
55 */
Francois Gouget85ae2552004-10-21 21:00:29 +000056BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN* catAdmin,
57 const GUID *sysSystem, DWORD dwFlags )
Stefan Leichter63289cd2004-10-18 21:19:46 +000058{
59 FIXME("%p %s %lx\n", catAdmin, debugstr_guid(sysSystem), dwFlags);
60 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
61 return FALSE;
62}
63
64/***********************************************************************
Paul Vriens0aec9902005-06-05 17:53:48 +000065 * CryptCATAdminCalcHashFromFileHandle (WINTRUST.@)
66 */
67BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD* pcbHash,
68 BYTE* pbHash, DWORD dwFlags )
69{
70 FIXME("%p %p %p %lx\n", hFile, pcbHash, pbHash, dwFlags);
71 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
72 return FALSE;
73}
74
75/***********************************************************************
Michael Stefaniuca7400452005-02-23 12:43:12 +000076 * CryptCATAdminReleaseContext (WINTRUST.@)
77 */
78BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags )
79{
80 FIXME("%p %lx\n", hCatAdmin, dwFlags);
81 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
82 return FALSE;
83}
84
85/***********************************************************************
Patrik Stridvallb3086a72001-04-25 19:54:21 +000086 * WinVerifyTrust (WINTRUST.@)
87 */
Francois Gouget85ae2552004-10-21 21:00:29 +000088LONG WINAPI WinVerifyTrust( HWND hwnd, GUID *ActionID, WINTRUST_DATA* ActionData )
Rein Klazes2a4c68b2001-04-16 19:36:12 +000089{
Mike McCormackee069f22006-03-22 13:46:02 +090090 static const GUID gen_verify_v2 = WINTRUST_ACTION_GENERIC_VERIFY_V2;
Paul Vriens90215e82005-09-12 10:10:36 +000091
Paul Vriensa221e0e2005-07-15 09:54:34 +000092 FIXME("%p %s %p\n", hwnd, debugstr_guid(ActionID), ActionData);
93
94 /* Trust providers can be found at:
95 * HKLM\SOFTWARE\Microsoft\Cryptography\Providers\Trust\CertCheck\
96 *
Paul Vriens90215e82005-09-12 10:10:36 +000097 * Process Explorer expects a correct implementation, so we
98 * return TRUST_E_PROVIDER_UNKNOWN.
99 *
100 * Girotel needs ERROR_SUCCESS.
101 *
102 * For now return TRUST_E_PROVIDER_UNKNOWN only when
103 * ActionID = WINTRUST_ACTION_GENERIC_VERIFY_V2.
104 *
Paul Vriensa221e0e2005-07-15 09:54:34 +0000105 */
106
Mike McCormackee069f22006-03-22 13:46:02 +0900107 if (IsEqualCLSID(ActionID, &gen_verify_v2))
Paul Vriens90215e82005-09-12 10:10:36 +0000108 return TRUST_E_PROVIDER_UNKNOWN;
109
110 return ERROR_SUCCESS;
Rein Klazes2a4c68b2001-04-16 19:36:12 +0000111}
Mike McCormack632ee622005-06-01 19:49:41 +0000112
113/***********************************************************************
Juan Lang2c5f20b2006-02-18 15:50:01 +0100114 * WinVerifyTrustEx (WINTRUST.@)
115 */
116HRESULT WINAPI WinVerifyTrustEx( HWND hwnd, GUID *ActionID,
117 WINTRUST_DATA* ActionData )
118{
119 FIXME("%p %s %p\n", hwnd, debugstr_guid(ActionID), ActionData);
120 return S_OK;
121}
122
123/***********************************************************************
124 * WTHelperGetProvSignerFromChain (WINTRUST.@)
125 */
126CRYPT_PROVIDER_SGNR * WINAPI WTHelperGetProvSignerFromChain(
127 CRYPT_PROVIDER_DATA *pProvData, DWORD idxSigner, BOOL fCounterSigner,
128 DWORD idxCounterSigner)
129{
130 FIXME("%p %ld %d %ld\n", pProvData, idxSigner, fCounterSigner,
131 idxCounterSigner);
132 return NULL;
133}
134
135/***********************************************************************
136 * WTHelperProvDataFromStateData (WINTRUST.@)
137 */
138CRYPT_PROVIDER_DATA * WINAPI WTHelperProvDataFromStateData(HANDLE hStateData)
139{
140 FIXME("%p\n", hStateData);
141 return NULL;
142}
143
144/***********************************************************************
Mike McCormack632ee622005-06-01 19:49:41 +0000145 * WintrustAddActionID (WINTRUST.@)
146 */
147BOOL WINAPI WintrustAddActionID( GUID* pgActionID, DWORD fdwFlags,
148 CRYPT_REGISTER_ACTIONID* psProvInfo)
149{
150 FIXME("%p %lx %p\n", pgActionID, fdwFlags, psProvInfo);
151 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
152 return FALSE;
153}
154
155/***********************************************************************
Stefan Leichterb7819c22005-09-16 18:44:26 +0000156 * WintrustGetRegPolicyFlags (WINTRUST.@)
Mike McCormack632ee622005-06-01 19:49:41 +0000157 */
158void WINAPI WintrustGetRegPolicyFlags( DWORD* pdwPolicyFlags )
159{
160 FIXME("%p\n", pdwPolicyFlags);
161 *pdwPolicyFlags = 0;
162}
Stefan Leichterb7819c22005-09-16 18:44:26 +0000163
164/***********************************************************************
165 * WintrustSetRegPolicyFlags (WINTRUST.@)
166 */
167BOOL WINAPI WintrustSetRegPolicyFlags( DWORD dwPolicyFlags)
168{
169 FIXME("stub: %lx\n", dwPolicyFlags);
170 return TRUE;
171}
172
173/***********************************************************************
174 * DllRegisterServer (WINTRUST.@)
175 */
176HRESULT WINAPI DllRegisterServer(void)
177{
178 FIXME("stub\n");
179 return S_OK;
180}
181
182/***********************************************************************
183 * DllUnregisterServer (WINTRUST.@)
184 */
185HRESULT WINAPI DllUnregisterServer(void)
186{
187 FIXME("stub\n");
188 return S_OK;
189}