CertEnumSystemStore

[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
);
 

Parameters

dwflags
Specifies the location of the system store. The following dwFlags are defined:

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.

pvSystemStoreLocationPara
If CERT_SYSTEM_STORE_RELOCATE_FLAG is set in dwFlags, pvSystemStore points to a CERT_SYSTEM_STORE_RELOCATE_PARA that indicates both the name and the location of the system store. Otherwise it is a pointer to a unicode string that names the system store.

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.

pvArg
Pointer to a void which allows the application to declare, define, and initialize a data structure to hold any information to be passed to the callback enumeration function.
pfnEnum
Pointer to the callback function used to show the details for each system store. This callback function determines the content and format for the presentation of information on each system store. The application must provide the callback function and must declare it with the following signature :
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.

Return Values

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

Call GetLastError to see the reason for any failures.

Remarks

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.

Example

See Example Code for Listing System and Physical Stores.

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, CertUnregisterSystemStore, CertUnregisterPhysicalStore, CertEnumSystemStoreLocation, CertEnumPhysicalStore