Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygencrypt32_private.h
Go to the documentation of this file.
00001 /* 00002 * Copyright 2005 Juan Lang 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00017 */ 00018 00019 #ifndef __CRYPT32_PRIVATE_H__ 00020 #define __CRYPT32_PRIVATE_H__ 00021 00022 /* a few asn.1 tags we need */ 00023 #define ASN_BOOL (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x01) 00024 #define ASN_BITSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x03) 00025 #define ASN_ENUMERATED (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x0a) 00026 #define ASN_UTF8STRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x0c) 00027 #define ASN_SETOF (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x11) 00028 #define ASN_NUMERICSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x12) 00029 #define ASN_PRINTABLESTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x13) 00030 #define ASN_T61STRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x14) 00031 #define ASN_VIDEOTEXSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x15) 00032 #define ASN_IA5STRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x16) 00033 #define ASN_UTCTIME (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x17) 00034 #define ASN_GENERALTIME (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x18) 00035 #define ASN_GRAPHICSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x19) 00036 #define ASN_VISIBLESTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1a) 00037 #define ASN_GENERALSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1b) 00038 #define ASN_UNIVERSALSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1c) 00039 #define ASN_BMPSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1e) 00040 00041 BOOL CRYPT_EncodeLen(DWORD len, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN; 00042 00043 typedef BOOL (WINAPI *CryptEncodeObjectExFunc)(DWORD, LPCSTR, const void *, 00044 DWORD, PCRYPT_ENCODE_PARA, BYTE *, DWORD *); 00045 00046 struct AsnEncodeSequenceItem 00047 { 00048 const void *pvStructInfo; 00049 CryptEncodeObjectExFunc encodeFunc; 00050 DWORD size; /* used during encoding, not for your use */ 00051 }; 00052 00053 BOOL WINAPI CRYPT_AsnEncodeSequence(DWORD dwCertEncodingType, 00054 struct AsnEncodeSequenceItem items[], DWORD cItem, DWORD dwFlags, 00055 PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN; 00056 00057 struct AsnConstructedItem 00058 { 00059 BYTE tag; 00060 const void *pvStructInfo; 00061 CryptEncodeObjectExFunc encodeFunc; 00062 }; 00063 00064 BOOL WINAPI CRYPT_AsnEncodeConstructed(DWORD dwCertEncodingType, 00065 LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, 00066 PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN; 00067 BOOL WINAPI CRYPT_AsnEncodeOid(DWORD dwCertEncodingType, 00068 LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, 00069 PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN; 00070 BOOL WINAPI CRYPT_AsnEncodeOctets(DWORD dwCertEncodingType, 00071 LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, 00072 PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN; 00073 00074 typedef struct _CRYPT_DIGESTED_DATA 00075 { 00076 DWORD version; 00077 CRYPT_ALGORITHM_IDENTIFIER DigestAlgorithm; 00078 CRYPT_CONTENT_INFO ContentInfo; 00079 CRYPT_HASH_BLOB hash; 00080 } CRYPT_DIGESTED_DATA; 00081 00082 BOOL CRYPT_AsnEncodePKCSDigestedData(const CRYPT_DIGESTED_DATA *digestedData, 00083 void *pvData, DWORD *pcbData) DECLSPEC_HIDDEN; 00084 00085 typedef struct _CRYPT_ENCRYPTED_CONTENT_INFO 00086 { 00087 LPSTR contentType; 00088 CRYPT_ALGORITHM_IDENTIFIER contentEncryptionAlgorithm; 00089 CRYPT_DATA_BLOB encryptedContent; 00090 } CRYPT_ENCRYPTED_CONTENT_INFO; 00091 00092 typedef struct _CRYPT_ENVELOPED_DATA 00093 { 00094 DWORD version; 00095 DWORD cRecipientInfo; 00096 PCMSG_KEY_TRANS_RECIPIENT_INFO rgRecipientInfo; 00097 CRYPT_ENCRYPTED_CONTENT_INFO encryptedContentInfo; 00098 } CRYPT_ENVELOPED_DATA; 00099 00100 BOOL CRYPT_AsnEncodePKCSEnvelopedData(const CRYPT_ENVELOPED_DATA *envelopedData, 00101 void *pvData, DWORD *pcbData) DECLSPEC_HIDDEN; 00102 00103 BOOL CRYPT_AsnDecodePKCSEnvelopedData(const BYTE *pbEncoded, DWORD cbEncoded, 00104 DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, 00105 CRYPT_ENVELOPED_DATA *envelopedData, DWORD *pcbEnvelopedData) DECLSPEC_HIDDEN; 00106 00107 typedef struct _CRYPT_SIGNED_INFO 00108 { 00109 DWORD version; 00110 DWORD cCertEncoded; 00111 PCERT_BLOB rgCertEncoded; 00112 DWORD cCrlEncoded; 00113 PCRL_BLOB rgCrlEncoded; 00114 CRYPT_CONTENT_INFO content; 00115 DWORD cSignerInfo; 00116 PCMSG_CMS_SIGNER_INFO rgSignerInfo; 00117 } CRYPT_SIGNED_INFO; 00118 00119 BOOL CRYPT_AsnEncodeCMSSignedInfo(CRYPT_SIGNED_INFO *, void *pvData, 00120 DWORD *pcbData) DECLSPEC_HIDDEN; 00121 00122 BOOL CRYPT_AsnDecodeCMSSignedInfo(const BYTE *pbEncoded, DWORD cbEncoded, 00123 DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, 00124 CRYPT_SIGNED_INFO *signedInfo, DWORD *pcbSignedInfo) DECLSPEC_HIDDEN; 00125 00126 /* Helper function to check *pcbEncoded, set it to the required size, and 00127 * optionally to allocate memory. Assumes pbEncoded is not NULL. 00128 * If CRYPT_ENCODE_ALLOC_FLAG is set in dwFlags, *pbEncoded will be set to a 00129 * pointer to the newly allocated memory. 00130 */ 00131 BOOL CRYPT_EncodeEnsureSpace(DWORD dwFlags, const CRYPT_ENCODE_PARA *pEncodePara, 00132 BYTE *pbEncoded, DWORD *pcbEncoded, DWORD bytesNeeded) DECLSPEC_HIDDEN; 00133 00134 BOOL CRYPT_AsnDecodePKCSDigestedData(const BYTE *pbEncoded, DWORD cbEncoded, 00135 DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, 00136 CRYPT_DIGESTED_DATA *digestedData, DWORD *pcbDigestedData) DECLSPEC_HIDDEN; 00137 00138 BOOL WINAPI CRYPT_AsnEncodePubKeyInfoNoNull(DWORD dwCertEncodingType, 00139 LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, 00140 PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) DECLSPEC_HIDDEN; 00141 00142 /* The following aren't defined in wincrypt.h, as they're "reserved" */ 00143 #define CERT_CERT_PROP_ID 32 00144 #define CERT_CRL_PROP_ID 33 00145 #define CERT_CTL_PROP_ID 34 00146 00147 /* Returns a handle to the default crypto provider; loads it if necessary. 00148 * Returns NULL on failure. 00149 */ 00150 HCRYPTPROV CRYPT_GetDefaultProvider(void) DECLSPEC_HIDDEN; 00151 00152 HINSTANCE hInstance DECLSPEC_HIDDEN; 00153 00154 void crypt_oid_init(void) DECLSPEC_HIDDEN; 00155 void crypt_oid_free(void) DECLSPEC_HIDDEN; 00156 void crypt_sip_free(void) DECLSPEC_HIDDEN; 00157 void root_store_free(void) DECLSPEC_HIDDEN; 00158 void default_chain_engine_free(void) DECLSPEC_HIDDEN; 00159 00160 /* Some typedefs that make it easier to abstract which type of context we're 00161 * working with. 00162 */ 00163 typedef const void *(WINAPI *CreateContextFunc)(DWORD dwCertEncodingType, 00164 const BYTE *pbCertEncoded, DWORD cbCertEncoded); 00165 typedef BOOL (WINAPI *AddContextToStoreFunc)(HCERTSTORE hCertStore, 00166 const void *context, DWORD dwAddDisposition, const void **ppStoreContext); 00167 typedef BOOL (WINAPI *AddEncodedContextToStoreFunc)(HCERTSTORE hCertStore, 00168 DWORD dwCertEncodingType, const BYTE *pbEncoded, DWORD cbEncoded, 00169 DWORD dwAddDisposition, const void **ppContext); 00170 typedef const void *(WINAPI *DuplicateContextFunc)(const void *context); 00171 typedef const void *(WINAPI *EnumContextsInStoreFunc)(HCERTSTORE hCertStore, 00172 const void *pPrevContext); 00173 typedef DWORD (WINAPI *EnumPropertiesFunc)(const void *context, DWORD dwPropId); 00174 typedef BOOL (WINAPI *GetContextPropertyFunc)(const void *context, 00175 DWORD dwPropID, void *pvData, DWORD *pcbData); 00176 typedef BOOL (WINAPI *SetContextPropertyFunc)(const void *context, 00177 DWORD dwPropID, DWORD dwFlags, const void *pvData); 00178 typedef BOOL (WINAPI *SerializeElementFunc)(const void *context, DWORD dwFlags, 00179 BYTE *pbElement, DWORD *pcbElement); 00180 typedef BOOL (WINAPI *FreeContextFunc)(const void *context); 00181 typedef BOOL (WINAPI *DeleteContextFunc)(const void *contex); 00182 00183 /* An abstract context (certificate, CRL, or CTL) interface */ 00184 typedef struct _WINE_CONTEXT_INTERFACE 00185 { 00186 CreateContextFunc create; 00187 AddContextToStoreFunc addContextToStore; 00188 AddEncodedContextToStoreFunc addEncodedToStore; 00189 DuplicateContextFunc duplicate; 00190 EnumContextsInStoreFunc enumContextsInStore; 00191 EnumPropertiesFunc enumProps; 00192 GetContextPropertyFunc getProp; 00193 SetContextPropertyFunc setProp; 00194 SerializeElementFunc serialize; 00195 FreeContextFunc free; 00196 DeleteContextFunc deleteFromStore; 00197 } WINE_CONTEXT_INTERFACE, *PWINE_CONTEXT_INTERFACE; 00198 typedef const WINE_CONTEXT_INTERFACE *PCWINE_CONTEXT_INTERFACE; 00199 00200 extern PCWINE_CONTEXT_INTERFACE pCertInterface DECLSPEC_HIDDEN; 00201 extern PCWINE_CONTEXT_INTERFACE pCRLInterface DECLSPEC_HIDDEN; 00202 extern PCWINE_CONTEXT_INTERFACE pCTLInterface DECLSPEC_HIDDEN; 00203 00204 /* (Internal) certificate store types and functions */ 00205 struct WINE_CRYPTCERTSTORE; 00206 00207 typedef struct WINE_CRYPTCERTSTORE * (*StoreOpenFunc)(HCRYPTPROV hCryptProv, 00208 DWORD dwFlags, const void *pvPara); 00209 00210 /* Called to enumerate the next context in a store. */ 00211 typedef void * (*EnumFunc)(struct WINE_CRYPTCERTSTORE *store, void *pPrev); 00212 00213 /* Called to add a context to a store. If toReplace is not NULL, 00214 * context replaces toReplace in the store, and access checks should not be 00215 * performed. Otherwise context is a new context, and it should only be 00216 * added if the store allows it. If ppStoreContext is not NULL, the added 00217 * context should be returned in *ppStoreContext. 00218 */ 00219 typedef BOOL (*AddFunc)(struct WINE_CRYPTCERTSTORE *store, void *context, 00220 void *toReplace, const void **ppStoreContext); 00221 00222 typedef BOOL (*DeleteFunc)(struct WINE_CRYPTCERTSTORE *store, void *context); 00223 00224 typedef struct _CONTEXT_FUNCS 00225 { 00226 AddFunc addContext; 00227 EnumFunc enumContext; 00228 DeleteFunc deleteContext; 00229 } CONTEXT_FUNCS, *PCONTEXT_FUNCS; 00230 00231 typedef enum _CertStoreType { 00232 StoreTypeMem, 00233 StoreTypeCollection, 00234 StoreTypeProvider, 00235 } CertStoreType; 00236 00237 struct _CONTEXT_PROPERTY_LIST; 00238 typedef struct _CONTEXT_PROPERTY_LIST *PCONTEXT_PROPERTY_LIST; 00239 00240 #define WINE_CRYPTCERTSTORE_MAGIC 0x74726563 00241 00242 /* A cert store is polymorphic through the use of function pointers. A type 00243 * is still needed to distinguish collection stores from other types. 00244 * On the function pointers: 00245 * - closeStore is called when the store's ref count becomes 0 00246 * - control is optional, but should be implemented by any store that supports 00247 * persistence 00248 */ 00249 typedef struct WINE_CRYPTCERTSTORE 00250 { 00251 DWORD dwMagic; 00252 LONG ref; 00253 DWORD dwOpenFlags; 00254 CertStoreType type; 00255 PFN_CERT_STORE_PROV_CLOSE closeStore; 00256 CONTEXT_FUNCS certs; 00257 CONTEXT_FUNCS crls; 00258 CONTEXT_FUNCS ctls; 00259 PFN_CERT_STORE_PROV_CONTROL control; /* optional */ 00260 PCONTEXT_PROPERTY_LIST properties; 00261 } WINECRYPT_CERTSTORE, *PWINECRYPT_CERTSTORE; 00262 00263 void CRYPT_InitStore(WINECRYPT_CERTSTORE *store, DWORD dwFlags, 00264 CertStoreType type) DECLSPEC_HIDDEN; 00265 void CRYPT_FreeStore(PWINECRYPT_CERTSTORE store) DECLSPEC_HIDDEN; 00266 BOOL WINAPI I_CertUpdateStore(HCERTSTORE store1, HCERTSTORE store2, DWORD unk0, 00267 DWORD unk1) DECLSPEC_HIDDEN; 00268 00269 PWINECRYPT_CERTSTORE CRYPT_CollectionOpenStore(HCRYPTPROV hCryptProv, 00270 DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN; 00271 PWINECRYPT_CERTSTORE CRYPT_ProvCreateStore(DWORD dwFlags, 00272 PWINECRYPT_CERTSTORE memStore, const CERT_STORE_PROV_INFO *pProvInfo) DECLSPEC_HIDDEN; 00273 PWINECRYPT_CERTSTORE CRYPT_ProvOpenStore(LPCSTR lpszStoreProvider, 00274 DWORD dwEncodingType, HCRYPTPROV hCryptProv, DWORD dwFlags, 00275 const void *pvPara) DECLSPEC_HIDDEN; 00276 PWINECRYPT_CERTSTORE CRYPT_RegOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, 00277 const void *pvPara) DECLSPEC_HIDDEN; 00278 PWINECRYPT_CERTSTORE CRYPT_FileOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, 00279 const void *pvPara) DECLSPEC_HIDDEN; 00280 PWINECRYPT_CERTSTORE CRYPT_FileNameOpenStoreA(HCRYPTPROV hCryptProv, 00281 DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN; 00282 PWINECRYPT_CERTSTORE CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv, 00283 DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN; 00284 PWINECRYPT_CERTSTORE CRYPT_RootOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags) DECLSPEC_HIDDEN; 00285 00286 /* Allocates and initializes a certificate chain engine, but without creating 00287 * the root store. Instead, it uses root, and assumes the caller has done any 00288 * checking necessary. 00289 */ 00290 HCERTCHAINENGINE CRYPT_CreateChainEngine(HCERTSTORE root, 00291 PCERT_CHAIN_ENGINE_CONFIG pConfig) DECLSPEC_HIDDEN; 00292 00293 /* Helper function for store reading functions and 00294 * CertAddSerializedElementToStore. Returns a context of the appropriate type 00295 * if it can, or NULL otherwise. Doesn't validate any of the properties in 00296 * the serialized context (for example, bad hashes are retained.) 00297 * *pdwContentType is set to the type of the returned context. 00298 */ 00299 const void *CRYPT_ReadSerializedElement(const BYTE *pbElement, 00300 DWORD cbElement, DWORD dwContextTypeFlags, DWORD *pdwContentType) DECLSPEC_HIDDEN; 00301 00302 /* Reads contexts serialized in the file into the memory store. Returns FALSE 00303 * if the file is not of the expected format. 00304 */ 00305 BOOL CRYPT_ReadSerializedStoreFromFile(HANDLE file, HCERTSTORE store) DECLSPEC_HIDDEN; 00306 00307 /* Reads contexts serialized in the blob into the memory store. Returns FALSE 00308 * if the file is not of the expected format. 00309 */ 00310 BOOL CRYPT_ReadSerializedStoreFromBlob(const CRYPT_DATA_BLOB *blob, 00311 HCERTSTORE store) DECLSPEC_HIDDEN; 00312 00313 /* Fixes up the pointers in info, where info is assumed to be a 00314 * CRYPT_KEY_PROV_INFO, followed by its container name, provider name, and any 00315 * provider parameters, in a contiguous buffer, but where info's pointers are 00316 * assumed to be invalid. Upon return, info's pointers point to the 00317 * appropriate memory locations. 00318 */ 00319 void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info) DECLSPEC_HIDDEN; 00320 00325 DWORD cert_name_to_str_with_indent(DWORD dwCertEncodingType, DWORD indent, 00326 const CERT_NAME_BLOB *pName, DWORD dwStrType, LPWSTR psz, DWORD csz) DECLSPEC_HIDDEN; 00327 00332 /* Allocates a new data context, a context which owns properties directly. 00333 * contextSize is the size of the public data type associated with context, 00334 * which should be one of CERT_CONTEXT, CRL_CONTEXT, or CTL_CONTEXT. 00335 * Free with Context_Release. 00336 */ 00337 void *Context_CreateDataContext(size_t contextSize) DECLSPEC_HIDDEN; 00338 00339 /* Creates a new link context with extra bytes. The context refers to linked 00340 * rather than owning its own properties. If addRef is TRUE (which ordinarily 00341 * it should be) linked is addref'd. 00342 * Free with Context_Release. 00343 */ 00344 void *Context_CreateLinkContext(unsigned int contextSize, void *linked, unsigned int extra, 00345 BOOL addRef) DECLSPEC_HIDDEN; 00346 00347 /* Returns a pointer to the extra bytes allocated with context, which must be 00348 * a link context. 00349 */ 00350 void *Context_GetExtra(const void *context, size_t contextSize) DECLSPEC_HIDDEN; 00351 00352 /* Gets the context linked to by context, which must be a link context. */ 00353 void *Context_GetLinkedContext(void *context, size_t contextSize) DECLSPEC_HIDDEN; 00354 00355 /* Copies properties from fromContext to toContext. */ 00356 void Context_CopyProperties(const void *to, const void *from, 00357 size_t contextSize) DECLSPEC_HIDDEN; 00358 00359 /* Returns context's properties, or the linked context's properties if context 00360 * is a link context. 00361 */ 00362 PCONTEXT_PROPERTY_LIST Context_GetProperties(const void *context, size_t contextSize) DECLSPEC_HIDDEN; 00363 00364 void Context_AddRef(void *context, size_t contextSize) DECLSPEC_HIDDEN; 00365 00366 typedef void (*ContextFreeFunc)(void *context); 00367 00368 /* Decrements context's ref count. If context is a link context, releases its 00369 * linked context as well. 00370 * If a data context has its ref count reach 0, calls dataContextFree on it. 00371 * Returns FALSE if the reference count is <= 0 when called. 00372 */ 00373 BOOL Context_Release(void *context, size_t contextSize, 00374 ContextFreeFunc dataContextFree) DECLSPEC_HIDDEN; 00375 00380 PCONTEXT_PROPERTY_LIST ContextPropertyList_Create(void) DECLSPEC_HIDDEN; 00381 00382 /* Searches for the property with ID id in the context. Returns TRUE if found, 00383 * and copies the property's length and a pointer to its data to blob. 00384 * Otherwise returns FALSE. 00385 */ 00386 BOOL ContextPropertyList_FindProperty(PCONTEXT_PROPERTY_LIST list, DWORD id, 00387 PCRYPT_DATA_BLOB blob) DECLSPEC_HIDDEN; 00388 00389 BOOL ContextPropertyList_SetProperty(PCONTEXT_PROPERTY_LIST list, DWORD id, 00390 const BYTE *pbData, size_t cbData) DECLSPEC_HIDDEN; 00391 00392 void ContextPropertyList_RemoveProperty(PCONTEXT_PROPERTY_LIST list, DWORD id) DECLSPEC_HIDDEN; 00393 00394 DWORD ContextPropertyList_EnumPropIDs(PCONTEXT_PROPERTY_LIST list, DWORD id) DECLSPEC_HIDDEN; 00395 00396 void ContextPropertyList_Copy(PCONTEXT_PROPERTY_LIST to, 00397 PCONTEXT_PROPERTY_LIST from) DECLSPEC_HIDDEN; 00398 00399 void ContextPropertyList_Free(PCONTEXT_PROPERTY_LIST list) DECLSPEC_HIDDEN; 00400 00404 struct ContextList; 00405 00406 struct ContextList *ContextList_Create( 00407 PCWINE_CONTEXT_INTERFACE contextInterface, size_t contextSize) DECLSPEC_HIDDEN; 00408 00409 void *ContextList_Add(struct ContextList *list, void *toLink, void *toReplace) DECLSPEC_HIDDEN; 00410 00411 void *ContextList_Enum(struct ContextList *list, void *pPrev) DECLSPEC_HIDDEN; 00412 00413 /* Removes a context from the list. Returns TRUE if the context was removed, 00414 * or FALSE if not. (The context may have been duplicated, so subsequent 00415 * removes have no effect.) 00416 */ 00417 BOOL ContextList_Remove(struct ContextList *list, void *context) DECLSPEC_HIDDEN; 00418 00419 void ContextList_Free(struct ContextList *list) DECLSPEC_HIDDEN; 00420 00425 /* Align up to a DWORD_PTR boundary 00426 */ 00427 #define ALIGN_DWORD_PTR(x) (((x) + sizeof(DWORD_PTR) - 1) & ~(sizeof(DWORD_PTR) - 1)) 00428 #define POINTER_ALIGN_DWORD_PTR(p) ((LPVOID)ALIGN_DWORD_PTR((DWORD_PTR)(p))) 00429 00430 /* Check if the OID is a small int 00431 */ 00432 #define IS_INTOID(x) (((ULONG_PTR)(x) >> 16) == 0) 00433 00434 #endif Generated on Sun May 27 2012 04:23:12 for ReactOS by
1.7.6.1
|