regedit: Remove custom filter from open/save dialogs.
[wine/multimedia.git] / include / wintrust.h
blob3d2ba8cbba73646cd8579d0e2019cba802c5f896
1 /*
2 * Copyright (C) 2004 Francois Gouget
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 #ifndef __WINE_WINTRUST_H
20 #define __WINE_WINTRUST_H
22 #include <wincrypt.h>
25 #include <pshpack8.h>
27 typedef struct WINTRUST_FILE_INFO_
29 DWORD cbStruct;
30 LPCWSTR pcwszFilePath;
31 HANDLE hFile;
32 GUID* pgKnownSubject;
33 } WINTRUST_FILE_INFO, *PWINTRUST_FILE_INFO;
35 typedef struct WINTRUST_CATALOG_INFO_
37 DWORD cbStruct;
38 DWORD dwCatalogVersion;
39 LPCWSTR pcwszCatalogFilePath;
40 LPCWSTR pcwszMemberTag;
41 LPCWSTR pcwszMemberFilePath;
42 HANDLE hMemberFile;
43 BYTE* pbCalculatedFileHash;
44 DWORD cbCalculatedFileHash;
45 PCCTL_CONTEXT pcCatalogContext;
46 } WINTRUST_CATALOG_INFO, *PWINTRUST_CATALOG_INFO;
48 typedef struct WINTRUST_BLOB_INFO_
50 DWORD cbStruct;
51 GUID gSubject;
52 LPCWSTR pcwszDisplayName;
53 DWORD cbMemObject;
54 BYTE* pbMemObject;
55 DWORD cbMemSignedMsg;
56 BYTE* pbMemSignedMsg;
57 } WINTRUST_BLOB_INFO, *PWINTRUST_BLOB_INFO;
59 typedef struct WINTRUST_SGNR_INFO_
61 DWORD cbStruct;
62 LPCWSTR pcwszDisplayName;
63 CMSG_SIGNER_INFO* psSignerInfo;
64 DWORD chStores;
65 HCERTSTORE* pahStores;
66 } WINTRUST_SGNR_INFO, *PWINTRUST_SGNR_INFO;
68 typedef struct WINTRUST_CERT_INFO_
70 DWORD cbStruct;
71 LPCWSTR pcwszDisplayName;
72 CERT_CONTEXT* psCertContext;
73 DWORD chStores;
74 HCERTSTORE* pahStores;
75 DWORD dwFlags;
76 FILETIME* psftVerifyAsOf;
77 } WINTRUST_CERT_INFO, *PWINTRUST_CERT_INFO;
79 /* dwUIChoice */
80 #define WTD_UI_ALL 1
81 #define WTD_UI_NONE 2
82 #define WTD_UI_NOBAD 3
83 #define WTD_UI_NOGOOD 4
84 /* fdwRevocationChecks */
85 #define WTD_REVOKE_NONE 0
86 #define WTD_REVOKE_WHOLECHAIN 1
87 /* dwUnionChoice */
88 #define WTD_CHOICE_FILE 1
89 #define WTD_CHOICE_CATALOG 2
90 #define WTD_CHOICE_BLOB 3
91 #define WTD_CHOICE_SIGNER 4
92 #define WTD_CHOICE_CERT 5
94 typedef struct _WINTRUST_DATA
96 DWORD cbStruct;
97 LPVOID pPolicyCallbackData;
98 LPVOID pSIPClientData;
99 DWORD dwUIChoice;
100 DWORD fdwRevocationChecks;
101 DWORD dwUnionChoice;
102 union
104 struct WINTRUST_FILE_INFO_* pFile;
105 struct WINTRUST_CATALOG_INFO_* pCatalog;
106 struct WINTRUST_BLOB_INFO_* pBlob;
107 struct WINTRUST_SGNR_INFO_* pSgnr;
108 struct WINTRUST_CERT_INFO_* pCert;
109 } DUMMYUNIONNAME;
111 DWORD dwStateAction;
112 HANDLE hWVTStateData;
113 WCHAR* pwszURLReference;
114 DWORD dwProvFlags;
115 DWORD dwUIContext;
116 } WINTRUST_DATA, *PWINTRUST_DATA;
118 typedef struct _CRYPT_TRUST_REG_ENTRY
120 DWORD cbStruct;
121 WCHAR *pwszDLLName;
122 WCHAR *pwszFunctionName;
123 } CRYPT_TRUST_REG_ENTRY, *PCRYPT_TRUST_REG_ENTRY;
125 typedef struct _CRYPT_REGISTER_ACTIONID
127 DWORD cbStruct;
128 CRYPT_TRUST_REG_ENTRY sInitProvider;
129 CRYPT_TRUST_REG_ENTRY sObjectProvider;
130 CRYPT_TRUST_REG_ENTRY sSignatureProvider;
131 CRYPT_TRUST_REG_ENTRY sCertificateProvider;
132 CRYPT_TRUST_REG_ENTRY sCertificatePolicyProvider;
133 CRYPT_TRUST_REG_ENTRY sFinalPolicyProvider;
134 CRYPT_TRUST_REG_ENTRY sTestPolicyProvider;
135 CRYPT_TRUST_REG_ENTRY sCleanupProvider;
136 } CRYPT_REGISTER_ACTIONID, *PCRYPT_REGISTER_ACTIONID;
138 typedef struct _CRYPT_PROVUI_DATA {
139 DWORD cbStruct;
140 DWORD dwFinalError;
141 WCHAR *pYesButtonText;
142 WCHAR *pNoButtonText;
143 WCHAR *pMoreInfoButtonText;
144 WCHAR *pAdvancedLinkText;
145 WCHAR *pCopyActionText;
146 WCHAR *pCopyActionTextNoTS;
147 WCHAR *pCopyActionTextNotSigned;
148 } CRYPT_PROVUI_DATA, *PCRYPT_PROVUI_DATA;
150 typedef struct _CRYPT_PROVIDER_CERT {
151 DWORD cbStruct;
152 PCCERT_CONTEXT pCert;
153 BOOL fCommercial;
154 BOOL fTrustedRoot;
155 BOOL fSelfSigned;
156 BOOL fTestCert;
157 DWORD dwRevokedReason;
158 DWORD dwConfidence;
159 DWORD dwError;
160 CTL_CONTEXT *pTrustListContext;
161 BOOL fTrustListSignerCert;
162 PCCTL_CONTEXT pCtlContext;
163 DWORD dwCtlError;
164 BOOL fIsCyclic;
165 PCERT_CHAIN_ELEMENT pChainElement;
166 } CRYPT_PROVIDER_CERT, *PCRYPT_PROVIDER_CERT;
168 typedef struct _CRYPT_PROVIDER_SGNR {
169 DWORD cbStruct;
170 FILETIME sftVerifyAsOf;
171 DWORD csCertChain;
172 CRYPT_PROVIDER_CERT *pasCertChain;
173 DWORD dwSignerType;
174 CMSG_SIGNER_INFO *psSigner;
175 DWORD dwError;
176 DWORD csCounterSigners;
177 struct _CRYPT_PROVIDER_SGNR *pasCounterSigners;
178 PCCERT_CHAIN_CONTEXT pChainContext;
179 } CRYPT_PROVIDER_SGNR, *PCRYPT_PROVIDER_SGNR;
181 typedef struct _CRYPT_PROVIDER_PRIVDATA {
182 DWORD cbStruct;
183 GUID gProviderID;
184 DWORD cbProvData;
185 void *pvProvData;
186 } CRYPT_PROVIDER_PRIVDATA, *PCRYPT_PROVIDER_PRIVDATA;
188 struct _CRYPT_PROVIDER_DATA;
190 typedef void * (*PFN_CPD_MEM_ALLOC)(DWORD cbSize);
191 typedef void (*PFN_CPD_MEM_FREE)(void *pvMem2Free);
192 typedef BOOL (*PFN_CPD_ADD_STORE)(struct _CRYPT_PROVIDER_DATA *pProvData,
193 HCERTSTORE hStore2Add);
194 typedef BOOL (*PFN_CPD_ADD_SGNR)(struct _CRYPT_PROVIDER_DATA *pProvData,
195 BOOL fCounterSigner, DWORD idxSigner, struct _CRYPT_PROVIDER_SGNR *pSgnr2Add);
196 typedef BOOL (*PFN_CPD_ADD_CERT)(struct _CRYPT_PROVIDER_DATA *pProvData,
197 DWORD idxSigner, BOOL fCounterSigner, DWORD idxCounterSigner,
198 PCCERT_CONTEXT pCert2Add);
199 typedef BOOL (*PFN_CPD_ADD_PRIVDATA)(struct _CRYPT_PROVIDER_DATA *pProvData,
200 struct _CRYPT_PROVIDER_PRIVDATA *pPrivData2Add);
201 typedef HRESULT (*PFN_PROVIDER_INIT_CALL)(
202 struct _CRYPT_PROVIDER_DATA *pProvData);
203 typedef HRESULT (*PFN_PROVIDER_OBJTRUST_CALL)(
204 struct _CRYPT_PROVIDER_DATA *pProvData);
205 typedef HRESULT (*PFN_PROVIDER_SIGTRUST_CALL)(
206 struct _CRYPT_PROVIDER_DATA *pProvData);
207 typedef HRESULT (*PFN_PROVIDER_CERTTTRUST_CALL)(
208 struct _CRYPT_PROVIDER_DATA *pProvData);
209 typedef HRESULT (*PFN_PROVIDER_FINALPOLICY_CALL)(
210 struct _CRYPT_PROVIDER_DATA *pProvData);
211 typedef HRESULT (*PFN_PROVIDER_TESTFINALPOLICY_CALL)(
212 struct _CRYPT_PROVIDER_DATA *pProvData);
213 typedef HRESULT (*PFN_PROVIDER_CLEANUP_CALL)(
214 struct _CRYPT_PROVIDER_DATA *pProvData);
215 typedef BOOL (*PFN_PROVIDER_CERTCHKPOLICY_CALL)(
216 struct _CRYPT_PROVIDER_DATA *pProvData, DWORD idxSigner,
217 BOOL fCounterSignerChain, DWORD idxCounterSigner);
219 typedef struct _CRYPT_PROVIDER_FUNCTIONS {
220 DWORD cbStruct;
221 PFN_CPD_MEM_ALLOC pfnAlloc;
222 PFN_CPD_MEM_FREE pfnFree;
223 PFN_CPD_ADD_STORE pfnAddStore2Chain;
224 PFN_CPD_ADD_SGNR pfnAddSgnr2Chain;
225 PFN_CPD_ADD_CERT pfnAddCert2Chain;
226 PFN_CPD_ADD_PRIVDATA pfnAddPrivData2Chain;
227 PFN_PROVIDER_INIT_CALL pfnInitialize;
228 PFN_PROVIDER_OBJTRUST_CALL pfnObjectTrust;
229 PFN_PROVIDER_SIGTRUST_CALL pfnSignatureTrust;
230 PFN_PROVIDER_CERTTTRUST_CALL pfnCertificateTrust;
231 PFN_PROVIDER_FINALPOLICY_CALL pfnFinalPolicy;
232 PFN_PROVIDER_CERTCHKPOLICY_CALL pfnCertCheckPolicy;
233 PFN_PROVIDER_TESTFINALPOLICY_CALL pfnTestFinalPolicy;
234 struct _CRYPT_PROVUI_FUNCS *psUIpfns;
235 PFN_PROVIDER_CLEANUP_CALL pfnCleanupPolicy;
236 } CRYPT_PROVIDER_FUNCTIONS, *PCRYPT_PROVIDER_FUNCTIONS;
238 struct SIP_DISPATCH_INFO_;
239 struct SIP_SUBJECTINFO_;
240 struct SIP_INDIRECT_DATA_;
242 typedef struct _PROVDATA_SIP {
243 DWORD cbStruct;
244 GUID gSubject;
245 struct SIP_DISPATCH_INFO_ *pSip;
246 struct SIP_DISPATCH_INFO_ *pCATSip;
247 struct SIP_SUBJECTINFO_ *psSipSubjectInfo;
248 struct SIP_SUBJECTINFO_ *psSipCATSubjectInfo;
249 struct SIP_INDIRECT_DATA_ *psIndirectData;
250 } PROVDATA_SIP, *PPROVDATA_SIP;
252 typedef struct _CRYPT_PROVIDER_DATA {
253 DWORD cbStruct;
254 WINTRUST_DATA *pWintrustData;
255 BOOL fOpenedFile;
256 HWND hWndParent;
257 GUID *pgActionID;
258 HCRYPTPROV hProv;
259 DWORD dwError;
260 DWORD dwRegSecuritySettings;
261 DWORD dwRegPolicySettings;
262 CRYPT_PROVIDER_FUNCTIONS *psPfns;
263 DWORD cdwTrustStepErrors;
264 DWORD *padwTrustStepErrors;
265 DWORD chStores;
266 HCERTSTORE *pahStores;
267 DWORD dwEncoding;
268 HCRYPTMSG hMsg;
269 DWORD csSigners;
270 CRYPT_PROVIDER_SGNR *pasSigners;
271 DWORD dwSubjectChoice;
272 union {
273 struct _PROVDATA_SIP *pPDSip;
274 } DUMMYUNIONNAME;
275 char *pszUsageOID;
276 BOOL fRecallWithState;
277 FILETIME sftSystemTime;
278 char *pszCTLSignerUsageOID;
279 DWORD dwProvFlags;
280 DWORD dwFinalError;
281 PCERT_USAGE_MATCH pRequestUsage;
282 DWORD dwTrustPubSettings;
283 DWORD dwUIStateFlags;
284 } CRYPT_PROVIDER_DATA, *PCRYPT_PROVIDER_DATA;
286 typedef BOOL (*PFN_PROVUI_CALL)(HWND hWndSecurityDialog,
287 struct _CRYPT_PROVIDER_DATA *pProvData);
289 typedef struct _CRYPT_PROVUI_FUNCS {
290 DWORD cbStruct;
291 CRYPT_PROVUI_DATA psUIData;
292 PFN_PROVUI_CALL pfnOnMoreInfoClick;
293 PFN_PROVUI_CALL pfnOnMoreInfoClickDefault;
294 PFN_PROVUI_CALL pfnOnAdvancedClick;
295 PFN_PROVUI_CALL pfnOnAdvancedClickDefault;
296 } CRYPT_PROVUI_FUNCS, *PCRYPT_PROVUI_FUNCS;
298 #include <poppack.h>
301 #ifdef __cplusplus
302 extern "C" {
303 #endif
305 BOOL WINAPI WintrustAddActionID(GUID*,DWORD,CRYPT_REGISTER_ACTIONID*);
306 BOOL WINAPI WintrustRemoveActionID(GUID*);
307 BOOL WINAPI WintrustLoadFunctionPointers(GUID*,CRYPT_PROVIDER_FUNCTIONS*);
308 void WINAPI WintrustGetRegPolicyFlags(DWORD*);
309 LONG WINAPI WinVerifyTrust(HWND,GUID*,WINTRUST_DATA*);
310 HRESULT WINAPI WinVerifyTrustEx(HWND,GUID*,WINTRUST_DATA*);
312 CRYPT_PROVIDER_SGNR * WINAPI WTHelperGetProvSignerFromChain(
313 CRYPT_PROVIDER_DATA *pProvData, DWORD idxSigner, BOOL fCounterSigner,
314 DWORD idxCounterSigner);
315 CRYPT_PROVIDER_DATA * WINAPI WTHelperProvDataFromStateData(HANDLE hStateData);
317 #ifdef __cplusplus
319 #endif
321 #endif