http://bugs.winehq.org/show_bug.cgi?id=21568
--- Comment #7 from Andrew Nguyen arethusa26@gmail.com 2010-07-13 03:33:13 --- It seems reasonable to believe that an HCRYPTKEY handle that CryptGenKey outputs is not a direct pointer to a data structure. Given that it's typedefed as a ULONG_PTR, and doing something (admittedly crude) like:
HCRYPTKEY p; BOOL result; for (p = 0; p < 0x00400000; p++) { result = pCryptDestroyKey(p); ok (!result && GetLastError() == ERROR_INVALID_PARAMETER, "%d\n", GetLastError()); }
does not induce a crash, nor is there any evidence of the process heap being corrupted (HeapValidate), this seems to suggest that some sort of handle table should be employed.