[This is preliminary documentation and subject to change.]
The CertRegisterSystemStore function registers a system store.
#include <wincrypt.h>
BOOL WINAPI CertRegisterSystemStore(
const void *pvSystemStore, // in
DWORD dwFlags, // in
PCERT_SYSTEM_STORE_INFO pStoreInfo, // in
void *pvReserved // in/optional
);
Leading "\\" backslashes are optional before a ComputerName.
The following HIWORD dwFlags are defined:
CERT_SYSTEM_STORE_CURRENT_USER
CERT_SYSTEM_STORE_CURRENT_SERVICE
CERT_SYSTEM_STORE_SERVICES
CERT_SYSTEM_STORE_USERS
CERT_SYSTEM_STORE_LOCAL_MACHINE
CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY
When CERT_SYSTEM_STORE_CURRENT_USER is set, pvSystemStore may be a system store name that is prefixed with the UserName.
When CERT_SYSTEM_STORE_CURRENT_SERVICE is set, pvSystemStore may be a system store name that is prefixed with the ServiceName.
When CERT_SYSTEM_STORE_SERVICES or CERT_SYSTEM_STORE_USERS is set pvSystemStore must be a system store name that is prefixed with the ServiceName or UserName.
Stores on remote computers can be registered for CERT_SYSTEM_STORE_LOCAL_MACHINE, CERT_SYSTEM_STORE_SERVICES, CERT_SYSTEM_STORE_USERS or CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY
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.
DWORD dwFlags= CERT_SYSTEM_STORE_CURRENT_USER;
LPCWSTR pySystemName= L"NEWSTORE"; // for this setting of
// dwFlags, the store name may
// be prefixed with a user name.
if(CertRegisterSystemStore(
pvSystemName,
dwFlags,
NULL,
NULL
))
printf("System store %S is registered \n",pvSystemName);
else
printf("The system store did not register. \n");
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in wincrypt.h.
Import Library: Use crypt32.lib.
CertRegisterPhysicalStore, CertUnregisterSystemStore, CertUnregisterPhysicalStore, CertEnumSystemStoreLocation, CertEnumSystemStore, CertEnumPhysicalStore