user/tests: Try harder to flush X events before running tests.
[wine] / dlls / wintrust / wintrust_main.c
1 /*
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
19 #include "config.h"
20
21 #include <stdarg.h>
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winerror.h"
26 #include "guiddef.h"
27 #include "wintrust.h"
28 #include "mscat.h"
29 #include "objbase.h"
30
31 #include "wine/debug.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(wintrust);
34
35 /***********************************************************************
36  *              CryptCATAdminAcquireContext (WINTRUST.@)
37  */
38 BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN* catAdmin,
39                                         const GUID *sysSystem, DWORD dwFlags )
40 {
41     FIXME("%p %s %lx\n", catAdmin, debugstr_guid(sysSystem), dwFlags);
42     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
43     return FALSE;
44 }
45
46 /***********************************************************************
47  *             CryptCATAdminCalcHashFromFileHandle (WINTRUST.@)
48  */
49 BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD* pcbHash,
50                                                 BYTE* pbHash, DWORD dwFlags )
51 {
52     FIXME("%p %p %p %lx\n", hFile, pcbHash, pbHash, dwFlags);
53     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
54     return FALSE;
55 }
56
57 /***********************************************************************
58  *              CryptCATAdminReleaseContext (WINTRUST.@)
59  */
60 BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags )
61 {
62     FIXME("%p %lx\n", hCatAdmin, dwFlags);
63     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
64     return FALSE;
65 }
66
67 /***********************************************************************
68  *              WinVerifyTrust (WINTRUST.@)
69  */
70 LONG WINAPI WinVerifyTrust( HWND hwnd, GUID *ActionID,  WINTRUST_DATA* ActionData )
71 {
72     static const GUID WINTRUST_ACTION_GENERIC_VERIFY_V2 = { 0xaac56b, 0xcd44, 0x11d0,
73                                                           { 0x8c,0xc2,0x00,0xc0,0x4f,0xc2,0x95,0xee }};
74
75     FIXME("%p %s %p\n", hwnd, debugstr_guid(ActionID), ActionData);
76
77     /* Trust providers can be found at:
78      * HKLM\SOFTWARE\Microsoft\Cryptography\Providers\Trust\CertCheck\
79      *
80      * Process Explorer expects a correct implementation, so we 
81      * return TRUST_E_PROVIDER_UNKNOWN.
82      *
83      * Girotel needs ERROR_SUCCESS.
84      *
85      * For now return TRUST_E_PROVIDER_UNKNOWN only when 
86      * ActionID = WINTRUST_ACTION_GENERIC_VERIFY_V2.
87      *
88      */
89
90     if (IsEqualCLSID(ActionID, &WINTRUST_ACTION_GENERIC_VERIFY_V2))
91         return TRUST_E_PROVIDER_UNKNOWN;
92
93     return ERROR_SUCCESS;
94 }
95
96 /***********************************************************************
97  *              WinVerifyTrustEx (WINTRUST.@)
98  */
99 HRESULT WINAPI WinVerifyTrustEx( HWND hwnd, GUID *ActionID,
100  WINTRUST_DATA* ActionData )
101 {
102     FIXME("%p %s %p\n", hwnd, debugstr_guid(ActionID), ActionData);
103     return S_OK;
104 }
105
106 /***********************************************************************
107  *              WTHelperGetProvSignerFromChain (WINTRUST.@)
108  */
109 CRYPT_PROVIDER_SGNR * WINAPI WTHelperGetProvSignerFromChain(
110  CRYPT_PROVIDER_DATA *pProvData, DWORD idxSigner, BOOL fCounterSigner,
111  DWORD idxCounterSigner)
112 {
113     FIXME("%p %ld %d %ld\n", pProvData, idxSigner, fCounterSigner,
114      idxCounterSigner);
115     return NULL;
116 }
117
118 /***********************************************************************
119  *              WTHelperProvDataFromStateData (WINTRUST.@)
120  */
121 CRYPT_PROVIDER_DATA * WINAPI WTHelperProvDataFromStateData(HANDLE hStateData)
122 {
123     FIXME("%p\n", hStateData);
124     return NULL;
125 }
126
127 /***********************************************************************
128  *              WintrustAddActionID (WINTRUST.@)
129  */
130 BOOL WINAPI WintrustAddActionID( GUID* pgActionID, DWORD fdwFlags,
131                                  CRYPT_REGISTER_ACTIONID* psProvInfo)
132 {
133     FIXME("%p %lx %p\n", pgActionID, fdwFlags, psProvInfo);
134     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
135     return FALSE;
136 }
137
138 /***********************************************************************
139  *              WintrustGetRegPolicyFlags (WINTRUST.@)
140  */
141 void WINAPI WintrustGetRegPolicyFlags( DWORD* pdwPolicyFlags )
142 {
143     FIXME("%p\n", pdwPolicyFlags);
144     *pdwPolicyFlags = 0;
145 }
146
147 /***********************************************************************
148  *              WintrustSetRegPolicyFlags (WINTRUST.@)
149  */
150 BOOL WINAPI WintrustSetRegPolicyFlags( DWORD dwPolicyFlags)
151 {
152     FIXME("stub: %lx\n", dwPolicyFlags);
153     return TRUE;
154 }
155
156 /***********************************************************************
157   *             DllRegisterServer (WINTRUST.@)
158   */
159 HRESULT WINAPI DllRegisterServer(void)
160 {
161      FIXME("stub\n");
162      return S_OK;
163 }
164
165 /***********************************************************************
166   *             DllUnregisterServer (WINTRUST.@)
167   */
168 HRESULT WINAPI DllUnregisterServer(void)
169 {
170      FIXME("stub\n");
171      return S_OK;
172 }