This topic has not yet been rated - Rate this topic

CertUnregisterSystemStore function

Applies to: desktop apps only

The CertUnregisterSystemStore function unregisters a specified system store.

Syntax

BOOL WINAPI CertUnregisterSystemStore(
  __in  const void *pvSystemStore,
  __in  DWORD dwFlags
);

Parameters

pvSystemStore [in]

Identifies the system store to be unregistered. It points either to a null-terminated Unicode string or to a CERT_SYSTEM_STORE_RELOCATE_PARA structure. For information about using the structure and on appending a ServiceName or ComputerName to the end of the system store name string, see CertRegisterSystemStore.

dwFlags [in]

The high word of the dwFlags parameter specifies the location of the system store. For information about defined high-word flags and on appending ServiceName, UserNames, and ComputerNames to the end of the system store name, see CertRegisterSystemStore.

The following low-word values are also defined and can be combined with high-word values using a bitwise-OR operation.

ValueMeaning
CERT_SYSTEM_STORE_RELOCATE_FLAG

The system store is not in its default registry location and pvSystemStore must be a pointer to a CERT_SYSTEM_STORE_RELOCATE_PARA structure.

CERT_STORE_DELETE_FLAG

The system store is deleted after it has been unregistered.

 

Return value

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE.

Examples

The following example shows deleting a specified system store.



//--------------------------------------------------------------------
// Declare and initialize variables.
DWORD dwFlags = CERT_SYSTEM_STORE_CURRENT_USER;
LPCWSTR pvSystemName = L"NEWSTORE";  

//--------------------------------------------------------------------
//  Unregister the system store named "NEWSTORE".
//  This assumes that a system store named "NEWSTORE" is 
//  registered.
if(CertUnregisterSystemStore(
     pvSystemName,
     dwFlags))
{
      printf("System store %S has been unregistered.\n",pvSystemName);
}
else
{
      printf("The system store was not unregistered.\n");
}


For another example that uses this function, see Example C Program: Listing System and Physical Stores .

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Wincrypt.h

Library

Crypt32.lib

DLL

Crypt32.dll

See also

CERT_SYSTEM_STORE_RELOCATE_PARA
CertEnumPhysicalStore
CertEnumSystemStore
CertEnumSystemStoreLocation
Certificate Store Functions
CertRegisterPhysicalStore
CertRegisterSystemStore
CertUnregisterPhysicalStore

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ