The CPDestroyHash function destroys the hash object referenced by the hHash parameter.
BOOL CPDestroyHash(
HCRYPTPROV hProv, // in
HCRYPTHASH hHash // in
);
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. |
CPCreateHash, CryptDestroyHash