The [documentation for CertSetCertificateContextProperty](https://learn.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cer...) says pvData should contain a pointer to an NCRYPT_KEY_HANDLE, however the actual implementation of this function expects just the handle. This is easily shown by passing a "dead beef" value in pvData, it will not be dereferenced on Windows and the value retrieved later will be the same as provided. Yes, this means there are consumers of this function out there passing a stack pointer which is dutifully stored away. It's only when that value is used that anything goes wrong. -- v2: crypt32: make CertContext_SetProperty of CERT_NCRYPT_KEY_HANDLE_PROP_ID behave as implemented, not as documented. Add tests to demonstrate undocumented behavior of crypt32 CERT_NCRYPT_KEY_HANDLE_PROP_ID setting https://gitlab.winehq.org/wine/wine/-/merge_requests/10993