NCryptEnumStorageProviders function (ncrypt.h)

The NCryptEnumStorageProviders function obtains the names of the registered key storage providers.

Syntax

SECURITY_STATUS NCryptEnumStorageProviders(
  [out] DWORD              *pdwProviderCount,
  [out] NCryptProviderName **ppProviderList,
  [in]  DWORD              dwFlags
);

Parameters

[out] pdwProviderCount

The address of a DWORD to receive the number of elements in the ppProviderList array.

[out] ppProviderList

The address of an NCryptProviderName structure pointer to receive an array of the registered key storage provider names. The variable pointed to by the pdwProviderCount parameter receives the number of elements in this array.

When this memory is no longer needed, free it by passing this pointer to the NCryptFreeBuffer function.

[in] dwFlags

Flags that modify function behavior. This can be zero (0) or the following value.

Value Meaning
NCRYPT_SILENT_FLAG
Requests that the key service provider (KSP) not display any user interface. If the provider must display the UI to operate, the call fails and the KSP should set the NTE_SILENT_CONTEXT error code as the last error.

Return value

Returns a status code that indicates the success or failure of the function.

Possible return codes include, but are not limited to, the following.

Return code Description
ERROR_SUCCESS
The function was successful.
NTE_BAD_FLAGS
The dwFlags parameter contains a value that is not valid.
NTE_INVALID_PARAMETER
One or more parameters are not valid.
NTE_NO_MEMORY
A memory allocation failure occurred.

Remarks

A service must not call this function from its StartService Function. If a service calls this function from its StartService function, a deadlock can occur, and the service may stop responding.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header ncrypt.h
Library Ncrypt.lib
DLL Ncrypt.dll

See also

NCryptFreeBuffer