The BCryptEnumContextFunctions function obtains the cryptographic functions for a context in the specified configuration table.
NTSTATUS BCryptEnumContextFunctions( ULONG dwTable, LPCWSTR pszContext, ULONG dwInterface, ULONG *pcbBuffer, PCRYPT_CONTEXT_FUNCTIONS *ppBuffer );
Identifies the configuration table from which to retrieve the context functions. This can be one of the following values.
||Retrieve the context functions from the local-machine configuration table.|
||This value is not available for use.|
A pointer to a null-terminated Unicode string that contains the identifier of the context to enumerate the functions for.
Identifies the cryptographic interface to retrieve the functions for. This can be one of the following values.
The address of a ULONG variable that, on entry, contains the size, in bytes, of the buffer pointed to by ppBuffer. If this size is not large enough to hold the set of context identifiers, this function will fail with STATUS_BUFFER_TOO_SMALL.
After this function returns, this value contains the number of bytes that were copied to the ppBuffer buffer.
The address of a pointer to a CRYPT_CONTEXT_FUNCTIONS structure that receives the set of context functions retrieved by this function. The value pointed to by the pcbBuffer parameter contains the size of this buffer.
If the value pointed to by this parameter is NULL, this function will allocate the required memory. This memory must be freed when it is no longer needed by passing this pointer to the BCryptFreeBuffer function.
If this parameter is NULL, this function will place the required size, in bytes, in the variable pointed to by the pcbBuffer parameter and 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 ppBuffer parameter is not NULL, and the value pointed to by the pcbBuffer parameter is not large enough to hold the set of contexts.|
||One or more parameters are not valid.|
||A memory allocation failure occurred.|
||No context functions that match the specified criteria were found.|
BCryptEnumContextFunctions can be called only in user mode.
The following example shows how to use the BCryptEnumContextFunctions function to enumerate the key storage functions for all contexts in the local-machine configuration table.
#include <windows.h> #include <stdio.h> #include <Bcrypt.h> #pragma comment(lib, "Bcrypt.lib")
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|