Johan Gill : advapi32: CryptCreateHash actually sets ERROR_INVALID_PARAMETER if the CSP handle is 0 .