CertUnregisterPhysicalStore

[This is preliminary documentation and subject to change.]

The CertUnregisterPhysicalStore function removes a physical store from a specified system store collection. CertUnregisterPhysicalStore may also be used to delete the physical store.

#include <wincrypt.h>
BOOL WINAPI CertUnregisterPhysicalStore(
  const void *pvSystemStore,  // in
  DWORD dwFlags,              // in
  LPCWSTR pwszStoreName       // in
);
 

Parameters

pvSystemStore
Identifier of the system store collection that the physical store is to be removed from. It points to either a NULL terminated unicode string or to a CERT_SYSTEM_STORE_RELOCATE_PARA data structure. See CertRegisterSystemStore for details on using the data structure and on prepending a ServiceName or Computer name to the system store name string.
dwFlags
The HIWORD of the dwFlags parameter is used to specify the location of the system store. See CertRegisterSystemStore for details on defined HIWORD dwFlags and prepending ServiceName, UserNames, and ComputerNames to the system store name.

The following LOWORD dwFlags are also defined and may be ORed with HIWORD flags.

CERT_SYSTEM_STORE_RELOCATE_FLAG
When this flag is set, the system store is not in its default registry location and pvSystemStore must be a pointer to a CERT_SYSTEM_STORE_RELOCATE_PARA data structure.
CERT_STORE_DELETE_FLAG
When this flag is set, the physical store is first removed from the system store collection and is then deleted.
pwszStoreName
NULL terminated unicode string that indicates the name of the physical store.

Return Values

TRUE if the function succeeded. FALSE if the function failed.

Remarks

To access a remote store, the Security Permissions in the registry keys on that remote computer must be set to allow access. For more information on setting Security Permissions in an NT registry, see MDSN Article ID Q155363. For information on what to do to enable remote administration on a Win95 registry.

Example

LPCWSTR pwszSystemStore= L"My";
LPCWSTR pwszPStore=L"TestPStore";
DWORD dwFlags=CERT_SYSTEM_STORE_CURRENT_USER |CERT_STORE_DELETE_FLAG ;
//
if(CertUnregisterPhysicalStore(
pwszSystemStore,
dwFlags,
pwszPStore
            ))
printf("Store %S has been unregistered. \n", pwszPStore);
else
printf("The unregister operation failed.\n");
 

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in wincrypt.h.
  Import Library: Use crypt32.lib.

See Also

CertRegisterSystemStore, CertRegisterPhysicalStore, CertEnumSystemStoreLocation, CertEnumSystemStore, CertEnumPhysicalStore