CertRegisterPhysicalStore function (wincrypt.h)

The CertRegisterPhysicalStore function adds a physical store to a registry system store collection.


BOOL CertRegisterPhysicalStore(
  [in] const void                *pvSystemStore,
  [in] DWORD                     dwFlags,
  [in] LPCWSTR                   pwszStoreName,
  [in] void                      *pvReserved


[in] pvSystemStore

The system store collection to which the physical store is added. This parameter 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 adding a ServiceName or ComputerName before the system store name string, see CertRegisterSystemStore.

[in] dwFlags

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

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

Value Meaning
The system store is not in its default registry location and the pvSystemStore parameter must be a pointer to a CERT_SYSTEM_STORE_RELOCATE_PARA structure.
The function fails if the physical store already exists in the store location.

[in] pwszStoreName

A pointer to a Unicode string that names the physical store to be added to the system store collection. To remove a physical store from the system store collection, call the CertUnregisterPhysicalStore function.

[in] pStoreInfo

A pointer to a CERT_PHYSICAL_STORE_INFO structure that provides basic information about the physical store.

[in] pvReserved

Reserved for future use and must be set to NULL.

Return value

If the function succeeds, the function returns nonzero.

If the function fails, it returns zero.


Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header wincrypt.h
Library Crypt32.lib
DLL Crypt32.dll

See also







Certificate Store Functions