Platform SDK: Cryptography |
The CPDuplicateHash function makes an exact copy of a hash and its state.
BOOL CPDuplicateHash( HCRYPTPROV hUID, // in HCRYPTHASH hHash, // in DWORD *pdwReserved, // in DWORD dwFlags, // in HCRYPTHASH *phHash // out );
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE, and the appropriate error code from the following table must be set using SetLastError.
Error | Description |
---|---|
ERROR_CALL_ NOT_IMPLEMENTED |
This is a new function and existing CSPs might not implement it. This error is returned if the CSP does not support this function. |
ERROR_INVALID_ PARAMETER |
One of the parameters contains an invalid value. This is most often an illegal pointer. |
NTE_BAD_HASH | The handle to the original hash is not valid. |
CPDuplicateHash makes a copy of a hash including its exact state. To generate two different hashes starting with some common hashed data,
CPDestroyHash must be called to destroy any hashes created with CPDuplicateHash. Destroying the original hash does not cause the duplicate hash to be destroyed. Once a duplicate hash is made, it is separate from the original hash. There is no shared state between the two hashes.
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98: Requires Windows 95 OSR2 or later (or Windows 95 with Internet Explorer 3.02 or later).
Header: Declared in Wincrypt.h.