include: Add some new ProcThreadAttribute definitions.
[wine.git] / dlls / crypt32 / crypt32_private.h
blobe29249b113697d9bea0c81853d13acffe2c40c64
1 /*
2 * Copyright 2005 Juan Lang
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 __CRYPT32_PRIVATE_H__
20 #define __CRYPT32_PRIVATE_H__
22 #include "wine/list.h"
23 #include "wine/unixlib.h"
25 BOOL CNG_ImportPubKey(CERT_PUBLIC_KEY_INFO *pubKeyInfo, BCRYPT_KEY_HANDLE *key) DECLSPEC_HIDDEN;
27 /* a few asn.1 tags we need */
28 #define ASN_BOOL (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x01)
29 #define ASN_BITSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x03)
30 #define ASN_ENUMERATED (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x0a)
31 #define ASN_UTF8STRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x0c)
32 #define ASN_SETOF (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x11)
33 #define ASN_NUMERICSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x12)
34 #define ASN_PRINTABLESTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x13)
35 #define ASN_T61STRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x14)
36 #define ASN_VIDEOTEXSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x15)
37 #define ASN_IA5STRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x16)
38 #define ASN_UTCTIME (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x17)
39 #define ASN_GENERALTIME (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x18)
40 #define ASN_GRAPHICSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x19)
41 #define ASN_VISIBLESTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1a)
42 #define ASN_GENERALSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1b)
43 #define ASN_UNIVERSALSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1c)
44 #define ASN_BMPSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1e)
46 /* Copies `len` bytes from `src` to `dst`,
47 * reversing the order of the bytes
49 void CRYPT_CopyReversed(BYTE *dst, const BYTE *src, size_t len);
51 BOOL CRYPT_EncodeLen(DWORD len, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN;
53 typedef BOOL (WINAPI *CryptEncodeObjectExFunc)(DWORD, LPCSTR, const void *,
54 DWORD, PCRYPT_ENCODE_PARA, BYTE *, DWORD *);
56 struct AsnEncodeSequenceItem
58 const void *pvStructInfo;
59 CryptEncodeObjectExFunc encodeFunc;
60 DWORD size; /* used during encoding, not for your use */
63 BOOL WINAPI CRYPT_AsnEncodeSequence(DWORD dwCertEncodingType,
64 struct AsnEncodeSequenceItem items[], DWORD cItem, DWORD dwFlags,
65 PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN;
67 struct AsnConstructedItem
69 BYTE tag;
70 const void *pvStructInfo;
71 CryptEncodeObjectExFunc encodeFunc;
74 BOOL WINAPI CRYPT_AsnEncodeConstructed(DWORD dwCertEncodingType,
75 LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags,
76 PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN;
77 BOOL WINAPI CRYPT_AsnEncodeOid(DWORD dwCertEncodingType,
78 LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags,
79 PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN;
80 BOOL WINAPI CRYPT_AsnEncodeOctets(DWORD dwCertEncodingType,
81 LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags,
82 PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN;
84 typedef struct _CRYPT_DIGESTED_DATA
86 DWORD version;
87 CRYPT_ALGORITHM_IDENTIFIER DigestAlgorithm;
88 CRYPT_CONTENT_INFO ContentInfo;
89 CRYPT_HASH_BLOB hash;
90 } CRYPT_DIGESTED_DATA;
92 BOOL CRYPT_AsnEncodePKCSDigestedData(const CRYPT_DIGESTED_DATA *digestedData,
93 void *pvData, DWORD *pcbData) DECLSPEC_HIDDEN;
95 typedef struct _CRYPT_ENCRYPTED_CONTENT_INFO
97 LPSTR contentType;
98 CRYPT_ALGORITHM_IDENTIFIER contentEncryptionAlgorithm;
99 CRYPT_DATA_BLOB encryptedContent;
100 } CRYPT_ENCRYPTED_CONTENT_INFO;
102 typedef struct _CRYPT_ENVELOPED_DATA
104 DWORD version;
105 DWORD cRecipientInfo;
106 PCMSG_KEY_TRANS_RECIPIENT_INFO rgRecipientInfo;
107 CRYPT_ENCRYPTED_CONTENT_INFO encryptedContentInfo;
108 } CRYPT_ENVELOPED_DATA;
110 BOOL CRYPT_AsnEncodePKCSEnvelopedData(const CRYPT_ENVELOPED_DATA *envelopedData,
111 void *pvData, DWORD *pcbData) DECLSPEC_HIDDEN;
113 BOOL CRYPT_AsnDecodePKCSEnvelopedData(const BYTE *pbEncoded, DWORD cbEncoded,
114 DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara,
115 CRYPT_ENVELOPED_DATA *envelopedData, DWORD *pcbEnvelopedData) DECLSPEC_HIDDEN;
117 typedef struct _CRYPT_SIGNED_INFO
119 DWORD version;
120 DWORD cCertEncoded;
121 PCERT_BLOB rgCertEncoded;
122 DWORD cCrlEncoded;
123 PCRL_BLOB rgCrlEncoded;
124 CRYPT_CONTENT_INFO content;
125 DWORD cSignerInfo;
126 PCMSG_CMS_SIGNER_INFO rgSignerInfo;
127 PDWORD signerKeySpec;
128 } CRYPT_SIGNED_INFO;
130 BOOL CRYPT_AsnEncodeCMSSignedInfo(CRYPT_SIGNED_INFO *, void *pvData,
131 DWORD *pcbData) DECLSPEC_HIDDEN;
133 BOOL CRYPT_AsnDecodeCMSSignedInfo(const BYTE *pbEncoded, DWORD cbEncoded,
134 DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara,
135 CRYPT_SIGNED_INFO *signedInfo, DWORD *pcbSignedInfo) DECLSPEC_HIDDEN;
137 /* Helper function to check *pcbEncoded, set it to the required size, and
138 * optionally to allocate memory. Assumes pbEncoded is not NULL.
139 * If CRYPT_ENCODE_ALLOC_FLAG is set in dwFlags, *pbEncoded will be set to a
140 * pointer to the newly allocated memory.
142 BOOL CRYPT_EncodeEnsureSpace(DWORD dwFlags, const CRYPT_ENCODE_PARA *pEncodePara,
143 BYTE *pbEncoded, DWORD *pcbEncoded, DWORD bytesNeeded) DECLSPEC_HIDDEN;
145 BOOL CRYPT_AsnDecodePKCSDigestedData(const BYTE *pbEncoded, DWORD cbEncoded,
146 DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara,
147 CRYPT_DIGESTED_DATA *digestedData, DWORD *pcbDigestedData) DECLSPEC_HIDDEN;
149 BOOL WINAPI CRYPT_AsnEncodePubKeyInfoNoNull(DWORD dwCertEncodingType,
150 LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags,
151 PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN;
153 /* The following aren't defined in wincrypt.h, as they're "reserved" */
154 #define CERT_CERT_PROP_ID 32
155 #define CERT_CRL_PROP_ID 33
156 #define CERT_CTL_PROP_ID 34
158 /* Returns a handle to the default crypto provider; loads it if necessary.
159 * Returns NULL on failure.
161 HCRYPTPROV WINAPI I_CryptGetDefaultCryptProv(ALG_ID);
163 extern HINSTANCE hInstance DECLSPEC_HIDDEN;
165 void crypt_oid_init(void) DECLSPEC_HIDDEN;
166 void crypt_oid_free(void) DECLSPEC_HIDDEN;
167 void crypt_sip_free(void) DECLSPEC_HIDDEN;
168 void root_store_free(void) DECLSPEC_HIDDEN;
169 void default_chain_engine_free(void) DECLSPEC_HIDDEN;
171 /* (Internal) certificate store types and functions */
172 struct WINE_CRYPTCERTSTORE;
174 typedef struct _CONTEXT_PROPERTY_LIST CONTEXT_PROPERTY_LIST;
176 typedef struct _context_t context_t;
178 typedef struct {
179 void (*free)(context_t*);
180 struct _context_t *(*clone)(context_t*,struct WINE_CRYPTCERTSTORE*,BOOL);
181 } context_vtbl_t;
183 struct _context_t {
184 const context_vtbl_t *vtbl;
185 LONG ref;
186 struct WINE_CRYPTCERTSTORE *store;
187 struct _context_t *linked;
188 CONTEXT_PROPERTY_LIST *properties;
189 union {
190 struct list entry;
191 void *ptr;
192 } u;
195 static inline context_t *context_from_ptr(const void *ptr)
197 return (context_t*)ptr-1;
200 static inline void *context_ptr(context_t *context)
202 return context+1;
205 typedef struct {
206 context_t base;
207 CERT_CONTEXT ctx;
208 } cert_t;
210 static inline cert_t *cert_from_ptr(const CERT_CONTEXT *ptr)
212 return CONTAINING_RECORD(ptr, cert_t, ctx);
215 typedef struct {
216 context_t base;
217 CRL_CONTEXT ctx;
218 } crl_t;
220 static inline crl_t *crl_from_ptr(const CRL_CONTEXT *ptr)
222 return CONTAINING_RECORD(ptr, crl_t, ctx);
225 typedef struct {
226 context_t base;
227 CTL_CONTEXT ctx;
228 } ctl_t;
230 static inline ctl_t *ctl_from_ptr(const CTL_CONTEXT *ptr)
232 return CONTAINING_RECORD(ptr, ctl_t, ctx);
235 /* Some typedefs that make it easier to abstract which type of context we're
236 * working with.
238 typedef const void *(WINAPI *CreateContextFunc)(DWORD dwCertEncodingType,
239 const BYTE *pbCertEncoded, DWORD cbCertEncoded);
240 typedef BOOL (WINAPI *AddContextToStoreFunc)(HCERTSTORE hCertStore,
241 const void *context, DWORD dwAddDisposition, const void **ppStoreContext);
242 typedef BOOL (WINAPI *AddEncodedContextToStoreFunc)(HCERTSTORE hCertStore,
243 DWORD dwCertEncodingType, const BYTE *pbEncoded, DWORD cbEncoded,
244 DWORD dwAddDisposition, const void **ppContext);
245 typedef const void *(WINAPI *EnumContextsInStoreFunc)(HCERTSTORE hCertStore,
246 const void *pPrevContext);
247 typedef DWORD (WINAPI *EnumPropertiesFunc)(const void *context, DWORD dwPropId);
248 typedef BOOL (WINAPI *GetContextPropertyFunc)(const void *context,
249 DWORD dwPropID, void *pvData, DWORD *pcbData);
250 typedef BOOL (WINAPI *SetContextPropertyFunc)(const void *context,
251 DWORD dwPropID, DWORD dwFlags, const void *pvData);
252 typedef BOOL (WINAPI *SerializeElementFunc)(const void *context, DWORD dwFlags,
253 BYTE *pbElement, DWORD *pcbElement);
254 typedef BOOL (WINAPI *DeleteContextFunc)(const void *contex);
256 /* An abstract context (certificate, CRL, or CTL) interface */
257 typedef struct _WINE_CONTEXT_INTERFACE
259 CreateContextFunc create;
260 AddContextToStoreFunc addContextToStore;
261 AddEncodedContextToStoreFunc addEncodedToStore;
262 EnumContextsInStoreFunc enumContextsInStore;
263 EnumPropertiesFunc enumProps;
264 GetContextPropertyFunc getProp;
265 SetContextPropertyFunc setProp;
266 SerializeElementFunc serialize;
267 DeleteContextFunc deleteFromStore;
268 } WINE_CONTEXT_INTERFACE;
270 extern const WINE_CONTEXT_INTERFACE *pCertInterface DECLSPEC_HIDDEN;
271 extern const WINE_CONTEXT_INTERFACE *pCRLInterface DECLSPEC_HIDDEN;
272 extern const WINE_CONTEXT_INTERFACE *pCTLInterface DECLSPEC_HIDDEN;
274 typedef struct WINE_CRYPTCERTSTORE * (*StoreOpenFunc)(HCRYPTPROV hCryptProv,
275 DWORD dwFlags, const void *pvPara);
277 typedef struct _CONTEXT_FUNCS
279 /* Called to add a context to a store. If toReplace is not NULL,
280 * context replaces toReplace in the store, and access checks should not be
281 * performed. Otherwise context is a new context, and it should only be
282 * added if the store allows it. If ppStoreContext is not NULL, the added
283 * context should be returned in *ppStoreContext.
285 BOOL (*addContext)(struct WINE_CRYPTCERTSTORE*,context_t*,context_t*,context_t**,BOOL);
286 context_t *(*enumContext)(struct WINE_CRYPTCERTSTORE *store, context_t *prev);
287 BOOL (*delete)(struct WINE_CRYPTCERTSTORE*,context_t*);
288 } CONTEXT_FUNCS;
290 typedef enum _CertStoreType {
291 StoreTypeMem,
292 StoreTypeCollection,
293 StoreTypeProvider,
294 StoreTypeEmpty
295 } CertStoreType;
297 #define WINE_CRYPTCERTSTORE_MAGIC 0x74726563
299 /* A cert store is polymorphic through the use of function pointers. A type
300 * is still needed to distinguish collection stores from other types.
301 * On the function pointers:
302 * - closeStore is called when the store's ref count becomes 0
303 * - control is optional, but should be implemented by any store that supports
304 * persistence
307 typedef struct {
308 void (*addref)(struct WINE_CRYPTCERTSTORE*);
309 DWORD (*release)(struct WINE_CRYPTCERTSTORE*,DWORD);
310 void (*releaseContext)(struct WINE_CRYPTCERTSTORE*,context_t*);
311 BOOL (*control)(struct WINE_CRYPTCERTSTORE*,DWORD,DWORD,void const*);
312 CONTEXT_FUNCS certs;
313 CONTEXT_FUNCS crls;
314 CONTEXT_FUNCS ctls;
315 } store_vtbl_t;
317 typedef struct WINE_CRYPTCERTSTORE
319 DWORD dwMagic;
320 LONG ref;
321 DWORD dwOpenFlags;
322 CertStoreType type;
323 const store_vtbl_t *vtbl;
324 CONTEXT_PROPERTY_LIST *properties;
325 } WINECRYPT_CERTSTORE;
327 void CRYPT_InitStore(WINECRYPT_CERTSTORE *store, DWORD dwFlags,
328 CertStoreType type, const store_vtbl_t*) DECLSPEC_HIDDEN;
329 void CRYPT_FreeStore(WINECRYPT_CERTSTORE *store) DECLSPEC_HIDDEN;
330 BOOL WINAPI I_CertUpdateStore(HCERTSTORE store1, HCERTSTORE store2, DWORD unk0,
331 DWORD unk1) DECLSPEC_HIDDEN;
333 WINECRYPT_CERTSTORE *CRYPT_CollectionOpenStore(HCRYPTPROV hCryptProv,
334 DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN;
335 WINECRYPT_CERTSTORE *CRYPT_ProvCreateStore(DWORD dwFlags,
336 WINECRYPT_CERTSTORE *memStore, const CERT_STORE_PROV_INFO *pProvInfo) DECLSPEC_HIDDEN;
337 WINECRYPT_CERTSTORE *CRYPT_ProvOpenStore(LPCSTR lpszStoreProvider,
338 DWORD dwEncodingType, HCRYPTPROV hCryptProv, DWORD dwFlags,
339 const void *pvPara) DECLSPEC_HIDDEN;
340 WINECRYPT_CERTSTORE *CRYPT_RegOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags,
341 const void *pvPara) DECLSPEC_HIDDEN;
342 WINECRYPT_CERTSTORE *CRYPT_FileOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags,
343 const void *pvPara) DECLSPEC_HIDDEN;
344 WINECRYPT_CERTSTORE *CRYPT_FileNameOpenStoreA(HCRYPTPROV hCryptProv,
345 DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN;
346 WINECRYPT_CERTSTORE *CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv,
347 DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN;
349 void CRYPT_ImportSystemRootCertsToReg(void) DECLSPEC_HIDDEN;
350 BOOL CRYPT_SerializeContextsToReg(HKEY key, DWORD flags, const WINE_CONTEXT_INTERFACE *contextInterface,
351 HCERTSTORE memStore) DECLSPEC_HIDDEN;
352 void CRYPT_RegReadSerializedFromReg(HKEY key, DWORD contextType,
353 HCERTSTORE store, DWORD disposition) DECLSPEC_HIDDEN;
355 DWORD CRYPT_IsCertificateSelfSigned(const CERT_CONTEXT *cert) DECLSPEC_HIDDEN;
357 /* Allocates and initializes a certificate chain engine, but without creating
358 * the root store. Instead, it uses root, and assumes the caller has done any
359 * checking necessary.
361 HCERTCHAINENGINE CRYPT_CreateChainEngine(HCERTSTORE, DWORD, const CERT_CHAIN_ENGINE_CONFIG*) DECLSPEC_HIDDEN;
363 /* Helper function for store reading functions and
364 * CertAddSerializedElementToStore. Returns a context of the appropriate type
365 * if it can, or NULL otherwise. Doesn't validate any of the properties in
366 * the serialized context (for example, bad hashes are retained.)
367 * *pdwContentType is set to the type of the returned context.
369 const void *CRYPT_ReadSerializedElement(const BYTE *pbElement,
370 DWORD cbElement, DWORD dwContextTypeFlags, DWORD *pdwContentType) DECLSPEC_HIDDEN;
372 /* Reads contexts serialized in the file into the memory store. Returns FALSE
373 * if the file is not of the expected format.
375 BOOL CRYPT_ReadSerializedStoreFromFile(HANDLE file, HCERTSTORE store) DECLSPEC_HIDDEN;
377 /* Reads contexts serialized in the blob into the memory store. Returns FALSE
378 * if the file is not of the expected format.
380 BOOL CRYPT_ReadSerializedStoreFromBlob(const CRYPT_DATA_BLOB *blob,
381 HCERTSTORE store) DECLSPEC_HIDDEN;
383 struct store_CERT_KEY_CONTEXT
385 DWORD cbSize;
386 DWORD64 hCryptProv;
387 DWORD dwKeySpec;
389 void CRYPT_ConvertKeyContext(const struct store_CERT_KEY_CONTEXT *src, CERT_KEY_CONTEXT *dst) DECLSPEC_HIDDEN;
392 * String functions
395 DWORD cert_name_to_str_with_indent(DWORD dwCertEncodingType, DWORD indent,
396 const CERT_NAME_BLOB *pName, DWORD dwStrType, LPWSTR psz, DWORD csz) DECLSPEC_HIDDEN;
399 * Context functions
402 /* Allocates a new data context, a context which owns properties directly.
403 * contextSize is the size of the public data type associated with context,
404 * which should be one of CERT_CONTEXT, CRL_CONTEXT, or CTL_CONTEXT.
405 * Free with Context_Release.
407 context_t *Context_CreateDataContext(size_t contextSize, const context_vtbl_t *vtbl, struct WINE_CRYPTCERTSTORE*) DECLSPEC_HIDDEN;
409 /* Creates a new link context. The context refers to linked
410 * rather than owning its own properties. If addRef is TRUE (which ordinarily
411 * it should be) linked is addref'd.
412 * Free with Context_Release.
414 context_t *Context_CreateLinkContext(unsigned contextSize, context_t *linked, struct WINE_CRYPTCERTSTORE*) DECLSPEC_HIDDEN;
416 /* Copies properties from fromContext to toContext. */
417 void Context_CopyProperties(const void *to, const void *from) DECLSPEC_HIDDEN;
419 void Context_AddRef(context_t*) DECLSPEC_HIDDEN;
420 void Context_Release(context_t *context) DECLSPEC_HIDDEN;
421 void Context_Free(context_t*) DECLSPEC_HIDDEN;
424 * Context property list functions
427 CONTEXT_PROPERTY_LIST *ContextPropertyList_Create(void) DECLSPEC_HIDDEN;
429 /* Searches for the property with ID id in the context. Returns TRUE if found,
430 * and copies the property's length and a pointer to its data to blob.
431 * Otherwise returns FALSE.
433 BOOL ContextPropertyList_FindProperty(CONTEXT_PROPERTY_LIST *list, DWORD id,
434 PCRYPT_DATA_BLOB blob) DECLSPEC_HIDDEN;
436 BOOL ContextPropertyList_SetProperty(CONTEXT_PROPERTY_LIST *list, DWORD id,
437 const BYTE *pbData, size_t cbData) DECLSPEC_HIDDEN;
439 void ContextPropertyList_RemoveProperty(CONTEXT_PROPERTY_LIST *list, DWORD id) DECLSPEC_HIDDEN;
441 DWORD ContextPropertyList_EnumPropIDs(CONTEXT_PROPERTY_LIST *list, DWORD id) DECLSPEC_HIDDEN;
443 void ContextPropertyList_Copy(CONTEXT_PROPERTY_LIST *to,
444 CONTEXT_PROPERTY_LIST *from) DECLSPEC_HIDDEN;
446 void ContextPropertyList_Free(CONTEXT_PROPERTY_LIST *list) DECLSPEC_HIDDEN;
448 extern WINECRYPT_CERTSTORE empty_store DECLSPEC_HIDDEN;
449 void init_empty_store(void) DECLSPEC_HIDDEN;
452 * Utilities.
455 /* Align up to a DWORD_PTR boundary
457 #define ALIGN_DWORD_PTR(x) (((x) + sizeof(DWORD_PTR) - 1) & ~(sizeof(DWORD_PTR) - 1))
458 #define POINTER_ALIGN_DWORD_PTR(p) ((LPVOID)ALIGN_DWORD_PTR((DWORD_PTR)(p)))
460 /* Check if the OID is a small int
462 #define IS_INTOID(x) (((ULONG_PTR)(x) >> 16) == 0)
464 /* Unix interface */
466 typedef UINT64 cert_store_data_t;
468 struct open_cert_store_params
470 CRYPT_DATA_BLOB *pfx;
471 const WCHAR *password;
472 cert_store_data_t *data_ret;
475 struct import_store_key_params
477 cert_store_data_t data;
478 void *buf;
479 DWORD *buf_size;
482 struct import_store_cert_params
484 cert_store_data_t data;
485 unsigned int index;
486 void *buf;
487 DWORD *buf_size;
490 struct close_cert_store_params
492 cert_store_data_t data;
495 struct enum_root_certs_params
497 void *buffer;
498 DWORD size;
499 DWORD *needed;
502 enum unix_funcs
504 unix_process_attach,
505 unix_process_detach,
506 unix_open_cert_store,
507 unix_import_store_key,
508 unix_import_store_cert,
509 unix_close_cert_store,
510 unix_enum_root_certs,
513 #define CRYPT32_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params )
515 #endif