[This is preliminary documentation and subject to change.]
The CertRegisterPhysicalStore function adds a physical Store to a registry system store collection.
#include <wincrypt.h>
BOOL WINAPI CertRegisterPhysicalStore(
const void *pvSystemStore, // in
DWORD dwFlags, // in
LPCWSTR pwszStoreName, // in
PCERT_PHYSICAL_STORE_INFO pStoreInfo, // in
void *pvReserved // in/optional
);
The following LOWORD dwFlags are also defined and may be ORed with HIWORD flags.
TRUE if the function succeeded. FALSE if the function failed.
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.
LPCWSTR pwszSystemStore = L"My"; LPcWSTR pwszStoreName = L"newstore"; CERT_PHYSICAL_STORE_INFO PhysicalStoreInfo DWORD dwFlags= CERT_SYSTEM_STORE_CURRENT_USER; // Initalize the PhysicalStoreInfo data structure. PhysicalStoreInfo.cbSize=sizeof(CERT_PHYSICAL_STORE_INFO); PhysicalStoreInfo.pszOpenStoreProvider=
CERT_STORE_PROV_FILENAME;PhysicalStoreInfo.dwFlags=CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG;
PhysicalStoreInfo.dwPriority=1;
PhysicalStoreInfo.dwOpenEncodingType=PKCS_7_ASN_ENCODING | X509_ASN_ENCODING;
if(CertRegisterPhysicalStore(
pwszSystemStoreName),
dwFlags,
pwszStoreName,
&PhyStoreInfo,
NULL
))
{
printf("Physical store %S is registered \n",pwszStoreName);
printf("As a store under %S \n",pvSystemStore);
}
else
printf("The physical store was not registered. \n");
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in wincrypt.h.
Import Library: Use crypt32.lib.
CertRegisterSystemStore, CertUnregisterPhysicalStore, CertEnumSystemStoreLocation, CertEnumSystemStore, CertEnumPhysicalStore