ReactOS  0.4.14-dev-833-g5f692ed
provstore.c File Reference
#include <stdarg.h>
#include <assert.h>
#include "windef.h"
#include "winbase.h"
#include "wincrypt.h"
#include "wine/debug.h"
#include "crypt32_private.h"
Include dependency graph for provstore.c:

Go to the source code of this file.

Classes

struct  _WINE_PROVIDERSTORE
 

Typedefs

typedef struct _WINE_PROVIDERSTORE WINE_PROVIDERSTORE
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (crypt)
 
static void ProvStore_addref (WINECRYPT_CERTSTORE *store)
 
static DWORD ProvStore_release (WINECRYPT_CERTSTORE *cert_store, DWORD flags)
 
static void ProvStore_releaseContext (WINECRYPT_CERTSTORE *store, context_t *context)
 
static BOOL ProvStore_addCert (WINECRYPT_CERTSTORE *store, context_t *cert, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
 
static context_tProvStore_enumCert (WINECRYPT_CERTSTORE *store, context_t *prev)
 
static BOOL ProvStore_deleteCert (WINECRYPT_CERTSTORE *store, context_t *context)
 
static BOOL ProvStore_addCRL (WINECRYPT_CERTSTORE *store, context_t *crl, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
 
static context_tProvStore_enumCRL (WINECRYPT_CERTSTORE *store, context_t *prev)
 
static BOOL ProvStore_deleteCRL (WINECRYPT_CERTSTORE *store, context_t *crl)
 
static BOOL ProvStore_addCTL (WINECRYPT_CERTSTORE *store, context_t *ctl, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
 
static context_tProvStore_enumCTL (WINECRYPT_CERTSTORE *store, context_t *prev)
 
static BOOL ProvStore_deleteCTL (WINECRYPT_CERTSTORE *store, context_t *ctl)
 
static BOOL ProvStore_control (WINECRYPT_CERTSTORE *cert_store, DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara)
 
WINECRYPT_CERTSTORECRYPT_ProvCreateStore (DWORD dwFlags, WINECRYPT_CERTSTORE *memStore, const CERT_STORE_PROV_INFO *pProvInfo)
 
WINECRYPT_CERTSTORECRYPT_ProvOpenStore (LPCSTR lpszStoreProvider, DWORD dwEncodingType, HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
 

Variables

static const store_vtbl_t ProvStoreVtbl
 

Typedef Documentation

◆ WINE_PROVIDERSTORE

Function Documentation

◆ CRYPT_ProvCreateStore()

WINECRYPT_CERTSTORE* CRYPT_ProvCreateStore ( DWORD  dwFlags,
WINECRYPT_CERTSTORE memStore,
const CERT_STORE_PROV_INFO pProvInfo 
)

Definition at line 307 of file provstore.c.

309 {
311 
312  if (ret)
313  {
315  ret->dwStoreProvFlags = pProvInfo->dwStoreProvFlags;
316  if (ret->dwStoreProvFlags & CERT_STORE_PROV_EXTERNAL_FLAG)
317  {
318  CertCloseStore(memStore, 0);
319  ret->memStore = NULL;
320  }
321  else
322  ret->memStore = memStore;
323  ret->hStoreProv = pProvInfo->hStoreProv;
325  ret->provCloseStore =
327  else
328  ret->provCloseStore = NULL;
329  if (pProvInfo->cStoreProvFunc >
331  ret->provWriteCert = pProvInfo->rgpvStoreProvFunc[
333  else
334  ret->provWriteCert = NULL;
335  if (pProvInfo->cStoreProvFunc >
337  ret->provDeleteCert = pProvInfo->rgpvStoreProvFunc[
339  else
340  ret->provDeleteCert = NULL;
341  if (pProvInfo->cStoreProvFunc >
343  ret->provWriteCrl = pProvInfo->rgpvStoreProvFunc[
345  else
346  ret->provWriteCrl = NULL;
347  if (pProvInfo->cStoreProvFunc >
349  ret->provDeleteCrl = pProvInfo->rgpvStoreProvFunc[
351  else
352  ret->provDeleteCrl = NULL;
353  if (pProvInfo->cStoreProvFunc >
355  ret->provWriteCtl = pProvInfo->rgpvStoreProvFunc[
357  else
358  ret->provWriteCtl = NULL;
359  if (pProvInfo->cStoreProvFunc >
361  ret->provDeleteCtl = pProvInfo->rgpvStoreProvFunc[
363  else
364  ret->provDeleteCtl = NULL;
365  if (pProvInfo->cStoreProvFunc >
367  ret->provControl = pProvInfo->rgpvStoreProvFunc[
369  else
370  ret->provControl = NULL;
371  }
372  return (WINECRYPT_CERTSTORE*)ret;
373 }
#define CERT_STORE_PROV_WRITE_CRL_FUNC
Definition: wincrypt.h:2559
#define CERT_STORE_PROV_DELETE_CTL_FUNC
Definition: wincrypt.h:2564
#define CERT_STORE_PROV_DELETE_CERT_FUNC
Definition: wincrypt.h:2556
#define CERT_STORE_PROV_DELETE_CRL_FUNC
Definition: wincrypt.h:2560
#define CERT_STORE_PROV_WRITE_CTL_FUNC
Definition: wincrypt.h:2563
HCERTSTOREPROV hStoreProv
Definition: wincrypt.h:1150
#define CERT_STORE_PROV_WRITE_CERT_FUNC
Definition: wincrypt.h:2555
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
Definition: main.c:131
void ** rgpvStoreProvFunc
Definition: wincrypt.h:1149
smooth NULL
Definition: ftsmooth.c:416
#define CERT_STORE_PROV_EXTERNAL_FLAG
Definition: wincrypt.h:2546
BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
Definition: store.c:1127
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define CERT_STORE_PROV_CLOSE_FUNC
Definition: wincrypt.h:2553
static const store_vtbl_t ProvStoreVtbl
Definition: provstore.c:287
#define CERT_STORE_PROV_CONTROL_FUNC
Definition: wincrypt.h:2566
void CRYPT_InitStore(WINECRYPT_CERTSTORE *store, DWORD dwFlags, CertStoreType type, const store_vtbl_t *) DECLSPEC_HIDDEN
Definition: store.c:91

Referenced by create_root_store(), CRYPT_CreateFileStore(), CRYPT_MsgOpenStore(), CRYPT_ProvOpenStore(), and CRYPT_RegOpenStore().

◆ CRYPT_ProvOpenStore()

WINECRYPT_CERTSTORE* CRYPT_ProvOpenStore ( LPCSTR  lpszStoreProvider,
DWORD  dwEncodingType,
HCRYPTPROV  hCryptProv,
DWORD  dwFlags,
const void pvPara 
)

Definition at line 375 of file provstore.c.

377 {
378  static HCRYPTOIDFUNCSET set = NULL;
380  HCRYPTOIDFUNCADDR hFunc;
382 
383  if (!set)
385  CryptGetOIDFunctionAddress(set, dwEncodingType, lpszStoreProvider, 0,
386  (void **)&provOpenFunc, &hFunc);
387  if (provOpenFunc)
388  {
389  CERT_STORE_PROV_INFO provInfo = { 0 };
390 
391  provInfo.cbSize = sizeof(provInfo);
393  provOpenFunc(lpszStoreProvider, dwEncodingType, hCryptProv,
394  dwFlags, pvPara, NULL, &provInfo);
395  else
396  {
397  HCERTSTORE memStore;
398 
399  memStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
401  if (memStore)
402  {
403  if (provOpenFunc(lpszStoreProvider, dwEncodingType, hCryptProv,
404  dwFlags, pvPara, memStore, &provInfo))
405  ret = CRYPT_ProvCreateStore(dwFlags, memStore, &provInfo);
406  else
407  CertCloseStore(memStore, 0);
408  }
409  }
410  CryptFreeOIDFunctionAddress(hFunc, 0);
411  }
412  else
414  return ret;
415 }
#define CERT_STORE_DELETE_FLAG
Definition: wincrypt.h:2455
HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName, DWORD dwFlags)
Definition: oid.c:114
WINECRYPT_CERTSTORE * CRYPT_ProvCreateStore(DWORD dwFlags, WINECRYPT_CERTSTORE *memStore, const CERT_STORE_PROV_INFO *pProvInfo)
Definition: provstore.c:307
#define CERT_STORE_CREATE_NEW_FLAG
Definition: wincrypt.h:2464
_In_ DWORD dwEncodingType
Definition: wincrypt.h:4629
#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 ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define SetLastError(x)
Definition: compat.h:417
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define CRYPT_OID_OPEN_STORE_PROV_FUNC
Definition: wincrypt.h:2491
BOOL WINAPI CryptFreeOIDFunctionAddress(HCRYPTOIDFUNCADDR hFuncAddr, DWORD dwFlags)
Definition: oid.c:468
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:815
BOOL WINAPI CryptGetOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet, DWORD dwEncodingType, LPCSTR pszOID, DWORD dwFlags, void **ppvFuncAddr, HCRYPTOIDFUNCADDR *phFuncAddr)
Definition: oid.c:387
_In_ void * pvPara
Definition: wincrypt.h:6081
Definition: _set.h:46
BOOL(WINAPI * PFN_CERT_DLL_OPEN_STORE_PROV_FUNC)(_In_ LPCSTR lpszStoreProvider, _In_ DWORD dwEncodingType, _In_opt_ HCRYPTPROV_LEGACY hCryptProv, _In_ DWORD dwFlags, _In_opt_ const void *pvPara, _In_ HCERTSTORE hCertStore, _Inout_ PCERT_STORE_PROV_INFO pStoreProvInfo)
Definition: wincrypt.h:1156

Referenced by CertOpenStore().

◆ ProvStore_addCert()

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

Definition at line 81 of file provstore.c.

83 {
85  BOOL ret;
86 
87  TRACE("(%p, %p, %p, %p)\n", store, cert, toReplace, ppStoreContext);
88 
89  if (toReplace)
90  ret = ps->memStore->vtbl->certs.addContext(ps->memStore, cert, toReplace,
92  else
93  {
94  ret = TRUE;
95  if (ps->provWriteCert)
97  if (ret)
100  }
101  /* dirty trick: replace the returned context's hCertStore with
102  * store.
103  */
104  if (ret && ppStoreContext)
105  (*(cert_t**)ppStoreContext)->ctx.hCertStore = store;
106  return ret;
107 }
#define TRUE
Definition: types.h:120
PFN_CERT_STORE_PROV_WRITE_CERT provWriteCert
Definition: provstore.c:37
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
HCERTSTOREPROV hStoreProv
Definition: provstore.c:35
CONTEXT_FUNCS certs
smooth NULL
Definition: ftsmooth.c:416
static BYTE cert[]
Definition: msg.c:1437
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
#define CERT_STORE_PROV_WRITE_ADD_FLAG
Definition: wincrypt.h:2971
int ret
WINECRYPT_CERTSTORE * memStore
Definition: provstore.c:34

◆ ProvStore_addCRL()

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

Definition at line 139 of file provstore.c.

141 {
143  BOOL ret;
144 
145  TRACE("(%p, %p, %p, %p)\n", store, crl, toReplace, ppStoreContext);
146 
147  if (toReplace)
148  ret = ps->memStore->vtbl->crls.addContext(ps->memStore, crl, toReplace,
150  else
151  {
153  {
155  ret = FALSE;
156  }
157  else
158  {
159  ret = TRUE;
160  if (ps->provWriteCrl)
163  if (ret)
166  }
167  }
168  /* dirty trick: replace the returned context's hCertStore with
169  * store.
170  */
171  if (ret && ppStoreContext)
172  (*(crl_t**)ppStoreContext)->ctx.hCertStore = store;
173  return ret;
174 }
#define TRUE
Definition: types.h:120
static const BYTE crl[]
Definition: message.c:864
WINECRYPT_CERTSTORE hdr
Definition: provstore.c:32
CONTEXT_FUNCS crls
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
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
unsigned int BOOL
Definition: ntddk_ex.h:94
HCERTSTOREPROV hStoreProv
Definition: provstore.c:35
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
#define CERT_STORE_PROV_WRITE_ADD_FLAG
Definition: wincrypt.h:2971
#define SetLastError(x)
Definition: compat.h:417
#define CERT_STORE_READONLY_FLAG
Definition: wincrypt.h:2466
int ret
WINECRYPT_CERTSTORE * memStore
Definition: provstore.c:34
PFN_CERT_STORE_PROV_WRITE_CRL provWriteCrl
Definition: provstore.c:39

◆ ProvStore_addCTL()

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

Definition at line 206 of file provstore.c.

208 {
210  BOOL ret;
211 
212  TRACE("(%p, %p, %p, %p)\n", store, ctl, toReplace, ppStoreContext);
213 
214  if (toReplace)
215  ret = ps->memStore->vtbl->ctls.addContext(ps->memStore, ctl, toReplace,
217  else
218  {
220  {
222  ret = FALSE;
223  }
224  else
225  {
226  ret = TRUE;
227  if (ps->provWriteCtl)
228  ret = ps->provWriteCtl(ps->hStoreProv, context_ptr(ctl),
230  if (ret)
231  ret = ps->memStore->vtbl->ctls.addContext(ps->memStore, ctl, NULL,
233  }
234  }
235  /* dirty trick: replace the returned context's hCertStore with
236  * store.
237  */
238  if (ret && ppStoreContext)
239  (*(ctl_t**)ppStoreContext)->ctx.hCertStore = store;
240  return ret;
241 }
#define TRUE
Definition: types.h:120
WINECRYPT_CERTSTORE hdr
Definition: provstore.c:32
PFN_CERT_STORE_PROV_WRITE_CTL provWriteCtl
Definition: provstore.c:41
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
CONTEXT_FUNCS ctls
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
unsigned int BOOL
Definition: ntddk_ex.h:94
HCERTSTOREPROV hStoreProv
Definition: provstore.c:35
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
#define CERT_STORE_PROV_WRITE_ADD_FLAG
Definition: wincrypt.h:2971
#define SetLastError(x)
Definition: compat.h:417
#define CERT_STORE_READONLY_FLAG
Definition: wincrypt.h:2466
int ret
WINECRYPT_CERTSTORE * memStore
Definition: provstore.c:34

◆ ProvStore_addref()

static void ProvStore_addref ( WINECRYPT_CERTSTORE store)
static

Definition at line 46 of file provstore.c.

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

◆ ProvStore_control()

static BOOL ProvStore_control ( WINECRYPT_CERTSTORE cert_store,
DWORD  dwFlags,
DWORD  dwCtrlType,
void const pvCtrlPara 
)
static

Definition at line 273 of file provstore.c.

274 {
276  BOOL ret = TRUE;
277 
278  TRACE("(%p, %08x, %d, %p)\n", store, dwFlags, dwCtrlType,
279  pvCtrlPara);
280 
281  if (store->provControl)
282  ret = store->provControl(store->hStoreProv, dwFlags, dwCtrlType,
283  pvCtrlPara);
284  return ret;
285 }
#define TRUE
Definition: types.h:120
unsigned int BOOL
Definition: ntddk_ex.h:94
HCERTSTOREPROV hStoreProv
Definition: provstore.c:35
#define TRACE(s)
Definition: solgame.cpp:4
PFN_CERT_STORE_PROV_CONTROL provControl
Definition: provstore.c:43
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
DWORD cert_store
Definition: store.c:344

◆ ProvStore_deleteCert()

static BOOL ProvStore_deleteCert ( WINECRYPT_CERTSTORE store,
context_t context 
)
static

Definition at line 125 of file provstore.c.

126 {
128  BOOL ret = TRUE;
129 
130  TRACE("(%p, %p)\n", store, context);
131 
132  if (ps->provDeleteCert)
134  if (ret)
135  ret = ps->memStore->vtbl->certs.delete(ps->memStore, context);
136  return ret;
137 }
#define TRUE
Definition: types.h:120
Definition: http.c:7094
static void * context_ptr(context_t *context)
unsigned int BOOL
Definition: ntddk_ex.h:94
HCERTSTOREPROV hStoreProv
Definition: provstore.c:35
CONTEXT_FUNCS certs
#define TRACE(s)
Definition: solgame.cpp:4
PFN_CERT_STORE_PROV_DELETE_CERT provDeleteCert
Definition: provstore.c:38
const store_vtbl_t * vtbl
int ret
WINECRYPT_CERTSTORE * memStore
Definition: provstore.c:34
BOOL(* delete)(struct WINE_CRYPTCERTSTORE *, context_t *)

◆ ProvStore_deleteCRL()

static BOOL ProvStore_deleteCRL ( WINECRYPT_CERTSTORE store,
context_t crl 
)
static

Definition at line 192 of file provstore.c.

193 {
195  BOOL ret = TRUE;
196 
197  TRACE("(%p, %p)\n", store, crl);
198 
199  if (ps->provDeleteCrl)
200  ret = ps->provDeleteCrl(ps->hStoreProv, context_ptr(crl), 0);
201  if (ret)
202  ret = ps->memStore->vtbl->crls.delete(ps->memStore, crl);
203  return ret;
204 }
#define TRUE
Definition: types.h:120
static const BYTE crl[]
Definition: message.c:864
CONTEXT_FUNCS crls
static void * context_ptr(context_t *context)
unsigned int BOOL
Definition: ntddk_ex.h:94
HCERTSTOREPROV hStoreProv
Definition: provstore.c:35
PFN_CERT_STORE_PROV_DELETE_CRL provDeleteCrl
Definition: provstore.c:40
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
int ret
WINECRYPT_CERTSTORE * memStore
Definition: provstore.c:34
BOOL(* delete)(struct WINE_CRYPTCERTSTORE *, context_t *)

◆ ProvStore_deleteCTL()

static BOOL ProvStore_deleteCTL ( WINECRYPT_CERTSTORE store,
context_t ctl 
)
static

Definition at line 259 of file provstore.c.

260 {
262  BOOL ret = TRUE;
263 
264  TRACE("(%p, %p)\n", store, ctl);
265 
266  if (ps->provDeleteCtl)
267  ret = ps->provDeleteCtl(ps->hStoreProv, context_ptr(ctl), 0);
268  if (ret)
269  ret = ps->memStore->vtbl->ctls.delete(ps->memStore, ctl);
270  return ret;
271 }
#define TRUE
Definition: types.h:120
PFN_CERT_STORE_PROV_DELETE_CTL provDeleteCtl
Definition: provstore.c:42
static void * context_ptr(context_t *context)
CONTEXT_FUNCS ctls
unsigned int BOOL
Definition: ntddk_ex.h:94
HCERTSTOREPROV hStoreProv
Definition: provstore.c:35
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
int ret
WINECRYPT_CERTSTORE * memStore
Definition: provstore.c:34
BOOL(* delete)(struct WINE_CRYPTCERTSTORE *, context_t *)

◆ ProvStore_enumCert()

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

Definition at line 109 of file provstore.c.

110 {
112  cert_t *ret;
113 
114  ret = (cert_t*)ps->memStore->vtbl->certs.enumContext(ps->memStore, prev);
115  if (!ret)
116  return NULL;
117 
118  /* same dirty trick: replace the returned context's hCertStore with
119  * store.
120  */
121  ret->ctx.hCertStore = store;
122  return &ret->base;
123 }
CONTEXT_FUNCS certs
smooth NULL
Definition: ftsmooth.c:416
const store_vtbl_t * vtbl
int ret
WINECRYPT_CERTSTORE * memStore
Definition: provstore.c:34
context_t *(* enumContext)(struct WINE_CRYPTCERTSTORE *store, context_t *prev)

◆ ProvStore_enumCRL()

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

Definition at line 176 of file provstore.c.

177 {
179  crl_t *ret;
180 
181  ret = (crl_t*)ps->memStore->vtbl->crls.enumContext(ps->memStore, prev);
182  if (!ret)
183  return NULL;
184 
185  /* same dirty trick: replace the returned context's hCertStore with
186  * store.
187  */
188  ret->ctx.hCertStore = store;
189  return &ret->base;
190 }
CONTEXT_FUNCS crls
smooth NULL
Definition: ftsmooth.c:416
const store_vtbl_t * vtbl
int ret
WINECRYPT_CERTSTORE * memStore
Definition: provstore.c:34
context_t *(* enumContext)(struct WINE_CRYPTCERTSTORE *store, context_t *prev)

◆ ProvStore_enumCTL()

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

Definition at line 243 of file provstore.c.

244 {
246  ctl_t *ret;
247 
248  ret = (ctl_t*)ps->memStore->vtbl->ctls.enumContext(ps->memStore, prev);
249  if (!ret)
250  return NULL;
251 
252  /* same dirty trick: replace the returned context's hCertStore with
253  * store.
254  */
255  ret->ctx.hCertStore = store;
256  return &ret->base;
257 }
CONTEXT_FUNCS ctls
smooth NULL
Definition: ftsmooth.c:416
const store_vtbl_t * vtbl
int ret
WINECRYPT_CERTSTORE * memStore
Definition: provstore.c:34
context_t *(* enumContext)(struct WINE_CRYPTCERTSTORE *store, context_t *prev)

◆ ProvStore_release()

static DWORD ProvStore_release ( WINECRYPT_CERTSTORE cert_store,
DWORD  flags 
)
static

Definition at line 52 of file provstore.c.

53 {
55  LONG ref;
56 
57  if(flags)
58  FIXME("Unimplemented flags %x\n", flags);
59 
60  ref = InterlockedDecrement(&store->hdr.ref);
61  TRACE("(%p) ref=%d\n", store, ref);
62 
63  if(ref)
64  return ERROR_SUCCESS;
65 
66  if (store->provCloseStore)
67  store->provCloseStore(store->hStoreProv, flags);
69  store->memStore->vtbl->release(store->memStore, flags);
70  CRYPT_FreeStore(&store->hdr);
71  return ERROR_SUCCESS;
72 }
WINECRYPT_CERTSTORE hdr
Definition: provstore.c:32
#define ERROR_SUCCESS
Definition: deptool.c:10
void CRYPT_FreeStore(WINECRYPT_CERTSTORE *store) DECLSPEC_HIDDEN
Definition: store.c:101
Definition: send.c:47
HCERTSTOREPROV hStoreProv
Definition: provstore.c:35
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define FIXME(fmt,...)
Definition: debug.h:110
#define CERT_STORE_PROV_EXTERNAL_FLAG
Definition: wincrypt.h:2546
DWORD(* release)(struct WINE_CRYPTCERTSTORE *, DWORD)
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
PFN_CERT_STORE_PROV_CLOSE provCloseStore
Definition: provstore.c:36
GLbitfield flags
Definition: glext.h:7161
WINECRYPT_CERTSTORE * memStore
Definition: provstore.c:34
#define InterlockedDecrement
Definition: armddk.h:52
DWORD cert_store
Definition: store.c:344
DWORD dwStoreProvFlags
Definition: provstore.c:33

◆ ProvStore_releaseContext()

static void ProvStore_releaseContext ( WINECRYPT_CERTSTORE store,
context_t context 
)
static

Definition at line 74 of file provstore.c.

75 {
76  /* As long as we don't have contexts properly stored (and hack around hCertStore
77  in add* and enum* functions), this function should never be called. */
78  assert(0);
79 }
#define assert(x)
Definition: debug.h:53

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( crypt  )

Variable Documentation

◆ ProvStoreVtbl

const store_vtbl_t ProvStoreVtbl
static
Initial value:
= {
{
}, {
}, {
}
}
static void ProvStore_addref(WINECRYPT_CERTSTORE *store)
Definition: provstore.c:46
static BOOL ProvStore_deleteCTL(WINECRYPT_CERTSTORE *store, context_t *ctl)
Definition: provstore.c:259
static void ProvStore_releaseContext(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: provstore.c:74
static BOOL ProvStore_deleteCert(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: provstore.c:125
static context_t * ProvStore_enumCRL(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: provstore.c:176
static DWORD ProvStore_release(WINECRYPT_CERTSTORE *cert_store, DWORD flags)
Definition: provstore.c:52
static BOOL ProvStore_addCTL(WINECRYPT_CERTSTORE *store, context_t *ctl, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
Definition: provstore.c:206
static BOOL ProvStore_deleteCRL(WINECRYPT_CERTSTORE *store, context_t *crl)
Definition: provstore.c:192
static BOOL ProvStore_addCert(WINECRYPT_CERTSTORE *store, context_t *cert, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
Definition: provstore.c:81
static BOOL ProvStore_addCRL(WINECRYPT_CERTSTORE *store, context_t *crl, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
Definition: provstore.c:139
static context_t * ProvStore_enumCTL(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: provstore.c:243
static BOOL ProvStore_control(WINECRYPT_CERTSTORE *cert_store, DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara)
Definition: provstore.c:273
static context_t * ProvStore_enumCert(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: provstore.c:109

Definition at line 287 of file provstore.c.

Referenced by CRYPT_ProvCreateStore().