BCryptDestroySecret

The BCryptDestroySecret function destroys a secret agreement handle that was created by using the BCryptSecretAgreement function.

Syntax

NTSTATUS BCryptDestroySecret(
         BCRYPT_SECRET_HANDLE hSecret
)  

Parameters

hSecret
Type: BCRYPT_SECRET_HANDLE 

[in, out] The BCRYPT_SECRET_HANDLE to be destroyed.

Return value

Type: NTSTATUS 

Returns a status code that indicates the success or failure of the function.

Return codes

Possible return codes include, but are not limited to, the following.

Return code Description
STATUS_SUCCESS The function was successful.
STATUS_INVALID_HANDLE The handle in the hSecret parameter is not valid.

Remarks

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_LEVELIRQL 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.

Requirements

Header: Declared in bcrypt.h.

Library: Use bcrypt.lib.