[This is preliminary documentation and subject to change.]
The CertEnumSystemStore function enumerates all available system stores.
#include wincrypt.h
BOOL WINAPI CertEnumSystemStore(
DWORD dwFlags, // in
void *pvSystemStoreLocationPara, // in optional
void *pvArg, // in
PFN_CERT_ENUM_SYSTEM_STORE pfnEnum // in
);
CERT_SYSTEM_STORE_CURRENT_USER
CERT_SYSTEM_STORE_CURRENT_SERVICE
CERT_SYSTEM_STORE_LOCAL_MACHINE
CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY
CERT_SYSTEM_STORE_CURRENT_MACHINE_GROUP_POLICY
CERT_SYSTEM_STORE_SERVICES
CERT_SYSTEM_STORE_USERS
In addition CERT_SYSTEM_STORE_RELOCATE_FLAG may be combined with any location flags using a bitwise OR.
For CERT_SYSTEM_STORE_LOCAL_MACHINE or CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY, pvSystemStoreLocationPara can optionally be set to a unicode computer name for enumerating local machine stores on a remote computer. For example, "\\ComputerName" or "ComputerName". The leading "\\" backslashes are optional in the ComputerName.
For CERT_SYSTEM_STORE_SERVICES or CERT_SYSTEM_STORE_USERS, if pvSystemStoreLocationPara is NULL, then, the function enumerates both the service/user names and the stores for each service/user name. Otherwise, pvSystemStoreLocationPara is a unicode string specifying a remote computer name and/or service/user name. For example: "ServiceName,""\\ComputerName," or "ComputerName\"
If only the ComputerName is specified, it must have either the leading "\\" backslashes or a trailing backslash. Otherwise, it is interpreted as the ServiceName or UserName.
BOOL WINAPI CertEnumSystemStoreCallback(
const void *pvSystemStore, // in
DWORD dwFlags, // in
PCERT_SYSTEM_STORE_INFO pStoreInfo, // in
void *pvReserved, // in, optional
void *pvArg // in, optional
);
The pvArg passed by CertEnumSystemStore to the callback function is the pvArg pointer passed to CertEnumSystemStore.
TRUE if the function succeeded. FALSE if the function failed.
Call GetLastError to see the reason for any failures.
To use CertEnumSystemStore, the application must declare and define the ENUM_ARG data structure and an enumeration callback function.
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.
See Example Code for Listing System and Physical Stores.
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in wincrypt.h.
Import Library: Use crypt32.lib.
CertRegisterSystemStore, CertRegisterPhysicalStore, CertUnregisterSystemStore, CertUnregisterPhysicalStore, CertEnumSystemStoreLocation, CertEnumPhysicalStore