CryptGetHashParam function (wincrypt.h)
BOOL CryptGetHashParam( HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags );
Handle of the hash object to be queried.
Query type. This parameter can be set to one of the following queries.
||An ALG_ID that indicates the algorithm specified when the hash object was created. For a list of hash algorithms, see CryptCreateHash.|
||DWORD value indicating the number of bytes in the hash value. This value will vary depending on the hash algorithm. Applications must retrieve this value just before the HP_HASHVAL value so the correct amount of memory can be allocated.|
The hash value or message hash for the hash object specified by hHash. This value is generated based on the data supplied to the hash object earlier through the
The CryptGetHashParam function completes the hash. After CryptGetHashParam has been called, no more data can be added to the hash. Additional calls to CryptHashData or CryptHashSessionKey fail. After the application is done with the hash, CryptDestroyHash should be called to destroy the hash object.
A pointer to a buffer that receives the specified value data. The form of this data varies, depending on the value number.
This parameter can be NULL to determine the memory size required.
A pointer to a DWORD value specifying the size, in bytes, of the pbData buffer. When the function returns, the DWORD value contains the number of bytes stored in the buffer.
If pbData is NULL, set the value of pdwDataLen to zero.
Reserved for future use and must be zero.
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. For extended error information, call GetLastError.
The error codes prefaced by "NTE" are generated by the particular CSP you are using. Some possible error codes follow.
||One of the parameters specifies a handle that is not valid.|
||One of the parameters contains a value that is not valid. This is most often a pointer that is not valid.|
||If the buffer specified by the pbData parameter is not large enough to hold the returned data, the function sets the ERROR_MORE_DATA code and stores the required buffer size, in bytes, in the variable pointed to by pdwDataLen.|
||The dwFlags parameter is nonzero.|
||The hash object specified by the hHash parameter is not valid.|
||The dwParam parameter specifies an unknown value number.|
||The CSP context that was specified when the hash was created cannot be found.|
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|