The NCryptOpenStorageProvider function loads and initializes a CNG key storage provider.
SECURITY_STATUS NCryptOpenStorageProvider( NCRYPT_PROV_HANDLE *phProvider, LPCWSTR pszProviderName, DWORD dwFlags );
A pointer to a NCRYPT_PROV_HANDLE variable that receives the provider handle. When you have finished using this handle, release it by passing it to the NCryptFreeObject function.
A pointer to a null-terminated Unicode string that identifies the key storage provider to load. This is the registered alias of the key storage provider. This parameter is optional and can be NULL. If this parameter is NULL, the default key storage provider is loaded. The following values identify the built-in key storage providers.
Flags that modify the behavior of the function. No flags are defined for this function.
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 dwFlags parameter contains one or more flags that are not supported.|
||One or more parameters are not valid.|
||A memory allocation failure occurred.|
In the case that an error condition is returned, the provider will have been unloaded from memory. Functions within the provider must not be called after a failure error is returned.
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.
|Minimum supported client||Windows Vista [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2008 [desktop apps | UWP apps]|