NCryptNotifyChangeKey function (ncrypt.h)
The NCryptNotifyChangeKey function creates or removes a key change notification.
The handle provided by this function is the same handle that is returned by the FindFirstChangeNotification function. You use the wait functions to wait for the notification handle to be signaled.
Syntax
SECURITY_STATUS NCryptNotifyChangeKey(
[in] NCRYPT_PROV_HANDLE hProvider,
[in, out] HANDLE *phEvent,
[in] DWORD dwFlags
);
Parameters
[in] hProvider
The handle of the key storage provider. This handle is obtained by using the NCryptOpenStorageProvider function.
[in, out] phEvent
The address of a HANDLE variable that either receives or contains the key change notification event handle. This is the same handle that is returned by the FindFirstChangeNotification function. For more information, see the dwFlags parameter description.
[in] dwFlags
A set of flags that modify the behavior of this function. This parameter contains a combination of one or more of the following values.
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 a value that is not valid. |
|
The hProvider parameter is not valid. |
|
One or more parameters are not valid. |
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 |