ReactOS  0.4.14-dev-614-gbfd8a84
store.c File Reference
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winreg.h"
#include "winuser.h"
#include "wincrypt.h"
#include "wine/debug.h"
#include "wine/exception.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 const WCHAR rootW [] = { 'R','o','o','t',0 }
 
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 960 of file store.c.

963 {
964  WINECRYPT_CERTSTORE *store = hCertStore;
965  BOOL ret = TRUE;
966  PCCRL_CONTEXT toAdd = NULL, existing = NULL;
967 
968  TRACE("(%p, %p, %08x, %p)\n", hCertStore, pCrlContext,
970 
971  /* Weird case to pass a test */
972  if (dwAddDisposition == 0)
973  {
975  return FALSE;
976  }
978  {
979  existing = CertFindCRLInStore(hCertStore, 0, 0, CRL_FIND_EXISTING,
980  pCrlContext, NULL);
981  }
982 
983  switch (dwAddDisposition)
984  {
987  break;
988  case CERT_STORE_ADD_NEW:
989  if (existing)
990  {
991  TRACE("found matching CRL, not adding\n");
993  ret = FALSE;
994  }
995  else
997  break;
999  if (existing)
1000  {
1001  LONG newer = CompareFileTime(&existing->pCrlInfo->ThisUpdate,
1003 
1004  if (newer < 0)
1006  else
1007  {
1008  TRACE("existing CRL is newer, not adding\n");
1010  ret = FALSE;
1011  }
1012  }
1013  else
1015  break;
1017  if (existing)
1018  {
1019  LONG newer = CompareFileTime(&existing->pCrlInfo->ThisUpdate,
1021 
1022  if (newer < 0)
1023  {
1025  Context_CopyProperties(toAdd, existing);
1026  }
1027  else
1028  {
1029  TRACE("existing CRL is newer, not adding\n");
1031  ret = FALSE;
1032  }
1033  }
1034  else
1036  break;
1039  break;
1042  if (existing)
1043  Context_CopyProperties(toAdd, existing);
1044  break;
1046  if (existing)
1047  {
1049  if (ppStoreContext)
1051  }
1052  else
1054  break;
1055  default:
1056  FIXME("Unimplemented add disposition %d\n", dwAddDisposition);
1057  ret = FALSE;
1058  }
1059 
1060  if (toAdd)
1061  {
1062  if (store) {
1063  context_t *ret_context;
1064  ret = store->vtbl->crls.addContext(store, context_from_ptr(toAdd),
1065  existing ? context_from_ptr(existing) : NULL, ppStoreContext ? &ret_context : NULL, FALSE);
1066  if (ret && ppStoreContext)
1067  *ppStoreContext = context_ptr(ret_context);
1068  }else if (ppStoreContext) {
1070  }
1071  CertFreeCRLContext(toAdd);
1072  }
1073  if (existing)
1074  CertFreeCRLContext(existing);
1075 
1076  TRACE("returning %d\n", ret);
1077  return ret;
1078 }
void Context_CopyProperties(const void *to, const void *from)
Definition: context.c:123
static context_t * context_from_ptr(const void *ptr)
#define TRUE
Definition: types.h:120
PCRL_INFO pCrlInfo
Definition: wincrypt.h:622
#define CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES
Definition: wincrypt.h:2486
_In_ PCCERT_CONTEXT _In_ DWORD dwAddDisposition
Definition: wincrypt.h:4987
#define CRYPT_E_EXISTS
Definition: winerror.h:3008
#define CERT_STORE_ADD_NEW
Definition: wincrypt.h:2482
CONTEXT_FUNCS crls
#define CERT_STORE_ADD_NEWER
Definition: wincrypt.h:2487
static void * context_ptr(context_t *context)
BOOL(* addContext)(struct WINE_CRYPTCERTSTORE *, context_t *, context_t *, context_t **, BOOL)
_In_ PCCERT_CONTEXT _In_ DWORD _Outptr_opt_ PCCERT_CONTEXT * ppStoreContext
Definition: wincrypt.h:4987
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define CERT_STORE_ADD_REPLACE_EXISTING
Definition: wincrypt.h:2484
#define CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES
Definition: wincrypt.h:2488
#define TRACE(s)
Definition: solgame.cpp:4
LONG WINAPI CompareFileTime(IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2)
Definition: time.c:106
const store_vtbl_t * vtbl
#define CERT_STORE_ADD_USE_EXISTING
Definition: wincrypt.h:2483
#define SetLastError(x)
Definition: compat.h:417
int ret
#define CRL_FIND_EXISTING
Definition: wincrypt.h:2929
void newer(int argc, const char *argv[])
Definition: cmds.c:2278
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:228
_In_ PCCRL_CONTEXT pCrlContext
Definition: wincrypt.h:4996
PCCRL_CONTEXT WINAPI CertFindCRLInStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType, const void *pvFindPara, PCCRL_CONTEXT pPrevCrlContext)
Definition: crl.c:287
#define CERT_STORE_ADD_ALWAYS
Definition: wincrypt.h:2485
PCCRL_CONTEXT WINAPI CertDuplicateCRLContext(PCCRL_CONTEXT pCrlContext)
Definition: crl.c:378
FILETIME ThisUpdate
Definition: wincrypt.h:498
BOOL WINAPI CertFreeCRLContext(PCCRL_CONTEXT pCrlContext)
Definition: crl.c:386

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

◆ CertCloseStore()

BOOL WINAPI CertCloseStore ( HCERTSTORE  hCertStore,
DWORD  dwFlags 
)

Definition at line 1127 of file store.c.

1128 {
1129  WINECRYPT_CERTSTORE *hcs = hCertStore;
1130  DWORD res;
1131 
1132  TRACE("(%p, %08x)\n", hCertStore, dwFlags);
1133 
1134  if( ! hCertStore )
1135  return TRUE;
1136 
1137  if ( hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC )
1138  return FALSE;
1139 
1140  res = hcs->vtbl->release(hcs, dwFlags);
1141  if (res != ERROR_SUCCESS) {
1142  SetLastError(res);
1143  return FALSE;
1144  }
1145 
1146  return TRUE;
1147 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD(* release)(struct WINE_CRYPTCERTSTORE *, DWORD)
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
#define WINE_CRYPTCERTSTORE_MAGIC
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
GLuint res
Definition: glext.h:9613

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(), CRYPTDLG_IsCertAllowed(), CRYPTDLG_MakeEngine(), CryptMsgGetAndVerifySigner(), CryptVerifyDetachedMessageSignature(), CryptVerifyMessageSignature(), free_chain_engine(), getChain(), import_cert(), import_crl(), import_ctl(), import_file(), 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_crypt_ui_wiz_import(), test_I_UpdateStore(), test_msg_get_and_verify_signer(), test_retrieveObjectByUrl(), test_utils(), test_verifyRevocation(), testAddCert(), testAddCertificateLink(), testAddCRL(), testAddCTLToStore(), testAddSerialized(), testCertOpenSystemStore(), testCertRegisterSystemStore(), testCloseStore(), testCollectionStore(), testCreateCertChainEngine(), testDupCert(), testEmptyStore(), testFileNameStore(), testFileStore(), testFindCert(), testFindCRL(), testGetCertChain(), testGetCRLFromStore(), testGetIssuerCert(), testGetSubjectCert(), testIsValidCRLForCert(), testLinkCert(), testMemStore(), testMessageStore(), testRegStore(), testRegStoreSavedCerts(), testSerializedStore(), testStoreProperty(), testStoresInCollection(), testSystemRegStore(), testSystemStore(), testVerifyRevocation(), and WINTRUST_CreateChainForSigner().

◆ CertControlStore()

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

Definition at line 1149 of file store.c.

1151 {
1152  WINECRYPT_CERTSTORE *hcs = hCertStore;
1153  BOOL ret;
1154 
1155  TRACE("(%p, %08x, %d, %p)\n", hCertStore, dwFlags, dwCtrlType,
1156  pvCtrlPara);
1157 
1158  if (!hcs)
1159  ret = FALSE;
1160  else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
1161  ret = FALSE;
1162  else
1163  {
1164  if (hcs->vtbl->control)
1165  ret = hcs->vtbl->control(hcs, dwFlags, dwCtrlType, pvCtrlPara);
1166  else
1167  ret = TRUE;
1168  }
1169  return ret;
1170 }
#define TRUE
Definition: types.h:120
BOOL(* control)(struct WINE_CRYPTCERTSTORE *, DWORD, DWORD, void const *)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
#define WINE_CRYPTCERTSTORE_MAGIC
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

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

◆ CertDeleteCertificateFromStore()

BOOL WINAPI CertDeleteCertificateFromStore ( PCCERT_CONTEXT  pCertContext)

Definition at line 943 of file store.c.

944 {
945  WINECRYPT_CERTSTORE *hcs;
946 
947  TRACE("(%p)\n", pCertContext);
948 
949  if (!pCertContext)
950  return TRUE;
951 
952  hcs = pCertContext->hCertStore;
953 
955  return FALSE;
956 
957  return hcs->vtbl->certs.delete(hcs, &cert_from_ptr(pCertContext)->base);
958 }
#define TRUE
Definition: types.h:120
HCERTSTORE hCertStore
Definition: wincrypt.h:483
CONTEXT_FUNCS certs
static cert_t * cert_from_ptr(const CERT_CONTEXT *ptr)
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
#define WINE_CRYPTCERTSTORE_MAGIC
BOOL(* delete)(struct WINE_CRYPTCERTSTORE *, context_t *)
_In_ PCCERT_CONTEXT pCertContext
Definition: wincrypt.h:4840

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

◆ CertDeleteCRLFromStore()

BOOL WINAPI CertDeleteCRLFromStore ( PCCRL_CONTEXT  pCrlContext)

Definition at line 1080 of file store.c.

1081 {
1082  WINECRYPT_CERTSTORE *hcs;
1083  BOOL ret;
1084 
1085  TRACE("(%p)\n", pCrlContext);
1086 
1087  if (!pCrlContext)
1088  return TRUE;
1089 
1090  hcs = pCrlContext->hCertStore;
1091 
1092  if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
1093  return FALSE;
1094 
1095  ret = hcs->vtbl->crls.delete(hcs, &crl_from_ptr(pCrlContext)->base);
1096  if (ret)
1098  return ret;
1099 }
#define TRUE
Definition: types.h:120
static crl_t * crl_from_ptr(const CRL_CONTEXT *ptr)
CONTEXT_FUNCS crls
unsigned int BOOL
Definition: ntddk_ex.h:94
HCERTSTORE hCertStore
Definition: wincrypt.h:623
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
#define WINE_CRYPTCERTSTORE_MAGIC
int ret
_In_ PCCRL_CONTEXT pCrlContext
Definition: wincrypt.h:4996
BOOL(* delete)(struct WINE_CRYPTCERTSTORE *, context_t *)
BOOL WINAPI CertFreeCRLContext(PCCRL_CONTEXT pCrlContext)
Definition: crl.c:386

Referenced by Collection_deleteCRL().

◆ CertDuplicateStore()

HCERTSTORE WINAPI CertDuplicateStore ( HCERTSTORE  hCertStore)

Definition at line 1116 of file store.c.

1117 {
1118  WINECRYPT_CERTSTORE *hcs = hCertStore;
1119 
1120  TRACE("(%p)\n", hCertStore);
1121 
1122  if (hcs && hcs->dwMagic == WINE_CRYPTCERTSTORE_MAGIC)
1123  hcs->vtbl->addref(hcs);
1124  return hCertStore;
1125 }
void(* addref)(struct WINE_CRYPTCERTSTORE *)
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
#define WINE_CRYPTCERTSTORE_MAGIC

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

◆ CertEnumCertificatesInStore()

PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore ( HCERTSTORE  hCertStore,
PCCERT_CONTEXT  pPrev 
)

Definition at line 928 of file store.c.

929 {
930  cert_t *prev = pPrev ? cert_from_ptr(pPrev) : NULL, *ret;
931  WINECRYPT_CERTSTORE *hcs = hCertStore;
932 
933  TRACE("(%p, %p)\n", hCertStore, pPrev);
934  if (!hCertStore)
935  ret = NULL;
936  else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
937  ret = NULL;
938  else
939  ret = (cert_t*)hcs->vtbl->certs.enumContext(hcs, prev ? &prev->base : NULL);
940  return ret ? &ret->ctx : NULL;
941 }
context_t base
CONTEXT_FUNCS certs
smooth NULL
Definition: ftsmooth.c:416
static cert_t * cert_from_ptr(const CERT_CONTEXT *ptr)
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
#define WINE_CRYPTCERTSTORE_MAGIC
int ret
context_t *(* enumContext)(struct WINE_CRYPTCERTSTORE *store, context_t *prev)

Referenced by _test_store_is_empty(), add_store_certs(), cert_compare_certs_in_store(), check_and_store_certs(), check_store_context_type(), countCertsInStore(), CRYPT_CheckRestrictedRoot(), CRYPT_SavePKCSToMem(), find_cert_any(), import_store(), show_store_certs(), test_crypt_ui_wiz_import(), test_remote_cert(), test_retrieveObjectByUrl(), testAddSerialized(), testCertRegisterSystemStore(), testCollectionStore(), testCreateCert(), testFileNameStore(), testFileStore(), testGetIssuerCert(), testMemStore(), testMessageStore(), testRegStore(), testSerializedStore(), and testStoresInCollection().

◆ CertEnumCRLsInStore()

PCCRL_CONTEXT WINAPI CertEnumCRLsInStore ( HCERTSTORE  hCertStore,
PCCRL_CONTEXT  pPrev 
)

Definition at line 1101 of file store.c.

1102 {
1103  crl_t *ret, *prev = pPrev ? crl_from_ptr(pPrev) : NULL;
1104  WINECRYPT_CERTSTORE *hcs = hCertStore;
1105 
1106  TRACE("(%p, %p)\n", hCertStore, pPrev);
1107  if (!hCertStore)
1108  ret = NULL;
1109  else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
1110  ret = NULL;
1111  else
1112  ret = (crl_t*)hcs->vtbl->crls.enumContext(hcs, prev ? &prev->base : NULL);
1113  return ret ? &ret->ctx : NULL;
1114 }
context_t base
static crl_t * crl_from_ptr(const CRL_CONTEXT *ptr)
CONTEXT_FUNCS crls
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
#define WINE_CRYPTCERTSTORE_MAGIC
int ret
context_t *(* enumContext)(struct WINE_CRYPTCERTSTORE *store, context_t *prev)

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 1361 of file store.c.

1363 {
1365  FIXME("(%p, %08x, %p, %p): stub\n", pvSystemStore, dwFlags, pvArg,
1366  pfnEnum);
1367  else
1368  FIXME("(%s, %08x, %p, %p): stub\n", debugstr_w(pvSystemStore),
1369  dwFlags, pvArg,
1370  pfnEnum);
1371  return FALSE;
1372 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define CERT_SYSTEM_STORE_RELOCATE_FLAG
Definition: wincrypt.h:2640
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ CertEnumSystemStore()

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

Definition at line 1321 of file store.c.

1323 {
1324  BOOL ret = FALSE;
1325  LONG rc;
1326  HKEY key;
1327  CERT_SYSTEM_STORE_INFO info = { sizeof(info) };
1328 
1329  TRACE("(%08x, %p, %p, %p)\n", dwFlags, pvSystemStoreLocationPara, pvArg,
1330  pfnEnum);
1331 
1332  rc = CRYPT_OpenParentStore(dwFlags, pvArg, &key);
1333  if (!rc)
1334  {
1335  DWORD index = 0;
1336 
1337  ret = TRUE;
1338  do {
1339  WCHAR name[MAX_PATH];
1341 
1342  rc = RegEnumKeyExW(key, index++, name, &size, NULL, NULL, NULL,
1343  NULL);
1344  if (!rc)
1345  ret = pfnEnum(name, dwFlags, &info, NULL, pvArg);
1346  } while (ret && !rc);
1347  if (ret && rc != ERROR_NO_MORE_ITEMS)
1348  SetLastError(rc);
1349  }
1350  else
1351  SetLastError(rc);
1352  /* Include root store for the local machine location (it isn't in the
1353  * registry)
1354  */
1357  ret = pfnEnum(rootW, dwFlags, &info, NULL, pvArg);
1358  return ret;
1359 }
static const WCHAR rootW[]
Definition: store.c:407
#define TRUE
Definition: types.h:120
static LONG CRYPT_OpenParentStore(DWORD dwFlags, void *pvSystemStoreLocationPara, HKEY *key)
Definition: store.c:1268
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
#define CERT_SYSTEM_STORE_LOCAL_MACHINE
Definition: wincrypt.h:2326
struct _test_info info[]
Definition: SetCursorPos.c:19
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
HKEY key
Definition: store.c:343
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define CERT_SYSTEM_STORE_LOCATION_MASK
Definition: wincrypt.h:2303
#define ARRAY_SIZE(a)
Definition: main.h:24
Definition: name.c:38
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:2527
Definition: path.c:41

Referenced by enumerate_stores(), and testCertEnumSystemStore().

◆ CertGetStoreProperty()

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

Definition at line 1172 of file store.c.

1174 {
1175  WINECRYPT_CERTSTORE *store = hCertStore;
1176  BOOL ret = FALSE;
1177 
1178  TRACE("(%p, %d, %p, %p)\n", hCertStore, dwPropId, pvData, pcbData);
1179 
1180  switch (dwPropId)
1181  {
1183  if (!pvData)
1184  {
1185  *pcbData = sizeof(DWORD);
1186  ret = TRUE;
1187  }
1188  else if (*pcbData < sizeof(DWORD))
1189  {
1191  *pcbData = sizeof(DWORD);
1192  }
1193  else
1194  {
1195  DWORD state = 0;
1196 
1197  if (store->type != StoreTypeMem &&
1200  *(DWORD *)pvData = state;
1201  ret = TRUE;
1202  }
1203  break;
1204  default:
1205  if (store->properties)
1206  {
1208 
1210  &blob);
1211  if (ret)
1212  {
1213  if (!pvData)
1214  *pcbData = blob.cbData;
1215  else if (*pcbData < blob.cbData)
1216  {
1218  *pcbData = blob.cbData;
1219  ret = FALSE;
1220  }
1221  else
1222  {
1223  memcpy(pvData, blob.pbData, blob.cbData);
1224  *pcbData = blob.cbData;
1225  }
1226  }
1227  else
1229  }
1230  else
1232  }
1233  return ret;
1234 }
#define TRUE
Definition: types.h:120
#define CRYPT_E_NOT_FOUND
Definition: winerror.h:3007
Definition: image.c:133
BOOL ContextPropertyList_FindProperty(CONTEXT_PROPERTY_LIST *list, DWORD id, PCRYPT_DATA_BLOB blob) DECLSPEC_HIDDEN
Definition: proplist.c:72
#define DWORD
Definition: nt_native.h:44
#define CERT_ACCESS_STATE_PROP_ID
Definition: wincrypt.h:2700
unsigned int BOOL
Definition: ntddk_ex.h:94
const CRYPT_DATA_BLOB * blob
Definition: serialize.c:551
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
#define TRACE(s)
Definition: solgame.cpp:4
CONTEXT_PROPERTY_LIST * properties
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
#define CERT_STORE_READONLY_FLAG
Definition: wincrypt.h:2466
int ret
static int state
Definition: maze.c:121
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERROR_MORE_DATA
Definition: dderror.h:13
_In_ DWORD dwPropId
Definition: wincrypt.h:4952
#define CERT_ACCESS_STATE_WRITE_PERSIST_FLAG
Definition: wincrypt.h:2766
_In_ DWORD _Out_writes_bytes_to_opt_ pcbData void _Inout_ DWORD * pcbData
Definition: wincrypt.h:4953

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 815 of file store.c.

818 {
819  WINECRYPT_CERTSTORE *hcs;
820  StoreOpenFunc openFunc = NULL;
821 
822  TRACE("(%s, %08x, %08lx, %08x, %p)\n", debugstr_a(lpszStoreProvider),
823  dwMsgAndCertEncodingType, hCryptProv, dwFlags, pvPara);
824 
825  if (IS_INTOID(lpszStoreProvider))
826  {
827  switch (LOWORD(lpszStoreProvider))
828  {
830  openFunc = CRYPT_MsgOpenStore;
831  break;
833  openFunc = CRYPT_MemOpenStore;
834  break;
836  openFunc = CRYPT_FileOpenStore;
837  break;
839  openFunc = CRYPT_PKCSOpenStore;
840  break;
842  openFunc = CRYPT_SerializedOpenStore;
843  break;
845  openFunc = CRYPT_RegOpenStore;
846  break;
848  openFunc = CRYPT_FileNameOpenStoreA;
849  break;
851  openFunc = CRYPT_FileNameOpenStoreW;
852  break;
854  openFunc = CRYPT_CollectionOpenStore;
855  break;
857  openFunc = CRYPT_SysOpenStoreA;
858  break;
860  openFunc = CRYPT_SysOpenStoreW;
861  break;
863  openFunc = CRYPT_SysRegOpenStoreA;
864  break;
866  openFunc = CRYPT_SysRegOpenStoreW;
867  break;
869  openFunc = CRYPT_PhysOpenStoreW;
870  break;
871  default:
872  if (LOWORD(lpszStoreProvider))
873  FIXME("unimplemented type %d\n", LOWORD(lpszStoreProvider));
874  }
875  }
876  else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_MEMORY))
877  openFunc = CRYPT_MemOpenStore;
878  else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_FILENAME_W))
879  openFunc = CRYPT_FileOpenStore;
880  else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_SYSTEM))
881  openFunc = CRYPT_SysOpenStoreW;
882  else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_PKCS7))
883  openFunc = CRYPT_PKCSOpenStore;
884  else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_SERIALIZED))
885  openFunc = CRYPT_SerializedOpenStore;
886  else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_COLLECTION))
887  openFunc = CRYPT_CollectionOpenStore;
888  else if (!strcasecmp(lpszStoreProvider, sz_CERT_STORE_PROV_SYSTEM_REGISTRY))
889  openFunc = CRYPT_SysRegOpenStoreW;
890  else
891  {
892  FIXME("unimplemented type %s\n", lpszStoreProvider);
893  openFunc = NULL;
894  }
895 
896  if (!openFunc)
897  hcs = CRYPT_ProvOpenStore(lpszStoreProvider, dwMsgAndCertEncodingType,
898  hCryptProv, dwFlags, pvPara);
899  else
900  hcs = openFunc(hCryptProv, dwFlags, pvPara);
901  return hcs;
902 }
WINECRYPT_CERTSTORE * CRYPT_CollectionOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
#define sz_CERT_STORE_PROV_SYSTEM_REGISTRY
Definition: wincrypt.h:2281
#define strcasecmp
Definition: fake.h:9
#define CERT_STORE_PROV_SYSTEM_REGISTRY_W
Definition: wincrypt.h:2263
WINECRYPT_CERTSTORE * CRYPT_ProvOpenStore(LPCSTR lpszStoreProvider, DWORD dwEncodingType, HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN
Definition: provstore.c:375
#define CERT_STORE_PROV_MSG
Definition: wincrypt.h:2250
#define sz_CERT_STORE_PROV_MEMORY
Definition: wincrypt.h:2272
#define sz_CERT_STORE_PROV_SYSTEM
Definition: wincrypt.h:2276
#define CERT_STORE_PROV_FILENAME_W
Definition: wincrypt.h:2257
#define CERT_STORE_PROV_COLLECTION
Definition: wincrypt.h:2261
#define sz_CERT_STORE_PROV_FILENAME_W
Definition: wincrypt.h:2273
#define sz_CERT_STORE_PROV_SERIALIZED
Definition: wincrypt.h:2278
static WINECRYPT_CERTSTORE * CRYPT_SysOpenStoreA(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:616
#define IS_INTOID(x)
#define FIXME(fmt,...)
Definition: debug.h:110
static WINECRYPT_CERTSTORE * CRYPT_SysRegOpenStoreA(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:515
#define CERT_STORE_PROV_SYSTEM_REGISTRY_A
Definition: wincrypt.h:2262
static WINECRYPT_CERTSTORE * CRYPT_SysRegOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:409
#define CERT_STORE_PROV_MEMORY
Definition: wincrypt.h:2251
static WINECRYPT_CERTSTORE * CRYPT_SerializedOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:776
smooth NULL
Definition: ftsmooth.c:416
WINECRYPT_CERTSTORE * CRYPT_FileNameOpenStoreA(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN
Definition: filestore.c:383
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define sz_CERT_STORE_PROV_COLLECTION
Definition: wincrypt.h:2279
static WINECRYPT_CERTSTORE * CRYPT_MsgOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:657
WINECRYPT_CERTSTORE * CRYPT_FileOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN
Definition: filestore.c:242
static WINECRYPT_CERTSTORE * CRYPT_PhysOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:804
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static WINECRYPT_CERTSTORE * CRYPT_PKCSOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:735
struct WINE_CRYPTCERTSTORE *(* StoreOpenFunc)(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
static WINECRYPT_CERTSTORE * CRYPT_MemOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:375
#define CERT_STORE_PROV_SYSTEM_W
Definition: wincrypt.h:2259
#define CERT_STORE_PROV_PKCS7
Definition: wincrypt.h:2254
WINECRYPT_CERTSTORE * CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN
Definition: filestore.c:292
#define CERT_STORE_PROV_REG
Definition: wincrypt.h:2253
#define CERT_STORE_PROV_SYSTEM_A
Definition: wincrypt.h:2258
#define CERT_STORE_PROV_SERIALIZED
Definition: wincrypt.h:2255
#define CERT_STORE_PROV_FILE
Definition: wincrypt.h:2252
static WINECRYPT_CERTSTORE * CRYPT_SysOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:544
WINECRYPT_CERTSTORE * CRYPT_RegOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN
Definition: regstore.c:512
_In_ DWORD dwMsgAndCertEncodingType
Definition: wincrypt.h:5080
#define CERT_STORE_PROV_FILENAME_A
Definition: wincrypt.h:2256
_In_ void * pvPara
Definition: wincrypt.h:6081
#define sz_CERT_STORE_PROV_PKCS7
Definition: wincrypt.h:2277
#define CERT_STORE_PROV_PHYSICAL_W
Definition: wincrypt.h:2265
#define LOWORD(l)
Definition: pedump.c:82

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_MsgOpenStore(), CRYPT_ProvOpenStore(), CRYPT_QueryContextObject(), CRYPT_QueryMessageObject(), CRYPT_QuerySerializedStoreFromBlob(), CRYPT_QuerySerializedStoreFromFile(), CRYPT_RegControl(), CRYPT_RegOpenStore(), CRYPT_SerializedOpenStore(), CRYPT_SysOpenStoreW(), CRYPTDLG_IsCertAllowed(), CRYPTDLG_MakeEngine(), CryptGetMessageCertificates(), CryptMsgGetAndVerifySigner(), CryptVerifyDetachedMessageSignature(), CryptVerifyMessageSignature(), getChain(), import_crl(), import_ctl(), read_trusted_roots_from_known_locations(), save_cert_as_cms(), save_pfx(), show_cert_stores(), SOFTPUB_CreateStoreFromMessage(), SoftpubAuthenticode(), test_CERT_CHAIN_PARA_cbSize(), test_crypt_ui_wiz_import(), test_I_UpdateStore(), test_msg_get_and_verify_signer(), test_utils(), test_verifyRevocation(), testAddCert(), testAddCertificateLink(), testAddCRL(), testAddCTLToStore(), testAddSerialized(), testCertOpenSystemStore(), testCertRegisterSystemStore(), testCloseStore(), testCollectionStore(), testCreateCertChainEngine(), testDupCert(), testEmptyStore(), testFileNameStore(), testFileStore(), testFindCert(), testFindCRL(), testGetCertChain(), testGetCRLFromStore(), testGetIssuerCert(), testGetSubjectCert(), testIsValidCRLForCert(), 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 904 of file store.c.

906 {
907  if (!szSubSystemProtocol)
908  {
910  return 0;
911  }
913  CERT_SYSTEM_STORE_CURRENT_USER, szSubSystemProtocol);
914 }
static HCRYPTPROV hProv
Definition: rsaenh.c:32
#define E_INVALIDARG
Definition: ddrawi.h:101
#define SetLastError(x)
Definition: compat.h:417
#define CERT_SYSTEM_STORE_CURRENT_USER
Definition: wincrypt.h:2324
#define CERT_STORE_PROV_SYSTEM_A
Definition: wincrypt.h:2258
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:815

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

◆ CertOpenSystemStoreW()

HCERTSTORE WINAPI CertOpenSystemStoreW ( HCRYPTPROV_LEGACY  hProv,
LPCWSTR  szSubSystemProtocol 
)

Definition at line 916 of file store.c.

918 {
919  if (!szSubSystemProtocol)
920  {
922  return 0;
923  }
925  CERT_SYSTEM_STORE_CURRENT_USER, szSubSystemProtocol);
926 }
static HCRYPTPROV hProv
Definition: rsaenh.c:32
#define E_INVALIDARG
Definition: ddrawi.h:101
#define SetLastError(x)
Definition: compat.h:417
#define CERT_STORE_PROV_SYSTEM_W
Definition: wincrypt.h:2259
#define CERT_SYSTEM_STORE_CURRENT_USER
Definition: wincrypt.h:2324
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:815

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 1374 of file store.c.

1376 {
1378  FIXME("(%p, %08x, %s, %p, %p): stub\n", pvSystemStore, dwFlags,
1379  debugstr_w(pwszStoreName), pStoreInfo, pvReserved);
1380  else
1381  FIXME("(%s, %08x, %s, %p, %p): stub\n", debugstr_w(pvSystemStore),
1382  dwFlags, debugstr_w(pwszStoreName), pStoreInfo, pvReserved);
1383  return FALSE;
1384 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
static LPCSTR DWORD void * pvReserved
Definition: str.c:196
#define CERT_SYSTEM_STORE_RELOCATE_FLAG
Definition: wincrypt.h:2640
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ CertRegisterSystemStore()

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

Definition at line 1393 of file store.c.

1395 {
1396  HCERTSTORE hstore;
1397 
1399  {
1400  FIXME("(%p, %08x, %p, %p): flag not supported\n", pvSystemStore, dwFlags, pStoreInfo, pvReserved);
1401  return FALSE;
1402  }
1403 
1404  TRACE("(%s, %08x, %p, %p)\n", debugstr_w(pvSystemStore), dwFlags, pStoreInfo, pvReserved);
1405 
1406  hstore = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W, 0, 0, dwFlags, pvSystemStore);
1407  if (hstore)
1408  {
1409  CertCloseStore(hstore, 0);
1410  return TRUE;
1411  }
1412 
1413  return FALSE;
1414 }
#define TRUE
Definition: types.h:120
#define CERT_STORE_PROV_SYSTEM_REGISTRY_W
Definition: wincrypt.h:2263
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
Definition: store.c:1127
#define TRACE(s)
Definition: solgame.cpp:4
static LPCSTR DWORD void * pvReserved
Definition: str.c:196
#define CERT_SYSTEM_STORE_RELOCATE_FLAG
Definition: wincrypt.h:2640
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:815

Referenced by testCertRegisterSystemStore().

◆ CertSetStoreProperty()

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

Definition at line 1236 of file store.c.

1238 {
1239  WINECRYPT_CERTSTORE *store = hCertStore;
1240  BOOL ret = FALSE;
1241 
1242  TRACE("(%p, %d, %08x, %p)\n", hCertStore, dwPropId, dwFlags, pvData);
1243 
1244  if (!store->properties)
1246  switch (dwPropId)
1247  {
1250  break;
1251  default:
1252  if (pvData)
1253  {
1254  const CRYPT_DATA_BLOB *blob = pvData;
1255 
1257  blob->pbData, blob->cbData);
1258  }
1259  else
1260  {
1262  ret = TRUE;
1263  }
1264  }
1265  return ret;
1266 }
void ContextPropertyList_RemoveProperty(CONTEXT_PROPERTY_LIST *list, DWORD id) DECLSPEC_HIDDEN
Definition: proplist.c:149
#define TRUE
Definition: types.h:120
Definition: image.c:133
BOOL ContextPropertyList_SetProperty(CONTEXT_PROPERTY_LIST *list, DWORD id, const BYTE *pbData, size_t cbData) DECLSPEC_HIDDEN
Definition: proplist.c:95
#define CERT_ACCESS_STATE_PROP_ID
Definition: wincrypt.h:2700
unsigned int BOOL
Definition: ntddk_ex.h:94
#define E_INVALIDARG
Definition: ddrawi.h:101
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
#define TRACE(s)
Definition: solgame.cpp:4
CONTEXT_PROPERTY_LIST * properties
#define SetLastError(x)
Definition: compat.h:417
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
CONTEXT_PROPERTY_LIST * ContextPropertyList_Create(void) DECLSPEC_HIDDEN
Definition: proplist.c:43
_In_ DWORD dwPropId
Definition: wincrypt.h:4952

Referenced by testStoreProperty().

◆ CertUnregisterPhysicalStore()

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

Definition at line 1386 of file store.c.

1388 {
1389  FIXME("(%p, %08x, %s): stub\n", pvSystemStore, dwFlags, debugstr_w(pwszStoreName));
1390  return TRUE;
1391 }
#define TRUE
Definition: types.h:120
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ CertUnregisterSystemStore()

BOOL WINAPI CertUnregisterSystemStore ( const void pvSystemStore,
DWORD  dwFlags 
)

Definition at line 1416 of file store.c.

1417 {
1418  HCERTSTORE hstore;
1419 
1421  {
1422  FIXME("(%p, %08x): flag not supported\n", pvSystemStore, dwFlags);
1423  return FALSE;
1424  }
1425  TRACE("(%s, %08x)\n", debugstr_w(pvSystemStore), dwFlags);
1426 
1428  if (hstore == NULL)
1429  return FALSE;
1430 
1432  if (hstore == NULL && GetLastError() == 0)
1433  return TRUE;
1434 
1435  return FALSE;
1436 }
#define CERT_STORE_DELETE_FLAG
Definition: wincrypt.h:2455
#define TRUE
Definition: types.h:120
#define CERT_STORE_PROV_SYSTEM_REGISTRY_W
Definition: wincrypt.h:2263
#define CERT_STORE_OPEN_EXISTING_FLAG
Definition: wincrypt.h:2465
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define CERT_SYSTEM_STORE_RELOCATE_FLAG
Definition: wincrypt.h:2640
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:815

Referenced by testCertRegisterSystemStore().

◆ CRYPT_FreeStore()

void CRYPT_FreeStore ( WINECRYPT_CERTSTORE store)

Definition at line 101 of file store.c.

102 {
103  if (store->properties)
105  store->dwMagic = 0;
106  CryptMemFree(store);
107 }
void ContextPropertyList_Free(CONTEXT_PROPERTY_LIST *list) DECLSPEC_HIDDEN
Definition: proplist.c:56
CONTEXT_PROPERTY_LIST * properties
VOID WINAPI CryptMemFree(LPVOID pv)
Definition: main.c:141

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 91 of file store.c.

92 {
93  store->ref = 1;
95  store->type = type;
96  store->dwOpenFlags = dwFlags;
97  store->vtbl = vtbl;
98  store->properties = NULL;
99 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
smooth NULL
Definition: ftsmooth.c:416
CONTEXT_PROPERTY_LIST * properties
const store_vtbl_t * vtbl
#define WINE_CRYPTCERTSTORE_MAGIC
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

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 375 of file store.c.

377 {
378  WINE_MEMSTORE *store;
379 
380  TRACE("(%ld, %08x, %p)\n", hCryptProv, dwFlags, pvPara);
381 
383  {
385  store = NULL;
386  }
387  else
388  {
389  store = CryptMemAlloc(sizeof(WINE_MEMSTORE));
390  if (store)
391  {
392  memset(store, 0, sizeof(WINE_MEMSTORE));
394  InitializeCriticalSection(&store->cs);
395  store->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ContextList.cs");
396  list_init(&store->certs);
397  list_init(&store->crls);
398  list_init(&store->ctls);
399  /* Mem store doesn't need crypto provider, so close it */
400  if (hCryptProv && !(dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG))
401  CryptReleaseContext(hCryptProv, 0);
402  }
403  }
404  return (WINECRYPT_CERTSTORE*)store;
405 }
#define CERT_STORE_DELETE_FLAG
Definition: wincrypt.h:2455
#define DWORD_PTR
Definition: treelist.c:76
void CRYPT_InitStore(WINECRYPT_CERTSTORE *store, DWORD dwFlags, CertStoreType type, const store_vtbl_t *vtbl)
Definition: store.c:91
static const store_vtbl_t MemStoreVtbl
Definition: store.c:355
struct list crls
Definition: store.c:87
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
Definition: main.c:131
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
CRITICAL_SECTION cs
Definition: store.c:85
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define SetLastError(x)
Definition: compat.h:417
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:866
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, ULONG_PTR dwFlags)
Definition: crypt.c:651
#define CERT_STORE_NO_CRYPT_RELEASE_FLAG
Definition: wincrypt.h:2452
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
struct list ctls
Definition: store.c:88
_In_ void * pvPara
Definition: wincrypt.h:6081
struct list certs
Definition: store.c:86
#define memset(x, y, z)
Definition: compat.h:39
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:859
WINECRYPT_CERTSTORE hdr
Definition: store.c:84

Referenced by CertOpenStore().

◆ CRYPT_MsgCloseStore()

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

Definition at line 645 of file store.c.

646 {
647  HCRYPTMSG msg = hCertStore;
648 
649  TRACE("(%p, %08x)\n", msg, dwFlags);
651 }
#define TRACE(s)
Definition: solgame.cpp:4
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg)
Definition: msg.c:3598
#define msg(x)
Definition: auth_time.c:54

◆ CRYPT_MsgOpenStore()

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

Definition at line 657 of file store.c.

659 {
660  WINECRYPT_CERTSTORE *store = NULL;
662  WINECRYPT_CERTSTORE *memStore;
663 
664  TRACE("(%ld, %08x, %p)\n", hCryptProv, dwFlags, pvPara);
665 
666  memStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
668  if (memStore)
669  {
670  BOOL ret;
671  DWORD size, count, i;
672 
673  size = sizeof(count);
675  for (i = 0; ret && i < count; i++)
676  {
677  size = 0;
679  if (ret)
680  {
682 
683  if (buf)
684  {
686  if (ret)
689  NULL);
690  CryptMemFree(buf);
691  }
692  }
693  }
694  size = sizeof(count);
696  for (i = 0; ret && i < count; i++)
697  {
698  size = 0;
700  if (ret)
701  {
703 
704  if (buf)
705  {
707  if (ret)
708  ret = CertAddEncodedCRLToStore(memStore,
710  NULL);
711  CryptMemFree(buf);
712  }
713  }
714  }
715  if (ret)
716  {
717  CERT_STORE_PROV_INFO provInfo = { 0 };
718 
719  provInfo.cbSize = sizeof(provInfo);
721  provInfo.rgpvStoreProvFunc = msgProvFuncs;
722  provInfo.hStoreProv = CryptMsgDuplicate(msg);
723  store = CRYPT_ProvCreateStore(dwFlags, memStore, &provInfo);
724  /* Msg store doesn't need crypto provider, so close it */
725  if (hCryptProv && !(dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG))
726  CryptReleaseContext(hCryptProv, 0);
727  }
728  else
729  CertCloseStore(memStore, 0);
730  }
731  TRACE("returning %p\n", store);
732  return store;
733 }
HCRYPTMSG WINAPI CryptMsgDuplicate(HCRYPTMSG hCryptMsg)
Definition: msg.c:3585
#define CMSG_CRL_PARAM
Definition: wincrypt.h:3938
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CMSG_CERT_PARAM
Definition: wincrypt.h:3936
GLuint GLuint GLsizei count
Definition: gl.h:1545
BOOL WINAPI CertAddEncodedCertificateToStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded, DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext)
Definition: cert.c:58
HCERTSTOREPROV hStoreProv
Definition: wincrypt.h:1150
BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded, DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext)
Definition: crl.c:129
void * HCRYPTMSG
Definition: wincrypt.h:52
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
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
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
Definition: main.c:131
#define CMSG_CRL_COUNT_PARAM
Definition: wincrypt.h:3937
unsigned char * LPBYTE
Definition: typedefs.h:52
#define CERT_STORE_CREATE_NEW_FLAG
Definition: wincrypt.h:2464
unsigned int BOOL
Definition: ntddk_ex.h:94
WINECRYPT_CERTSTORE * CRYPT_ProvCreateStore(DWORD dwFlags, WINECRYPT_CERTSTORE *memStore, const CERT_STORE_PROV_INFO *pProvInfo) DECLSPEC_HIDDEN
Definition: provstore.c:307
void ** rgpvStoreProvFunc
Definition: wincrypt.h:1149
#define CERT_STORE_PROV_MEMORY
Definition: wincrypt.h:2251
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
Definition: store.c:1127
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CMSG_CERT_COUNT_PARAM
Definition: wincrypt.h:3935
static void * msgProvFuncs[]
Definition: store.c:653
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define ARRAY_SIZE(a)
Definition: main.h:24
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:815
VOID WINAPI CryptMemFree(LPVOID pv)
Definition: main.c:141
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, ULONG_PTR dwFlags)
Definition: crypt.c:651
#define msg(x)
Definition: auth_time.c:54
#define CERT_STORE_NO_CRYPT_RELEASE_FLAG
Definition: wincrypt.h:2452
BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, DWORD dwIndex, void *pvData, DWORD *pcbData)
Definition: msg.c:3627
_In_ void * pvPara
Definition: wincrypt.h:6081
#define CERT_STORE_ADD_ALWAYS
Definition: wincrypt.h:2485

Referenced by CertOpenStore(), and CRYPT_PKCSOpenStore().

◆ CRYPT_OpenParentStore()

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

Definition at line 1268 of file store.c.

1270 {
1271  HKEY root;
1272  LPCWSTR base;
1273 
1274  TRACE("(%08x, %p)\n", dwFlags, pvSystemStoreLocationPara);
1275 
1277  {
1281  break;
1285  break;
1287  /* hklm\Software\Microsoft\Cryptography\Services\servicename\
1288  * SystemCertificates
1289  */
1290  FIXME("CERT_SYSTEM_STORE_CURRENT_SERVICE\n");
1291  return ERROR_FILE_NOT_FOUND;
1293  /* hklm\Software\Microsoft\Cryptography\Services\servicename\
1294  * SystemCertificates
1295  */
1296  FIXME("CERT_SYSTEM_STORE_SERVICES\n");
1297  return ERROR_FILE_NOT_FOUND;
1299  /* hku\user sid\Software\Microsoft\SystemCertificates */
1300  FIXME("CERT_SYSTEM_STORE_USERS\n");
1301  return ERROR_FILE_NOT_FOUND;
1305  break;
1309  break;
1311  /* hklm\Software\Microsoft\EnterpriseCertificates */
1312  FIXME("CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE\n");
1313  return ERROR_FILE_NOT_FOUND;
1314  default:
1315  return ERROR_FILE_NOT_FOUND;
1316  }
1317 
1318  return RegOpenKeyExW(root, base, 0, KEY_READ, key);
1319 }
#define CERT_SYSTEM_STORE_CURRENT_SERVICE
Definition: wincrypt.h:2328
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
struct _root root
#define CERT_SYSTEM_STORE_USERS
Definition: wincrypt.h:2332
#define CERT_SYSTEM_STORE_LOCAL_MACHINE
Definition: wincrypt.h:2326
static const WCHAR CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH[]
Definition: wincrypt.h:2356
GLuint base
Definition: 3dtext.c:35
#define FIXME(fmt,...)
Definition: debug.h:110
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define TRACE(s)
Definition: solgame.cpp:4
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE
Definition: wincrypt.h:2338
#define CERT_SYSTEM_STORE_LOCATION_MASK
Definition: wincrypt.h:2303
#define CERT_SYSTEM_STORE_CURRENT_USER
Definition: wincrypt.h:2324
#define CERT_SYSTEM_STORE_SERVICES
Definition: wincrypt.h:2330
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
static const WCHAR CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH[]
Definition: wincrypt.h:2359
#define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY
Definition: wincrypt.h:2336
#define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY
Definition: wincrypt.h:2334
Definition: path.c:41
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by CertEnumSystemStore().

◆ CRYPT_PhysOpenStoreW()

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

Definition at line 804 of file store.c.

806 {
808  FIXME("(%ld, %08x, %p): stub\n", hCryptProv, dwFlags, pvPara);
809  else
810  FIXME("(%ld, %08x, %s): stub\n", hCryptProv, dwFlags,
811  debugstr_w(pvPara));
812  return NULL;
813 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define CERT_SYSTEM_STORE_RELOCATE_FLAG
Definition: wincrypt.h:2640
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
_In_ void * pvPara
Definition: wincrypt.h:6081

Referenced by CertOpenStore().

◆ CRYPT_PKCSOpenStore()

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

Definition at line 735 of file store.c.

737 {
738  HCRYPTMSG msg;
739  WINECRYPT_CERTSTORE *store = NULL;
740  const CRYPT_DATA_BLOB *data = pvPara;
741  BOOL ret;
742  DWORD msgOpenFlags = dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG ? 0 :
744 
745  TRACE("(%ld, %08x, %p)\n", hCryptProv, dwFlags, pvPara);
746 
748  hCryptProv, NULL, NULL);
749  ret = CryptMsgUpdate(msg, data->pbData, data->cbData, TRUE);
750  if (!ret)
751  {
753  msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, msgOpenFlags, 0,
754  hCryptProv, NULL, NULL);
755  ret = CryptMsgUpdate(msg, data->pbData, data->cbData, TRUE);
756  if (ret)
757  {
758  DWORD type, size = sizeof(type);
759 
760  /* Only signed messages are allowed, check type */
762  if (ret && type != CMSG_SIGNED)
763  {
765  ret = FALSE;
766  }
767  }
768  }
769  if (ret)
770  store = CRYPT_MsgOpenStore(0, dwFlags, msg);
772  TRACE("returning %p\n", store);
773  return store;
774 }
#define TRUE
Definition: types.h:120
#define CMSG_SIGNED
Definition: wincrypt.h:3680
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define PKCS_7_ASN_ENCODING
Definition: wincrypt.h:2299
HCRYPTMSG WINAPI CryptMsgOpenToDecode(DWORD dwMsgEncodingType, DWORD dwFlags, DWORD dwMsgType, HCRYPTPROV_LEGACY hCryptProv, PCERT_INFO pRecipientInfo, PCMSG_STREAM_INFO pStreamInfo)
Definition: msg.c:3553
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define CRYPT_E_INVALID_MSG_TYPE
Definition: winerror.h:2988
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static WINECRYPT_CERTSTORE * CRYPT_MsgOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:657
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define CMSG_TYPE_PARAM
Definition: wincrypt.h:3925
BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg)
Definition: msg.c:3598
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData, DWORD cbData, BOOL fFinal)
Definition: msg.c:3617
#define CERT_STORE_NO_CRYPT_RELEASE_FLAG
Definition: wincrypt.h:2452
BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, DWORD dwIndex, void *pvData, DWORD *pcbData)
Definition: msg.c:3627
#define CMSG_CRYPT_RELEASE_CONTEXT_FLAG
Definition: wincrypt.h:3867
_In_ void * pvPara
Definition: wincrypt.h:6081

Referenced by CertOpenStore().

◆ CRYPT_SerializedOpenStore()

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

Definition at line 776 of file store.c.

778 {
779  HCERTSTORE store;
780  const CRYPT_DATA_BLOB *data = pvPara;
781 
782  TRACE("(%ld, %08x, %p)\n", hCryptProv, dwFlags, pvPara);
783 
785  {
787  return NULL;
788  }
789 
792  if (store)
793  {
795  {
796  CertCloseStore(store, 0);
797  store = NULL;
798  }
799  }
800  TRACE("returning %p\n", store);
801  return (WINECRYPT_CERTSTORE*)store;
802 }
#define CERT_STORE_DELETE_FLAG
Definition: wincrypt.h:2455
#define CERT_STORE_CREATE_NEW_FLAG
Definition: wincrypt.h:2464
#define CERT_STORE_PROV_MEMORY
Definition: wincrypt.h:2251
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
Definition: store.c:1127
#define TRACE(s)
Definition: solgame.cpp:4
#define SetLastError(x)
Definition: compat.h:417
BOOL CRYPT_ReadSerializedStoreFromBlob(const CRYPT_DATA_BLOB *blob, HCERTSTORE store) DECLSPEC_HIDDEN
Definition: serialize.c:578
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:815
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
_In_ void * pvPara
Definition: wincrypt.h:6081

Referenced by CertOpenStore().

◆ CRYPT_SysOpenStoreA()

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

Definition at line 616 of file store.c.

618 {
619  int len;
621 
622  TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags,
623  debugstr_a(pvPara));
624 
625  if (!pvPara)
626  {
628  return NULL;
629  }
630  len = MultiByteToWideChar(CP_ACP, 0, pvPara, -1, NULL, 0);
631  if (len)
632  {
633  LPWSTR storeName = CryptMemAlloc(len * sizeof(WCHAR));
634 
635  if (storeName)
636  {
637  MultiByteToWideChar(CP_ACP, 0, pvPara, -1, storeName, len);
638  ret = CRYPT_SysOpenStoreW(hCryptProv, dwFlags, storeName);
639  CryptMemFree(storeName);
640  }
641  }
642  return ret;
643 }
#define CP_ACP
Definition: compat.h:99
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
Definition: main.c:131
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
#define SetLastError(x)
Definition: compat.h:417
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
GLenum GLsizei len
Definition: glext.h:6722
static WINECRYPT_CERTSTORE * CRYPT_SysOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:544
#define MultiByteToWideChar
Definition: compat.h:100
VOID WINAPI CryptMemFree(LPVOID pv)
Definition: main.c:141
_In_ void * pvPara
Definition: wincrypt.h:6081
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CertOpenStore().

◆ CRYPT_SysOpenStoreW()

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

Definition at line 544 of file store.c.

546 {
547  HCERTSTORE store = 0;
548  BOOL ret;
549 
550  TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags,
551  debugstr_w(pvPara));
552 
553  if (!pvPara)
554  {
556  return NULL;
557  }
558  /* This returns a different error than system registry stores if the
559  * location is invalid.
560  */
562  {
571  ret = TRUE;
572  break;
573  default:
575  ret = FALSE;
576  }
577  if (ret)
578  {
580  0, 0, dwFlags, pvPara);
581 
582  if (regStore)
583  {
586  CertAddStoreToCollection(store, regStore,
589  CertCloseStore(regStore, 0);
590  /* CERT_SYSTEM_STORE_CURRENT_USER returns both the HKCU and HKLM
591  * stores.
592  */
595  {
599  0, dwFlags, pvPara);
600  if (regStore)
601  {
602  CertAddStoreToCollection(store, regStore,
605  CertCloseStore(regStore, 0);
606  }
607  }
608  /* System store doesn't need crypto provider, so close it */
609  if (hCryptProv && !(dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG))
610  CryptReleaseContext(hCryptProv, 0);
611  }
612  }
613  return store;
614 }
#define CERT_SYSTEM_STORE_CURRENT_SERVICE
Definition: wincrypt.h:2328
#define TRUE
Definition: types.h:120
#define CERT_STORE_PROV_SYSTEM_REGISTRY_W
Definition: wincrypt.h:2263
#define CERT_SYSTEM_STORE_USERS
Definition: wincrypt.h:2332
BOOL WINAPI CertAddStoreToCollection(HCERTSTORE hCollectionStore, HCERTSTORE hSiblingStore, DWORD dwUpdateFlags, DWORD dwPriority)
#define CERT_STORE_PROV_COLLECTION
Definition: wincrypt.h:2261
#define CERT_SYSTEM_STORE_LOCAL_MACHINE
Definition: wincrypt.h:2326
#define CERT_STORE_CREATE_NEW_FLAG
Definition: wincrypt.h:2464
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
Definition: store.c:1127
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define TRACE(s)
Definition: solgame.cpp:4
#define SetLastError(x)
Definition: compat.h:417
#define CERT_STORE_READONLY_FLAG
Definition: wincrypt.h:2466
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE
Definition: wincrypt.h:2338
#define CERT_SYSTEM_STORE_LOCATION_MASK
Definition: wincrypt.h:2303
#define CERT_SYSTEM_STORE_CURRENT_USER
Definition: wincrypt.h:2324
#define CERT_SYSTEM_STORE_SERVICES
Definition: wincrypt.h:2330
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:815
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, ULONG_PTR dwFlags)
Definition: crypt.c:651
#define CERT_STORE_NO_CRYPT_RELEASE_FLAG
Definition: wincrypt.h:2452
_In_ void * pvPara
Definition: wincrypt.h:6081
#define CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG
Definition: wincrypt.h:2580
#define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY
Definition: wincrypt.h:2336
#define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY
Definition: wincrypt.h:2334

Referenced by CertOpenStore(), and CRYPT_SysOpenStoreA().

◆ CRYPT_SysRegOpenStoreA()

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

Definition at line 515 of file store.c.

517 {
518  int len;
520 
521  TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags,
522  debugstr_a(pvPara));
523 
524  if (!pvPara)
525  {
527  return NULL;
528  }
529  len = MultiByteToWideChar(CP_ACP, 0, pvPara, -1, NULL, 0);
530  if (len)
531  {
532  LPWSTR storeName = CryptMemAlloc(len * sizeof(WCHAR));
533 
534  if (storeName)
535  {
536  MultiByteToWideChar(CP_ACP, 0, pvPara, -1, storeName, len);
537  ret = CRYPT_SysRegOpenStoreW(hCryptProv, dwFlags, storeName);
538  CryptMemFree(storeName);
539  }
540  }
541  return ret;
542 }
#define CP_ACP
Definition: compat.h:99
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
Definition: main.c:131
static WINECRYPT_CERTSTORE * CRYPT_SysRegOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:409
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
#define SetLastError(x)
Definition: compat.h:417
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
VOID WINAPI CryptMemFree(LPVOID pv)
Definition: main.c:141
_In_ void * pvPara
Definition: wincrypt.h:6081
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CertOpenStore().

◆ CRYPT_SysRegOpenStoreW()

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

Definition at line 409 of file store.c.

411 {
412  static const WCHAR fmt[] = { '%','s','\\','%','s',0 };
413  LPCWSTR storeName = pvPara;
414  LPWSTR storePath;
415  WINECRYPT_CERTSTORE *store = NULL;
416  HKEY root;
417  LPCWSTR base;
418 
419  TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags,
420  debugstr_w(pvPara));
421 
422  if (!pvPara)
423  {
425  return NULL;
426  }
427 
429  {
433  /* If the HKLM\Root certs are requested, expressing system certs into the registry */
434  if (!lstrcmpiW(storeName, rootW))
436  break;
440  break;
442  /* hklm\Software\Microsoft\Cryptography\Services\servicename\
443  * SystemCertificates
444  */
445  FIXME("CERT_SYSTEM_STORE_CURRENT_SERVICE, %s: stub\n",
446  debugstr_w(storeName));
447  return NULL;
449  /* hklm\Software\Microsoft\Cryptography\Services\servicename\
450  * SystemCertificates
451  */
452  FIXME("CERT_SYSTEM_STORE_SERVICES, %s: stub\n",
453  debugstr_w(storeName));
454  return NULL;
456  /* hku\user sid\Software\Microsoft\SystemCertificates */
457  FIXME("CERT_SYSTEM_STORE_USERS, %s: stub\n",
458  debugstr_w(storeName));
459  return NULL;
463  break;
467  break;
469  /* hklm\Software\Microsoft\EnterpriseCertificates */
470  FIXME("CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE, %s: stub\n",
471  debugstr_w(storeName));
472  return NULL;
473  default:
475  return NULL;
476  }
477 
478  storePath = CryptMemAlloc((lstrlenW(base) + lstrlenW(storeName) + 2) *
479  sizeof(WCHAR));
480  if (storePath)
481  {
482  LONG rc;
483  HKEY key;
486 
487  wsprintfW(storePath, fmt, base, storeName);
489  rc = RegOpenKeyExW(root, storePath, 0, sam, &key);
490  else
491  {
492  DWORD disp;
493 
494  rc = RegCreateKeyExW(root, storePath, 0, NULL, 0, sam, NULL,
495  &key, &disp);
496  if (!rc && dwFlags & CERT_STORE_CREATE_NEW_FLAG &&
498  {
499  RegCloseKey(key);
500  rc = ERROR_FILE_EXISTS;
501  }
502  }
503  if (!rc)
504  {
505  store = CRYPT_RegOpenStore(hCryptProv, dwFlags, key);
506  RegCloseKey(key);
507  }
508  else
509  SetLastError(rc);
510  CryptMemFree(storePath);
511  }
512  return store;
513 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define CERT_SYSTEM_STORE_CURRENT_SERVICE
Definition: wincrypt.h:2328
disp
Definition: i386-dis.c:3181
#define ERROR_FILE_EXISTS
Definition: winerror.h:165
static const WCHAR rootW[]
Definition: store.c:407
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
struct _root root
#define CERT_STORE_OPEN_EXISTING_FLAG
Definition: wincrypt.h:2465
#define CERT_SYSTEM_STORE_USERS
Definition: wincrypt.h:2332
#define REG_OPENED_EXISTING_KEY
Definition: nt_native.h:1085
#define lstrlenW
Definition: compat.h:415
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:1091
#define CERT_SYSTEM_STORE_LOCAL_MACHINE
Definition: wincrypt.h:2326
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
static const WCHAR CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH[]
Definition: wincrypt.h:2356
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
Definition: main.c:131
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CERT_STORE_CREATE_NEW_FLAG
Definition: wincrypt.h:2464
GLuint base
Definition: 3dtext.c:35
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
HKEY key
Definition: store.c:343
#define CERT_STORE_READONLY_FLAG
Definition: wincrypt.h:2466
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE
Definition: wincrypt.h:2338
#define CERT_SYSTEM_STORE_LOCATION_MASK
Definition: wincrypt.h:2303
void CRYPT_ImportSystemRootCertsToReg(void) DECLSPEC_HIDDEN
Definition: rootstore.c:1044
#define CERT_SYSTEM_STORE_CURRENT_USER
Definition: wincrypt.h:2324
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
ACCESS_MASK REGSAM
Definition: winreg.h:69
#define CERT_SYSTEM_STORE_SERVICES
Definition: wincrypt.h:2330
WINECRYPT_CERTSTORE * CRYPT_RegOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN
Definition: regstore.c:512
VOID WINAPI CryptMemFree(LPVOID pv)
Definition: main.c:141
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
_In_ void * pvPara
Definition: wincrypt.h:6081
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static const WCHAR CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH[]
Definition: wincrypt.h:2359
Definition: dsound.c:943
#define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY
Definition: wincrypt.h:2336
#define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY
Definition: wincrypt.h:2334
Definition: path.c:41
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

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 1454 of file store.c.

1456 {
1457  TRACE("(%p, %p, %p, %p)\n", store, context, replace, ret_context);
1458 
1459  /* FIXME: We should clone the context */
1460  if(ret_context) {
1462  *ret_context = context;
1463  }
1464 
1465  return TRUE;
1466 }
#define TRUE
Definition: types.h:120
Definition: http.c:7098
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:47
#define TRACE(s)
Definition: solgame.cpp:4

◆ EmptyStore_addref()

static void EmptyStore_addref ( WINECRYPT_CERTSTORE store)
static

Definition at line 1438 of file store.c.

1439 {
1440  TRACE("(%p)\n", store);
1441 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ EmptyStore_control()

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

Definition at line 1481 of file store.c.

1482 {
1483  TRACE("()\n");
1484 
1486  return FALSE;
1487 }
#define TRACE(s)
Definition: solgame.cpp:4
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ EmptyStore_delete()

static BOOL EmptyStore_delete ( WINECRYPT_CERTSTORE store,
context_t context 
)
static

Definition at line 1476 of file store.c.

1477 {
1478  return TRUE;
1479 }
#define TRUE
Definition: types.h:120

◆ EmptyStore_enum()

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

Definition at line 1468 of file store.c.

1469 {
1470  TRACE("(%p, %p)\n", store, prev);
1471 
1473  return NULL;
1474 }
#define CRYPT_E_NOT_FOUND
Definition: winerror.h:3007
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define SetLastError(x)
Definition: compat.h:417

◆ EmptyStore_release()

static DWORD EmptyStore_release ( WINECRYPT_CERTSTORE store,
DWORD  flags 
)
static

Definition at line 1443 of file store.c.

1444 {
1445  TRACE("(%p)\n", store);
1446  return E_UNEXPECTED;
1447 }
#define TRACE(s)
Definition: solgame.cpp:4
#define E_UNEXPECTED
Definition: winerror.h:2456

◆ EmptyStore_releaseContext()

static void EmptyStore_releaseContext ( WINECRYPT_CERTSTORE store,
context_t context 
)
static

Definition at line 1449 of file store.c.

1450 {
1452 }
Definition: http.c:7098
void Context_Free(context_t *context)
Definition: context.c:90

◆ free_contexts()

static void free_contexts ( struct list list)
static

Definition at line 218 of file store.c.

219 {
221 
223  {
224  TRACE("freeing %p\n", context);
225  list_remove(&context->u.entry);
227  }
228 }
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
Definition: http.c:7098
void Context_Free(context_t *context)
Definition: context.c:90
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
Definition: _list.h:228
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 109 of file store.c.

111 {
112  static BOOL warned = FALSE;
113  const WINE_CONTEXT_INTERFACE * const interfaces[] = { pCertInterface,
115  DWORD i;
116 
117  TRACE("(%p, %p, %08x, %08x)\n", store1, store2, unk0, unk1);
118  if (!warned)
119  {
120  FIXME("semi-stub\n");
121  warned = TRUE;
122  }
123 
124  /* Poor-man's resync: empty first store, then add everything from second
125  * store to it.
126  */
127  for (i = 0; i < ARRAY_SIZE(interfaces); i++)
128  {
129  const void *context;
130 
131  do {
132  context = interfaces[i]->enumContextsInStore(store1, NULL);
133  if (context)
134  interfaces[i]->deleteFromStore(context);
135  } while (context);
136  do {
137  context = interfaces[i]->enumContextsInStore(store2, context);
138  if (context)
139  interfaces[i]->addContextToStore(store1, context,
141  } while (context);
142  }
143  return TRUE;
144 }
const WINE_CONTEXT_INTERFACE * pCRLInterface
Definition: store.c:67
#define TRUE
Definition: types.h:120
DeleteContextFunc deleteFromStore
Definition: http.c:7098
const WINE_CONTEXT_INTERFACE * pCTLInterface
Definition: store.c:80
static DWORD unk1
Definition: cursoricon.c:1638
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
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
AddContextToStoreFunc addContextToStore
EnumContextsInStoreFunc enumContextsInStore
#define ARRAY_SIZE(a)
Definition: main.h:24
const WINE_CONTEXT_INTERFACE * pCertInterface
Definition: store.c:54
#define CERT_STORE_ADD_ALWAYS
Definition: wincrypt.h:2485

Referenced by CRYPT_FileControl(), and CRYPT_RegControl().

◆ init_empty_store()

void init_empty_store ( void  )

Definition at line 1511 of file store.c.

1512 {
1514 }
WINECRYPT_CERTSTORE empty_store
Definition: store.c:1509
void CRYPT_InitStore(WINECRYPT_CERTSTORE *store, DWORD dwFlags, CertStoreType type, const store_vtbl_t *vtbl)
Definition: store.c:91
static const store_vtbl_t EmptyStoreVtbl
Definition: store.c:1489
#define CERT_STORE_READONLY_FLAG
Definition: wincrypt.h:2466

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 237 of file store.c.

239 {
240  WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
241 
242  TRACE("(%p, %p, %p, %p)\n", store, cert, toReplace, ppStoreContext);
243  return MemStore_addContext(ms, &ms->certs, cert, toReplace, ppStoreContext, use_link);
244 }
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:146
_In_ PCCERT_CONTEXT _In_ DWORD _Outptr_opt_ PCCERT_CONTEXT * ppStoreContext
Definition: wincrypt.h:4987
static BYTE cert[]
Definition: msg.c:1437
#define TRACE(s)
Definition: solgame.cpp:4
struct list certs
Definition: store.c:86

◆ 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 146 of file store.c.

148 {
150 
151  context = orig_context->vtbl->clone(orig_context, &store->hdr, use_link);
152  if (!context)
153  return FALSE;
154 
155  TRACE("adding %p\n", context);
156  EnterCriticalSection(&store->cs);
157  if (existing) {
158  context->u.entry.prev = existing->u.entry.prev;
159  context->u.entry.next = existing->u.entry.next;
160  context->u.entry.prev->next = &context->u.entry;
161  context->u.entry.next->prev = &context->u.entry;
162  list_init(&existing->u.entry);
163  if(!existing->ref)
164  Context_Release(existing);
165  }else {
166  list_add_head(list, &context->u.entry);
167  }
168  LeaveCriticalSection(&store->cs);
169 
170  if(ret_context)
171  *ret_context = context;
172  else
174  return TRUE;
175 }
#define TRUE
Definition: types.h:120
struct list entry
Definition: http.c:7098
const context_vtbl_t * vtbl
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
union _context_t::@341 u
void Context_Release(context_t *context)
Definition: context.c:106
CRITICAL_SECTION cs
Definition: store.c:85
#define TRACE(s)
Definition: solgame.cpp:4
Definition: _list.h:228
struct _context_t *(* clone)(context_t *, struct WINE_CRYPTCERTSTORE *, BOOL)
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
WINECRYPT_CERTSTORE hdr
Definition: store.c:84

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 264 of file store.c.

266 {
267  WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
268 
269  TRACE("(%p, %p, %p, %p)\n", store, crl, toReplace, ppStoreContext);
270 
271  return MemStore_addContext(ms, &ms->crls, crl, toReplace, ppStoreContext, use_link);
272 }
static const BYTE crl[]
Definition: message.c:864
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:146
struct list crls
Definition: store.c:87
_In_ PCCERT_CONTEXT _In_ DWORD _Outptr_opt_ PCCERT_CONTEXT * ppStoreContext
Definition: wincrypt.h:4987
#define TRACE(s)
Definition: solgame.cpp:4

◆ 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 292 of file store.c.

294 {
295  WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
296 
297  TRACE("(%p, %p, %p, %p)\n", store, ctl, toReplace, ppStoreContext);
298 
299  return MemStore_addContext(ms, &ms->ctls, ctl, toReplace, ppStoreContext, use_link);
300 }
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:146
_In_ PCCERT_CONTEXT _In_ DWORD _Outptr_opt_ PCCERT_CONTEXT * ppStoreContext
Definition: wincrypt.h:4987
#define TRACE(s)
Definition: solgame.cpp:4
struct list ctls
Definition: store.c:88

◆ MemStore_addref()

static void MemStore_addref ( WINECRYPT_CERTSTORE store)
static

Definition at line 320 of file store.c.

321 {
322  LONG ref = InterlockedIncrement(&store->ref);
323  TRACE("ref = %d\n", ref);
324 }
Definition: send.c:47
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53

◆ MemStore_control()

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

Definition at line 348 of file store.c.

350 {
352  return FALSE;
353 }
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ MemStore_deleteCert()

static BOOL MemStore_deleteCert ( WINECRYPT_CERTSTORE store,
context_t context 
)
static

Definition at line 255 of file store.c.

256 {
257  WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
258 
259  TRACE("(%p, %p)\n", store, context);
260 
261  return MemStore_deleteContext(ms, context);
262 }
Definition: http.c:7098
static BOOL MemStore_deleteContext(WINE_MEMSTORE *store, context_t *context)
Definition: store.c:201
#define TRACE(s)
Definition: solgame.cpp:4

◆ MemStore_deleteContext()

static BOOL MemStore_deleteContext ( WINE_MEMSTORE store,
context_t context 
)
static

Definition at line 201 of file store.c.

202 {
203  BOOL in_list = FALSE;
204 
205  EnterCriticalSection(&store->cs);
206  if (!list_empty(&context->u.entry)) {
207  list_remove(&context->u.entry);
208  list_init(&context->u.entry);
209  in_list = TRUE;
210  }
211  LeaveCriticalSection(&store->cs);
212 
213  if(in_list && !context->ref)
215  return TRUE;
216 }
#define TRUE
Definition: types.h:120
Definition: http.c:7098
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
unsigned int BOOL
Definition: ntddk_ex.h:94
CRITICAL_SECTION cs
Definition: store.c:85
void Context_Free(context_t *context)
Definition: context.c:90
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

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 283 of file store.c.

284 {
285  WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
286 
287  TRACE("(%p, %p)\n", store, context);
288 
289  return MemStore_deleteContext(ms, context);
290 }
Definition: http.c:7098
static BOOL MemStore_deleteContext(WINE_MEMSTORE *store, context_t *context)
Definition: store.c:201
#define TRACE(s)
Definition: solgame.cpp:4

◆ MemStore_deleteCTL()

static BOOL MemStore_deleteCTL ( WINECRYPT_CERTSTORE store,
context_t context 
)
static

Definition at line 311 of file store.c.

312 {
313  WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
314 
315  TRACE("(%p, %p)\n", store, context);
316 
317  return MemStore_deleteContext(ms, context);
318 }
Definition: http.c:7098
static BOOL MemStore_deleteContext(WINE_MEMSTORE *store, context_t *context)
Definition: store.c:201
#define TRACE(s)
Definition: solgame.cpp:4

◆ MemStore_enumCert()

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

Definition at line 246 of file store.c.

247 {
248  WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
249 
250  TRACE("(%p, %p)\n", store, prev);
251 
252  return MemStore_enumContext(ms, &ms->certs, prev);
253 }
#define TRACE(s)
Definition: solgame.cpp:4
static context_t * MemStore_enumContext(WINE_MEMSTORE *store, struct list *list, context_t *prev)
Definition: store.c:177
struct list certs
Definition: store.c:86

◆ MemStore_enumContext()

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

Definition at line 177 of file store.c.

178 {
179  struct list *next;
180  context_t *ret;
181 
182  EnterCriticalSection(&store->cs);
183  if (prev) {
184  next = list_next(list, &prev->u.entry);
186  }else {
187  next = list_next(list, list);
188  }
189  LeaveCriticalSection(&store->cs);
190 
191  if (!next) {
193  return NULL;
194  }
195 
196  ret = LIST_ENTRY(next, context_t, u.entry);
198  return ret;
199 }
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
struct list * prev
Definition: list.h:39
#define CRYPT_E_NOT_FOUND
Definition: winerror.h:3007
void Context_AddRef(context_t *context)
Definition: context.c:78
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void Context_Release(context_t *context)
Definition: context.c:106
CRITICAL_SECTION cs
Definition: store.c:85
smooth NULL
Definition: ftsmooth.c:416
#define SetLastError(x)
Definition: compat.h:417
int ret
Definition: _list.h:228
static unsigned __int64 next
Definition: rand_nt.c:6
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:115
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#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 274 of file store.c.

275 {
276  WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
277 
278  TRACE("(%p, %p)\n", store, prev);
279 
280  return MemStore_enumContext(ms, &ms->crls, prev);
281 }
struct list * prev
Definition: list.h:39
struct list crls
Definition: store.c:87
#define TRACE(s)
Definition: solgame.cpp:4
static context_t * MemStore_enumContext(WINE_MEMSTORE *store, struct list *list, context_t *prev)
Definition: store.c:177

◆ MemStore_enumCTL()

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

Definition at line 302 of file store.c.

303 {
304  WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
305 
306  TRACE("(%p, %p)\n", store, prev);
307 
308  return MemStore_enumContext(ms, &ms->ctls, prev);
309 }
struct list * prev
Definition: list.h:39
#define TRACE(s)
Definition: solgame.cpp:4
struct list ctls
Definition: store.c:88
static context_t * MemStore_enumContext(WINE_MEMSTORE *store, struct list *list, context_t *prev)
Definition: store.c:177

◆ MemStore_release()

static DWORD MemStore_release ( WINECRYPT_CERTSTORE cert_store,
DWORD  flags 
)
static

Definition at line 326 of file store.c.

327 {
329  LONG ref;
330 
332  FIXME("Unimplemented flags %x\n", flags);
333 
334  ref = InterlockedDecrement(&store->hdr.ref);
335  TRACE("(%p) ref=%d\n", store, ref);
336  if(ref)
338 
339  free_contexts(&store->certs);
340  free_contexts(&store->crls);
341  free_contexts(&store->ctls);
342  store->cs.DebugInfo->Spare[0] = 0;
343  DeleteCriticalSection(&store->cs);
344  CRYPT_FreeStore(&store->hdr);
345  return ERROR_SUCCESS;
346 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static void free_contexts(struct list *list)
Definition: store.c:218
Definition: send.c:47
struct list crls
Definition: store.c:87
void CRYPT_FreeStore(WINECRYPT_CERTSTORE *store)
Definition: store.c:101
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define FIXME(fmt,...)
Definition: debug.h:110
CRITICAL_SECTION cs
Definition: store.c:85
#define TRACE(s)
Definition: solgame.cpp:4
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:866
GLbitfield flags
Definition: glext.h:7161
#define InterlockedDecrement
Definition: armddk.h:52
#define CRYPT_E_PENDING_CLOSE
Definition: winerror.h:3018
DWORD cert_store
Definition: store.c:344
struct list ctls
Definition: store.c:88
struct list certs
Definition: store.c:86
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:859
WINECRYPT_CERTSTORE hdr
Definition: store.c:84
#define CERT_CLOSE_STORE_CHECK_FLAG
Definition: wincrypt.h:2479

◆ MemStore_releaseContext()

static void MemStore_releaseContext ( WINECRYPT_CERTSTORE store,
context_t context 
)
static

Definition at line 230 of file store.c.

231 {
232  /* Free the context only if it's not in a list. Otherwise it may be reused later. */
233  if(list_empty(&context->u.entry))
235 }
Definition: http.c:7098
void Context_Free(context_t *context)
Definition: context.c:90
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143

◆ 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:1468
static BOOL EmptyStore_control(WINECRYPT_CERTSTORE *store, DWORD flags, DWORD ctrl_type, void const *ctrl_para)
Definition: store.c:1481
static void EmptyStore_releaseContext(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:1449
static BOOL EmptyStore_add(WINECRYPT_CERTSTORE *store, context_t *context, context_t *replace, context_t **ret_context, BOOL use_link)
Definition: store.c:1454
static DWORD EmptyStore_release(WINECRYPT_CERTSTORE *store, DWORD flags)
Definition: store.c:1443
static BOOL EmptyStore_delete(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:1476
static void EmptyStore_addref(WINECRYPT_CERTSTORE *store)
Definition: store.c:1438

Definition at line 1489 of file store.c.

Referenced by init_empty_store().

◆ gCertInterface

const WINE_CONTEXT_INTERFACE gCertInterface
static
Initial value:
= {
}
BOOL(WINAPI * AddContextToStoreFunc)(HCERTSTORE hCertStore, const void *context, DWORD dwAddDisposition, const void **ppStoreContext)
BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition, PCCERT_CONTEXT *ppStoreContext)
Definition: cert.c:286
BOOL WINAPI CertAddEncodedCertificateToStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded, DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext)
Definition: cert.c:58
BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: cert.c:551
BOOL(WINAPI * SerializeElementFunc)(const void *context, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext)
Definition: store.c:943
DWORD WINAPI CertEnumCertificateContextProperties(PCCERT_CONTEXT pCertContext, DWORD dwPropId)
Definition: cert.c:380
BOOL(WINAPI * GetContextPropertyFunc)(const void *context, DWORD dwPropID, void *pvData, DWORD *pcbData)
BOOL(WINAPI * AddEncodedContextToStoreFunc)(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwAddDisposition, const void **ppContext)
PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded)
Definition: cert.c:316
BOOL(WINAPI * SetContextPropertyFunc)(const void *context, DWORD dwPropID, DWORD dwFlags, const void *pvData)
DWORD(WINAPI * EnumPropertiesFunc)(const void *context, DWORD dwPropId)
PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrev)
Definition: store.c:928
const void *(WINAPI * EnumContextsInStoreFunc)(HCERTSTORE hCertStore, const void *pPrevContext)
BOOL(WINAPI * DeleteContextFunc)(const void *contex)
const void *(WINAPI * CreateContextFunc)(DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded)
BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
Definition: serialize.c:144
BOOL WINAPI CertSetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: cert.c:799

Definition at line 43 of file store.c.

◆ gCRLInterface

const WINE_CONTEXT_INTERFACE gCRLInterface
static
Initial value:
= {
}
BOOL(WINAPI * AddContextToStoreFunc)(HCERTSTORE hCertStore, const void *context, DWORD dwAddDisposition, const void **ppStoreContext)
BOOL WINAPI CertSetCRLContextProperty(PCCRL_CONTEXT pCRLContext, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: crl.c:566
PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore, PCCRL_CONTEXT pPrev)
Definition: store.c:1101
BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: crl.c:472
BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded, DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext)
Definition: crl.c:129
BOOL(WINAPI * SerializeElementFunc)(const void *context, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
BOOL(WINAPI * GetContextPropertyFunc)(const void *context, DWORD dwPropID, void *pvData, DWORD *pcbData)
BOOL WINAPI CertSerializeCRLStoreElement(PCCRL_CONTEXT pCrlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
Definition: serialize.c:152
PCCRL_CONTEXT WINAPI CertCreateCRLContext(DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded)
Definition: crl.c:85
BOOL(WINAPI * AddEncodedContextToStoreFunc)(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwAddDisposition, const void **ppContext)
DWORD WINAPI CertEnumCRLContextProperties(PCCRL_CONTEXT pCRLContext, DWORD dwPropId)
Definition: crl.c:395
BOOL(WINAPI * SetContextPropertyFunc)(const void *context, DWORD dwPropID, DWORD dwFlags, const void *pvData)
DWORD(WINAPI * EnumPropertiesFunc)(const void *context, DWORD dwPropId)
const void *(WINAPI * EnumContextsInStoreFunc)(HCERTSTORE hCertStore, const void *pPrevContext)
BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext)
Definition: store.c:1080
BOOL(WINAPI * DeleteContextFunc)(const void *contex)
BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore, PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition, PCCRL_CONTEXT *ppStoreContext)
Definition: store.c:960
const void *(WINAPI * CreateContextFunc)(DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded)

Definition at line 56 of file store.c.

◆ gCTLInterface

const WINE_CONTEXT_INTERFACE gCTLInterface
static
Initial value:
= {
}
DWORD WINAPI CertEnumCTLContextProperties(PCCTL_CONTEXT pCTLContext, DWORD dwPropId)
Definition: ctl.c:508
BOOL(WINAPI * AddContextToStoreFunc)(HCERTSTORE hCertStore, const void *context, DWORD dwAddDisposition, const void **ppStoreContext)
BOOL WINAPI CertSerializeCTLStoreElement(PCCTL_CONTEXT pCtlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
Definition: serialize.c:160
BOOL WINAPI CertSetCTLContextProperty(PCCTL_CONTEXT pCTLContext, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: ctl.c:685
PCCTL_CONTEXT WINAPI CertCreateCTLContext(DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded)
Definition: ctl.c:363
BOOL(WINAPI * SerializeElementFunc)(const void *context, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
BOOL(WINAPI * GetContextPropertyFunc)(const void *context, DWORD dwPropID, void *pvData, DWORD *pcbData)
BOOL(WINAPI * AddEncodedContextToStoreFunc)(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwAddDisposition, const void **ppContext)
BOOL WINAPI CertAddEncodedCTLToStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded, DWORD dwAddDisposition, PCCTL_CONTEXT *ppCtlContext)
Definition: ctl.c:177
BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext)
Definition: ctl.c:341
BOOL WINAPI CertGetCTLContextProperty(PCCTL_CONTEXT pCTLContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: ctl.c:590
BOOL(WINAPI * SetContextPropertyFunc)(const void *context, DWORD dwPropID, DWORD dwFlags, const void *pvData)
DWORD(WINAPI * EnumPropertiesFunc)(const void *context, DWORD dwPropId)
const void *(WINAPI * EnumContextsInStoreFunc)(HCERTSTORE hCertStore, const void *pPrevContext)
BOOL WINAPI CertAddCTLContextToStore(HCERTSTORE hCertStore, PCCTL_CONTEXT pCtlContext, DWORD dwAddDisposition, PCCTL_CONTEXT *ppStoreContext)
Definition: ctl.c:63
PCCTL_CONTEXT WINAPI CertEnumCTLsInStore(HCERTSTORE hCertStore, PCCTL_CONTEXT pPrev)
Definition: ctl.c:200
BOOL(WINAPI * DeleteContextFunc)(const void *contex)
const void *(WINAPI * CreateContextFunc)(DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded)

Definition at line 69 of file store.c.

◆ MemStoreVtbl

const store_vtbl_t MemStoreVtbl
static
Initial value:
= {
{
}, {
}, {
}
}
static context_t * MemStore_enumCert(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: store.c:246
static context_t * MemStore_enumCTL(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: store.c:302
static BOOL MemStore_addCert(WINECRYPT_CERTSTORE *store, context_t *cert, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
Definition: store.c:237
static BOOL MemStore_deleteCRL(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:283
static void MemStore_addref(WINECRYPT_CERTSTORE *store)
Definition: store.c:320
static DWORD MemStore_release(WINECRYPT_CERTSTORE *cert_store, DWORD flags)
Definition: store.c:326
static BOOL MemStore_addCRL(WINECRYPT_CERTSTORE *store, context_t *crl, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
Definition: store.c:264
static BOOL MemStore_control(WINECRYPT_CERTSTORE *store, DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara)
Definition: store.c:348
static context_t * MemStore_enumCRL(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: store.c:274
static BOOL MemStore_deleteCert(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:255
static void MemStore_releaseContext(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:230
static BOOL MemStore_deleteCTL(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:311
static BOOL MemStore_addCTL(WINECRYPT_CERTSTORE *store, context_t *ctl, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
Definition: store.c:292

Definition at line 355 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:645

Definition at line 653 of file store.c.

Referenced by CRYPT_MsgOpenStore().

◆ pCertInterface

◆ pCRLInterface

◆ pCTLInterface

◆ rootW

const WCHAR rootW[] = { 'R','o','o','t',0 }
static

Definition at line 407 of file store.c.

Referenced by CertEnumSystemStore(), and CRYPT_SysRegOpenStoreW().