Platform SDK: Cryptography |
The CPCreateHash function creates a hash object and initiates the hashing of a stream of data.
BOOL CPCreateHash( HCRYPTPROV hProv, // in ALG_ID Algid, // in HCRYPTKEY hKey, // 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 |
---|---|
NTE_BAD_ALGID | The Algid parameter specifies an algorithm that this CSP does not support. |
NTE_BAD_FLAGS | The dwFlags parameter is non-zero. |
NTE_BAD_KEY | The algid parameter specifies a keyed hash algorithm, such as CALG_MAC, and the hKey parameter is either zero or an invalid key handle. This error code will also be returned if the key is to a stream cipher or if the cipher mode is one that does not use feedback. |
NTE_NO_MEMORY | The CSP ran out of memory during the operation. |
For information on writing CPCreateHash for schannel applications, see Schannel CSP Reference.
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.