NCryptOpenStorageProvider function
The NCryptOpenStorageProvider function loads and initializes a CNG key storage provider.
Syntax
SECURITY_STATUS WINAPI NCryptOpenStorageProvider( _Out_ NCRYPT_PROV_HANDLE *phProvider, _In_opt_ LPCWSTR pszProviderName, _In_ DWORD dwFlags );
Parameters
- phProvider [out]
-
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.
- pszProviderName [in, optional]
-
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.
- dwFlags [in]
-
Flags that modify the behavior of the function. No flags are defined for this function.
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 |
|---|---|
|
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. |
Remarks
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.
Requirements
|
Minimum supported client |
Windows Vista [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2008 [desktop apps | Windows Store apps] |
|
Header |
|
|
Library |
|
|
DLL |
|