Juan Lang : crypt32: Use public functions to get store access state.

Alexandre Julliard julliard at wine.codeweavers.com
Tue May 15 14:02:15 CDT 2007


Module: wine
Branch: master
Commit: 79cd672c3dbef774d47af78825eb0c48218cf12a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=79cd672c3dbef774d47af78825eb0c48218cf12a

Author: Juan Lang <juan_lang at yahoo.com>
Date:   Mon May 14 18:06:48 2007 -0700

crypt32: Use public functions to get store access state.

---

 dlls/crypt32/cert.c            |    7 +++++--
 dlls/crypt32/crl.c             |    7 +++++--
 dlls/crypt32/crypt32_private.h |    2 --
 dlls/crypt32/store.c           |   22 ++++++----------------
 4 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c
index 8abca01..94859ca 100644
--- a/dlls/crypt32/cert.c
+++ b/dlls/crypt32/cert.c
@@ -296,8 +296,11 @@ BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext,
         }
         else
         {
-            *(DWORD *)pvData =
-             CertStore_GetAccessState(pCertContext->hCertStore);
+            if (pCertContext->hCertStore)
+                ret = CertGetStoreProperty(pCertContext->hCertStore, dwPropId,
+                 pvData, pcbData);
+            else
+                *(DWORD *)pvData = 0;
             ret = TRUE;
         }
         break;
diff --git a/dlls/crypt32/crl.c b/dlls/crypt32/crl.c
index aa94f39..bc7f73e 100644
--- a/dlls/crypt32/crl.c
+++ b/dlls/crypt32/crl.c
@@ -368,8 +368,11 @@ BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext,
         }
         else
         {
-            *(DWORD *)pvData =
-             CertStore_GetAccessState(pCRLContext->hCertStore);
+            if (pCRLContext->hCertStore)
+                ret = CertGetStoreProperty(pCRLContext->hCertStore, dwPropId,
+                 pvData, pcbData);
+            else
+                *(DWORD *)pvData = 0;
             ret = TRUE;
         }
         break;
diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h
index 8aa544b..64900d2 100644
--- a/dlls/crypt32/crypt32_private.h
+++ b/dlls/crypt32/crypt32_private.h
@@ -120,8 +120,6 @@ BOOL CRYPT_ReadSerializedFile(HANDLE file, HCERTSTORE store);
  */
 void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info);
 
-DWORD CertStore_GetAccessState(HCERTSTORE hCertStore);
-
 /**
  *  Context functions
  */
diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c
index 46556d8..a38d06c 100644
--- a/dlls/crypt32/store.c
+++ b/dlls/crypt32/store.c
@@ -2098,21 +2098,6 @@ BOOL WINAPI CertSaveStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType,
     return TRUE;
 }
 
-DWORD CertStore_GetAccessState(HCERTSTORE hCertStore)
-{
-    DWORD state = 0;
-
-    if (hCertStore)
-    {
-        PWINECRYPT_CERTSTORE store = (PWINECRYPT_CERTSTORE)hCertStore;
-
-        if (store->type != StoreTypeMem &&
-         !(store->dwOpenFlags & CERT_STORE_READONLY_FLAG))
-            state |= CERT_ACCESS_STATE_WRITE_PERSIST_FLAG;
-    }
-    return state;
-}
-
 #define CertContext_CopyProperties(to, from) \
  Context_CopyProperties((to), (from), sizeof(CERT_CONTEXT))
 
@@ -2508,7 +2493,12 @@ BOOL WINAPI CertGetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId,
         }
         else
         {
-            *(DWORD *)pvData = CertStore_GetAccessState(hCertStore);
+            DWORD state = 0;
+
+            if (store->type != StoreTypeMem &&
+             !(store->dwOpenFlags & CERT_STORE_READONLY_FLAG))
+                state |= CERT_ACCESS_STATE_WRITE_PERSIST_FLAG;
+            *(DWORD *)pvData = state;
             ret = TRUE;
         }
         break;




More information about the wine-cvs mailing list