CPDestroyHash

The CPDestroyHash function destroys the hash object referenced by the hHash parameter.

BOOL CPDestroyHash(
  HCRYPTPROV hProv, // in
  HCRYPTHASH hHash  // in
);
 

Parameters

hProv
Handle to a particular key container (or "context") within the CSP. This handle is obtained via a call to CPAcquireContext.
hHash
Handle to the hash object to be destroyed.

Return Values

If the function succeeds, TRUE should be returned; otherwise, return FALSE. When FALSE is returned, the appropriate error code (see the following table) must be set via SetLastError.

Error Description
NTE_BAD_ALGID The hHash handle specifies an algorithm that this CSP does not support.
NTE_BAD_HASH The hash object specified by the hHash parameter is invalid.
NTE_BAD_UID The CSP context that was specified when the hash object was created cannot now be found.

See Also

CPCreateHash, CryptDestroyHash