ReactOS 0.4.17-dev-470-gf9e3448
store.c File Reference
#include <assert.h>
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winreg.h"
#include "winternl.h"
#include "winuser.h"
#include "wincrypt.h"
#include "wine/debug.h"
#include "crypt32_private.h"
Include dependency graph for store.c:

Go to the source code of this file.

Classes

struct  _WINE_MEMSTORE
 

Typedefs

typedef struct _WINE_MEMSTORE WINE_MEMSTORE
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (crypt)
 
void CRYPT_InitStore (WINECRYPT_CERTSTORE *store, DWORD dwFlags, CertStoreType type, const store_vtbl_t *vtbl)
 
void CRYPT_FreeStore (WINECRYPT_CERTSTORE *store)
 
BOOL WINAPI I_CertUpdateStore (HCERTSTORE store1, HCERTSTORE store2, DWORD unk0, DWORD unk1)
 
static BOOL MemStore_addContext (WINE_MEMSTORE *store, struct list *list, context_t *orig_context, context_t *existing, context_t **ret_context, BOOL use_link)
 
static context_tMemStore_enumContext (WINE_MEMSTORE *store, struct list *list, context_t *prev)
 
static BOOL MemStore_deleteContext (WINE_MEMSTORE *store, context_t *context)
 
static void free_contexts (struct list *list)
 
static void MemStore_releaseContext (WINECRYPT_CERTSTORE *store, context_t *context)
 
static BOOL MemStore_addCert (WINECRYPT_CERTSTORE *store, context_t *cert, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
 
static context_tMemStore_enumCert (WINECRYPT_CERTSTORE *store, context_t *prev)
 
static BOOL MemStore_deleteCert (WINECRYPT_CERTSTORE *store, context_t *context)
 
static BOOL MemStore_addCRL (WINECRYPT_CERTSTORE *store, context_t *crl, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
 
static context_tMemStore_enumCRL (WINECRYPT_CERTSTORE *store, context_t *prev)
 
static BOOL MemStore_deleteCRL (WINECRYPT_CERTSTORE *store, context_t *context)
 
static BOOL MemStore_addCTL (WINECRYPT_CERTSTORE *store, context_t *ctl, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
 
static context_tMemStore_enumCTL (WINECRYPT_CERTSTORE *store, context_t *prev)
 
static BOOL MemStore_deleteCTL (WINECRYPT_CERTSTORE *store, context_t *context)
 
static void MemStore_addref (WINECRYPT_CERTSTORE *store)
 
static DWORD MemStore_release (WINECRYPT_CERTSTORE *cert_store, DWORD flags)
 
static BOOL MemStore_control (WINECRYPT_CERTSTORE *store, DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara)
 
static WINECRYPT_CERTSTORECRYPT_MemOpenStore (HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
 
static WINECRYPT_CERTSTORECRYPT_SysRegOpenStoreW (HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
 
static WINECRYPT_CERTSTORECRYPT_SysRegOpenStoreA (HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
 
static WINECRYPT_CERTSTORECRYPT_SysOpenStoreW (HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
 
static WINECRYPT_CERTSTORECRYPT_SysOpenStoreA (HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
 
static void WINAPI CRYPT_MsgCloseStore (HCERTSTORE hCertStore, DWORD dwFlags)
 
static WINECRYPT_CERTSTORECRYPT_MsgOpenStore (HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
 
static WINECRYPT_CERTSTORECRYPT_PKCSOpenStore (HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
 
static WINECRYPT_CERTSTORECRYPT_SerializedOpenStore (HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
 
static WINECRYPT_CERTSTORECRYPT_PhysOpenStoreW (HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
 
HCERTSTORE WINAPI CertOpenStore (LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
 
HCERTSTORE WINAPI CertOpenSystemStoreA (HCRYPTPROV_LEGACY hProv, LPCSTR szSubSystemProtocol)
 
HCERTSTORE WINAPI CertOpenSystemStoreW (HCRYPTPROV_LEGACY hProv, LPCWSTR szSubSystemProtocol)
 
PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore (HCERTSTORE hCertStore, PCCERT_CONTEXT pPrev)
 
BOOL WINAPI CertDeleteCertificateFromStore (PCCERT_CONTEXT pCertContext)
 
BOOL WINAPI CertAddCRLContextToStore (HCERTSTORE hCertStore, PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition, PCCRL_CONTEXT *ppStoreContext)
 
BOOL WINAPI CertDeleteCRLFromStore (PCCRL_CONTEXT pCrlContext)
 
PCCRL_CONTEXT WINAPI CertEnumCRLsInStore (HCERTSTORE hCertStore, PCCRL_CONTEXT pPrev)
 
HCERTSTORE WINAPI CertDuplicateStore (HCERTSTORE hCertStore)
 
BOOL WINAPI CertCloseStore (HCERTSTORE hCertStore, DWORD dwFlags)
 
BOOL WINAPI CertControlStore (HCERTSTORE hCertStore, DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara)
 
BOOL WINAPI CertGetStoreProperty (HCERTSTORE hCertStore, DWORD dwPropId, void *pvData, DWORD *pcbData)
 
BOOL WINAPI CertSetStoreProperty (HCERTSTORE hCertStore, DWORD dwPropId, DWORD dwFlags, const void *pvData)
 
static LONG CRYPT_OpenParentStore (DWORD dwFlags, void *pvSystemStoreLocationPara, HKEY *key)
 
BOOL WINAPI CertEnumSystemStore (DWORD dwFlags, void *pvSystemStoreLocationPara, void *pvArg, PFN_CERT_ENUM_SYSTEM_STORE pfnEnum)
 
BOOL WINAPI CertEnumPhysicalStore (const void *pvSystemStore, DWORD dwFlags, void *pvArg, PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum)
 
BOOL WINAPI CertRegisterPhysicalStore (const void *pvSystemStore, DWORD dwFlags, LPCWSTR pwszStoreName, PCERT_PHYSICAL_STORE_INFO pStoreInfo, void *pvReserved)
 
BOOL WINAPI CertUnregisterPhysicalStore (const void *pvSystemStore, DWORD dwFlags, LPCWSTR pwszStoreName)
 
BOOL WINAPI CertRegisterSystemStore (const void *pvSystemStore, DWORD dwFlags, PCERT_SYSTEM_STORE_INFO pStoreInfo, void *pvReserved)
 
BOOL WINAPI CertUnregisterSystemStore (const void *pvSystemStore, DWORD dwFlags)
 
static void EmptyStore_addref (WINECRYPT_CERTSTORE *store)
 
static DWORD EmptyStore_release (WINECRYPT_CERTSTORE *store, DWORD flags)
 
static void EmptyStore_releaseContext (WINECRYPT_CERTSTORE *store, context_t *context)
 
static BOOL EmptyStore_add (WINECRYPT_CERTSTORE *store, context_t *context, context_t *replace, context_t **ret_context, BOOL use_link)
 
static context_tEmptyStore_enum (WINECRYPT_CERTSTORE *store, context_t *prev)
 
static BOOL EmptyStore_delete (WINECRYPT_CERTSTORE *store, context_t *context)
 
static BOOL EmptyStore_control (WINECRYPT_CERTSTORE *store, DWORD flags, DWORD ctrl_type, void const *ctrl_para)
 
void init_empty_store (void)
 

Variables

static const WINE_CONTEXT_INTERFACE gCertInterface
 
const WINE_CONTEXT_INTERFACEpCertInterface = &gCertInterface
 
static const WINE_CONTEXT_INTERFACE gCRLInterface
 
const WINE_CONTEXT_INTERFACEpCRLInterface = &gCRLInterface
 
static const WINE_CONTEXT_INTERFACE gCTLInterface
 
const WINE_CONTEXT_INTERFACEpCTLInterface = &gCTLInterface
 
static const store_vtbl_t MemStoreVtbl
 
static voidmsgProvFuncs []
 
static const store_vtbl_t EmptyStoreVtbl
 
WINECRYPT_CERTSTORE empty_store
 

Typedef Documentation

◆ WINE_MEMSTORE

Function Documentation

◆ CertAddCRLContextToStore()

BOOL WINAPI CertAddCRLContextToStore ( HCERTSTORE  hCertStore,
PCCRL_CONTEXT  pCrlContext,
DWORD  dwAddDisposition,
PCCRL_CONTEXT ppStoreContext 
)

Definition at line 954 of file store.c.

957{
958 WINECRYPT_CERTSTORE *store = hCertStore;
959 BOOL ret = TRUE;
960 PCCRL_CONTEXT toAdd = NULL, existing = NULL;
961
962 TRACE("(%p, %p, %08lx, %p)\n", hCertStore, pCrlContext,
963 dwAddDisposition, ppStoreContext);
964
965 /* Weird case to pass a test */
966 if (dwAddDisposition == 0)
967 {
969 return FALSE;
970 }
971 if (dwAddDisposition != CERT_STORE_ADD_ALWAYS)
972 {
973 existing = CertFindCRLInStore(hCertStore, 0, 0, CRL_FIND_EXISTING,
974 pCrlContext, NULL);
975 }
976
977 switch (dwAddDisposition)
978 {
980 toAdd = CertDuplicateCRLContext(pCrlContext);
981 break;
983 if (existing)
984 {
985 TRACE("found matching CRL, not adding\n");
987 ret = FALSE;
988 }
989 else
990 toAdd = CertDuplicateCRLContext(pCrlContext);
991 break;
993 if (existing)
994 {
995 LONG newer = CompareFileTime(&existing->pCrlInfo->ThisUpdate,
996 &pCrlContext->pCrlInfo->ThisUpdate);
997
998 if (newer < 0)
999 toAdd = CertDuplicateCRLContext(pCrlContext);
1000 else
1001 {
1002 TRACE("existing CRL is newer, not adding\n");
1004 ret = FALSE;
1005 }
1006 }
1007 else
1008 toAdd = CertDuplicateCRLContext(pCrlContext);
1009 break;
1011 if (existing)
1012 {
1013 LONG newer = CompareFileTime(&existing->pCrlInfo->ThisUpdate,
1014 &pCrlContext->pCrlInfo->ThisUpdate);
1015
1016 if (newer < 0)
1017 {
1018 toAdd = CertDuplicateCRLContext(pCrlContext);
1019 Context_CopyProperties(toAdd, existing);
1020 }
1021 else
1022 {
1023 TRACE("existing CRL is newer, not adding\n");
1025 ret = FALSE;
1026 }
1027 }
1028 else
1029 toAdd = CertDuplicateCRLContext(pCrlContext);
1030 break;
1032 toAdd = CertDuplicateCRLContext(pCrlContext);
1033 break;
1035 toAdd = CertDuplicateCRLContext(pCrlContext);
1036 if (existing)
1037 Context_CopyProperties(toAdd, existing);
1038 break;
1040 if (existing)
1041 {
1042 Context_CopyProperties(existing, pCrlContext);
1043 if (ppStoreContext)
1044 *ppStoreContext = CertDuplicateCRLContext(existing);
1045 }
1046 else
1047 toAdd = CertDuplicateCRLContext(pCrlContext);
1048 break;
1049 default:
1050 FIXME("Unimplemented add disposition %ld\n", dwAddDisposition);
1051 ret = FALSE;
1052 }
1053
1054 if (toAdd)
1055 {
1056 if (store) {
1057 context_t *ret_context;
1058 ret = store->vtbl->crls.addContext(store, context_from_ptr(toAdd),
1059 existing ? context_from_ptr(existing) : NULL, ppStoreContext ? &ret_context : NULL, FALSE);
1060 if (ret && ppStoreContext)
1061 *ppStoreContext = context_ptr(ret_context);
1062 }else if (ppStoreContext) {
1063 *ppStoreContext = CertDuplicateCRLContext(toAdd);
1064 }
1065 CertFreeCRLContext(toAdd);
1066 }
1067 if (existing)
1068 CertFreeCRLContext(existing);
1069
1070 TRACE("returning %d\n", ret);
1071 return ret;
1072}
void newer(int argc, const char *argv[])
Definition: cmds.c:2278
#define FIXME(fmt,...)
Definition: precomp.h:53
static void * context_ptr(context_t *context)
static context_t * context_from_ptr(const void *ptr)
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
void Context_CopyProperties(const void *to, const void *from)
Definition: context.c:123
BOOL WINAPI CertFreeCRLContext(PCCRL_CONTEXT pCrlContext)
Definition: crl.c:480
PCCRL_CONTEXT WINAPI CertDuplicateCRLContext(PCCRL_CONTEXT pCrlContext)
Definition: crl.c:472
PCCRL_CONTEXT WINAPI CertFindCRLInStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType, const void *pvFindPara, PCCRL_CONTEXT pPrevCrlContext)
Definition: crl.c:381
#define SetLastError(x)
Definition: compat.h:752
LONG WINAPI CompareFileTime(IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2)
Definition: time.c:106
return ret
Definition: mutex.c:146
unsigned int BOOL
Definition: ntddk_ex.h:94
#define STATUS_ACCESS_VIOLATION
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
BOOL(* addContext)(struct WINE_CRYPTCERTSTORE *, context_t *, context_t *, context_t **, BOOL)
PCRL_INFO pCrlInfo
Definition: wincrypt.h:734
FILETIME ThisUpdate
Definition: wincrypt.h:507
CONTEXT_FUNCS crls
#define CERT_STORE_ADD_REPLACE_EXISTING
Definition: wincrypt.h:2653
#define CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES
Definition: wincrypt.h:2657
#define CERT_STORE_ADD_NEWER
Definition: wincrypt.h:2656
#define CERT_STORE_ADD_USE_EXISTING
Definition: wincrypt.h:2652
#define CERT_STORE_ADD_NEW
Definition: wincrypt.h:2651
#define CERT_STORE_ADD_ALWAYS
Definition: wincrypt.h:2654
#define CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES
Definition: wincrypt.h:2655
#define CRL_FIND_EXISTING
Definition: wincrypt.h:3076
#define CRYPT_E_EXISTS
Definition: winerror.h:4422

Referenced by CertAddEncodedCRLToStore(), CRYPT_CreateAny(), CRYPT_CreateCRL(), import_crl(), and testAddCRL().

◆ CertCloseStore()

BOOL WINAPI CertCloseStore ( HCERTSTORE  hCertStore,
DWORD  dwFlags 
)

Definition at line 1121 of file store.c.

1122{
1123 WINECRYPT_CERTSTORE *hcs = hCertStore;
1124 DWORD res;
1125
1126 TRACE("(%p, %08lx)\n", hCertStore, dwFlags);
1127
1128 if( ! hCertStore )
1129 return TRUE;
1130
1131 if ( hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC )
1132 return FALSE;
1133
1134 res = hcs->vtbl->release(hcs, dwFlags);
1135 if (res != ERROR_SUCCESS) {
1137 return FALSE;
1138 }
1139
1140 return TRUE;
1141}
#define WINE_CRYPTCERTSTORE_MAGIC
#define ERROR_SUCCESS
Definition: deptool.c:10
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
DWORD(* release)(struct WINE_CRYPTCERTSTORE *, DWORD)

Referenced by cert_mgr_do_export(), CertAddEncodedCertificateToSystemStoreA(), CertAddEncodedCertificateToSystemStoreW(), CertRegisterSystemStore(), CertRemoveStoreFromCollection(), check_ssl_policy(), close_stores(), CRYPT_CheckRestrictedRoot(), CRYPT_CloseStores(), CRYPT_CreateAny(), CRYPT_CreateChainEngine(), CRYPT_FileControl(), CRYPT_FindIssuer(), CRYPT_FreeChainContext(), CRYPT_ImportSystemRootCertsToReg(), CRYPT_MsgOpenStore(), CRYPT_ProvCreateStore(), CRYPT_ProvOpenStore(), CRYPT_QueryContextObject(), CRYPT_QuerySerializedStoreFromBlob(), CRYPT_QuerySerializedStoreFromFile(), CRYPT_RegControl(), CRYPT_SerializedOpenStore(), CRYPT_SysOpenStoreW(), CryptAcquireCertificatePrivateKey(), CRYPTDLG_IsCertAllowed(), CRYPTDLG_MakeEngine(), CryptMsgGetAndVerifySigner(), CryptVerifyDetachedMessageSignature(), CryptVerifyMessageSignature(), free_chain_engine(), getChain(), import_cert(), import_crl(), import_ctl(), import_file(), PFXImportCertStore(), read_trusted_roots_from_known_locations(), save_cert_as_cms(), save_pfx(), select_store_dlg_proc(), show_import_ui(), SOFTPUB_CreateStoreFromMessage(), SoftpubAuthenticode(), SoftpubCleanup(), test_CERT_CHAIN_PARA_cbSize(), test_client_cert_authentication(), test_crypt_ui_wiz_import(), test_I_UpdateStore(), test_msg_get_and_verify_signer(), test_PFXImportCertStore(), test_retrieveObjectByUrl(), test_utils(), test_verify_ecc_signature(), test_verifyRevocation(), testAddCert(), testAddCertificateLink(), testAddCRL(), testAddCTLToStore(), testAddSerialized(), testCertOpenSystemStore(), testCertRegisterSystemStore(), testCloseStore(), testCollectionStore(), testCreateCertChainEngine(), testDupCert(), testEmptyStore(), testFileNameStore(), testFileStore(), testFindCert(), testFindCRL(), testGetCertChain(), testGetCRLFromStore(), testGetIssuerCert(), testGetSubjectCert(), testIsValidCRLForCert(), testKeyProvInfo(), testLinkCert(), testMemStore(), testMessageStore(), testRegStore(), testRegStoreSavedCerts(), testSerializedStore(), testStoreProperty(), testStoresInCollection(), testSystemRegStore(), testSystemStore(), testVerifyRevocation(), WINTRUST_CreateChainForSigner(), and CStore::~CStore().

◆ CertControlStore()

BOOL WINAPI CertControlStore ( HCERTSTORE  hCertStore,
DWORD  dwFlags,
DWORD  dwCtrlType,
void const pvCtrlPara 
)

Definition at line 1143 of file store.c.

1145{
1146 WINECRYPT_CERTSTORE *hcs = hCertStore;
1147 BOOL ret;
1148
1149 TRACE("(%p, %08lx, %ld, %p)\n", hCertStore, dwFlags, dwCtrlType,
1150 pvCtrlPara);
1151
1152 if (!hcs)
1153 ret = FALSE;
1154 else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
1155 ret = FALSE;
1156 else
1157 {
1158 if (hcs->vtbl->control)
1159 ret = hcs->vtbl->control(hcs, dwFlags, dwCtrlType, pvCtrlPara);
1160 else
1161 ret = TRUE;
1162 }
1163 return ret;
1164}
BOOL(* control)(struct WINE_CRYPTCERTSTORE *, DWORD, DWORD, void const *)

Referenced by testAddCertificateLink(), testCollectionStore(), testFileStore(), and testRegStore().

◆ CertDeleteCertificateFromStore()

BOOL WINAPI CertDeleteCertificateFromStore ( PCCERT_CONTEXT  pCertContext)

Definition at line 937 of file store.c.

938{
940
941 TRACE("(%p)\n", pCertContext);
942
943 if (!pCertContext)
944 return TRUE;
945
946 hcs = pCertContext->hCertStore;
947
949 return FALSE;
950
951 return hcs->vtbl->certs.delete(hcs, &cert_from_ptr(pCertContext)->base);
952}
static cert_t * cert_from_ptr(const CERT_CONTEXT *ptr)
HCERTSTORE hCertStore
Definition: wincrypt.h:492
BOOL(* delete)(struct WINE_CRYPTCERTSTORE *, context_t *)
CONTEXT_FUNCS certs

Referenced by add_ms_root_certs(), cert_mgr_do_remove(), Collection_deleteCert(), find_and_delete_cert_in_store(), test_I_UpdateStore(), testAddCert(), testAddCertificateLink(), testAddSerialized(), testCertRegisterSystemStore(), testCollectionStore(), testEmptyStore(), testKeyProvInfo(), testMemStore(), testRegStore(), and testRegStoreSavedCerts().

◆ CertDeleteCRLFromStore()

BOOL WINAPI CertDeleteCRLFromStore ( PCCRL_CONTEXT  pCrlContext)

Definition at line 1074 of file store.c.

1075{
1077 BOOL ret;
1078
1079 TRACE("(%p)\n", pCrlContext);
1080
1081 if (!pCrlContext)
1082 return TRUE;
1083
1084 hcs = pCrlContext->hCertStore;
1085
1087 return FALSE;
1088
1089 ret = hcs->vtbl->crls.delete(hcs, &crl_from_ptr(pCrlContext)->base);
1090 if (ret)
1091 ret = CertFreeCRLContext(pCrlContext);
1092 return ret;
1093}
static crl_t * crl_from_ptr(const CRL_CONTEXT *ptr)
HCERTSTORE hCertStore
Definition: wincrypt.h:735

Referenced by Collection_deleteCRL().

◆ CertDuplicateStore()

HCERTSTORE WINAPI CertDuplicateStore ( HCERTSTORE  hCertStore)

Definition at line 1110 of file store.c.

1111{
1112 WINECRYPT_CERTSTORE *hcs = hCertStore;
1113
1114 TRACE("(%p)\n", hCertStore);
1115
1116 if (hcs && hcs->dwMagic == WINE_CRYPTCERTSTORE_MAGIC)
1117 hcs->vtbl->addref(hcs);
1118 return hCertStore;
1119}
void(* addref)(struct WINE_CRYPTCERTSTORE *)

Referenced by check_and_store_certs(), CRYPT_CopyChainToElement(), CRYPT_CreateChainEngine(), CRYPT_QueryContextObject(), CRYPT_QuerySerializedContextObject(), CRYPT_QuerySerializedStoreFromBlob(), CRYPT_QuerySerializedStoreFromFile(), testCloseStore(), and WINTRUST_AddStore().

◆ CertEnumCertificatesInStore()

◆ CertEnumCRLsInStore()

PCCRL_CONTEXT WINAPI CertEnumCRLsInStore ( HCERTSTORE  hCertStore,
PCCRL_CONTEXT  pPrev 
)

Definition at line 1095 of file store.c.

1096{
1097 crl_t *ret, *prev = pPrev ? crl_from_ptr(pPrev) : NULL;
1098 WINECRYPT_CERTSTORE *hcs = hCertStore;
1099
1100 TRACE("(%p, %p)\n", hCertStore, pPrev);
1101 if (!hCertStore)
1102 ret = NULL;
1103 else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
1104 ret = NULL;
1105 else
1106 ret = (crl_t*)hcs->vtbl->crls.enumContext(hcs, prev ? &prev->base : NULL);
1107 return ret ? &ret->ctx : NULL;
1108}
context_t base

Referenced by CertFindCRLInStore(), check_store_context_type(), countCRLsInStore(), CRYPT_SavePKCSToMem(), import_store(), test_crypt_ui_wiz_import(), testFileNameStore(), testMessageStore(), and testSerializedStore().

◆ CertEnumPhysicalStore()

BOOL WINAPI CertEnumPhysicalStore ( const void pvSystemStore,
DWORD  dwFlags,
void pvArg,
PFN_CERT_ENUM_PHYSICAL_STORE  pfnEnum 
)

Definition at line 1355 of file store.c.

1357{
1359 FIXME("(%p, %08lx, %p, %p): stub\n", pvSystemStore, dwFlags, pvArg,
1360 pfnEnum);
1361 else
1362 FIXME("(%s, %08lx, %p, %p): stub\n", debugstr_w(pvSystemStore),
1363 dwFlags, pvArg,
1364 pfnEnum);
1365 return FALSE;
1366}
#define debugstr_w
Definition: kernel32.h:32
#define CERT_SYSTEM_STORE_RELOCATE_FLAG
Definition: wincrypt.h:2787

◆ CertEnumSystemStore()

BOOL WINAPI CertEnumSystemStore ( DWORD  dwFlags,
void pvSystemStoreLocationPara,
void pvArg,
PFN_CERT_ENUM_SYSTEM_STORE  pfnEnum 
)

Definition at line 1315 of file store.c.

1317{
1318 BOOL ret = FALSE;
1319 LONG rc;
1320 HKEY key;
1321 CERT_SYSTEM_STORE_INFO info = { sizeof(info) };
1322
1323 TRACE("(%08lx, %p, %p, %p)\n", dwFlags, pvSystemStoreLocationPara, pvArg,
1324 pfnEnum);
1325
1326 rc = CRYPT_OpenParentStore(dwFlags, pvArg, &key);
1327 if (!rc)
1328 {
1329 DWORD index = 0;
1330
1331 ret = TRUE;
1332 do {
1335
1336 rc = RegEnumKeyExW(key, index++, name, &size, NULL, NULL, NULL,
1337 NULL);
1338 if (!rc)
1339 ret = pfnEnum(name, dwFlags, &info, NULL, pvArg);
1340 } while (ret && !rc);
1341 if (ret && rc != ERROR_NO_MORE_ITEMS)
1342 SetLastError(rc);
1343 }
1344 else
1345 SetLastError(rc);
1346 /* Include root store for the local machine location (it isn't in the
1347 * registry)
1348 */
1351 ret = pfnEnum(L"Root", dwFlags, &info, NULL, pvArg);
1352 return ret;
1353}
#define ARRAY_SIZE(A)
Definition: main.h:20
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
static LONG CRYPT_OpenParentStore(DWORD dwFlags, void *pvSystemStoreLocationPara, HKEY *key)
Definition: store.c:1262
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define MAX_PATH
Definition: compat.h:34
#define L(x)
Definition: resources.c:13
GLsizeiptr size
Definition: glext.h:5919
GLuint index
Definition: glext.h:6031
short WCHAR
Definition: pedump.c:58
Definition: copy.c:22
Definition: name.c:39
#define CERT_SYSTEM_STORE_LOCATION_MASK
Definition: wincrypt.h:2507
#define CERT_SYSTEM_STORE_LOCAL_MACHINE
Definition: wincrypt.h:2530

Referenced by enumerate_stores(), CStoreList::LoadStores(), and testCertEnumSystemStore().

◆ CertGetStoreProperty()

BOOL WINAPI CertGetStoreProperty ( HCERTSTORE  hCertStore,
DWORD  dwPropId,
void pvData,
DWORD pcbData 
)

Definition at line 1166 of file store.c.

1168{
1169 WINECRYPT_CERTSTORE *store = hCertStore;
1170 BOOL ret = FALSE;
1171
1172 TRACE("(%p, %ld, %p, %p)\n", hCertStore, dwPropId, pvData, pcbData);
1173
1174 switch (dwPropId)
1175 {
1177 if (!pvData)
1178 {
1179 *pcbData = sizeof(DWORD);
1180 ret = TRUE;
1181 }
1182 else if (*pcbData < sizeof(DWORD))
1183 {
1185 *pcbData = sizeof(DWORD);
1186 }
1187 else
1188 {
1189 DWORD state = 0;
1190
1191 if (store->type != StoreTypeMem &&
1194 *(DWORD *)pvData = state;
1195 ret = TRUE;
1196 }
1197 break;
1198 default:
1199 if (store->properties)
1200 {
1202
1204 &blob);
1205 if (ret)
1206 {
1207 if (!pvData)
1208 *pcbData = blob.cbData;
1209 else if (*pcbData < blob.cbData)
1210 {
1212 *pcbData = blob.cbData;
1213 ret = FALSE;
1214 }
1215 else
1216 {
1217 memcpy(pvData, blob.pbData, blob.cbData);
1218 *pcbData = blob.cbData;
1219 }
1220 }
1221 else
1223 }
1224 else
1226 }
1227 return ret;
1228}
static int state
Definition: maze.c:121
BOOL ContextPropertyList_FindProperty(CONTEXT_PROPERTY_LIST *list, DWORD id, PCRYPT_DATA_BLOB blob)
Definition: proplist.c:72
@ StoreTypeMem
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
_In_ LPWSTR _In_ DWORD _In_ LPCVOID pvData
Definition: netsh.h:116
#define DWORD
Definition: nt_native.h:44
_In_ _Out_writes_opt_ pcchValueName _Inout_opt_ LPDWORD _Out_opt_ _Out_writes_bytes_to_opt_ pcbData _Inout_opt_ LPDWORD pcbData
Definition: shlwapi.h:757
CONTEXT_PROPERTY_LIST * properties
Definition: image.c:134
#define CERT_ACCESS_STATE_PROP_ID
Definition: wincrypt.h:2847
#define CERT_ACCESS_STATE_WRITE_PERSIST_FLAG
Definition: wincrypt.h:2913
#define CERT_STORE_READONLY_FLAG
Definition: wincrypt.h:2635
#define CRYPT_E_NOT_FOUND
Definition: winerror.h:4421

Referenced by CertGetCertificateContextProperty(), CertGetCRLContextProperty(), CertGetCTLContextProperty(), enumerate_stores(), and testStoreProperty().

◆ CertOpenStore()

HCERTSTORE WINAPI CertOpenStore ( LPCSTR  lpszStoreProvider,
DWORD  dwMsgAndCertEncodingType,
HCRYPTPROV_LEGACY  hCryptProv,
DWORD  dwFlags,
const void pvPara 
)

Definition at line 809 of file store.c.

812{
814 StoreOpenFunc openFunc = NULL;
815
816 TRACE("(%s, %08lx, %08Ix, %08lx, %p)\n", debugstr_a(lpszStoreProvider),
817 dwMsgAndCertEncodingType, hCryptProv, dwFlags, pvPara);
818
819 if (IS_INTOID(lpszStoreProvider))
820 {
821 switch (LOWORD(lpszStoreProvider))
822 {
824 openFunc = CRYPT_MsgOpenStore;
825 break;
827 openFunc = CRYPT_MemOpenStore;
828 break;
830 openFunc = CRYPT_FileOpenStore;
831 break;
833 openFunc = CRYPT_PKCSOpenStore;
834 break;
836 openFunc = CRYPT_SerializedOpenStore;
837 break;
839 openFunc = CRYPT_RegOpenStore;
840 break;
842 openFunc = CRYPT_FileNameOpenStoreA;
843 break;
845 openFunc = CRYPT_FileNameOpenStoreW;
846 break;
848 openFunc = CRYPT_CollectionOpenStore;
849 break;
851 openFunc = CRYPT_SysOpenStoreA;
852 break;
854 openFunc = CRYPT_SysOpenStoreW;
855 break;
857 openFunc = CRYPT_SysRegOpenStoreA;
858 break;
860 openFunc = CRYPT_SysRegOpenStoreW;
861 break;
863 openFunc = CRYPT_PhysOpenStoreW;
864 break;
865 default:
866 if (LOWORD(lpszStoreProvider))
867 FIXME("unimplemented type %d\n", LOWORD(lpszStoreProvider));
868 }
869 }
870 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_MEMORY))
871 openFunc = CRYPT_MemOpenStore;
872 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_FILENAME_W))
873 openFunc = CRYPT_FileOpenStore;
874 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_SYSTEM))
875 openFunc = CRYPT_SysOpenStoreW;
876 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_PKCS7))
877 openFunc = CRYPT_PKCSOpenStore;
878 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_SERIALIZED))
879 openFunc = CRYPT_SerializedOpenStore;
880 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_COLLECTION))
881 openFunc = CRYPT_CollectionOpenStore;
882 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_SYSTEM_REGISTRY))
883 openFunc = CRYPT_SysRegOpenStoreW;
884 else
885 {
886 FIXME("unimplemented type %s\n", lpszStoreProvider);
887 openFunc = NULL;
888 }
889
890 if (!openFunc)
891 hcs = CRYPT_ProvOpenStore(lpszStoreProvider, dwMsgAndCertEncodingType,
892 hCryptProv, dwFlags, pvPara);
893 else
894 hcs = openFunc(hCryptProv, dwFlags, pvPara);
895 return hcs;
896}
WINECRYPT_CERTSTORE * CRYPT_CollectionOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
WINECRYPT_CERTSTORE * CRYPT_ProvOpenStore(LPCSTR lpszStoreProvider, DWORD dwEncodingType, HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: provstore.c:375
WINECRYPT_CERTSTORE * CRYPT_FileNameOpenStoreA(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: filestore.c:380
WINECRYPT_CERTSTORE * CRYPT_RegOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: regstore.c:504
struct WINE_CRYPTCERTSTORE *(* StoreOpenFunc)(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
WINECRYPT_CERTSTORE * CRYPT_FileOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: filestore.c:241
WINECRYPT_CERTSTORE * CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: filestore.c:291
#define IS_INTOID(x)
static WINECRYPT_CERTSTORE * CRYPT_SysOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:538
static WINECRYPT_CERTSTORE * CRYPT_PKCSOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:729
static WINECRYPT_CERTSTORE * CRYPT_SysRegOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:404
static WINECRYPT_CERTSTORE * CRYPT_SerializedOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:770
static WINECRYPT_CERTSTORE * CRYPT_PhysOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:798
static WINECRYPT_CERTSTORE * CRYPT_MemOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:372
static WINECRYPT_CERTSTORE * CRYPT_SysOpenStoreA(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:610
static WINECRYPT_CERTSTORE * CRYPT_SysRegOpenStoreA(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:509
static WINECRYPT_CERTSTORE * CRYPT_MsgOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:651
#define stricmp(_String1, _String2)
Definition: compat.h:24
#define debugstr_a
Definition: kernel32.h:31
#define LOWORD(l)
Definition: pedump.c:82
#define sz_CERT_STORE_PROV_SERIALIZED
Definition: wincrypt.h:2482
#define CERT_STORE_PROV_PKCS7
Definition: wincrypt.h:2458
#define sz_CERT_STORE_PROV_FILENAME_W
Definition: wincrypt.h:2477
#define CERT_STORE_PROV_COLLECTION
Definition: wincrypt.h:2465
#define CERT_STORE_PROV_FILENAME_A
Definition: wincrypt.h:2460
#define sz_CERT_STORE_PROV_COLLECTION
Definition: wincrypt.h:2483
#define sz_CERT_STORE_PROV_MEMORY
Definition: wincrypt.h:2476
#define sz_CERT_STORE_PROV_SYSTEM_REGISTRY
Definition: wincrypt.h:2485
#define sz_CERT_STORE_PROV_SYSTEM
Definition: wincrypt.h:2480
#define CERT_STORE_PROV_SERIALIZED
Definition: wincrypt.h:2459
#define CERT_STORE_PROV_SYSTEM_REGISTRY_W
Definition: wincrypt.h:2467
#define CERT_STORE_PROV_FILENAME_W
Definition: wincrypt.h:2461
#define CERT_STORE_PROV_SYSTEM_A
Definition: wincrypt.h:2462
#define sz_CERT_STORE_PROV_PKCS7
Definition: wincrypt.h:2481
#define CERT_STORE_PROV_MEMORY
Definition: wincrypt.h:2455
#define CERT_STORE_PROV_REG
Definition: wincrypt.h:2457
#define CERT_STORE_PROV_FILE
Definition: wincrypt.h:2456
#define CERT_STORE_PROV_MSG
Definition: wincrypt.h:2454
#define CERT_STORE_PROV_SYSTEM_W
Definition: wincrypt.h:2463
#define CERT_STORE_PROV_SYSTEM_REGISTRY_A
Definition: wincrypt.h:2466
#define CERT_STORE_PROV_PHYSICAL_W
Definition: wincrypt.h:2469

Referenced by cert_mgr_do_export(), CertOpenSystemStoreA(), CertOpenSystemStoreW(), CertRegisterSystemStore(), CertUnregisterSystemStore(), check_ssl_policy(), choose_store_for_cert(), create_root_store(), CRYPT_BuildCandidateChainFromCert(), CRYPT_CreateAny(), CRYPT_CreateChainEngine(), CRYPT_CreateContext(), CRYPT_FileControl(), CRYPT_FileNameOpenStoreW(), CRYPT_FileOpenStore(), CRYPT_FindIssuer(), CRYPT_ImportSystemRootCertsToReg(), CRYPT_MsgOpenStore(), CRYPT_ProvOpenStore(), CRYPT_QueryContextObject(), CRYPT_QueryMessageObject(), CRYPT_QuerySerializedStoreFromBlob(), CRYPT_QuerySerializedStoreFromFile(), CRYPT_RegControl(), CRYPT_RegOpenStore(), CRYPT_SerializedOpenStore(), CRYPT_SysOpenStoreW(), CryptAcquireCertificatePrivateKey(), CRYPTDLG_IsCertAllowed(), CRYPTDLG_MakeEngine(), CryptGetMessageCertificates(), CryptMsgGetAndVerifySigner(), CryptVerifyDetachedMessageSignature(), CryptVerifyMessageSignature(), getChain(), import_crl(), import_ctl(), PFXImportCertStore(), read_trusted_roots_from_known_locations(), save_cert_as_cms(), save_pfx(), show_cert_stores(), SOFTPUB_CreateStoreFromMessage(), SoftpubAuthenticode(), CStore::StoreHandle(), test_CERT_CHAIN_PARA_cbSize(), test_crypt_ui_wiz_import(), test_I_UpdateStore(), test_msg_get_and_verify_signer(), test_utils(), test_verify_ecc_signature(), test_verifyRevocation(), testAddCert(), testAddCertificateLink(), testAddCRL(), testAddCTLToStore(), testAddSerialized(), testCertOpenSystemStore(), testCertRegisterSystemStore(), testCloseStore(), testCollectionStore(), testCreateCertChainEngine(), testDupCert(), testEmptyStore(), testFileNameStore(), testFileStore(), testFindCert(), testFindCRL(), testGetCertChain(), testGetCRLFromStore(), testGetIssuerCert(), testGetSubjectCert(), testIsValidCRLForCert(), testKeyProvInfo(), testLinkCert(), testMemStore(), testMessageStore(), testRegStore(), testRegStoreSavedCerts(), testSerializedStore(), testStoreProperty(), testStoresInCollection(), testSystemRegStore(), testSystemStore(), testVerifyRevocation(), and WINTRUST_CreateChainForSigner().

◆ CertOpenSystemStoreA()

HCERTSTORE WINAPI CertOpenSystemStoreA ( HCRYPTPROV_LEGACY  hProv,
LPCSTR  szSubSystemProtocol 
)

Definition at line 898 of file store.c.

900{
901 if (!szSubSystemProtocol)
902 {
904 return 0;
905 }
907 CERT_SYSTEM_STORE_CURRENT_USER, szSubSystemProtocol);
908}
#define E_INVALIDARG
Definition: ddrawi.h:101
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:809
static HCRYPTPROV hProv
Definition: rsaenh.c:32
#define CERT_SYSTEM_STORE_CURRENT_USER
Definition: wincrypt.h:2528

Referenced by CertAddEncodedCertificateToSystemStoreA(), testAddCertificateLink(), and testCollectionStore().

◆ CertOpenSystemStoreW()

HCERTSTORE WINAPI CertOpenSystemStoreW ( HCRYPTPROV_LEGACY  hProv,
LPCWSTR  szSubSystemProtocol 
)

Definition at line 910 of file store.c.

912{
913 if (!szSubSystemProtocol)
914 {
916 return 0;
917 }
919 CERT_SYSTEM_STORE_CURRENT_USER, szSubSystemProtocol);
920}

Referenced by CertAddEncodedCertificateToSystemStoreW(), CRYPT_CheckRestrictedRoot(), selected_item_to_store(), testCertOpenSystemStore(), and testStoreProperty().

◆ CertRegisterPhysicalStore()

BOOL WINAPI CertRegisterPhysicalStore ( const void pvSystemStore,
DWORD  dwFlags,
LPCWSTR  pwszStoreName,
PCERT_PHYSICAL_STORE_INFO  pStoreInfo,
void pvReserved 
)

Definition at line 1368 of file store.c.

1370{
1372 FIXME("(%p, %08lx, %s, %p, %p): stub\n", pvSystemStore, dwFlags,
1373 debugstr_w(pwszStoreName), pStoreInfo, pvReserved);
1374 else
1375 FIXME("(%s, %08lx, %s, %p, %p): stub\n", debugstr_w(pvSystemStore),
1376 dwFlags, debugstr_w(pwszStoreName), pStoreInfo, pvReserved);
1377 return FALSE;
1378}
static LPCWSTR LPVOID pvReserved
Definition: asmcache.c:749

◆ CertRegisterSystemStore()

BOOL WINAPI CertRegisterSystemStore ( const void pvSystemStore,
DWORD  dwFlags,
PCERT_SYSTEM_STORE_INFO  pStoreInfo,
void pvReserved 
)

Definition at line 1387 of file store.c.

1389{
1390 HCERTSTORE hstore;
1391
1393 {
1394 FIXME("(%p, %08lx, %p, %p): flag not supported\n", pvSystemStore, dwFlags, pStoreInfo, pvReserved);
1395 return FALSE;
1396 }
1397
1398 TRACE("(%s, %08lx, %p, %p)\n", debugstr_w(pvSystemStore), dwFlags, pStoreInfo, pvReserved);
1399
1400 hstore = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W, 0, 0, dwFlags, pvSystemStore);
1401 if (hstore)
1402 {
1403 CertCloseStore(hstore, 0);
1404 return TRUE;
1405 }
1406
1407 return FALSE;
1408}
BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
Definition: store.c:1121

Referenced by testCertRegisterSystemStore().

◆ CertSetStoreProperty()

BOOL WINAPI CertSetStoreProperty ( HCERTSTORE  hCertStore,
DWORD  dwPropId,
DWORD  dwFlags,
const void pvData 
)

Definition at line 1230 of file store.c.

1232{
1233 WINECRYPT_CERTSTORE *store = hCertStore;
1234 BOOL ret = FALSE;
1235
1236 TRACE("(%p, %ld, %08lx, %p)\n", hCertStore, dwPropId, dwFlags, pvData);
1237
1238 if (!store->properties)
1240 switch (dwPropId)
1241 {
1244 break;
1245 default:
1246 if (pvData)
1247 {
1248 const CRYPT_DATA_BLOB *blob = pvData;
1249
1251 blob->pbData, blob->cbData);
1252 }
1253 else
1254 {
1256 ret = TRUE;
1257 }
1258 }
1259 return ret;
1260}
CONTEXT_PROPERTY_LIST * ContextPropertyList_Create(void)
Definition: proplist.c:43
void ContextPropertyList_RemoveProperty(CONTEXT_PROPERTY_LIST *list, DWORD id)
Definition: proplist.c:149
BOOL ContextPropertyList_SetProperty(CONTEXT_PROPERTY_LIST *list, DWORD id, const BYTE *pbData, size_t cbData)
Definition: proplist.c:95

Referenced by testStoreProperty().

◆ CertUnregisterPhysicalStore()

BOOL WINAPI CertUnregisterPhysicalStore ( const void pvSystemStore,
DWORD  dwFlags,
LPCWSTR  pwszStoreName 
)

Definition at line 1380 of file store.c.

1382{
1383 FIXME("(%p, %08lx, %s): stub\n", pvSystemStore, dwFlags, debugstr_w(pwszStoreName));
1384 return TRUE;
1385}

◆ CertUnregisterSystemStore()

BOOL WINAPI CertUnregisterSystemStore ( const void pvSystemStore,
DWORD  dwFlags 
)

Definition at line 1410 of file store.c.

1411{
1412 HCERTSTORE hstore;
1413
1415 {
1416 FIXME("(%p, %08lx): flag not supported\n", pvSystemStore, dwFlags);
1417 return FALSE;
1418 }
1419 TRACE("(%s, %08lx)\n", debugstr_w(pvSystemStore), dwFlags);
1420
1422 if (hstore == NULL)
1423 return FALSE;
1424
1426 if (hstore == NULL && GetLastError() == 0)
1427 return TRUE;
1428
1429 return FALSE;
1430}
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CERT_STORE_OPEN_EXISTING_FLAG
Definition: wincrypt.h:2634
#define CERT_STORE_DELETE_FLAG
Definition: wincrypt.h:2624

Referenced by testCertRegisterSystemStore().

◆ CRYPT_FreeStore()

void CRYPT_FreeStore ( WINECRYPT_CERTSTORE store)

Definition at line 98 of file store.c.

99{
100 if (store->properties)
102 store->dwMagic = 0;
103 CryptMemFree(store);
104}
void ContextPropertyList_Free(CONTEXT_PROPERTY_LIST *list)
Definition: proplist.c:56
VOID WINAPI CryptMemFree(LPVOID pv)
Definition: main.c:146

Referenced by Collection_release(), MemStore_release(), and ProvStore_release().

◆ CRYPT_InitStore()

void CRYPT_InitStore ( WINECRYPT_CERTSTORE store,
DWORD  dwFlags,
CertStoreType  type,
const store_vtbl_t vtbl 
)

Definition at line 88 of file store.c.

89{
90 store->ref = 1;
92 store->type = type;
93 store->dwOpenFlags = dwFlags;
94 store->vtbl = vtbl;
95 store->properties = NULL;
96}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by CRYPT_CollectionOpenStore(), CRYPT_MemOpenStore(), CRYPT_ProvCreateStore(), and init_empty_store().

◆ CRYPT_MemOpenStore()

static WINECRYPT_CERTSTORE * CRYPT_MemOpenStore ( HCRYPTPROV  hCryptProv,
DWORD  dwFlags,
const void pvPara 
)
static

Definition at line 372 of file store.c.

374{
375 WINE_MEMSTORE *store;
376
377 TRACE("(%Id, %08lx, %p)\n", hCryptProv, dwFlags, pvPara);
378
380 {
382 store = NULL;
383 }
384 else
385 {
386 store = CryptMemAlloc(sizeof(WINE_MEMSTORE));
387 if (store)
388 {
389 memset(store, 0, sizeof(WINE_MEMSTORE));
392 store->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ContextList.cs");
393 list_init(&store->certs);
394 list_init(&store->crls);
395 list_init(&store->ctls);
396 /* Mem store doesn't need crypto provider, so close it */
397 if (hCryptProv && !(dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG))
398 CryptReleaseContext(hCryptProv, 0);
399 }
400 }
401 return (WINECRYPT_CERTSTORE*)store;
402}
static void list_init(struct list_entry *head)
Definition: list.h:51
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, DWORD dwFlags)
Definition: crypt.c:641
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
Definition: main.c:136
void CRYPT_InitStore(WINECRYPT_CERTSTORE *store, DWORD dwFlags, CertStoreType type, const store_vtbl_t *vtbl)
Definition: store.c:88
static const store_vtbl_t MemStoreVtbl
Definition: store.c:352
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
#define memset(x, y, z)
Definition: compat.h:39
PRTL_CRITICAL_SECTION_DEBUG DebugInfo
Definition: rtltypes.h:1450
struct list certs
Definition: store.c:83
CRITICAL_SECTION cs
Definition: store.c:82
struct list ctls
Definition: store.c:85
WINECRYPT_CERTSTORE hdr
Definition: store.c:81
struct list crls
Definition: store.c:84
#define DWORD_PTR
Definition: treelist.c:76
#define CERT_STORE_NO_CRYPT_RELEASE_FLAG
Definition: wincrypt.h:2621
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1156

Referenced by CertOpenStore().

◆ CRYPT_MsgCloseStore()

static void WINAPI CRYPT_MsgCloseStore ( HCERTSTORE  hCertStore,
DWORD  dwFlags 
)
static

Definition at line 639 of file store.c.

640{
641 HCRYPTMSG msg = hCertStore;
642
643 TRACE("(%p, %08lx)\n", msg, dwFlags);
645}
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg)
Definition: msg.c:3679

◆ CRYPT_MsgOpenStore()

static WINECRYPT_CERTSTORE * CRYPT_MsgOpenStore ( HCRYPTPROV  hCryptProv,
DWORD  dwFlags,
const void pvPara 
)
static

Definition at line 651 of file store.c.

653{
654 WINECRYPT_CERTSTORE *store = NULL;
655 HCRYPTMSG msg = (HCRYPTMSG)pvPara;
656 WINECRYPT_CERTSTORE *memStore;
657
658 TRACE("(%Id, %08lx, %p)\n", hCryptProv, dwFlags, pvPara);
659
660 memStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
662 if (memStore)
663 {
664 BOOL ret;
665 DWORD size, count, i;
666
667 size = sizeof(count);
669 for (i = 0; ret && i < count; i++)
670 {
671 size = 0;
673 if (ret)
674 {
676
677 if (buf)
678 {
680 if (ret)
683 NULL);
685 }
686 }
687 }
688 size = sizeof(count);
690 for (i = 0; ret && i < count; i++)
691 {
692 size = 0;
694 if (ret)
695 {
697
698 if (buf)
699 {
701 if (ret)
702 ret = CertAddEncodedCRLToStore(memStore,
704 NULL);
706 }
707 }
708 }
709 if (ret)
710 {
711 CERT_STORE_PROV_INFO provInfo = { 0 };
712
713 provInfo.cbSize = sizeof(provInfo);
716 provInfo.hStoreProv = CryptMsgDuplicate(msg);
717 store = CRYPT_ProvCreateStore(dwFlags, memStore, &provInfo);
718 /* Msg store doesn't need crypto provider, so close it */
719 if (hCryptProv && !(dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG))
720 CryptReleaseContext(hCryptProv, 0);
721 }
722 else
723 CertCloseStore(memStore, 0);
724 }
725 TRACE("returning %p\n", store);
726 return store;
727}
WINECRYPT_CERTSTORE * CRYPT_ProvCreateStore(DWORD dwFlags, WINECRYPT_CERTSTORE *memStore, const CERT_STORE_PROV_INFO *pProvInfo)
Definition: provstore.c:307
BOOL WINAPI CertAddEncodedCertificateToStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded, DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext)
Definition: cert.c:56
BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded, DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext)
Definition: crl.c:223
BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, DWORD dwIndex, void *pvData, DWORD *pcbData)
Definition: msg.c:3708
HCRYPTMSG WINAPI CryptMsgDuplicate(HCRYPTMSG hCryptMsg)
Definition: msg.c:3666
static void * msgProvFuncs[]
Definition: store.c:647
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
void ** rgpvStoreProvFunc
Definition: wincrypt.h:1275
HCERTSTOREPROV hStoreProv
Definition: wincrypt.h:1276
unsigned char * LPBYTE
Definition: typedefs.h:53
#define CERT_STORE_CREATE_NEW_FLAG
Definition: wincrypt.h:2633
void * HCRYPTMSG
Definition: wincrypt.h:61
#define X509_ASN_ENCODING
Definition: wincrypt.h:2501
#define CMSG_CRL_PARAM
Definition: wincrypt.h:4103
#define CMSG_CERT_COUNT_PARAM
Definition: wincrypt.h:4100
#define CMSG_CRL_COUNT_PARAM
Definition: wincrypt.h:4102
#define CMSG_CERT_PARAM
Definition: wincrypt.h:4101

Referenced by CertOpenStore(), and CRYPT_PKCSOpenStore().

◆ CRYPT_OpenParentStore()

static LONG CRYPT_OpenParentStore ( DWORD  dwFlags,
void pvSystemStoreLocationPara,
HKEY key 
)
static

Definition at line 1262 of file store.c.

1264{
1265 HKEY root;
1266 LPCWSTR base;
1267
1268 TRACE("(%08lx, %p)\n", dwFlags, pvSystemStoreLocationPara);
1269
1271 {
1275 break;
1279 break;
1281 /* hklm\Software\Microsoft\Cryptography\Services\servicename\
1282 * SystemCertificates
1283 */
1284 FIXME("CERT_SYSTEM_STORE_CURRENT_SERVICE\n");
1285 return ERROR_FILE_NOT_FOUND;
1287 /* hklm\Software\Microsoft\Cryptography\Services\servicename\
1288 * SystemCertificates
1289 */
1290 FIXME("CERT_SYSTEM_STORE_SERVICES\n");
1291 return ERROR_FILE_NOT_FOUND;
1293 /* hku\user sid\Software\Microsoft\SystemCertificates */
1294 FIXME("CERT_SYSTEM_STORE_USERS\n");
1295 return ERROR_FILE_NOT_FOUND;
1299 break;
1303 break;
1305 /* hklm\Software\Microsoft\EnterpriseCertificates */
1306 FIXME("CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE\n");
1307 return ERROR_FILE_NOT_FOUND;
1308 default:
1309 return ERROR_FILE_NOT_FOUND;
1310 }
1311
1312 return RegOpenKeyExW(root, base, 0, KEY_READ, key);
1313}
struct _root root
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define KEY_READ
Definition: nt_native.h:1026
const uint16_t * LPCWSTR
Definition: typedefs.h:57
#define CERT_SYSTEM_STORE_SERVICES
Definition: wincrypt.h:2534
#define CERT_SYSTEM_STORE_CURRENT_SERVICE
Definition: wincrypt.h:2532
#define CERT_SYSTEM_STORE_USERS
Definition: wincrypt.h:2536
#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE
Definition: wincrypt.h:2542
static const WCHAR CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH[]
Definition: wincrypt.h:2551
static const WCHAR CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH[]
Definition: wincrypt.h:2554
#define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY
Definition: wincrypt.h:2538
#define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY
Definition: wincrypt.h:2540
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by CertEnumSystemStore().

◆ CRYPT_PhysOpenStoreW()

static WINECRYPT_CERTSTORE * CRYPT_PhysOpenStoreW ( HCRYPTPROV  hCryptProv,
DWORD  dwFlags,
const void pvPara 
)
static

Definition at line 798 of file store.c.

800{
802 FIXME("(%Id, %08lx, %p): stub\n", hCryptProv, dwFlags, pvPara);
803 else
804 FIXME("(%Id, %08lx, %s): stub\n", hCryptProv, dwFlags,
805 debugstr_w(pvPara));
806 return NULL;
807}

Referenced by CertOpenStore().

◆ CRYPT_PKCSOpenStore()

static WINECRYPT_CERTSTORE * CRYPT_PKCSOpenStore ( HCRYPTPROV  hCryptProv,
DWORD  dwFlags,
const void pvPara 
)
static

Definition at line 729 of file store.c.

731{
733 WINECRYPT_CERTSTORE *store = NULL;
734 const CRYPT_DATA_BLOB *data = pvPara;
735 BOOL ret;
736 DWORD msgOpenFlags = dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG ? 0 :
738
739 TRACE("(%Id, %08lx, %p)\n", hCryptProv, dwFlags, pvPara);
740
742 hCryptProv, NULL, NULL);
743 ret = CryptMsgUpdate(msg, data->pbData, data->cbData, TRUE);
744 if (!ret)
745 {
748 hCryptProv, NULL, NULL);
749 ret = CryptMsgUpdate(msg, data->pbData, data->cbData, TRUE);
750 if (ret)
751 {
752 DWORD type, size = sizeof(type);
753
754 /* Only signed messages are allowed, check type */
756 if (ret && type != CMSG_SIGNED)
757 {
759 ret = FALSE;
760 }
761 }
762 }
763 if (ret)
764 store = CRYPT_MsgOpenStore(0, dwFlags, msg);
766 TRACE("returning %p\n", store);
767 return store;
768}
HCRYPTMSG WINAPI CryptMsgOpenToDecode(DWORD dwMsgEncodingType, DWORD dwFlags, DWORD dwMsgType, HCRYPTPROV_LEGACY hCryptProv, PCERT_INFO pRecipientInfo, PCMSG_STREAM_INFO pStreamInfo)
Definition: msg.c:3634
BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData, DWORD cbData, BOOL fFinal)
Definition: msg.c:3698
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define CMSG_TYPE_PARAM
Definition: wincrypt.h:4090
#define CMSG_CRYPT_RELEASE_CONTEXT_FLAG
Definition: wincrypt.h:4032
#define CMSG_SIGNED
Definition: wincrypt.h:3845
#define PKCS_7_ASN_ENCODING
Definition: wincrypt.h:2503
#define CRYPT_E_INVALID_MSG_TYPE
Definition: winerror.h:4402

Referenced by CertOpenStore().

◆ CRYPT_SerializedOpenStore()

static WINECRYPT_CERTSTORE * CRYPT_SerializedOpenStore ( HCRYPTPROV  hCryptProv,
DWORD  dwFlags,
const void pvPara 
)
static

Definition at line 770 of file store.c.

772{
773 HCERTSTORE store;
774 const CRYPT_DATA_BLOB *data = pvPara;
775
776 TRACE("(%Id, %08lx, %p)\n", hCryptProv, dwFlags, pvPara);
777
779 {
781 return NULL;
782 }
783
786 if (store)
787 {
789 {
790 CertCloseStore(store, 0);
791 store = NULL;
792 }
793 }
794 TRACE("returning %p\n", store);
795 return (WINECRYPT_CERTSTORE*)store;
796}
BOOL CRYPT_ReadSerializedStoreFromBlob(const CRYPT_DATA_BLOB *blob, HCERTSTORE store)
Definition: serialize.c:765

Referenced by CertOpenStore().

◆ CRYPT_SysOpenStoreA()

static WINECRYPT_CERTSTORE * CRYPT_SysOpenStoreA ( HCRYPTPROV  hCryptProv,
DWORD  dwFlags,
const void pvPara 
)
static

Definition at line 610 of file store.c.

612{
613 int len;
615
616 TRACE("(%Id, %08lx, %s)\n", hCryptProv, dwFlags,
617 debugstr_a(pvPara));
618
619 if (!pvPara)
620 {
622 return NULL;
623 }
624 len = MultiByteToWideChar(CP_ACP, 0, pvPara, -1, NULL, 0);
625 if (len)
626 {
627 LPWSTR storeName = CryptMemAlloc(len * sizeof(WCHAR));
628
629 if (storeName)
630 {
631 MultiByteToWideChar(CP_ACP, 0, pvPara, -1, storeName, len);
632 ret = CRYPT_SysOpenStoreW(hCryptProv, dwFlags, storeName);
633 CryptMemFree(storeName);
634 }
635 }
636 return ret;
637}
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
GLenum GLsizei len
Definition: glext.h:6722
uint16_t * LPWSTR
Definition: typedefs.h:56

Referenced by CertOpenStore().

◆ CRYPT_SysOpenStoreW()

static WINECRYPT_CERTSTORE * CRYPT_SysOpenStoreW ( HCRYPTPROV  hCryptProv,
DWORD  dwFlags,
const void pvPara 
)
static

Definition at line 538 of file store.c.

540{
541 HCERTSTORE store = 0;
542 BOOL ret;
543
544 TRACE("(%Id, %08lx, %s)\n", hCryptProv, dwFlags,
545 debugstr_w(pvPara));
546
547 if (!pvPara)
548 {
550 return NULL;
551 }
552 /* This returns a different error than system registry stores if the
553 * location is invalid.
554 */
556 {
565 ret = TRUE;
566 break;
567 default:
569 ret = FALSE;
570 }
571 if (ret)
572 {
574 0, 0, dwFlags, pvPara);
575
576 if (regStore)
577 {
580 CertAddStoreToCollection(store, regStore,
583 CertCloseStore(regStore, 0);
584 /* CERT_SYSTEM_STORE_CURRENT_USER returns both the HKCU and HKLM
585 * stores.
586 */
589 {
590 dwFlags &= ~CERT_SYSTEM_STORE_CURRENT_USER;
593 0, dwFlags, pvPara);
594 if (regStore)
595 {
596 CertAddStoreToCollection(store, regStore,
599 CertCloseStore(regStore, 0);
600 }
601 }
602 /* System store doesn't need crypto provider, so close it */
603 if (hCryptProv && !(dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG))
604 CryptReleaseContext(hCryptProv, 0);
605 }
606 }
607 return store;
608}
BOOL WINAPI CertAddStoreToCollection(HCERTSTORE hCollectionStore, HCERTSTORE hSiblingStore, DWORD dwUpdateFlags, DWORD dwPriority)
#define CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG
Definition: wincrypt.h:2743

Referenced by CertOpenStore(), and CRYPT_SysOpenStoreA().

◆ CRYPT_SysRegOpenStoreA()

static WINECRYPT_CERTSTORE * CRYPT_SysRegOpenStoreA ( HCRYPTPROV  hCryptProv,
DWORD  dwFlags,
const void pvPara 
)
static

Definition at line 509 of file store.c.

511{
512 int len;
514
515 TRACE("(%Id, %08lx, %s)\n", hCryptProv, dwFlags,
516 debugstr_a(pvPara));
517
518 if (!pvPara)
519 {
521 return NULL;
522 }
523 len = MultiByteToWideChar(CP_ACP, 0, pvPara, -1, NULL, 0);
524 if (len)
525 {
526 LPWSTR storeName = CryptMemAlloc(len * sizeof(WCHAR));
527
528 if (storeName)
529 {
530 MultiByteToWideChar(CP_ACP, 0, pvPara, -1, storeName, len);
531 ret = CRYPT_SysRegOpenStoreW(hCryptProv, dwFlags, storeName);
532 CryptMemFree(storeName);
533 }
534 }
535 return ret;
536}

Referenced by CertOpenStore().

◆ CRYPT_SysRegOpenStoreW()

static WINECRYPT_CERTSTORE * CRYPT_SysRegOpenStoreW ( HCRYPTPROV  hCryptProv,
DWORD  dwFlags,
const void pvPara 
)
static

Definition at line 404 of file store.c.

406{
407 LPCWSTR storeName = pvPara;
408 LPWSTR storePath;
409 WINECRYPT_CERTSTORE *store = NULL;
410 HKEY root;
412
413 TRACE("(%Id, %08lx, %s)\n", hCryptProv, dwFlags,
414 debugstr_w(pvPara));
415
416 if (!pvPara)
417 {
419 return NULL;
420 }
421
423 {
427 /* If the HKLM\Root certs are requested, expressing system certs into the registry */
428 if (!lstrcmpiW(storeName, L"Root"))
430 break;
434 break;
436 /* hklm\Software\Microsoft\Cryptography\Services\servicename\
437 * SystemCertificates
438 */
439 FIXME("CERT_SYSTEM_STORE_CURRENT_SERVICE, %s: stub\n",
440 debugstr_w(storeName));
441 return NULL;
443 /* hklm\Software\Microsoft\Cryptography\Services\servicename\
444 * SystemCertificates
445 */
446 FIXME("CERT_SYSTEM_STORE_SERVICES, %s: stub\n",
447 debugstr_w(storeName));
448 return NULL;
450 /* hku\user sid\Software\Microsoft\SystemCertificates */
451 FIXME("CERT_SYSTEM_STORE_USERS, %s: stub\n",
452 debugstr_w(storeName));
453 return NULL;
457 break;
461 break;
463 /* hklm\Software\Microsoft\EnterpriseCertificates */
464 FIXME("CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE, %s: stub\n",
465 debugstr_w(storeName));
466 return NULL;
467 default:
469 return NULL;
470 }
471
472 storePath = CryptMemAlloc((lstrlenW(base) + lstrlenW(storeName) + 2) *
473 sizeof(WCHAR));
474 if (storePath)
475 {
476 LONG rc;
477 HKEY key;
480
481 wsprintfW(storePath, L"%s\\%s", base, storeName);
483 rc = RegOpenKeyExW(root, storePath, 0, sam, &key);
484 else
485 {
486 DWORD disp;
487
488 rc = RegCreateKeyExW(root, storePath, 0, NULL, 0, sam, NULL,
489 &key, &disp);
490 if (!rc && dwFlags & CERT_STORE_CREATE_NEW_FLAG &&
492 {
495 }
496 }
497 if (!rc)
498 {
499 store = CRYPT_RegOpenStore(hCryptProv, dwFlags, key);
501 }
502 else
503 SetLastError(rc);
504 CryptMemFree(storePath);
505 }
506 return store;
507}
static REGSAM sam
Definition: query.c:143
#define RegCloseKey(hKey)
Definition: registry.h:49
void CRYPT_ImportSystemRootCertsToReg(void)
Definition: rootstore.c:738
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
#define lstrlenW
Definition: compat.h:750
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4171
#define KEY_ALL_ACCESS
Definition: nt_native.h:1044
#define REG_OPENED_EXISTING_KEY
Definition: nt_native.h:1088
#define ERROR_FILE_EXISTS
Definition: winerror.h:287
ACCESS_MASK REGSAM
Definition: winreg.h:76
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)

Referenced by CertOpenStore(), and CRYPT_SysRegOpenStoreA().

◆ EmptyStore_add()

static BOOL EmptyStore_add ( WINECRYPT_CERTSTORE store,
context_t context,
context_t replace,
context_t **  ret_context,
BOOL  use_link 
)
static

Definition at line 1448 of file store.c.

1450{
1451 TRACE("(%p, %p, %p, %p)\n", store, context, replace, ret_context);
1452
1453 /* FIXME: We should clone the context */
1454 if(ret_context) {
1456 *ret_context = context;
1457 }
1458
1459 return TRUE;
1460}
void Context_AddRef(context_t *context)
Definition: context.c:78
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:38
Definition: http.c:7252

◆ EmptyStore_addref()

static void EmptyStore_addref ( WINECRYPT_CERTSTORE store)
static

Definition at line 1432 of file store.c.

1433{
1434 TRACE("(%p)\n", store);
1435}

◆ EmptyStore_control()

static BOOL EmptyStore_control ( WINECRYPT_CERTSTORE store,
DWORD  flags,
DWORD  ctrl_type,
void const ctrl_para 
)
static

Definition at line 1475 of file store.c.

1476{
1477 TRACE("()\n");
1478
1480 return FALSE;
1481}

◆ EmptyStore_delete()

static BOOL EmptyStore_delete ( WINECRYPT_CERTSTORE store,
context_t context 
)
static

Definition at line 1470 of file store.c.

1471{
1472 return TRUE;
1473}

◆ EmptyStore_enum()

static context_t * EmptyStore_enum ( WINECRYPT_CERTSTORE store,
context_t prev 
)
static

Definition at line 1462 of file store.c.

1463{
1464 TRACE("(%p, %p)\n", store, prev);
1465
1467 return NULL;
1468}

◆ EmptyStore_release()

static DWORD EmptyStore_release ( WINECRYPT_CERTSTORE store,
DWORD  flags 
)
static

Definition at line 1437 of file store.c.

1438{
1439 TRACE("(%p)\n", store);
1440 return E_UNEXPECTED;
1441}
#define E_UNEXPECTED
Definition: winerror.h:3528

◆ EmptyStore_releaseContext()

static void EmptyStore_releaseContext ( WINECRYPT_CERTSTORE store,
context_t context 
)
static

Definition at line 1443 of file store.c.

1444{
1446}
void Context_Free(context_t *context)
Definition: context.c:90

◆ free_contexts()

static void free_contexts ( struct list list)
static

Definition at line 215 of file store.c.

216{
218
220 {
221 TRACE("freeing %p\n", context);
222 list_remove(&context->u.entry);
224 }
225}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
Definition: list.h:37
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
static unsigned __int64 next
Definition: rand_nt.c:6
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204

Referenced by MemStore_release().

◆ I_CertUpdateStore()

BOOL WINAPI I_CertUpdateStore ( HCERTSTORE  store1,
HCERTSTORE  store2,
DWORD  unk0,
DWORD  unk1 
)

Definition at line 106 of file store.c.

108{
109 static BOOL warned = FALSE;
110 const WINE_CONTEXT_INTERFACE * const interfaces[] = { pCertInterface,
112 DWORD i;
113
114 TRACE("(%p, %p, %08lx, %08lx)\n", store1, store2, unk0, unk1);
115 if (!warned)
116 {
117 FIXME("semi-stub\n");
118 warned = TRUE;
119 }
120
121 /* Poor-man's resync: empty first store, then add everything from second
122 * store to it.
123 */
124 for (i = 0; i < ARRAY_SIZE(interfaces); i++)
125 {
126 const void *context;
127
128 do {
129 context = interfaces[i]->enumContextsInStore(store1, NULL);
130 if (context)
131 interfaces[i]->deleteFromStore(context);
132 } while (context);
133 do {
134 context = interfaces[i]->enumContextsInStore(store2, context);
135 if (context)
136 interfaces[i]->addContextToStore(store1, context,
138 } while (context);
139 }
140 return TRUE;
141}
const WINE_CONTEXT_INTERFACE * pCTLInterface
Definition: store.c:77
const WINE_CONTEXT_INTERFACE * pCertInterface
Definition: store.c:51
const WINE_CONTEXT_INTERFACE * pCRLInterface
Definition: store.c:64
static DWORD unk1
Definition: cursoricon.c:1804
DeleteContextFunc deleteFromStore
AddContextToStoreFunc addContextToStore
EnumContextsInStoreFunc enumContextsInStore

Referenced by CRYPT_FileControl(), and CRYPT_RegControl().

◆ init_empty_store()

void init_empty_store ( void  )

Definition at line 1505 of file store.c.

1506{
1508}
@ StoreTypeEmpty
static const store_vtbl_t EmptyStoreVtbl
Definition: store.c:1483
WINECRYPT_CERTSTORE empty_store
Definition: store.c:1503

Referenced by DllMain().

◆ MemStore_addCert()

static BOOL MemStore_addCert ( WINECRYPT_CERTSTORE store,
context_t cert,
context_t toReplace,
context_t **  ppStoreContext,
BOOL  use_link 
)
static

Definition at line 234 of file store.c.

236{
237 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
238
239 TRACE("(%p, %p, %p, %p)\n", store, cert, toReplace, ppStoreContext);
240 return MemStore_addContext(ms, &ms->certs, cert, toReplace, ppStoreContext, use_link);
241}
static BOOL MemStore_addContext(WINE_MEMSTORE *store, struct list *list, context_t *orig_context, context_t *existing, context_t **ret_context, BOOL use_link)
Definition: store.c:143
static BYTE cert[]
Definition: msg.c:1374

◆ MemStore_addContext()

static BOOL MemStore_addContext ( WINE_MEMSTORE store,
struct list list,
context_t orig_context,
context_t existing,
context_t **  ret_context,
BOOL  use_link 
)
static

Definition at line 143 of file store.c.

145{
147
148 context = orig_context->vtbl->clone(orig_context, &store->hdr, use_link);
149 if (!context)
150 return FALSE;
151
152 TRACE("adding %p\n", context);
153 EnterCriticalSection(&store->cs);
154 if (existing) {
155 context->u.entry.prev = existing->u.entry.prev;
156 context->u.entry.next = existing->u.entry.next;
157 context->u.entry.prev->next = &context->u.entry;
158 context->u.entry.next->prev = &context->u.entry;
159 list_init(&existing->u.entry);
160 if(!existing->ref)
161 Context_Release(existing);
162 }else {
163 list_add_head(list, &context->u.entry);
164 }
165 LeaveCriticalSection(&store->cs);
166
167 if(ret_context)
168 *ret_context = context;
169 else
171 return TRUE;
172}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
void Context_Release(context_t *context)
Definition: context.c:106
const context_vtbl_t * vtbl
struct list entry
union _context_t::@342 u
struct _context_t *(* clone)(context_t *, struct WINE_CRYPTCERTSTORE *, BOOL)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by MemStore_addCert(), MemStore_addCRL(), and MemStore_addCTL().

◆ MemStore_addCRL()

static BOOL MemStore_addCRL ( WINECRYPT_CERTSTORE store,
context_t crl,
context_t toReplace,
context_t **  ppStoreContext,
BOOL  use_link 
)
static

Definition at line 261 of file store.c.

263{
264 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
265
266 TRACE("(%p, %p, %p, %p)\n", store, crl, toReplace, ppStoreContext);
267
268 return MemStore_addContext(ms, &ms->crls, crl, toReplace, ppStoreContext, use_link);
269}
static const BYTE crl[]
Definition: message.c:817

◆ MemStore_addCTL()

static BOOL MemStore_addCTL ( WINECRYPT_CERTSTORE store,
context_t ctl,
context_t toReplace,
context_t **  ppStoreContext,
BOOL  use_link 
)
static

Definition at line 289 of file store.c.

291{
292 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
293
294 TRACE("(%p, %p, %p, %p)\n", store, ctl, toReplace, ppStoreContext);
295
296 return MemStore_addContext(ms, &ms->ctls, ctl, toReplace, ppStoreContext, use_link);
297}

◆ MemStore_addref()

static void MemStore_addref ( WINECRYPT_CERTSTORE store)
static

Definition at line 317 of file store.c.

318{
319 LONG ref = InterlockedIncrement(&store->ref);
320 TRACE("ref = %ld\n", ref);
321}
#define InterlockedIncrement
Definition: armddk.h:53
Definition: send.c:48

◆ MemStore_control()

static BOOL MemStore_control ( WINECRYPT_CERTSTORE store,
DWORD  dwFlags,
DWORD  dwCtrlType,
void const pvCtrlPara 
)
static

Definition at line 345 of file store.c.

347{
349 return FALSE;
350}

◆ MemStore_deleteCert()

static BOOL MemStore_deleteCert ( WINECRYPT_CERTSTORE store,
context_t context 
)
static

Definition at line 252 of file store.c.

253{
254 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
255
256 TRACE("(%p, %p)\n", store, context);
257
259}
static BOOL MemStore_deleteContext(WINE_MEMSTORE *store, context_t *context)
Definition: store.c:198

◆ MemStore_deleteContext()

static BOOL MemStore_deleteContext ( WINE_MEMSTORE store,
context_t context 
)
static

Definition at line 198 of file store.c.

199{
200 BOOL in_list = FALSE;
201
202 EnterCriticalSection(&store->cs);
203 if (!list_empty(&context->u.entry)) {
204 list_remove(&context->u.entry);
205 list_init(&context->u.entry);
206 in_list = TRUE;
207 }
208 LeaveCriticalSection(&store->cs);
209
210 if(in_list && !context->ref)
212 return TRUE;
213}
static int list_empty(struct list_entry *head)
Definition: list.h:58

Referenced by MemStore_deleteCert(), MemStore_deleteCRL(), and MemStore_deleteCTL().

◆ MemStore_deleteCRL()

static BOOL MemStore_deleteCRL ( WINECRYPT_CERTSTORE store,
context_t context 
)
static

Definition at line 280 of file store.c.

281{
282 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
283
284 TRACE("(%p, %p)\n", store, context);
285
287}

◆ MemStore_deleteCTL()

static BOOL MemStore_deleteCTL ( WINECRYPT_CERTSTORE store,
context_t context 
)
static

Definition at line 308 of file store.c.

309{
310 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
311
312 TRACE("(%p, %p)\n", store, context);
313
315}

◆ MemStore_enumCert()

static context_t * MemStore_enumCert ( WINECRYPT_CERTSTORE store,
context_t prev 
)
static

Definition at line 243 of file store.c.

244{
245 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
246
247 TRACE("(%p, %p)\n", store, prev);
248
249 return MemStore_enumContext(ms, &ms->certs, prev);
250}
static context_t * MemStore_enumContext(WINE_MEMSTORE *store, struct list *list, context_t *prev)
Definition: store.c:174

◆ MemStore_enumContext()

static context_t * MemStore_enumContext ( WINE_MEMSTORE store,
struct list list,
context_t prev 
)
static

Definition at line 174 of file store.c.

175{
176 struct list *next;
177 context_t *ret;
178
179 EnterCriticalSection(&store->cs);
180 if (prev) {
181 next = list_next(list, &prev->u.entry);
182 Context_Release(prev);
183 }else {
185 }
186 LeaveCriticalSection(&store->cs);
187
188 if (!next) {
190 return NULL;
191 }
192
193 ret = LIST_ENTRY(next, context_t, u.entry);
195 return ret;
196}
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:115
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by MemStore_enumCert(), MemStore_enumCRL(), and MemStore_enumCTL().

◆ MemStore_enumCRL()

static context_t * MemStore_enumCRL ( WINECRYPT_CERTSTORE store,
context_t prev 
)
static

Definition at line 271 of file store.c.

272{
273 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
274
275 TRACE("(%p, %p)\n", store, prev);
276
277 return MemStore_enumContext(ms, &ms->crls, prev);
278}

◆ MemStore_enumCTL()

static context_t * MemStore_enumCTL ( WINECRYPT_CERTSTORE store,
context_t prev 
)
static

Definition at line 299 of file store.c.

300{
301 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
302
303 TRACE("(%p, %p)\n", store, prev);
304
305 return MemStore_enumContext(ms, &ms->ctls, prev);
306}

◆ MemStore_release()

static DWORD MemStore_release ( WINECRYPT_CERTSTORE cert_store,
DWORD  flags 
)
static

Definition at line 323 of file store.c.

324{
326 LONG ref;
327
329 FIXME("Unimplemented flags %lx\n", flags);
330
331 ref = InterlockedDecrement(&store->hdr.ref);
332 TRACE("(%p) ref=%ld\n", store, ref);
333 if(ref)
335
336 free_contexts(&store->certs);
337 free_contexts(&store->crls);
338 free_contexts(&store->ctls);
339 store->cs.DebugInfo->Spare[0] = 0;
340 DeleteCriticalSection(&store->cs);
341 CRYPT_FreeStore(&store->hdr);
342 return ERROR_SUCCESS;
343}
#define InterlockedDecrement
Definition: armddk.h:52
void CRYPT_FreeStore(WINECRYPT_CERTSTORE *store)
Definition: store.c:98
static void free_contexts(struct list *list)
Definition: store.c:215
GLbitfield flags
Definition: glext.h:7161
DWORD cert_store
Definition: store.c:342
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define CERT_CLOSE_STORE_CHECK_FLAG
Definition: wincrypt.h:2648
#define CRYPT_E_PENDING_CLOSE
Definition: winerror.h:4432

◆ MemStore_releaseContext()

static void MemStore_releaseContext ( WINECRYPT_CERTSTORE store,
context_t context 
)
static

Definition at line 227 of file store.c.

228{
229 /* Free the context only if it's not in a list. Otherwise it may be reused later. */
230 if(list_empty(&context->u.entry))
232}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( crypt  )

Variable Documentation

◆ empty_store

◆ EmptyStoreVtbl

const store_vtbl_t EmptyStoreVtbl
static
Initial value:
= {
{
}, {
}, {
}
}
static context_t * EmptyStore_enum(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: store.c:1462
static void EmptyStore_addref(WINECRYPT_CERTSTORE *store)
Definition: store.c:1432
static DWORD EmptyStore_release(WINECRYPT_CERTSTORE *store, DWORD flags)
Definition: store.c:1437
static BOOL EmptyStore_add(WINECRYPT_CERTSTORE *store, context_t *context, context_t *replace, context_t **ret_context, BOOL use_link)
Definition: store.c:1448
static BOOL EmptyStore_delete(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:1470
static void EmptyStore_releaseContext(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:1443
static BOOL EmptyStore_control(WINECRYPT_CERTSTORE *store, DWORD flags, DWORD ctrl_type, void const *ctrl_para)
Definition: store.c:1475

Definition at line 1483 of file store.c.

Referenced by init_empty_store().

◆ gCertInterface

const WINE_CONTEXT_INTERFACE gCertInterface
static
Initial value:
= {
}
const void *(WINAPI * EnumContextsInStoreFunc)(HCERTSTORE hCertStore, const void *pPrevContext)
BOOL(WINAPI * SerializeElementFunc)(const void *context, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
BOOL(WINAPI * AddContextToStoreFunc)(HCERTSTORE hCertStore, const void *context, DWORD dwAddDisposition, const void **ppStoreContext)
BOOL(WINAPI * GetContextPropertyFunc)(const void *context, DWORD dwPropID, void *pvData, DWORD *pcbData)
BOOL(WINAPI * SetContextPropertyFunc)(const void *context, DWORD dwPropID, DWORD dwFlags, const void *pvData)
const void *(WINAPI * CreateContextFunc)(DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded)
BOOL(WINAPI * DeleteContextFunc)(const void *contex)
DWORD(WINAPI * EnumPropertiesFunc)(const void *context, DWORD dwPropId)
BOOL(WINAPI * AddEncodedContextToStoreFunc)(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwAddDisposition, const void **ppContext)
BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition, PCCERT_CONTEXT *ppStoreContext)
Definition: cert.c:284
PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded)
Definition: cert.c:314
BOOL WINAPI CertSetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: cert.c:838
BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: cert.c:615
DWORD WINAPI CertEnumCertificateContextProperties(PCCERT_CONTEXT pCertContext, DWORD dwPropId)
Definition: cert.c:378
PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrev)
Definition: store.c:922
BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext)
Definition: store.c:937
BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
Definition: serialize.c:238

Definition at line 40 of file store.c.

◆ gCRLInterface

const WINE_CONTEXT_INTERFACE gCRLInterface
static
Initial value:
= {
}
BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: crl.c:566
DWORD WINAPI CertEnumCRLContextProperties(PCCRL_CONTEXT pCRLContext, DWORD dwPropId)
Definition: crl.c:489
BOOL WINAPI CertSetCRLContextProperty(PCCRL_CONTEXT pCRLContext, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: crl.c:660
PCCRL_CONTEXT WINAPI CertCreateCRLContext(DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded)
Definition: crl.c:179
BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore, PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition, PCCRL_CONTEXT *ppStoreContext)
Definition: store.c:954
BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext)
Definition: store.c:1074
PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore, PCCRL_CONTEXT pPrev)
Definition: store.c:1095
BOOL WINAPI CertSerializeCRLStoreElement(PCCRL_CONTEXT pCrlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
Definition: serialize.c:246

Definition at line 53 of file store.c.

◆ gCTLInterface

const WINE_CONTEXT_INTERFACE gCTLInterface
static
Initial value:
= {
}
PCCTL_CONTEXT WINAPI CertEnumCTLsInStore(HCERTSTORE hCertStore, PCCTL_CONTEXT pPrev)
Definition: ctl.c:200
PCCTL_CONTEXT WINAPI CertCreateCTLContext(DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded)
Definition: ctl.c:363
BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext)
Definition: ctl.c:341
BOOL WINAPI CertSetCTLContextProperty(PCCTL_CONTEXT pCTLContext, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: ctl.c:685
DWORD WINAPI CertEnumCTLContextProperties(PCCTL_CONTEXT pCTLContext, DWORD dwPropId)
Definition: ctl.c:508
BOOL WINAPI CertGetCTLContextProperty(PCCTL_CONTEXT pCTLContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: ctl.c:590
BOOL WINAPI CertAddEncodedCTLToStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded, DWORD dwAddDisposition, PCCTL_CONTEXT *ppCtlContext)
Definition: ctl.c:177
BOOL WINAPI CertAddCTLContextToStore(HCERTSTORE hCertStore, PCCTL_CONTEXT pCtlContext, DWORD dwAddDisposition, PCCTL_CONTEXT *ppStoreContext)
Definition: ctl.c:63
BOOL WINAPI CertSerializeCTLStoreElement(PCCTL_CONTEXT pCtlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
Definition: serialize.c:254

Definition at line 66 of file store.c.

◆ MemStoreVtbl

const store_vtbl_t MemStoreVtbl
static
Initial value:
= {
{
}, {
}, {
}
}
static DWORD MemStore_release(WINECRYPT_CERTSTORE *cert_store, DWORD flags)
Definition: store.c:323
static context_t * MemStore_enumCRL(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: store.c:271
static BOOL MemStore_addCTL(WINECRYPT_CERTSTORE *store, context_t *ctl, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
Definition: store.c:289
static BOOL MemStore_addCRL(WINECRYPT_CERTSTORE *store, context_t *crl, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
Definition: store.c:261
static BOOL MemStore_deleteCRL(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:280
static void MemStore_releaseContext(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:227
static void MemStore_addref(WINECRYPT_CERTSTORE *store)
Definition: store.c:317
static BOOL MemStore_control(WINECRYPT_CERTSTORE *store, DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara)
Definition: store.c:345
static BOOL MemStore_deleteCert(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:252
static context_t * MemStore_enumCert(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: store.c:243
static BOOL MemStore_deleteCTL(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:308
static BOOL MemStore_addCert(WINECRYPT_CERTSTORE *store, context_t *cert, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
Definition: store.c:234
static context_t * MemStore_enumCTL(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: store.c:299

Definition at line 352 of file store.c.

Referenced by CRYPT_MemOpenStore().

◆ msgProvFuncs

void* msgProvFuncs[]
static
Initial value:
= {
}
static void WINAPI CRYPT_MsgCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
Definition: store.c:639

Definition at line 647 of file store.c.

Referenced by CRYPT_MsgOpenStore().

◆ pCertInterface

◆ pCRLInterface

◆ pCTLInterface