crypt32(3/11): Use public type and APIs for memory stores wherever possible

Juan Lang juan.lang at gmail.com
Thu Aug 16 13:01:51 CDT 2007


--Juan
-------------- next part --------------
From 3231df68b5d263592180dfcc7433d5363896cd72 Mon Sep 17 00:00:00 2001
From: Juan Lang <juan.lang at gmail.com>
Date: Thu, 16 Aug 2007 10:42:07 -0700
Subject: [PATCH] Use public type and APIs for memory stores wherever possible
---
 dlls/crypt32/store.c |   43 +++++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c
index cc5fccd..07b5448 100644
--- a/dlls/crypt32/store.c
+++ b/dlls/crypt32/store.c
@@ -156,31 +156,31 @@ typedef struct _WINE_HASH_TO_DELETE
 
 typedef struct _WINE_REGSTOREINFO
 {
-    DWORD                dwOpenFlags;
-    HCRYPTPROV           cryptProv;
-    PWINECRYPT_CERTSTORE memStore;
-    HKEY                 key;
-    BOOL                 dirty;
-    CRITICAL_SECTION     cs;
-    struct list          certsToDelete;
-    struct list          crlsToDelete;
+    DWORD            dwOpenFlags;
+    HCRYPTPROV       cryptProv;
+    HCERTSTORE       memStore;
+    HKEY             key;
+    BOOL             dirty;
+    CRITICAL_SECTION cs;
+    struct list      certsToDelete;
+    struct list      crlsToDelete;
 } WINE_REGSTOREINFO, *PWINE_REGSTOREINFO;
 
 typedef struct _WINE_FILESTOREINFO
 {
-    DWORD                dwOpenFlags;
-    HCRYPTPROV           cryptProv;
-    PWINECRYPT_CERTSTORE memStore;
-    HANDLE               file;
-    BOOL                 dirty;
+    DWORD      dwOpenFlags;
+    HCRYPTPROV cryptProv;
+    HCERTSTORE memStore;
+    HANDLE     file;
+    BOOL       dirty;
 } WINE_FILESTOREINFO, *PWINE_FILESTOREINFO;
 
 typedef struct _WINE_MSGSTOREINFO
 {
-    DWORD                dwOpenFlags;
-    HCRYPTPROV           cryptProv;
-    PWINECRYPT_CERTSTORE memStore;
-    HCRYPTMSG            msg;
+    DWORD      dwOpenFlags;
+    HCRYPTPROV cryptProv;
+    HCERTSTORE memStore;
+    HCRYPTMSG  msg;
 } WINE_MSGSTOREINFO, *PWINE_MSGSTOREINFO;
 
 typedef struct _WINE_STORE_LIST_ENTRY
@@ -1421,7 +1421,8 @@ static WINECRYPT_CERTSTORE *CRYPT_RegOpe
         {
             PWINECRYPT_CERTSTORE memStore;
 
-            memStore = CRYPT_MemOpenStore(hCryptProv, dwFlags, NULL);
+            memStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, hCryptProv,
+             CERT_STORE_CREATE_NEW_FLAG, NULL);
             if (memStore)
             {
                 PWINE_REGSTOREINFO regInfo = CryptMemAlloc(
@@ -1827,7 +1828,8 @@ static PWINECRYPT_CERTSTORE CRYPT_FileOp
     {
         PWINECRYPT_CERTSTORE memStore;
 
-        memStore = CRYPT_MemOpenStore(hCryptProv, dwFlags, NULL);
+        memStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, hCryptProv,
+         CERT_STORE_CREATE_NEW_FLAG, NULL);
         if (memStore)
         {
             if (CRYPT_ReadSerializedFile(file, memStore))
@@ -1963,7 +1965,8 @@ static PWINECRYPT_CERTSTORE CRYPT_MsgOpe
 
     TRACE("(%ld, %08x, %p)\n", hCryptProv, dwFlags, pvPara);
 
-    memStore = CRYPT_MemOpenStore(hCryptProv, dwFlags, NULL);
+    memStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, hCryptProv,
+     CERT_STORE_CREATE_NEW_FLAG, NULL);
     if (memStore)
     {
         BOOL ret;
-- 
1.4.1


More information about the wine-patches mailing list