The CPHashData function is used by applications to feed data to a specified hash object.
BOOL CPHashData(
HCRYPTPROV hProv, // in
HCRYPTHASH hHash, // in
CONST BYTE *pbData, // in
DWORD dwDataLen, // in
DWORD dwFlags // in
);
Support for this flag is optional.
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_FLAGS | The dwFlags parameter contains an invalid value. |
NTE_BAD_HASH | The hash object specified by the hHash parameter is invalid. |
NTE_BAD_HASH_STATE | An attempt was made to add data to a hash object that is already marked as "finished." |
NTE_BAD_KEY | A keyed hash algorithm is being used, but the session key is no longer valid. This error will be generated if the session key is destroyed before the hashing operating is complete. |
NTE_BAD_LEN | The CRYPT_USERDATA flag is set, and the dwDataLen parameter has a non-zero value. |
NTE_BAD_UID | The CSP context that was specified when the hash object was created cannot now be found. |
NTE_FAIL | The function failed in some unexpected way. |
NTE_NO_MEMORY | The CSP ran out of memory during the operation. |
CPCreateHash, CPHashSessionKey, CryptHashData