ReactOS 0.4.17-dev-470-gf9e3448
store.c
Go to the documentation of this file.
1/*
2 * Copyright 2002 Mike McCormack for CodeWeavers
3 * Copyright 2004-2006 Juan Lang
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 *
19 * FIXME:
20 * - The concept of physical stores and locations isn't implemented. (This
21 * doesn't mean registry stores et al aren't implemented. See the PSDK for
22 * registering and enumerating physical stores and locations.)
23 * - Many flags, options and whatnot are unimplemented.
24 */
25
26#include <assert.h>
27#include <stdarg.h>
28#include "windef.h"
29#include "winbase.h"
30#include "winnls.h"
31#include "winreg.h"
32#include "winternl.h"
33#include "winuser.h"
34#include "wincrypt.h"
35#include "wine/debug.h"
36#include "crypt32_private.h"
37
39
50};
52
63};
65
76};
78
79typedef struct _WINE_MEMSTORE
80{
83 struct list certs;
84 struct list crls;
85 struct list ctls;
87
89{
90 store->ref = 1;
92 store->type = type;
93 store->dwOpenFlags = dwFlags;
94 store->vtbl = vtbl;
95 store->properties = NULL;
96}
97
99{
100 if (store->properties)
102 store->dwMagic = 0;
103 CryptMemFree(store);
104}
105
107 DWORD unk1)
108{
109 static BOOL warned = FALSE;
110 const WINE_CONTEXT_INTERFACE * const interfaces[] = { pCertInterface,
112 DWORD i;
113
114 TRACE("(%p, %p, %08lx, %08lx)\n", store1, store2, unk0, unk1);
115 if (!warned)
116 {
117 FIXME("semi-stub\n");
118 warned = TRUE;
119 }
120
121 /* Poor-man's resync: empty first store, then add everything from second
122 * store to it.
123 */
124 for (i = 0; i < ARRAY_SIZE(interfaces); i++)
125 {
126 const void *context;
127
128 do {
129 context = interfaces[i]->enumContextsInStore(store1, NULL);
130 if (context)
131 interfaces[i]->deleteFromStore(context);
132 } while (context);
133 do {
134 context = interfaces[i]->enumContextsInStore(store2, context);
135 if (context)
136 interfaces[i]->addContextToStore(store1, context,
138 } while (context);
139 }
140 return TRUE;
141}
142
143static BOOL MemStore_addContext(WINE_MEMSTORE *store, struct list *list, context_t *orig_context,
144 context_t *existing, context_t **ret_context, BOOL use_link)
145{
147
148 context = orig_context->vtbl->clone(orig_context, &store->hdr, use_link);
149 if (!context)
150 return FALSE;
151
152 TRACE("adding %p\n", context);
153 EnterCriticalSection(&store->cs);
154 if (existing) {
155 context->u.entry.prev = existing->u.entry.prev;
156 context->u.entry.next = existing->u.entry.next;
157 context->u.entry.prev->next = &context->u.entry;
158 context->u.entry.next->prev = &context->u.entry;
159 list_init(&existing->u.entry);
160 if(!existing->ref)
161 Context_Release(existing);
162 }else {
163 list_add_head(list, &context->u.entry);
164 }
165 LeaveCriticalSection(&store->cs);
166
167 if(ret_context)
168 *ret_context = context;
169 else
171 return TRUE;
172}
173
175{
176 struct list *next;
177 context_t *ret;
178
179 EnterCriticalSection(&store->cs);
180 if (prev) {
181 next = list_next(list, &prev->u.entry);
182 Context_Release(prev);
183 }else {
185 }
186 LeaveCriticalSection(&store->cs);
187
188 if (!next) {
190 return NULL;
191 }
192
193 ret = LIST_ENTRY(next, context_t, u.entry);
195 return ret;
196}
197
199{
200 BOOL in_list = FALSE;
201
202 EnterCriticalSection(&store->cs);
203 if (!list_empty(&context->u.entry)) {
204 list_remove(&context->u.entry);
205 list_init(&context->u.entry);
206 in_list = TRUE;
207 }
208 LeaveCriticalSection(&store->cs);
209
210 if(in_list && !context->ref)
212 return TRUE;
213}
214
215static void free_contexts(struct list *list)
216{
218
220 {
221 TRACE("freeing %p\n", context);
222 list_remove(&context->u.entry);
224 }
225}
226
228{
229 /* Free the context only if it's not in a list. Otherwise it may be reused later. */
230 if(list_empty(&context->u.entry))
232}
233
235 context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
236{
237 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
238
239 TRACE("(%p, %p, %p, %p)\n", store, cert, toReplace, ppStoreContext);
240 return MemStore_addContext(ms, &ms->certs, cert, toReplace, ppStoreContext, use_link);
241}
242
244{
245 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
246
247 TRACE("(%p, %p)\n", store, prev);
248
249 return MemStore_enumContext(ms, &ms->certs, prev);
250}
251
253{
254 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
255
256 TRACE("(%p, %p)\n", store, context);
257
259}
260
262 context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
263{
264 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
265
266 TRACE("(%p, %p, %p, %p)\n", store, crl, toReplace, ppStoreContext);
267
268 return MemStore_addContext(ms, &ms->crls, crl, toReplace, ppStoreContext, use_link);
269}
270
272{
273 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
274
275 TRACE("(%p, %p)\n", store, prev);
276
277 return MemStore_enumContext(ms, &ms->crls, prev);
278}
279
281{
282 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
283
284 TRACE("(%p, %p)\n", store, context);
285
287}
288
290 context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
291{
292 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
293
294 TRACE("(%p, %p, %p, %p)\n", store, ctl, toReplace, ppStoreContext);
295
296 return MemStore_addContext(ms, &ms->ctls, ctl, toReplace, ppStoreContext, use_link);
297}
298
300{
301 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
302
303 TRACE("(%p, %p)\n", store, prev);
304
305 return MemStore_enumContext(ms, &ms->ctls, prev);
306}
307
309{
310 WINE_MEMSTORE *ms = (WINE_MEMSTORE *)store;
311
312 TRACE("(%p, %p)\n", store, context);
313
315}
316
318{
319 LONG ref = InterlockedIncrement(&store->ref);
320 TRACE("ref = %ld\n", ref);
321}
322
324{
326 LONG ref;
327
329 FIXME("Unimplemented flags %lx\n", flags);
330
331 ref = InterlockedDecrement(&store->hdr.ref);
332 TRACE("(%p) ref=%ld\n", store, ref);
333 if(ref)
335
336 free_contexts(&store->certs);
337 free_contexts(&store->crls);
338 free_contexts(&store->ctls);
339 store->cs.DebugInfo->Spare[0] = 0;
340 DeleteCriticalSection(&store->cs);
341 CRYPT_FreeStore(&store->hdr);
342 return ERROR_SUCCESS;
343}
344
346 DWORD dwCtrlType, void const *pvCtrlPara)
347{
349 return FALSE;
350}
351
357 {
361 }, {
365 }, {
369 }
370};
371
373 DWORD dwFlags, const void *pvPara)
374{
375 WINE_MEMSTORE *store;
376
377 TRACE("(%Id, %08lx, %p)\n", hCryptProv, dwFlags, pvPara);
378
380 {
382 store = NULL;
383 }
384 else
385 {
386 store = CryptMemAlloc(sizeof(WINE_MEMSTORE));
387 if (store)
388 {
389 memset(store, 0, sizeof(WINE_MEMSTORE));
392 store->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ContextList.cs");
393 list_init(&store->certs);
394 list_init(&store->crls);
395 list_init(&store->ctls);
396 /* Mem store doesn't need crypto provider, so close it */
397 if (hCryptProv && !(dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG))
398 CryptReleaseContext(hCryptProv, 0);
399 }
400 }
401 return (WINECRYPT_CERTSTORE*)store;
402}
403
405 DWORD dwFlags, const void *pvPara)
406{
407 LPCWSTR storeName = pvPara;
408 LPWSTR storePath;
409 WINECRYPT_CERTSTORE *store = NULL;
410 HKEY root;
412
413 TRACE("(%Id, %08lx, %s)\n", hCryptProv, dwFlags,
414 debugstr_w(pvPara));
415
416 if (!pvPara)
417 {
419 return NULL;
420 }
421
423 {
427 /* If the HKLM\Root certs are requested, expressing system certs into the registry */
428 if (!lstrcmpiW(storeName, L"Root"))
430 break;
434 break;
436 /* hklm\Software\Microsoft\Cryptography\Services\servicename\
437 * SystemCertificates
438 */
439 FIXME("CERT_SYSTEM_STORE_CURRENT_SERVICE, %s: stub\n",
440 debugstr_w(storeName));
441 return NULL;
443 /* hklm\Software\Microsoft\Cryptography\Services\servicename\
444 * SystemCertificates
445 */
446 FIXME("CERT_SYSTEM_STORE_SERVICES, %s: stub\n",
447 debugstr_w(storeName));
448 return NULL;
450 /* hku\user sid\Software\Microsoft\SystemCertificates */
451 FIXME("CERT_SYSTEM_STORE_USERS, %s: stub\n",
452 debugstr_w(storeName));
453 return NULL;
457 break;
461 break;
463 /* hklm\Software\Microsoft\EnterpriseCertificates */
464 FIXME("CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE, %s: stub\n",
465 debugstr_w(storeName));
466 return NULL;
467 default:
469 return NULL;
470 }
471
472 storePath = CryptMemAlloc((lstrlenW(base) + lstrlenW(storeName) + 2) *
473 sizeof(WCHAR));
474 if (storePath)
475 {
476 LONG rc;
477 HKEY key;
480
481 wsprintfW(storePath, L"%s\\%s", base, storeName);
483 rc = RegOpenKeyExW(root, storePath, 0, sam, &key);
484 else
485 {
486 DWORD disp;
487
488 rc = RegCreateKeyExW(root, storePath, 0, NULL, 0, sam, NULL,
489 &key, &disp);
490 if (!rc && dwFlags & CERT_STORE_CREATE_NEW_FLAG &&
492 {
495 }
496 }
497 if (!rc)
498 {
499 store = CRYPT_RegOpenStore(hCryptProv, dwFlags, key);
501 }
502 else
503 SetLastError(rc);
504 CryptMemFree(storePath);
505 }
506 return store;
507}
508
510 DWORD dwFlags, const void *pvPara)
511{
512 int len;
514
515 TRACE("(%Id, %08lx, %s)\n", hCryptProv, dwFlags,
516 debugstr_a(pvPara));
517
518 if (!pvPara)
519 {
521 return NULL;
522 }
523 len = MultiByteToWideChar(CP_ACP, 0, pvPara, -1, NULL, 0);
524 if (len)
525 {
526 LPWSTR storeName = CryptMemAlloc(len * sizeof(WCHAR));
527
528 if (storeName)
529 {
530 MultiByteToWideChar(CP_ACP, 0, pvPara, -1, storeName, len);
531 ret = CRYPT_SysRegOpenStoreW(hCryptProv, dwFlags, storeName);
532 CryptMemFree(storeName);
533 }
534 }
535 return ret;
536}
537
539 DWORD dwFlags, const void *pvPara)
540{
541 HCERTSTORE store = 0;
542 BOOL ret;
543
544 TRACE("(%Id, %08lx, %s)\n", hCryptProv, dwFlags,
545 debugstr_w(pvPara));
546
547 if (!pvPara)
548 {
550 return NULL;
551 }
552 /* This returns a different error than system registry stores if the
553 * location is invalid.
554 */
556 {
565 ret = TRUE;
566 break;
567 default:
569 ret = FALSE;
570 }
571 if (ret)
572 {
574 0, 0, dwFlags, pvPara);
575
576 if (regStore)
577 {
580 CertAddStoreToCollection(store, regStore,
583 CertCloseStore(regStore, 0);
584 /* CERT_SYSTEM_STORE_CURRENT_USER returns both the HKCU and HKLM
585 * stores.
586 */
589 {
590 dwFlags &= ~CERT_SYSTEM_STORE_CURRENT_USER;
593 0, dwFlags, pvPara);
594 if (regStore)
595 {
596 CertAddStoreToCollection(store, regStore,
599 CertCloseStore(regStore, 0);
600 }
601 }
602 /* System store doesn't need crypto provider, so close it */
603 if (hCryptProv && !(dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG))
604 CryptReleaseContext(hCryptProv, 0);
605 }
606 }
607 return store;
608}
609
611 DWORD dwFlags, const void *pvPara)
612{
613 int len;
615
616 TRACE("(%Id, %08lx, %s)\n", hCryptProv, dwFlags,
617 debugstr_a(pvPara));
618
619 if (!pvPara)
620 {
622 return NULL;
623 }
624 len = MultiByteToWideChar(CP_ACP, 0, pvPara, -1, NULL, 0);
625 if (len)
626 {
627 LPWSTR storeName = CryptMemAlloc(len * sizeof(WCHAR));
628
629 if (storeName)
630 {
631 MultiByteToWideChar(CP_ACP, 0, pvPara, -1, storeName, len);
632 ret = CRYPT_SysOpenStoreW(hCryptProv, dwFlags, storeName);
633 CryptMemFree(storeName);
634 }
635 }
636 return ret;
637}
638
640{
641 HCRYPTMSG msg = hCertStore;
642
643 TRACE("(%p, %08lx)\n", msg, dwFlags);
645}
646
647static void *msgProvFuncs[] = {
649};
650
652 DWORD dwFlags, const void *pvPara)
653{
654 WINECRYPT_CERTSTORE *store = NULL;
655 HCRYPTMSG msg = (HCRYPTMSG)pvPara;
656 WINECRYPT_CERTSTORE *memStore;
657
658 TRACE("(%Id, %08lx, %p)\n", hCryptProv, dwFlags, pvPara);
659
660 memStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
662 if (memStore)
663 {
664 BOOL ret;
665 DWORD size, count, i;
666
667 size = sizeof(count);
669 for (i = 0; ret && i < count; i++)
670 {
671 size = 0;
673 if (ret)
674 {
676
677 if (buf)
678 {
680 if (ret)
683 NULL);
685 }
686 }
687 }
688 size = sizeof(count);
690 for (i = 0; ret && i < count; i++)
691 {
692 size = 0;
694 if (ret)
695 {
697
698 if (buf)
699 {
701 if (ret)
702 ret = CertAddEncodedCRLToStore(memStore,
704 NULL);
706 }
707 }
708 }
709 if (ret)
710 {
711 CERT_STORE_PROV_INFO provInfo = { 0 };
712
713 provInfo.cbSize = sizeof(provInfo);
716 provInfo.hStoreProv = CryptMsgDuplicate(msg);
717 store = CRYPT_ProvCreateStore(dwFlags, memStore, &provInfo);
718 /* Msg store doesn't need crypto provider, so close it */
719 if (hCryptProv && !(dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG))
720 CryptReleaseContext(hCryptProv, 0);
721 }
722 else
723 CertCloseStore(memStore, 0);
724 }
725 TRACE("returning %p\n", store);
726 return store;
727}
728
730 DWORD dwFlags, const void *pvPara)
731{
733 WINECRYPT_CERTSTORE *store = NULL;
734 const CRYPT_DATA_BLOB *data = pvPara;
735 BOOL ret;
736 DWORD msgOpenFlags = dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG ? 0 :
738
739 TRACE("(%Id, %08lx, %p)\n", hCryptProv, dwFlags, pvPara);
740
742 hCryptProv, NULL, NULL);
743 ret = CryptMsgUpdate(msg, data->pbData, data->cbData, TRUE);
744 if (!ret)
745 {
748 hCryptProv, NULL, NULL);
749 ret = CryptMsgUpdate(msg, data->pbData, data->cbData, TRUE);
750 if (ret)
751 {
752 DWORD type, size = sizeof(type);
753
754 /* Only signed messages are allowed, check type */
756 if (ret && type != CMSG_SIGNED)
757 {
759 ret = FALSE;
760 }
761 }
762 }
763 if (ret)
764 store = CRYPT_MsgOpenStore(0, dwFlags, msg);
766 TRACE("returning %p\n", store);
767 return store;
768}
769
771 DWORD dwFlags, const void *pvPara)
772{
773 HCERTSTORE store;
774 const CRYPT_DATA_BLOB *data = pvPara;
775
776 TRACE("(%Id, %08lx, %p)\n", hCryptProv, dwFlags, pvPara);
777
779 {
781 return NULL;
782 }
783
786 if (store)
787 {
789 {
790 CertCloseStore(store, 0);
791 store = NULL;
792 }
793 }
794 TRACE("returning %p\n", store);
795 return (WINECRYPT_CERTSTORE*)store;
796}
797
799 DWORD dwFlags, const void *pvPara)
800{
802 FIXME("(%Id, %08lx, %p): stub\n", hCryptProv, dwFlags, pvPara);
803 else
804 FIXME("(%Id, %08lx, %s): stub\n", hCryptProv, dwFlags,
805 debugstr_w(pvPara));
806 return NULL;
807}
808
810 DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags,
811 const void* pvPara)
812{
814 StoreOpenFunc openFunc = NULL;
815
816 TRACE("(%s, %08lx, %08Ix, %08lx, %p)\n", debugstr_a(lpszStoreProvider),
817 dwMsgAndCertEncodingType, hCryptProv, dwFlags, pvPara);
818
819 if (IS_INTOID(lpszStoreProvider))
820 {
821 switch (LOWORD(lpszStoreProvider))
822 {
824 openFunc = CRYPT_MsgOpenStore;
825 break;
827 openFunc = CRYPT_MemOpenStore;
828 break;
830 openFunc = CRYPT_FileOpenStore;
831 break;
833 openFunc = CRYPT_PKCSOpenStore;
834 break;
836 openFunc = CRYPT_SerializedOpenStore;
837 break;
839 openFunc = CRYPT_RegOpenStore;
840 break;
842 openFunc = CRYPT_FileNameOpenStoreA;
843 break;
845 openFunc = CRYPT_FileNameOpenStoreW;
846 break;
848 openFunc = CRYPT_CollectionOpenStore;
849 break;
851 openFunc = CRYPT_SysOpenStoreA;
852 break;
854 openFunc = CRYPT_SysOpenStoreW;
855 break;
857 openFunc = CRYPT_SysRegOpenStoreA;
858 break;
860 openFunc = CRYPT_SysRegOpenStoreW;
861 break;
863 openFunc = CRYPT_PhysOpenStoreW;
864 break;
865 default:
866 if (LOWORD(lpszStoreProvider))
867 FIXME("unimplemented type %d\n", LOWORD(lpszStoreProvider));
868 }
869 }
870 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_MEMORY))
871 openFunc = CRYPT_MemOpenStore;
872 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_FILENAME_W))
873 openFunc = CRYPT_FileOpenStore;
874 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_SYSTEM))
875 openFunc = CRYPT_SysOpenStoreW;
876 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_PKCS7))
877 openFunc = CRYPT_PKCSOpenStore;
878 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_SERIALIZED))
879 openFunc = CRYPT_SerializedOpenStore;
880 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_COLLECTION))
881 openFunc = CRYPT_CollectionOpenStore;
882 else if (!stricmp(lpszStoreProvider, sz_CERT_STORE_PROV_SYSTEM_REGISTRY))
883 openFunc = CRYPT_SysRegOpenStoreW;
884 else
885 {
886 FIXME("unimplemented type %s\n", lpszStoreProvider);
887 openFunc = NULL;
888 }
889
890 if (!openFunc)
891 hcs = CRYPT_ProvOpenStore(lpszStoreProvider, dwMsgAndCertEncodingType,
892 hCryptProv, dwFlags, pvPara);
893 else
894 hcs = openFunc(hCryptProv, dwFlags, pvPara);
895 return hcs;
896}
897
899 LPCSTR szSubSystemProtocol)
900{
901 if (!szSubSystemProtocol)
902 {
904 return 0;
905 }
907 CERT_SYSTEM_STORE_CURRENT_USER, szSubSystemProtocol);
908}
909
911 LPCWSTR szSubSystemProtocol)
912{
913 if (!szSubSystemProtocol)
914 {
916 return 0;
917 }
919 CERT_SYSTEM_STORE_CURRENT_USER, szSubSystemProtocol);
920}
921
923{
924 cert_t *prev = pPrev ? cert_from_ptr(pPrev) : NULL, *ret;
925 WINECRYPT_CERTSTORE *hcs = hCertStore;
926
927 TRACE("(%p, %p)\n", hCertStore, pPrev);
928 if (!hCertStore)
929 ret = NULL;
930 else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
931 ret = NULL;
932 else
933 ret = (cert_t*)hcs->vtbl->certs.enumContext(hcs, prev ? &prev->base : NULL);
934 return ret ? &ret->ctx : NULL;
935}
936
938{
940
941 TRACE("(%p)\n", pCertContext);
942
943 if (!pCertContext)
944 return TRUE;
945
946 hcs = pCertContext->hCertStore;
947
949 return FALSE;
950
951 return hcs->vtbl->certs.delete(hcs, &cert_from_ptr(pCertContext)->base);
952}
953
955 PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition,
956 PCCRL_CONTEXT* ppStoreContext)
957{
958 WINECRYPT_CERTSTORE *store = hCertStore;
959 BOOL ret = TRUE;
960 PCCRL_CONTEXT toAdd = NULL, existing = NULL;
961
962 TRACE("(%p, %p, %08lx, %p)\n", hCertStore, pCrlContext,
963 dwAddDisposition, ppStoreContext);
964
965 /* Weird case to pass a test */
966 if (dwAddDisposition == 0)
967 {
969 return FALSE;
970 }
971 if (dwAddDisposition != CERT_STORE_ADD_ALWAYS)
972 {
973 existing = CertFindCRLInStore(hCertStore, 0, 0, CRL_FIND_EXISTING,
974 pCrlContext, NULL);
975 }
976
977 switch (dwAddDisposition)
978 {
980 toAdd = CertDuplicateCRLContext(pCrlContext);
981 break;
983 if (existing)
984 {
985 TRACE("found matching CRL, not adding\n");
987 ret = FALSE;
988 }
989 else
990 toAdd = CertDuplicateCRLContext(pCrlContext);
991 break;
993 if (existing)
994 {
995 LONG newer = CompareFileTime(&existing->pCrlInfo->ThisUpdate,
996 &pCrlContext->pCrlInfo->ThisUpdate);
997
998 if (newer < 0)
999 toAdd = CertDuplicateCRLContext(pCrlContext);
1000 else
1001 {
1002 TRACE("existing CRL is newer, not adding\n");
1004 ret = FALSE;
1005 }
1006 }
1007 else
1008 toAdd = CertDuplicateCRLContext(pCrlContext);
1009 break;
1011 if (existing)
1012 {
1013 LONG newer = CompareFileTime(&existing->pCrlInfo->ThisUpdate,
1014 &pCrlContext->pCrlInfo->ThisUpdate);
1015
1016 if (newer < 0)
1017 {
1018 toAdd = CertDuplicateCRLContext(pCrlContext);
1019 Context_CopyProperties(toAdd, existing);
1020 }
1021 else
1022 {
1023 TRACE("existing CRL is newer, not adding\n");
1025 ret = FALSE;
1026 }
1027 }
1028 else
1029 toAdd = CertDuplicateCRLContext(pCrlContext);
1030 break;
1032 toAdd = CertDuplicateCRLContext(pCrlContext);
1033 break;
1035 toAdd = CertDuplicateCRLContext(pCrlContext);
1036 if (existing)
1037 Context_CopyProperties(toAdd, existing);
1038 break;
1040 if (existing)
1041 {
1042 Context_CopyProperties(existing, pCrlContext);
1043 if (ppStoreContext)
1044 *ppStoreContext = CertDuplicateCRLContext(existing);
1045 }
1046 else
1047 toAdd = CertDuplicateCRLContext(pCrlContext);
1048 break;
1049 default:
1050 FIXME("Unimplemented add disposition %ld\n", dwAddDisposition);
1051 ret = FALSE;
1052 }
1053
1054 if (toAdd)
1055 {
1056 if (store) {
1057 context_t *ret_context;
1058 ret = store->vtbl->crls.addContext(store, context_from_ptr(toAdd),
1059 existing ? context_from_ptr(existing) : NULL, ppStoreContext ? &ret_context : NULL, FALSE);
1060 if (ret && ppStoreContext)
1061 *ppStoreContext = context_ptr(ret_context);
1062 }else if (ppStoreContext) {
1063 *ppStoreContext = CertDuplicateCRLContext(toAdd);
1064 }
1065 CertFreeCRLContext(toAdd);
1066 }
1067 if (existing)
1068 CertFreeCRLContext(existing);
1069
1070 TRACE("returning %d\n", ret);
1071 return ret;
1072}
1073
1075{
1077 BOOL ret;
1078
1079 TRACE("(%p)\n", pCrlContext);
1080
1081 if (!pCrlContext)
1082 return TRUE;
1083
1084 hcs = pCrlContext->hCertStore;
1085
1087 return FALSE;
1088
1089 ret = hcs->vtbl->crls.delete(hcs, &crl_from_ptr(pCrlContext)->base);
1090 if (ret)
1091 ret = CertFreeCRLContext(pCrlContext);
1092 return ret;
1093}
1094
1096{
1097 crl_t *ret, *prev = pPrev ? crl_from_ptr(pPrev) : NULL;
1098 WINECRYPT_CERTSTORE *hcs = hCertStore;
1099
1100 TRACE("(%p, %p)\n", hCertStore, pPrev);
1101 if (!hCertStore)
1102 ret = NULL;
1103 else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
1104 ret = NULL;
1105 else
1106 ret = (crl_t*)hcs->vtbl->crls.enumContext(hcs, prev ? &prev->base : NULL);
1107 return ret ? &ret->ctx : NULL;
1108}
1109
1111{
1112 WINECRYPT_CERTSTORE *hcs = hCertStore;
1113
1114 TRACE("(%p)\n", hCertStore);
1115
1116 if (hcs && hcs->dwMagic == WINE_CRYPTCERTSTORE_MAGIC)
1117 hcs->vtbl->addref(hcs);
1118 return hCertStore;
1119}
1120
1122{
1123 WINECRYPT_CERTSTORE *hcs = hCertStore;
1124 DWORD res;
1125
1126 TRACE("(%p, %08lx)\n", hCertStore, dwFlags);
1127
1128 if( ! hCertStore )
1129 return TRUE;
1130
1131 if ( hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC )
1132 return FALSE;
1133
1134 res = hcs->vtbl->release(hcs, dwFlags);
1135 if (res != ERROR_SUCCESS) {
1137 return FALSE;
1138 }
1139
1140 return TRUE;
1141}
1142
1144 DWORD dwCtrlType, void const *pvCtrlPara)
1145{
1146 WINECRYPT_CERTSTORE *hcs = hCertStore;
1147 BOOL ret;
1148
1149 TRACE("(%p, %08lx, %ld, %p)\n", hCertStore, dwFlags, dwCtrlType,
1150 pvCtrlPara);
1151
1152 if (!hcs)
1153 ret = FALSE;
1154 else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
1155 ret = FALSE;
1156 else
1157 {
1158 if (hcs->vtbl->control)
1159 ret = hcs->vtbl->control(hcs, dwFlags, dwCtrlType, pvCtrlPara);
1160 else
1161 ret = TRUE;
1162 }
1163 return ret;
1164}
1165
1167 void *pvData, DWORD *pcbData)
1168{
1169 WINECRYPT_CERTSTORE *store = hCertStore;
1170 BOOL ret = FALSE;
1171
1172 TRACE("(%p, %ld, %p, %p)\n", hCertStore, dwPropId, pvData, pcbData);
1173
1174 switch (dwPropId)
1175 {
1177 if (!pvData)
1178 {
1179 *pcbData = sizeof(DWORD);
1180 ret = TRUE;
1181 }
1182 else if (*pcbData < sizeof(DWORD))
1183 {
1185 *pcbData = sizeof(DWORD);
1186 }
1187 else
1188 {
1189 DWORD state = 0;
1190
1191 if (store->type != StoreTypeMem &&
1194 *(DWORD *)pvData = state;
1195 ret = TRUE;
1196 }
1197 break;
1198 default:
1199 if (store->properties)
1200 {
1202
1204 &blob);
1205 if (ret)
1206 {
1207 if (!pvData)
1208 *pcbData = blob.cbData;
1209 else if (*pcbData < blob.cbData)
1210 {
1212 *pcbData = blob.cbData;
1213 ret = FALSE;
1214 }
1215 else
1216 {
1217 memcpy(pvData, blob.pbData, blob.cbData);
1218 *pcbData = blob.cbData;
1219 }
1220 }
1221 else
1223 }
1224 else
1226 }
1227 return ret;
1228}
1229
1231 DWORD dwFlags, const void *pvData)
1232{
1233 WINECRYPT_CERTSTORE *store = hCertStore;
1234 BOOL ret = FALSE;
1235
1236 TRACE("(%p, %ld, %08lx, %p)\n", hCertStore, dwPropId, dwFlags, pvData);
1237
1238 if (!store->properties)
1240 switch (dwPropId)
1241 {
1244 break;
1245 default:
1246 if (pvData)
1247 {
1248 const CRYPT_DATA_BLOB *blob = pvData;
1249
1251 blob->pbData, blob->cbData);
1252 }
1253 else
1254 {
1256 ret = TRUE;
1257 }
1258 }
1259 return ret;
1260}
1261
1263 void *pvSystemStoreLocationPara, HKEY *key)
1264{
1265 HKEY root;
1266 LPCWSTR base;
1267
1268 TRACE("(%08lx, %p)\n", dwFlags, pvSystemStoreLocationPara);
1269
1271 {
1275 break;
1279 break;
1281 /* hklm\Software\Microsoft\Cryptography\Services\servicename\
1282 * SystemCertificates
1283 */
1284 FIXME("CERT_SYSTEM_STORE_CURRENT_SERVICE\n");
1285 return ERROR_FILE_NOT_FOUND;
1287 /* hklm\Software\Microsoft\Cryptography\Services\servicename\
1288 * SystemCertificates
1289 */
1290 FIXME("CERT_SYSTEM_STORE_SERVICES\n");
1291 return ERROR_FILE_NOT_FOUND;
1293 /* hku\user sid\Software\Microsoft\SystemCertificates */
1294 FIXME("CERT_SYSTEM_STORE_USERS\n");
1295 return ERROR_FILE_NOT_FOUND;
1299 break;
1303 break;
1305 /* hklm\Software\Microsoft\EnterpriseCertificates */
1306 FIXME("CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE\n");
1307 return ERROR_FILE_NOT_FOUND;
1308 default:
1309 return ERROR_FILE_NOT_FOUND;
1310 }
1311
1312 return RegOpenKeyExW(root, base, 0, KEY_READ, key);
1313}
1314
1315BOOL WINAPI CertEnumSystemStore(DWORD dwFlags, void *pvSystemStoreLocationPara,
1316 void *pvArg, PFN_CERT_ENUM_SYSTEM_STORE pfnEnum)
1317{
1318 BOOL ret = FALSE;
1319 LONG rc;
1320 HKEY key;
1321 CERT_SYSTEM_STORE_INFO info = { sizeof(info) };
1322
1323 TRACE("(%08lx, %p, %p, %p)\n", dwFlags, pvSystemStoreLocationPara, pvArg,
1324 pfnEnum);
1325
1326 rc = CRYPT_OpenParentStore(dwFlags, pvArg, &key);
1327 if (!rc)
1328 {
1329 DWORD index = 0;
1330
1331 ret = TRUE;
1332 do {
1335
1336 rc = RegEnumKeyExW(key, index++, name, &size, NULL, NULL, NULL,
1337 NULL);
1338 if (!rc)
1339 ret = pfnEnum(name, dwFlags, &info, NULL, pvArg);
1340 } while (ret && !rc);
1341 if (ret && rc != ERROR_NO_MORE_ITEMS)
1342 SetLastError(rc);
1343 }
1344 else
1345 SetLastError(rc);
1346 /* Include root store for the local machine location (it isn't in the
1347 * registry)
1348 */
1351 ret = pfnEnum(L"Root", dwFlags, &info, NULL, pvArg);
1352 return ret;
1353}
1354
1355BOOL WINAPI CertEnumPhysicalStore(const void *pvSystemStore, DWORD dwFlags,
1356 void *pvArg, PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum)
1357{
1359 FIXME("(%p, %08lx, %p, %p): stub\n", pvSystemStore, dwFlags, pvArg,
1360 pfnEnum);
1361 else
1362 FIXME("(%s, %08lx, %p, %p): stub\n", debugstr_w(pvSystemStore),
1363 dwFlags, pvArg,
1364 pfnEnum);
1365 return FALSE;
1366}
1367
1369 LPCWSTR pwszStoreName, PCERT_PHYSICAL_STORE_INFO pStoreInfo, void *pvReserved)
1370{
1372 FIXME("(%p, %08lx, %s, %p, %p): stub\n", pvSystemStore, dwFlags,
1373 debugstr_w(pwszStoreName), pStoreInfo, pvReserved);
1374 else
1375 FIXME("(%s, %08lx, %s, %p, %p): stub\n", debugstr_w(pvSystemStore),
1376 dwFlags, debugstr_w(pwszStoreName), pStoreInfo, pvReserved);
1377 return FALSE;
1378}
1379
1381 LPCWSTR pwszStoreName)
1382{
1383 FIXME("(%p, %08lx, %s): stub\n", pvSystemStore, dwFlags, debugstr_w(pwszStoreName));
1384 return TRUE;
1385}
1386
1388 PCERT_SYSTEM_STORE_INFO pStoreInfo, void *pvReserved)
1389{
1390 HCERTSTORE hstore;
1391
1393 {
1394 FIXME("(%p, %08lx, %p, %p): flag not supported\n", pvSystemStore, dwFlags, pStoreInfo, pvReserved);
1395 return FALSE;
1396 }
1397
1398 TRACE("(%s, %08lx, %p, %p)\n", debugstr_w(pvSystemStore), dwFlags, pStoreInfo, pvReserved);
1399
1400 hstore = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W, 0, 0, dwFlags, pvSystemStore);
1401 if (hstore)
1402 {
1403 CertCloseStore(hstore, 0);
1404 return TRUE;
1405 }
1406
1407 return FALSE;
1408}
1409
1411{
1412 HCERTSTORE hstore;
1413
1415 {
1416 FIXME("(%p, %08lx): flag not supported\n", pvSystemStore, dwFlags);
1417 return FALSE;
1418 }
1419 TRACE("(%s, %08lx)\n", debugstr_w(pvSystemStore), dwFlags);
1420
1422 if (hstore == NULL)
1423 return FALSE;
1424
1426 if (hstore == NULL && GetLastError() == 0)
1427 return TRUE;
1428
1429 return FALSE;
1430}
1431
1433{
1434 TRACE("(%p)\n", store);
1435}
1436
1438{
1439 TRACE("(%p)\n", store);
1440 return E_UNEXPECTED;
1441}
1442
1444{
1446}
1447
1449 context_t *replace, context_t **ret_context, BOOL use_link)
1450{
1451 TRACE("(%p, %p, %p, %p)\n", store, context, replace, ret_context);
1452
1453 /* FIXME: We should clone the context */
1454 if(ret_context) {
1456 *ret_context = context;
1457 }
1458
1459 return TRUE;
1460}
1461
1463{
1464 TRACE("(%p, %p)\n", store, prev);
1465
1467 return NULL;
1468}
1469
1471{
1472 return TRUE;
1473}
1474
1475static BOOL EmptyStore_control(WINECRYPT_CERTSTORE *store, DWORD flags, DWORD ctrl_type, void const *ctrl_para)
1476{
1477 TRACE("()\n");
1478
1480 return FALSE;
1481}
1482
1488 {
1492 }, {
1496 }, {
1500 }
1501};
1502
1504
1506{
1508}
static int state
Definition: maze.c:121
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
static REGSAM sam
Definition: query.c:143
void newer(int argc, const char *argv[])
Definition: cmds.c:2278
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static int list_empty(struct list_entry *head)
Definition: list.h:58
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define RegCloseKey(hKey)
Definition: registry.h:49
struct _root root
Definition: list.h:37
BOOL WINAPI CertAddStoreToCollection(HCERTSTORE hCollectionStore, HCERTSTORE hSiblingStore, DWORD dwUpdateFlags, DWORD dwPriority)
WINECRYPT_CERTSTORE * CRYPT_CollectionOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
const void *(WINAPI * EnumContextsInStoreFunc)(HCERTSTORE hCertStore, const void *pPrevContext)
static void * context_ptr(context_t *context)
void ContextPropertyList_Free(CONTEXT_PROPERTY_LIST *list)
Definition: proplist.c:56
enum _CertStoreType CertStoreType
WINECRYPT_CERTSTORE * CRYPT_ProvOpenStore(LPCSTR lpszStoreProvider, DWORD dwEncodingType, HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: provstore.c:375
WINECRYPT_CERTSTORE * CRYPT_ProvCreateStore(DWORD dwFlags, WINECRYPT_CERTSTORE *memStore, const CERT_STORE_PROV_INFO *pProvInfo)
Definition: provstore.c:307
WINECRYPT_CERTSTORE * CRYPT_FileNameOpenStoreA(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: filestore.c:380
BOOL(WINAPI * SerializeElementFunc)(const void *context, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
void CRYPT_ImportSystemRootCertsToReg(void)
Definition: rootstore.c:738
WINECRYPT_CERTSTORE * CRYPT_RegOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: regstore.c:504
static crl_t * crl_from_ptr(const CRL_CONTEXT *ptr)
struct WINE_CRYPTCERTSTORE *(* StoreOpenFunc)(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
CONTEXT_PROPERTY_LIST * ContextPropertyList_Create(void)
Definition: proplist.c:43
BOOL CRYPT_ReadSerializedStoreFromBlob(const CRYPT_DATA_BLOB *blob, HCERTSTORE store)
Definition: serialize.c:765
#define WINE_CRYPTCERTSTORE_MAGIC
BOOL(WINAPI * AddContextToStoreFunc)(HCERTSTORE hCertStore, const void *context, DWORD dwAddDisposition, const void **ppStoreContext)
WINECRYPT_CERTSTORE * CRYPT_FileOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: filestore.c:241
BOOL(WINAPI * GetContextPropertyFunc)(const void *context, DWORD dwPropID, void *pvData, DWORD *pcbData)
static context_t * context_from_ptr(const void *ptr)
BOOL ContextPropertyList_FindProperty(CONTEXT_PROPERTY_LIST *list, DWORD id, PCRYPT_DATA_BLOB blob)
Definition: proplist.c:72
BOOL(WINAPI * SetContextPropertyFunc)(const void *context, DWORD dwPropID, DWORD dwFlags, const void *pvData)
@ StoreTypeEmpty
@ StoreTypeMem
WINECRYPT_CERTSTORE * CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: filestore.c:291
static cert_t * cert_from_ptr(const CERT_CONTEXT *ptr)
void ContextPropertyList_RemoveProperty(CONTEXT_PROPERTY_LIST *list, DWORD id)
Definition: proplist.c:149
const void *(WINAPI * CreateContextFunc)(DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded)
BOOL(WINAPI * DeleteContextFunc)(const void *contex)
#define IS_INTOID(x)
BOOL ContextPropertyList_SetProperty(CONTEXT_PROPERTY_LIST *list, DWORD id, const BYTE *pbData, size_t cbData)
Definition: proplist.c:95
DWORD(WINAPI * EnumPropertiesFunc)(const void *context, DWORD dwPropId)
BOOL(WINAPI * AddEncodedContextToStoreFunc)(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwAddDisposition, const void **ppContext)
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define E_INVALIDARG
Definition: ddrawi.h:101
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, DWORD dwFlags)
Definition: crypt.c:641
BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition, PCCERT_CONTEXT *ppStoreContext)
Definition: cert.c:284
PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded)
Definition: cert.c:314
BOOL WINAPI CertAddEncodedCertificateToStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded, DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext)
Definition: cert.c:56
BOOL WINAPI CertSetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: cert.c:838
BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: cert.c:615
DWORD WINAPI CertEnumCertificateContextProperties(PCCERT_CONTEXT pCertContext, DWORD dwPropId)
Definition: cert.c:378
void Context_AddRef(context_t *context)
Definition: context.c:78
void Context_Release(context_t *context)
Definition: context.c:106
void Context_Free(context_t *context)
Definition: context.c:90
void Context_CopyProperties(const void *to, const void *from)
Definition: context.c:123
BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: crl.c:566
DWORD WINAPI CertEnumCRLContextProperties(PCCRL_CONTEXT pCRLContext, DWORD dwPropId)
Definition: crl.c:489
BOOL WINAPI CertFreeCRLContext(PCCRL_CONTEXT pCrlContext)
Definition: crl.c:480
BOOL WINAPI CertSetCRLContextProperty(PCCRL_CONTEXT pCRLContext, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: crl.c:660
PCCRL_CONTEXT WINAPI CertDuplicateCRLContext(PCCRL_CONTEXT pCrlContext)
Definition: crl.c:472
PCCRL_CONTEXT WINAPI CertFindCRLInStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType, const void *pvFindPara, PCCRL_CONTEXT pPrevCrlContext)
Definition: crl.c:381
BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded, DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext)
Definition: crl.c:223
PCCRL_CONTEXT WINAPI CertCreateCRLContext(DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded)
Definition: crl.c:179
PCCTL_CONTEXT WINAPI CertEnumCTLsInStore(HCERTSTORE hCertStore, PCCTL_CONTEXT pPrev)
Definition: ctl.c:200
PCCTL_CONTEXT WINAPI CertCreateCTLContext(DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded)
Definition: ctl.c:363
BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext)
Definition: ctl.c:341
BOOL WINAPI CertSetCTLContextProperty(PCCTL_CONTEXT pCTLContext, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: ctl.c:685
DWORD WINAPI CertEnumCTLContextProperties(PCCTL_CONTEXT pCTLContext, DWORD dwPropId)
Definition: ctl.c:508
BOOL WINAPI CertGetCTLContextProperty(PCCTL_CONTEXT pCTLContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: ctl.c:590
BOOL WINAPI CertAddEncodedCTLToStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded, DWORD dwAddDisposition, PCCTL_CONTEXT *ppCtlContext)
Definition: ctl.c:177
BOOL WINAPI CertAddCTLContextToStore(HCERTSTORE hCertStore, PCCTL_CONTEXT pCtlContext, DWORD dwAddDisposition, PCCTL_CONTEXT *ppStoreContext)
Definition: ctl.c:63
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
Definition: main.c:136
VOID WINAPI CryptMemFree(LPVOID pv)
Definition: main.c:146
HCRYPTMSG WINAPI CryptMsgOpenToDecode(DWORD dwMsgEncodingType, DWORD dwFlags, DWORD dwMsgType, HCRYPTPROV_LEGACY hCryptProv, PCERT_INFO pRecipientInfo, PCMSG_STREAM_INFO pStreamInfo)
Definition: msg.c:3634
BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, DWORD dwIndex, void *pvData, DWORD *pcbData)
Definition: msg.c:3708
BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData, DWORD cbData, BOOL fFinal)
Definition: msg.c:3698
HCRYPTMSG WINAPI CryptMsgDuplicate(HCRYPTMSG hCryptMsg)
Definition: msg.c:3666
BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg)
Definition: msg.c:3679
static context_t * EmptyStore_enum(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: store.c:1462
BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore, PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition, PCCRL_CONTEXT *ppStoreContext)
Definition: store.c:954
static WINECRYPT_CERTSTORE * CRYPT_SysOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:538
static DWORD MemStore_release(WINECRYPT_CERTSTORE *cert_store, DWORD flags)
Definition: store.c:323
static WINECRYPT_CERTSTORE * CRYPT_PKCSOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:729
static void * msgProvFuncs[]
Definition: store.c:647
static WINECRYPT_CERTSTORE * CRYPT_SysRegOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:404
static context_t * MemStore_enumCRL(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: store.c:271
BOOL WINAPI CertRegisterSystemStore(const void *pvSystemStore, DWORD dwFlags, PCERT_SYSTEM_STORE_INFO pStoreInfo, void *pvReserved)
Definition: store.c:1387
static void EmptyStore_addref(WINECRYPT_CERTSTORE *store)
Definition: store.c:1432
void CRYPT_InitStore(WINECRYPT_CERTSTORE *store, DWORD dwFlags, CertStoreType type, const store_vtbl_t *vtbl)
Definition: store.c:88
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:809
BOOL WINAPI I_CertUpdateStore(HCERTSTORE store1, HCERTSTORE store2, DWORD unk0, DWORD unk1)
Definition: store.c:106
static context_t * MemStore_enumContext(WINE_MEMSTORE *store, struct list *list, context_t *prev)
Definition: store.c:174
static WINECRYPT_CERTSTORE * CRYPT_SerializedOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:770
void CRYPT_FreeStore(WINECRYPT_CERTSTORE *store)
Definition: store.c:98
BOOL WINAPI CertSetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: store.c:1230
static const WINE_CONTEXT_INTERFACE gCertInterface
Definition: store.c:40
static const store_vtbl_t MemStoreVtbl
Definition: store.c:352
static const store_vtbl_t EmptyStoreVtbl
Definition: store.c:1483
static DWORD EmptyStore_release(WINECRYPT_CERTSTORE *store, DWORD flags)
Definition: store.c:1437
static WINECRYPT_CERTSTORE * CRYPT_PhysOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:798
static BOOL MemStore_addCTL(WINECRYPT_CERTSTORE *store, context_t *ctl, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
Definition: store.c:289
static BOOL EmptyStore_add(WINECRYPT_CERTSTORE *store, context_t *context, context_t *replace, context_t **ret_context, BOOL use_link)
Definition: store.c:1448
BOOL WINAPI CertRegisterPhysicalStore(const void *pvSystemStore, DWORD dwFlags, LPCWSTR pwszStoreName, PCERT_PHYSICAL_STORE_INFO pStoreInfo, void *pvReserved)
Definition: store.c:1368
const WINE_CONTEXT_INTERFACE * pCTLInterface
Definition: store.c:77
BOOL WINAPI CertControlStore(HCERTSTORE hCertStore, DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara)
Definition: store.c:1143
const WINE_CONTEXT_INTERFACE * pCertInterface
Definition: store.c:51
static WINECRYPT_CERTSTORE * CRYPT_MemOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:372
static BOOL MemStore_addCRL(WINECRYPT_CERTSTORE *store, context_t *crl, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
Definition: store.c:261
static BOOL MemStore_deleteCRL(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:280
static void MemStore_releaseContext(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:227
struct _WINE_MEMSTORE WINE_MEMSTORE
BOOL WINAPI CertEnumPhysicalStore(const void *pvSystemStore, DWORD dwFlags, void *pvArg, PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum)
Definition: store.c:1355
static WINECRYPT_CERTSTORE * CRYPT_SysOpenStoreA(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:610
HCERTSTORE WINAPI CertDuplicateStore(HCERTSTORE hCertStore)
Definition: store.c:1110
static WINECRYPT_CERTSTORE * CRYPT_SysRegOpenStoreA(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:509
static void WINAPI CRYPT_MsgCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
Definition: store.c:639
static void MemStore_addref(WINECRYPT_CERTSTORE *store)
Definition: store.c:317
BOOL WINAPI CertEnumSystemStore(DWORD dwFlags, void *pvSystemStoreLocationPara, void *pvArg, PFN_CERT_ENUM_SYSTEM_STORE pfnEnum)
Definition: store.c:1315
static BOOL MemStore_control(WINECRYPT_CERTSTORE *store, DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara)
Definition: store.c:345
BOOL WINAPI CertUnregisterPhysicalStore(const void *pvSystemStore, DWORD dwFlags, LPCWSTR pwszStoreName)
Definition: store.c:1380
static const WINE_CONTEXT_INTERFACE gCTLInterface
Definition: store.c:66
BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext)
Definition: store.c:1074
static BOOL EmptyStore_delete(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:1470
BOOL WINAPI CertUnregisterSystemStore(const void *pvSystemStore, DWORD dwFlags)
Definition: store.c:1410
const WINE_CONTEXT_INTERFACE * pCRLInterface
Definition: store.c:64
static BOOL MemStore_deleteContext(WINE_MEMSTORE *store, context_t *context)
Definition: store.c:198
void init_empty_store(void)
Definition: store.c:1505
static BOOL MemStore_deleteCert(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:252
static WINECRYPT_CERTSTORE * CRYPT_MsgOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:651
static context_t * MemStore_enumCert(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: store.c:243
static void free_contexts(struct list *list)
Definition: store.c:215
static BOOL MemStore_deleteCTL(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:308
static LONG CRYPT_OpenParentStore(DWORD dwFlags, void *pvSystemStoreLocationPara, HKEY *key)
Definition: store.c:1262
static BOOL MemStore_addCert(WINECRYPT_CERTSTORE *store, context_t *cert, context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
Definition: store.c:234
PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore, PCCRL_CONTEXT pPrev)
Definition: store.c:1095
static const WINE_CONTEXT_INTERFACE gCRLInterface
Definition: store.c:53
PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrev)
Definition: store.c:922
HCERTSTORE WINAPI CertOpenSystemStoreA(HCRYPTPROV_LEGACY hProv, LPCSTR szSubSystemProtocol)
Definition: store.c:898
WINECRYPT_CERTSTORE empty_store
Definition: store.c:1503
static BOOL MemStore_addContext(WINE_MEMSTORE *store, struct list *list, context_t *orig_context, context_t *existing, context_t **ret_context, BOOL use_link)
Definition: store.c:143
BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
Definition: store.c:1121
static void EmptyStore_releaseContext(WINECRYPT_CERTSTORE *store, context_t *context)
Definition: store.c:1443
BOOL WINAPI CertGetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: store.c:1166
static context_t * MemStore_enumCTL(WINECRYPT_CERTSTORE *store, context_t *prev)
Definition: store.c:299
static BOOL EmptyStore_control(WINECRYPT_CERTSTORE *store, DWORD flags, DWORD ctrl_type, void const *ctrl_para)
Definition: store.c:1475
BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext)
Definition: store.c:937
HCERTSTORE WINAPI CertOpenSystemStoreW(HCRYPTPROV_LEGACY hProv, LPCWSTR szSubSystemProtocol)
Definition: store.c:910
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define CP_ACP
Definition: compat.h:109
#define SetLastError(x)
Definition: compat.h:752
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define stricmp(_String1, _String2)
Definition: compat.h:24
#define MAX_PATH
Definition: compat.h:34
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrlenW
Definition: compat.h:750
LONG WINAPI CompareFileTime(IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2)
Definition: time.c:106
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4171
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STATUS_ACCESS_VIOLATION
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint res
Definition: glext.h:9613
GLsizeiptr size
Definition: glext.h:5919
GLuint index
Definition: glext.h:6031
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
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
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
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static const BYTE crl[]
Definition: message.c:817
static BYTE cert[]
Definition: msg.c:1374
DWORD cert_store
Definition: store.c:342
static LPCWSTR LPVOID pvReserved
Definition: asmcache.c:749
static HCRYPTPROV hProv
Definition: rsaenh.c:32
static DWORD unk1
Definition: cursoricon.c:1804
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
_In_ LPWSTR _In_ DWORD _In_ LPCVOID pvData
Definition: netsh.h:116
#define KEY_ALL_ACCESS
Definition: nt_native.h:1044
#define KEY_READ
Definition: nt_native.h:1026
#define DWORD
Definition: nt_native.h:44
#define REG_OPENED_EXISTING_KEY
Definition: nt_native.h:1088
#define LOWORD(l)
Definition: pedump.c:82
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
_In_ _Out_writes_opt_ pcchValueName _Inout_opt_ LPDWORD _Out_opt_ _Out_writes_bytes_to_opt_ pcbData _Inout_opt_ LPDWORD pcbData
Definition: shlwapi.h:757
static unsigned __int64 next
Definition: rand_nt.c:6
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:38
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:115
#define memset(x, y, z)
Definition: compat.h:39
BOOL WINAPI CertSerializeCRLStoreElement(PCCRL_CONTEXT pCrlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
Definition: serialize.c:246
BOOL WINAPI CertSerializeCTLStoreElement(PCCTL_CONTEXT pCtlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
Definition: serialize.c:254
BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement)
Definition: serialize.c:238
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
CONTEXT_PROPERTY_LIST * properties
HCERTSTORE hCertStore
Definition: wincrypt.h:492
void ** rgpvStoreProvFunc
Definition: wincrypt.h:1275
HCERTSTOREPROV hStoreProv
Definition: wincrypt.h:1276
BOOL(* delete)(struct WINE_CRYPTCERTSTORE *, context_t *)
context_t *(* enumContext)(struct WINE_CRYPTCERTSTORE *store, context_t *prev)
BOOL(* addContext)(struct WINE_CRYPTCERTSTORE *, context_t *, context_t *, context_t **, BOOL)
HCERTSTORE hCertStore
Definition: wincrypt.h:735
PCRL_INFO pCrlInfo
Definition: wincrypt.h:734
FILETIME ThisUpdate
Definition: wincrypt.h:507
PRTL_CRITICAL_SECTION_DEBUG DebugInfo
Definition: rtltypes.h:1450
DeleteContextFunc deleteFromStore
AddContextToStoreFunc addContextToStore
EnumContextsInStoreFunc enumContextsInStore
struct list certs
Definition: store.c:83
CRITICAL_SECTION cs
Definition: store.c:82
struct list ctls
Definition: store.c:85
WINECRYPT_CERTSTORE hdr
Definition: store.c:81
struct list crls
Definition: store.c:84
const context_vtbl_t * vtbl
struct list entry
union _context_t::@342 u
Definition: image.c:134
context_t base
struct _context_t *(* clone)(context_t *, struct WINE_CRYPTCERTSTORE *, BOOL)
Definition: http.c:7252
context_t base
Definition: copy.c:22
Definition: name.c:39
Definition: send.c:48
DWORD(* release)(struct WINE_CRYPTCERTSTORE *, DWORD)
void(* addref)(struct WINE_CRYPTCERTSTORE *)
CONTEXT_FUNCS crls
CONTEXT_FUNCS certs
BOOL(* control)(struct WINE_CRYPTCERTSTORE *, DWORD, DWORD, void const *)
#define LIST_ENTRY(type)
Definition: queue.h:175
#define DWORD_PTR
Definition: treelist.c:76
const char * LPCSTR
Definition: typedefs.h:52
const uint16_t * LPCWSTR
Definition: typedefs.h:57
unsigned char * LPBYTE
Definition: typedefs.h:53
uint16_t * LPWSTR
Definition: typedefs.h:56
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define sz_CERT_STORE_PROV_SERIALIZED
Definition: wincrypt.h:2482
#define CERT_STORE_PROV_PKCS7
Definition: wincrypt.h:2458
#define sz_CERT_STORE_PROV_FILENAME_W
Definition: wincrypt.h:2477
#define CERT_STORE_PROV_COLLECTION
Definition: wincrypt.h:2465
#define CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG
Definition: wincrypt.h:2743
ULONG_PTR HCRYPTPROV_LEGACY
Definition: wincrypt.h:57
#define CERT_STORE_ADD_REPLACE_EXISTING
Definition: wincrypt.h:2653
ULONG_PTR HCRYPTPROV
Definition: wincrypt.h:55
#define CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES
Definition: wincrypt.h:2657
#define CERT_STORE_PROV_FILENAME_A
Definition: wincrypt.h:2460
#define CERT_SYSTEM_STORE_SERVICES
Definition: wincrypt.h:2534
#define sz_CERT_STORE_PROV_COLLECTION
Definition: wincrypt.h:2483
#define sz_CERT_STORE_PROV_MEMORY
Definition: wincrypt.h:2476
#define CMSG_TYPE_PARAM
Definition: wincrypt.h:4090
#define CMSG_CRYPT_RELEASE_CONTEXT_FLAG
Definition: wincrypt.h:4032
#define sz_CERT_STORE_PROV_SYSTEM_REGISTRY
Definition: wincrypt.h:2485
#define CERT_STORE_OPEN_EXISTING_FLAG
Definition: wincrypt.h:2634
#define CERT_STORE_ADD_NEWER
Definition: wincrypt.h:2656
#define CERT_STORE_CREATE_NEW_FLAG
Definition: wincrypt.h:2633
void * HCRYPTMSG
Definition: wincrypt.h:61
#define sz_CERT_STORE_PROV_SYSTEM
Definition: wincrypt.h:2480
#define CERT_CLOSE_STORE_CHECK_FLAG
Definition: wincrypt.h:2648
#define CERT_SYSTEM_STORE_RELOCATE_FLAG
Definition: wincrypt.h:2787
#define CERT_STORE_PROV_SERIALIZED
Definition: wincrypt.h:2459
#define CERT_SYSTEM_STORE_LOCATION_MASK
Definition: wincrypt.h:2507
#define CERT_STORE_PROV_SYSTEM_REGISTRY_W
Definition: wincrypt.h:2467
#define CERT_STORE_PROV_FILENAME_W
Definition: wincrypt.h:2461
#define CERT_STORE_PROV_SYSTEM_A
Definition: wincrypt.h:2462
#define CERT_SYSTEM_STORE_CURRENT_SERVICE
Definition: wincrypt.h:2532
#define X509_ASN_ENCODING
Definition: wincrypt.h:2501
BOOL(WINAPI * PFN_CERT_ENUM_PHYSICAL_STORE)(const void *pvSystemStore, DWORD dwFlags, LPCWSTR pwszStoreName, PCERT_PHYSICAL_STORE_INFO pStoreInfo, void *pvReserved, void *pvArg)
Definition: wincrypt.h:1251
#define CERT_SYSTEM_STORE_USERS
Definition: wincrypt.h:2536
#define sz_CERT_STORE_PROV_PKCS7
Definition: wincrypt.h:2481
#define CERT_STORE_PROV_MEMORY
Definition: wincrypt.h:2455
#define CERT_STORE_PROV_REG
Definition: wincrypt.h:2457
#define CERT_STORE_PROV_FILE
Definition: wincrypt.h:2456
#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE
Definition: wincrypt.h:2542
#define CERT_STORE_PROV_MSG
Definition: wincrypt.h:2454
#define CERT_ACCESS_STATE_PROP_ID
Definition: wincrypt.h:2847
static const WCHAR CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH[]
Definition: wincrypt.h:2551
#define CERT_SYSTEM_STORE_LOCAL_MACHINE
Definition: wincrypt.h:2530
#define CERT_STORE_ADD_USE_EXISTING
Definition: wincrypt.h:2652
#define CERT_ACCESS_STATE_WRITE_PERSIST_FLAG
Definition: wincrypt.h:2913
#define CERT_STORE_ADD_NEW
Definition: wincrypt.h:2651
#define CMSG_SIGNED
Definition: wincrypt.h:3845
#define CERT_STORE_ADD_ALWAYS
Definition: wincrypt.h:2654
#define CERT_STORE_PROV_SYSTEM_W
Definition: wincrypt.h:2463
BOOL(WINAPI * PFN_CERT_ENUM_SYSTEM_STORE)(const void *pvSystemStore, DWORD dwFlags, PCERT_SYSTEM_STORE_INFO pStoreInfo, void *pvReserved, void *pvArg)
Definition: wincrypt.h:1247
static const WCHAR CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH[]
Definition: wincrypt.h:2554
#define CMSG_CRL_PARAM
Definition: wincrypt.h:4103
#define CERT_STORE_NO_CRYPT_RELEASE_FLAG
Definition: wincrypt.h:2621
#define CERT_SYSTEM_STORE_CURRENT_USER
Definition: wincrypt.h:2528
#define CERT_STORE_PROV_SYSTEM_REGISTRY_A
Definition: wincrypt.h:2466
#define PKCS_7_ASN_ENCODING
Definition: wincrypt.h:2503
#define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY
Definition: wincrypt.h:2538
#define CERT_STORE_DELETE_FLAG
Definition: wincrypt.h:2624
#define CERT_STORE_PROV_PHYSICAL_W
Definition: wincrypt.h:2469
#define CERT_STORE_READONLY_FLAG
Definition: wincrypt.h:2635
#define CMSG_CERT_COUNT_PARAM
Definition: wincrypt.h:4100
#define CMSG_CRL_COUNT_PARAM
Definition: wincrypt.h:4102
#define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY
Definition: wincrypt.h:2540
#define CMSG_CERT_PARAM
Definition: wincrypt.h:4101
#define CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES
Definition: wincrypt.h:2655
#define CRL_FIND_EXISTING
Definition: wincrypt.h:3076
#define WINAPI
Definition: msvc.h:6
#define CRYPT_E_NOT_FOUND
Definition: winerror.h:4421
#define ERROR_FILE_EXISTS
Definition: winerror.h:287
#define E_UNEXPECTED
Definition: winerror.h:3528
#define CRYPT_E_INVALID_MSG_TYPE
Definition: winerror.h:4402
#define CRYPT_E_PENDING_CLOSE
Definition: winerror.h:4432
#define CRYPT_E_EXISTS
Definition: winerror.h:4422
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1156
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
ACCESS_MASK REGSAM
Definition: winreg.h:76
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)