crypt32(2/13): Move cert store definition to header

Juan Lang juan.lang at gmail.com
Wed Aug 15 18:46:23 CDT 2007


--Juan
-------------- next part --------------
From b4d12e09d107c9f5efa78f382f42bb14939fcdfb Mon Sep 17 00:00:00 2001
From: Juan Lang <juan.lang at gmail.com>
Date: Wed, 15 Aug 2007 16:23:21 -0700
Subject: [PATCH] Move cert store definition to header
---
 dlls/crypt32/crypt32_private.h |   63 ++++++++++++++++++++++++++++++++++++++--
 dlls/crypt32/store.c           |   55 -----------------------------------
 2 files changed, 60 insertions(+), 58 deletions(-)

diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h
index 9104b98..c69cb13 100644
--- a/dlls/crypt32/crypt32_private.h
+++ b/dlls/crypt32/crypt32_private.h
@@ -172,6 +172,66 @@ extern PCWINE_CONTEXT_INTERFACE pCertInt
 extern PCWINE_CONTEXT_INTERFACE pCRLInterface;
 extern PCWINE_CONTEXT_INTERFACE pCTLInterface;
 
+/* Cert stores */
+struct WINE_CRYPTCERTSTORE;
+
+typedef struct WINE_CRYPTCERTSTORE * (*StoreOpenFunc)(HCRYPTPROV hCryptProv,
+ DWORD dwFlags, const void *pvPara);
+
+/* Called to enumerate the next context in a store. */
+typedef void * (*EnumFunc)(struct WINE_CRYPTCERTSTORE *store, void *pPrev);
+
+/* Called to add a context to a store.  If toReplace is not NULL,
+ * context replaces toReplace in the store, and access checks should not be
+ * performed.  Otherwise context is a new context, and it should only be
+ * added if the store allows it.  If ppStoreContext is not NULL, the added
+ * context should be returned in *ppStoreContext.
+ */
+typedef BOOL (*AddFunc)(struct WINE_CRYPTCERTSTORE *store, void *context,
+ void *toReplace, const void **ppStoreContext);
+
+typedef BOOL (*DeleteFunc)(struct WINE_CRYPTCERTSTORE *store, void *context);
+
+typedef struct _CONTEXT_STORE
+{
+    AddFunc    addContext;
+    EnumFunc   enumContext;
+    DeleteFunc deleteContext;
+} CONTEXT_STORE, *PCONTEXT_STORE;
+
+typedef enum _CertStoreType {
+    StoreTypeMem,
+    StoreTypeCollection,
+    StoreTypeProvider,
+} CertStoreType;
+
+#define WINE_CRYPTCERTSTORE_MAGIC 0x74726563
+
+struct _CONTEXT_PROPERTY_LIST;
+typedef struct _CONTEXT_PROPERTY_LIST *PCONTEXT_PROPERTY_LIST;
+
+/* A cert store is polymorphic through the use of function pointers.  A type
+ * is still needed to distinguish collection stores from other types.
+ * On the function pointers:
+ * - closeStore is called when the store's ref count becomes 0
+ * - control is optional, but should be implemented by any store that supports
+ *   persistence
+ */
+typedef struct WINE_CRYPTCERTSTORE
+{
+    DWORD                       dwMagic;
+    LONG                        ref;
+    DWORD                       dwOpenFlags;
+    HCRYPTPROV                  cryptProv;
+    CertStoreType               type;
+    PFN_CERT_STORE_PROV_CLOSE   closeStore;
+    CONTEXT_STORE               certs;
+    CONTEXT_STORE               crls;
+    PFN_CERT_STORE_PROV_CONTROL control; /* optional */
+    PCONTEXT_PROPERTY_LIST      properties;
+} WINECRYPT_CERTSTORE, *PWINECRYPT_CERTSTORE;
+
+
 /* Helper function for store reading functions and
  * CertAddSerializedElementToStore.  Returns a context of the appropriate type
  * if it can, or NULL otherwise.  Doesn't validate any of the properties in
@@ -228,9 +288,6 @@ void *Context_GetLinkedContext(void *con
 void Context_CopyProperties(const void *to, const void *from,
  size_t contextSize);
 
-struct _CONTEXT_PROPERTY_LIST;
-typedef struct _CONTEXT_PROPERTY_LIST *PCONTEXT_PROPERTY_LIST;
-
 /* Returns context's properties, or the linked context's properties if context
  * is a link context.
  */
diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c
index 2c09335..42695b8 100644
--- a/dlls/crypt32/store.c
+++ b/dlls/crypt32/store.c
@@ -41,8 +41,6 @@ #include "crypt32_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(crypt);
 
-#define WINE_CRYPTCERTSTORE_MAGIC 0x74726563
-
 static const WINE_CONTEXT_INTERFACE gCertInterface = {
     (CreateContextFunc)CertCreateCertificateContext,
     (AddContextToStoreFunc)CertAddCertificateContextToStore,
@@ -88,59 +86,6 @@ static const WINE_CONTEXT_INTERFACE gCTL
 };
 PCWINE_CONTEXT_INTERFACE pCTLInterface = &gCTLInterface;
 
-struct WINE_CRYPTCERTSTORE;
-
-typedef struct WINE_CRYPTCERTSTORE * (*StoreOpenFunc)(HCRYPTPROV hCryptProv,
- DWORD dwFlags, const void *pvPara);
-
-/* Called to enumerate the next context in a store. */
-typedef void * (*EnumFunc)(struct WINE_CRYPTCERTSTORE *store, void *pPrev);
-
-/* Called to add a context to a store.  If toReplace is not NULL,
- * context replaces toReplace in the store, and access checks should not be
- * performed.  Otherwise context is a new context, and it should only be
- * added if the store allows it.  If ppStoreContext is not NULL, the added
- * context should be returned in *ppStoreContext.
- */
-typedef BOOL (*AddFunc)(struct WINE_CRYPTCERTSTORE *store, void *context,
- void *toReplace, const void **ppStoreContext);
-
-typedef BOOL (*DeleteFunc)(struct WINE_CRYPTCERTSTORE *store, void *context);
-
-typedef struct _CONTEXT_STORE
-{
-    AddFunc    addContext;
-    EnumFunc   enumContext;
-    DeleteFunc deleteContext;
-} CONTEXT_STORE, *PCONTEXT_STORE;
-
-typedef enum _CertStoreType {
-    StoreTypeMem,
-    StoreTypeCollection,
-    StoreTypeProvider,
-} CertStoreType;
-
-/* A cert store is polymorphic through the use of function pointers.  A type
- * is still needed to distinguish collection stores from other types.
- * On the function pointers:
- * - closeStore is called when the store's ref count becomes 0
- * - control is optional, but should be implemented by any store that supports
- *   persistence
- */
-typedef struct WINE_CRYPTCERTSTORE
-{
-    DWORD                       dwMagic;
-    LONG                        ref;
-    DWORD                       dwOpenFlags;
-    HCRYPTPROV                  cryptProv;
-    CertStoreType               type;
-    PFN_CERT_STORE_PROV_CLOSE   closeStore;
-    CONTEXT_STORE               certs;
-    CONTEXT_STORE               crls;
-    PFN_CERT_STORE_PROV_CONTROL control; /* optional */
-    PCONTEXT_PROPERTY_LIST      properties;
-} WINECRYPT_CERTSTORE, *PWINECRYPT_CERTSTORE;
-
 typedef struct _WINE_MEMSTORE
 {
     WINECRYPT_CERTSTORE hdr;
-- 
1.4.1


More information about the wine-patches mailing list