The CMSG_HASHED_ENCODE_INFO structure is used with hashed messages. This structure is passed to CryptMsgOpenToEncode for a value of CMSG_HASHED in dwMsgType.
typedef struct _CMSG_HASHED_ENCODE_INFO {
DWORD cbSize;
HCRYPTPROV hCryptProv;
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
void* pvHashAuxInfo;
} CMSG_HASHED_ENCODE_INFO, *PCMSG_HASHED_ENCODE_INFO;
Unless there is a strong reason for passing in a specific cryptographic provider in hCryptProv, zero should be passed in. Passing in zero causes the default RSA or DSS provider to be acquired before doing hash, signature verification or recipient encryption operations.