BCryptResolveProviders function (bcrypt.h)
The BCryptResolveProviders function obtains a collection of all of the providers that meet the specified criteria.
NTSTATUS BCryptResolveProviders( [in, optional] LPCWSTR pszContext, [in, optional] ULONG dwInterface, [in, optional] LPCWSTR pszFunction, [in, optional] LPCWSTR pszProvider, [in] ULONG dwMode, [in] ULONG dwFlags, [in, out] ULONG *pcbBuffer, [in, out] PCRYPT_PROVIDER_REFS *ppBuffer );
[in, optional] pszContext
A pointer to a null-terminated Unicode string that contains the identifier of the context for which to obtain the providers. If this is set to NULL or to an empty string, the default context is assumed.
[in, optional] dwInterface
The identifier of an interface that the provider must support. This must be one of the CNG Interface Identifiers. If the pszFunction parameter is not NULL or an empty string, you can set dwInterface to zero to force the function to infer the interface.
[in, optional] pszFunction
A pointer to a null-terminated Unicode string that contains the algorithm or function identifier that the provider must support. This can be one of the standard CNG Algorithm Identifiers or the identifier for another registered algorithm. If dwInterface is set to a nonzero value, then pszFunction can be NULL to include all algorithms and functions.
[in, optional] pszProvider
A pointer to a null-terminated Unicode string that contains the name of the provider to retrieve. If this parameter is NULL, then all providers will be included.
This parameter allows you to specify a specific provider to retrieve in the event that more than one provider meets the other criteria.
Specifies the type of provider to retrieve. This can be one of the following values.
||Retrieve user mode providers.|
||Retrieve kernel mode providers.|
||Retrieve both user mode and kernel mode providers.|
A set of flags that modify the behavior of this function.
This can be a zero or a combination of one or more of the following values.
[in, out] pcbBuffer
A pointer to a DWORD value that, on entry, contains the size, in bytes, of the buffer pointed to by the ppBuffer parameter. On exit, this value receives either the number of bytes copied to the buffer or the required size, in bytes, of the buffer.
[in, out] ppBuffer
The address of a CRYPT_PROVIDER_REFS pointer that receives the collection of providers that meet the specified criteria.
If this parameter is NULL, this function will return STATUS_SUCCESS and place in the value pointed to by the pcbBuffer parameter, the required size, in bytes, of all the data.
If this parameter is the address of a NULL pointer, this function will allocate the required memory, fill the memory with the information about the providers, and place the pointer to this memory in this parameter. When you have finished using this memory, free it by passing this pointer to the BCryptFreeBuffer function.
If this parameter is the address of a non-NULL pointer, this function will copy the provider information into this buffer. The pcbBuffer parameter must contain the size, in bytes, of the entire buffer. If the buffer is not large enough to hold all of the provider information, this function will return STATUS_BUFFER_TOO_SMALL.
Returns a status code that indicates the success or failure of the function.
Possible return codes include, but are not limited to, the following.
||The function was successful.|
||The size specified by the pcbBuffer parameter is not large enough to hold all of the data.|
||One or more parameters are not valid.|
||No provider could be found that meets all of the specified criteria.|
BCryptResolveProviders can be called either from user mode or kernel mode. Kernel mode callers must be executing at PASSIVE_LEVEL IRQL.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|