Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

CryptDestroyHash (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This function destroys the hash object referenced by the hHash parameter. Once a hash object has been destroyed, it can no longer be used and its handle is useless from then on.

All hash objects should be destroyed with the CryptDestroyHash function when the application is finished with them.

BOOL CRYPTFUNC CryptDestroyHash( 
  HCRYPTHASH hHash
);

Parameters

hHash
[in] HCRYPTHASH handle to the hash object to be destroyed.

Return Values

TRUE indicates success. FALSE indicates failure. To get extended error information, call the GetLastError function.

The following table shows the common values for the GetLastError function. The error values prefaced by NTE are generated by the particular cryptographic service provider (CSP) you are using.

ValueDescription
ERROR_BUSYThe hash object specified by hHash is currently being used by another process.
ERROR_INVALID_HANDLEThe hHash parameter specifies an invalid handle.
ERROR_INVALID_PARAMETERThe hHash parameter contains an invalid value.
NTE_BAD_ALGIDThe hHash handle specifies an algorithm that this CSP does not support.
NTE_BAD_HASHThe hash object specified by the hHash parameter is invalid.
NTE_BAD_UIDThe CSP context that was specified when the hash object was created cannot be found.

Remarks

When a hash object is destroyed, many CSPs will scrub the memory in the CSP where the hash object was held. The CSP memory is then freed.

There should be a one-to-one relationship between calls to the CryptCreateHash function and calls to the CryptDestroyHash function.

Example Code

See CryptHashSessionKey.

Requirements

OS Versions: Windows CE 2.10 and later.
Header: Wincrypt.h.
Link Library: Coredll.lib.

See Also

CryptCreateHash | CryptHashData | CryptSignHash | HCRYPTHASH


Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.