Desktop Functions: Smart Device Functions:
|
CertDuplicateStore (crypt32)
The CertDuplicateStore function duplicates a store handle by incrementing the store's reference count. C# Signature:
[DllImport("crypt32.dll", SetLastError=true)] VB Signature:
Declare Function CertDuplicateStore Lib "crypt32.dll" (TODO) As TODO User-Defined Types:None. Alternative Managed API:Do you know one? Please contribute it! Notes:None. Tips & Tricks:Please add some! Sample Code:The following example shows creating an alias for a store handle and incrementing the store's reference count. HCERTSTORE hSystemStore; // The system store handle. HCERTSTORE hDuplicateStore; // Handle for a store to be
//created //------------------------------------------------------------------- // Open a system store using CertOpenStore. if(hSystemStore = CertOpenStore(
CERT_STORE_PROV_SYSTEM, // The system store will be a {
printf("Opened the MY system store. \n"); } else {
printf( "Could not open the MY system store.\n"); } //-------------------------------------------------------------------- // Create a duplicate of the MY store. if(hDuplicateStore = CertDuplicateStore(hSystemStore)) {
printf("The MY store is duplicated.\n"); } else {
printf("Duplication of the MY store failed.\n."); } //-------------------------------------------------------------------- // Clean up by closing the store. if(hSystemStore)
CertCloseStore( if(hDuplicateStore)
CertCloseStore( Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|