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/config.h>
23 #include <wine/port.h>
30 #define COM_NO_WINDOWS_H
32 #define NONAMELESSUNION
40 #define CERT_CHAIN_PARA_HAS_EXTRA_FIELDS
41 #define CERT_REVOCATION_PARA_HAS_EXTRA_FIELDS
46 #include <wine/unicode.h>
47 #include <wine/list.h>
48 #include <wine/exception.h>
49 #include <wine/debug.h>
53 /* a few asn.1 tags we need */
54 #define ASN_BOOL (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x01)
55 #define ASN_BITSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x03)
56 #define ASN_ENUMERATED (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x0a)
57 #define ASN_UTF8STRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x0c)
58 #define ASN_SETOF (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x11)
59 #define ASN_NUMERICSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x12)
60 #define ASN_PRINTABLESTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x13)
61 #define ASN_T61STRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x14)
62 #define ASN_VIDEOTEXSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x15)
63 #define ASN_IA5STRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x16)
64 #define ASN_UTCTIME (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x17)
65 #define ASN_GENERALTIME (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x18)
66 #define ASN_GRAPHICSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x19)
67 #define ASN_VISIBLESTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1a)
68 #define ASN_GENERALSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1b)
69 #define ASN_UNIVERSALSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1c)
70 #define ASN_BMPSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1e)
72 BOOL
CRYPT_EncodeLen(DWORD len
, BYTE
*pbEncoded
, DWORD
*pcbEncoded
) DECLSPEC_HIDDEN
;
74 typedef BOOL (WINAPI
*CryptEncodeObjectExFunc
)(DWORD
, LPCSTR
, const void *,
75 DWORD
, PCRYPT_ENCODE_PARA
, BYTE
*, DWORD
*);
77 struct AsnEncodeSequenceItem
79 const void *pvStructInfo
;
80 CryptEncodeObjectExFunc encodeFunc
;
81 DWORD size
; /* used during encoding, not for your use */
84 BOOL WINAPI
CRYPT_AsnEncodeSequence(DWORD dwCertEncodingType
,
85 struct AsnEncodeSequenceItem items
[], DWORD cItem
, DWORD dwFlags
,
86 PCRYPT_ENCODE_PARA pEncodePara
, BYTE
*pbEncoded
, DWORD
*pcbEncoded
) DECLSPEC_HIDDEN
;
88 struct AsnConstructedItem
91 const void *pvStructInfo
;
92 CryptEncodeObjectExFunc encodeFunc
;
95 BOOL WINAPI
CRYPT_AsnEncodeConstructed(DWORD dwCertEncodingType
,
96 LPCSTR lpszStructType
, const void *pvStructInfo
, DWORD dwFlags
,
97 PCRYPT_ENCODE_PARA pEncodePara
, BYTE
*pbEncoded
, DWORD
*pcbEncoded
) DECLSPEC_HIDDEN
;
98 BOOL WINAPI
CRYPT_AsnEncodeOid(DWORD dwCertEncodingType
,
99 LPCSTR lpszStructType
, const void *pvStructInfo
, DWORD dwFlags
,
100 PCRYPT_ENCODE_PARA pEncodePara
, BYTE
*pbEncoded
, DWORD
*pcbEncoded
) DECLSPEC_HIDDEN
;
101 BOOL WINAPI
CRYPT_AsnEncodeOctets(DWORD dwCertEncodingType
,
102 LPCSTR lpszStructType
, const void *pvStructInfo
, DWORD dwFlags
,
103 PCRYPT_ENCODE_PARA pEncodePara
, BYTE
*pbEncoded
, DWORD
*pcbEncoded
) DECLSPEC_HIDDEN
;
105 typedef struct _CRYPT_DIGESTED_DATA
108 CRYPT_ALGORITHM_IDENTIFIER DigestAlgorithm
;
109 CRYPT_CONTENT_INFO ContentInfo
;
110 CRYPT_HASH_BLOB hash
;
111 } CRYPT_DIGESTED_DATA
;
113 BOOL
CRYPT_AsnEncodePKCSDigestedData(const CRYPT_DIGESTED_DATA
*digestedData
,
114 void *pvData
, DWORD
*pcbData
) DECLSPEC_HIDDEN
;
116 typedef struct _CRYPT_ENCRYPTED_CONTENT_INFO
119 CRYPT_ALGORITHM_IDENTIFIER contentEncryptionAlgorithm
;
120 CRYPT_DATA_BLOB encryptedContent
;
121 } CRYPT_ENCRYPTED_CONTENT_INFO
;
123 typedef struct _CRYPT_ENVELOPED_DATA
126 DWORD cRecipientInfo
;
127 PCMSG_KEY_TRANS_RECIPIENT_INFO rgRecipientInfo
;
128 CRYPT_ENCRYPTED_CONTENT_INFO encryptedContentInfo
;
129 } CRYPT_ENVELOPED_DATA
;
131 BOOL
CRYPT_AsnEncodePKCSEnvelopedData(const CRYPT_ENVELOPED_DATA
*envelopedData
,
132 void *pvData
, DWORD
*pcbData
) DECLSPEC_HIDDEN
;
134 BOOL
CRYPT_AsnDecodePKCSEnvelopedData(const BYTE
*pbEncoded
, DWORD cbEncoded
,
135 DWORD dwFlags
, PCRYPT_DECODE_PARA pDecodePara
,
136 CRYPT_ENVELOPED_DATA
*envelopedData
, DWORD
*pcbEnvelopedData
) DECLSPEC_HIDDEN
;
138 typedef struct _CRYPT_SIGNED_INFO
142 PCERT_BLOB rgCertEncoded
;
144 PCRL_BLOB rgCrlEncoded
;
145 CRYPT_CONTENT_INFO content
;
147 PCMSG_CMS_SIGNER_INFO rgSignerInfo
;
150 BOOL
CRYPT_AsnEncodeCMSSignedInfo(CRYPT_SIGNED_INFO
*, void *pvData
,
151 DWORD
*pcbData
) DECLSPEC_HIDDEN
;
153 BOOL
CRYPT_AsnDecodeCMSSignedInfo(const BYTE
*pbEncoded
, DWORD cbEncoded
,
154 DWORD dwFlags
, PCRYPT_DECODE_PARA pDecodePara
,
155 CRYPT_SIGNED_INFO
*signedInfo
, DWORD
*pcbSignedInfo
) DECLSPEC_HIDDEN
;
157 /* Helper function to check *pcbEncoded, set it to the required size, and
158 * optionally to allocate memory. Assumes pbEncoded is not NULL.
159 * If CRYPT_ENCODE_ALLOC_FLAG is set in dwFlags, *pbEncoded will be set to a
160 * pointer to the newly allocated memory.
162 BOOL
CRYPT_EncodeEnsureSpace(DWORD dwFlags
, const CRYPT_ENCODE_PARA
*pEncodePara
,
163 BYTE
*pbEncoded
, DWORD
*pcbEncoded
, DWORD bytesNeeded
) DECLSPEC_HIDDEN
;
165 BOOL
CRYPT_AsnDecodePKCSDigestedData(const BYTE
*pbEncoded
, DWORD cbEncoded
,
166 DWORD dwFlags
, PCRYPT_DECODE_PARA pDecodePara
,
167 CRYPT_DIGESTED_DATA
*digestedData
, DWORD
*pcbDigestedData
) DECLSPEC_HIDDEN
;
169 BOOL WINAPI
CRYPT_AsnEncodePubKeyInfoNoNull(DWORD dwCertEncodingType
,
170 LPCSTR lpszStructType
, const void *pvStructInfo
, DWORD dwFlags
,
171 PCRYPT_ENCODE_PARA pEncodePara
, BYTE
*pbEncoded
, DWORD
*pcbEncoded
) DECLSPEC_HIDDEN
;
173 /* The following aren't defined in wincrypt.h, as they're "reserved" */
174 #define CERT_CERT_PROP_ID 32
175 #define CERT_CRL_PROP_ID 33
176 #define CERT_CTL_PROP_ID 34
178 /* Returns a handle to the default crypto provider; loads it if necessary.
179 * Returns NULL on failure.
181 HCRYPTPROV
CRYPT_GetDefaultProvider(void) DECLSPEC_HIDDEN
;
183 HINSTANCE hInstance DECLSPEC_HIDDEN
;
185 void crypt_oid_init(void) DECLSPEC_HIDDEN
;
186 void crypt_oid_free(void) DECLSPEC_HIDDEN
;
187 void crypt_sip_free(void) DECLSPEC_HIDDEN
;
188 void root_store_free(void) DECLSPEC_HIDDEN
;
189 void default_chain_engine_free(void) DECLSPEC_HIDDEN
;
191 /* Some typedefs that make it easier to abstract which type of context we're
194 typedef const void *(WINAPI
*CreateContextFunc
)(DWORD dwCertEncodingType
,
195 const BYTE
*pbCertEncoded
, DWORD cbCertEncoded
);
196 typedef BOOL (WINAPI
*AddContextToStoreFunc
)(HCERTSTORE hCertStore
,
197 const void *context
, DWORD dwAddDisposition
, const void **ppStoreContext
);
198 typedef BOOL (WINAPI
*AddEncodedContextToStoreFunc
)(HCERTSTORE hCertStore
,
199 DWORD dwCertEncodingType
, const BYTE
*pbEncoded
, DWORD cbEncoded
,
200 DWORD dwAddDisposition
, const void **ppContext
);
201 typedef const void *(WINAPI
*DuplicateContextFunc
)(const void *context
);
202 typedef const void *(WINAPI
*EnumContextsInStoreFunc
)(HCERTSTORE hCertStore
,
203 const void *pPrevContext
);
204 typedef DWORD (WINAPI
*EnumPropertiesFunc
)(const void *context
, DWORD dwPropId
);
205 typedef BOOL (WINAPI
*GetContextPropertyFunc
)(const void *context
,
206 DWORD dwPropID
, void *pvData
, DWORD
*pcbData
);
207 typedef BOOL (WINAPI
*SetContextPropertyFunc
)(const void *context
,
208 DWORD dwPropID
, DWORD dwFlags
, const void *pvData
);
209 typedef BOOL (WINAPI
*SerializeElementFunc
)(const void *context
, DWORD dwFlags
,
210 BYTE
*pbElement
, DWORD
*pcbElement
);
211 typedef BOOL (WINAPI
*FreeContextFunc
)(const void *context
);
212 typedef BOOL (WINAPI
*DeleteContextFunc
)(const void *contex
);
214 /* An abstract context (certificate, CRL, or CTL) interface */
215 typedef struct _WINE_CONTEXT_INTERFACE
217 CreateContextFunc create
;
218 AddContextToStoreFunc addContextToStore
;
219 AddEncodedContextToStoreFunc addEncodedToStore
;
220 DuplicateContextFunc duplicate
;
221 EnumContextsInStoreFunc enumContextsInStore
;
222 EnumPropertiesFunc enumProps
;
223 GetContextPropertyFunc getProp
;
224 SetContextPropertyFunc setProp
;
225 SerializeElementFunc serialize
;
226 FreeContextFunc free
;
227 DeleteContextFunc deleteFromStore
;
228 } WINE_CONTEXT_INTERFACE
, *PWINE_CONTEXT_INTERFACE
;
229 typedef const WINE_CONTEXT_INTERFACE
*PCWINE_CONTEXT_INTERFACE
;
231 extern PCWINE_CONTEXT_INTERFACE pCertInterface DECLSPEC_HIDDEN
;
232 extern PCWINE_CONTEXT_INTERFACE pCRLInterface DECLSPEC_HIDDEN
;
233 extern PCWINE_CONTEXT_INTERFACE pCTLInterface DECLSPEC_HIDDEN
;
235 /* (Internal) certificate store types and functions */
236 struct WINE_CRYPTCERTSTORE
;
238 typedef struct WINE_CRYPTCERTSTORE
* (*StoreOpenFunc
)(HCRYPTPROV hCryptProv
,
239 DWORD dwFlags
, const void *pvPara
);
241 /* Called to enumerate the next context in a store. */
242 typedef void * (*EnumFunc
)(struct WINE_CRYPTCERTSTORE
*store
, void *pPrev
);
244 /* Called to add a context to a store. If toReplace is not NULL,
245 * context replaces toReplace in the store, and access checks should not be
246 * performed. Otherwise context is a new context, and it should only be
247 * added if the store allows it. If ppStoreContext is not NULL, the added
248 * context should be returned in *ppStoreContext.
250 typedef BOOL (*AddFunc
)(struct WINE_CRYPTCERTSTORE
*store
, void *context
,
251 void *toReplace
, const void **ppStoreContext
);
253 typedef BOOL (*DeleteFunc
)(struct WINE_CRYPTCERTSTORE
*store
, void *context
);
255 typedef struct _CONTEXT_FUNCS
258 EnumFunc enumContext
;
259 DeleteFunc deleteContext
;
260 } CONTEXT_FUNCS
, *PCONTEXT_FUNCS
;
262 typedef enum _CertStoreType
{
268 struct _CONTEXT_PROPERTY_LIST
;
269 typedef struct _CONTEXT_PROPERTY_LIST
*PCONTEXT_PROPERTY_LIST
;
271 #define WINE_CRYPTCERTSTORE_MAGIC 0x74726563
273 /* A cert store is polymorphic through the use of function pointers. A type
274 * is still needed to distinguish collection stores from other types.
275 * On the function pointers:
276 * - closeStore is called when the store's ref count becomes 0
277 * - control is optional, but should be implemented by any store that supports
280 typedef struct WINE_CRYPTCERTSTORE
286 PFN_CERT_STORE_PROV_CLOSE closeStore
;
290 PFN_CERT_STORE_PROV_CONTROL control
; /* optional */
291 PCONTEXT_PROPERTY_LIST properties
;
292 } WINECRYPT_CERTSTORE
, *PWINECRYPT_CERTSTORE
;
294 void CRYPT_InitStore(WINECRYPT_CERTSTORE
*store
, DWORD dwFlags
,
295 CertStoreType type
) DECLSPEC_HIDDEN
;
296 void CRYPT_FreeStore(PWINECRYPT_CERTSTORE store
) DECLSPEC_HIDDEN
;
297 BOOL WINAPI
I_CertUpdateStore(HCERTSTORE store1
, HCERTSTORE store2
, DWORD unk0
,
298 DWORD unk1
) DECLSPEC_HIDDEN
;
300 PWINECRYPT_CERTSTORE
CRYPT_CollectionOpenStore(HCRYPTPROV hCryptProv
,
301 DWORD dwFlags
, const void *pvPara
) DECLSPEC_HIDDEN
;
302 PWINECRYPT_CERTSTORE
CRYPT_ProvCreateStore(DWORD dwFlags
,
303 PWINECRYPT_CERTSTORE memStore
, const CERT_STORE_PROV_INFO
*pProvInfo
) DECLSPEC_HIDDEN
;
304 PWINECRYPT_CERTSTORE
CRYPT_ProvOpenStore(LPCSTR lpszStoreProvider
,
305 DWORD dwEncodingType
, HCRYPTPROV hCryptProv
, DWORD dwFlags
,
306 const void *pvPara
) DECLSPEC_HIDDEN
;
307 PWINECRYPT_CERTSTORE
CRYPT_RegOpenStore(HCRYPTPROV hCryptProv
, DWORD dwFlags
,
308 const void *pvPara
) DECLSPEC_HIDDEN
;
309 PWINECRYPT_CERTSTORE
CRYPT_FileOpenStore(HCRYPTPROV hCryptProv
, DWORD dwFlags
,
310 const void *pvPara
) DECLSPEC_HIDDEN
;
311 PWINECRYPT_CERTSTORE
CRYPT_FileNameOpenStoreA(HCRYPTPROV hCryptProv
,
312 DWORD dwFlags
, const void *pvPara
) DECLSPEC_HIDDEN
;
313 PWINECRYPT_CERTSTORE
CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv
,
314 DWORD dwFlags
, const void *pvPara
) DECLSPEC_HIDDEN
;
315 PWINECRYPT_CERTSTORE
CRYPT_RootOpenStore(HCRYPTPROV hCryptProv
, DWORD dwFlags
) DECLSPEC_HIDDEN
;
317 /* Allocates and initializes a certificate chain engine, but without creating
318 * the root store. Instead, it uses root, and assumes the caller has done any
319 * checking necessary.
321 HCERTCHAINENGINE
CRYPT_CreateChainEngine(HCERTSTORE root
,
322 PCERT_CHAIN_ENGINE_CONFIG pConfig
) DECLSPEC_HIDDEN
;
324 /* Helper function for store reading functions and
325 * CertAddSerializedElementToStore. Returns a context of the appropriate type
326 * if it can, or NULL otherwise. Doesn't validate any of the properties in
327 * the serialized context (for example, bad hashes are retained.)
328 * *pdwContentType is set to the type of the returned context.
330 const void *CRYPT_ReadSerializedElement(const BYTE
*pbElement
,
331 DWORD cbElement
, DWORD dwContextTypeFlags
, DWORD
*pdwContentType
) DECLSPEC_HIDDEN
;
333 /* Reads contexts serialized in the file into the memory store. Returns FALSE
334 * if the file is not of the expected format.
336 BOOL
CRYPT_ReadSerializedStoreFromFile(HANDLE file
, HCERTSTORE store
) DECLSPEC_HIDDEN
;
338 /* Reads contexts serialized in the blob into the memory store. Returns FALSE
339 * if the file is not of the expected format.
341 BOOL
CRYPT_ReadSerializedStoreFromBlob(const CRYPT_DATA_BLOB
*blob
,
342 HCERTSTORE store
) DECLSPEC_HIDDEN
;
344 /* Fixes up the pointers in info, where info is assumed to be a
345 * CRYPT_KEY_PROV_INFO, followed by its container name, provider name, and any
346 * provider parameters, in a contiguous buffer, but where info's pointers are
347 * assumed to be invalid. Upon return, info's pointers point to the
348 * appropriate memory locations.
350 void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info
) DECLSPEC_HIDDEN
;
356 DWORD
cert_name_to_str_with_indent(DWORD dwCertEncodingType
, DWORD indent
,
357 const CERT_NAME_BLOB
*pName
, DWORD dwStrType
, LPWSTR psz
, DWORD csz
) DECLSPEC_HIDDEN
;
363 /* Allocates a new data context, a context which owns properties directly.
364 * contextSize is the size of the public data type associated with context,
365 * which should be one of CERT_CONTEXT, CRL_CONTEXT, or CTL_CONTEXT.
366 * Free with Context_Release.
368 void *Context_CreateDataContext(size_t contextSize
) DECLSPEC_HIDDEN
;
370 /* Creates a new link context with extra bytes. The context refers to linked
371 * rather than owning its own properties. If addRef is TRUE (which ordinarily
372 * it should be) linked is addref'd.
373 * Free with Context_Release.
375 void *Context_CreateLinkContext(unsigned int contextSize
, void *linked
, unsigned int extra
,
376 BOOL addRef
) DECLSPEC_HIDDEN
;
378 /* Returns a pointer to the extra bytes allocated with context, which must be
381 void *Context_GetExtra(const void *context
, size_t contextSize
) DECLSPEC_HIDDEN
;
383 /* Gets the context linked to by context, which must be a link context. */
384 void *Context_GetLinkedContext(void *context
, size_t contextSize
) DECLSPEC_HIDDEN
;
386 /* Copies properties from fromContext to toContext. */
387 void Context_CopyProperties(const void *to
, const void *from
,
388 size_t contextSize
) DECLSPEC_HIDDEN
;
390 /* Returns context's properties, or the linked context's properties if context
393 PCONTEXT_PROPERTY_LIST
Context_GetProperties(const void *context
, size_t contextSize
) DECLSPEC_HIDDEN
;
395 void Context_AddRef(void *context
, size_t contextSize
) DECLSPEC_HIDDEN
;
397 typedef void (*ContextFreeFunc
)(void *context
);
399 /* Decrements context's ref count. If context is a link context, releases its
400 * linked context as well.
401 * If a data context has its ref count reach 0, calls dataContextFree on it.
402 * Returns FALSE if the reference count is <= 0 when called.
404 BOOL
Context_Release(void *context
, size_t contextSize
,
405 ContextFreeFunc dataContextFree
) DECLSPEC_HIDDEN
;
408 * Context property list functions
411 PCONTEXT_PROPERTY_LIST
ContextPropertyList_Create(void) DECLSPEC_HIDDEN
;
413 /* Searches for the property with ID id in the context. Returns TRUE if found,
414 * and copies the property's length and a pointer to its data to blob.
415 * Otherwise returns FALSE.
417 BOOL
ContextPropertyList_FindProperty(PCONTEXT_PROPERTY_LIST list
, DWORD id
,
418 PCRYPT_DATA_BLOB blob
) DECLSPEC_HIDDEN
;
420 BOOL
ContextPropertyList_SetProperty(PCONTEXT_PROPERTY_LIST list
, DWORD id
,
421 const BYTE
*pbData
, size_t cbData
) DECLSPEC_HIDDEN
;
423 void ContextPropertyList_RemoveProperty(PCONTEXT_PROPERTY_LIST list
, DWORD id
) DECLSPEC_HIDDEN
;
425 DWORD
ContextPropertyList_EnumPropIDs(PCONTEXT_PROPERTY_LIST list
, DWORD id
) DECLSPEC_HIDDEN
;
427 void ContextPropertyList_Copy(PCONTEXT_PROPERTY_LIST to
,
428 PCONTEXT_PROPERTY_LIST from
) DECLSPEC_HIDDEN
;
430 void ContextPropertyList_Free(PCONTEXT_PROPERTY_LIST list
) DECLSPEC_HIDDEN
;
433 * Context list functions. A context list is a simple list of link contexts.
437 struct ContextList
*ContextList_Create(
438 PCWINE_CONTEXT_INTERFACE contextInterface
, size_t contextSize
) DECLSPEC_HIDDEN
;
440 void *ContextList_Add(struct ContextList
*list
, void *toLink
, void *toReplace
) DECLSPEC_HIDDEN
;
442 void *ContextList_Enum(struct ContextList
*list
, void *pPrev
) DECLSPEC_HIDDEN
;
444 /* Removes a context from the list. Returns TRUE if the context was removed,
445 * or FALSE if not. (The context may have been duplicated, so subsequent
446 * removes have no effect.)
448 BOOL
ContextList_Remove(struct ContextList
*list
, void *context
) DECLSPEC_HIDDEN
;
450 void ContextList_Free(struct ContextList
*list
) DECLSPEC_HIDDEN
;
456 /* Align up to a DWORD_PTR boundary
458 #define ALIGN_DWORD_PTR(x) (((x) + sizeof(DWORD_PTR) - 1) & ~(sizeof(DWORD_PTR) - 1))
459 #define POINTER_ALIGN_DWORD_PTR(p) ((LPVOID)ALIGN_DWORD_PTR((DWORD_PTR)(p)))
461 /* Check if the OID is a small int
463 #define IS_INTOID(x) (((ULONG_PTR)(x) >> 16) == 0)
465 #endif /* __CRYPT32_PRIVATE_H__ */