BCryptDestroySecret function (bcrypt.h)
The BCryptDestroySecret function destroys a secret agreement handle that was created by using the BCryptSecretAgreement function.
NTSTATUS BCryptDestroySecret( BCRYPT_SECRET_HANDLE hSecret );
The BCRYPT_SECRET_HANDLE to be destroyed.
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 handle in the hSecret parameter is not valid.|
Depending on what processor modes a provider supports, BCryptDestroySecret can be called either from user mode or kernel mode. Kernel mode callers can execute either at PASSIVE_LEVEL IRQL or DISPATCH_LEVEL IRQL. If the current IRQL level is DISPATCH_LEVEL, the handle provided in the hSecret parameter must be derived from an algorithm handle returned by a provider that was opened by using the BCRYPT_PROV_DISPATCH flag.
To call this function in kernel mode, use Cng.lib, which is part of the Driver Development Kit (DDK). Windows Server 2008 and Windows Vista: To call this function in kernel mode, use Ksecdd.lib.
|Minimum supported client||Windows Vista [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2008 [desktop apps | UWP apps]|