Some of the function prototypes in wintrust.h have the wrong calling convention. The trouble is, PSDK gets them wrong too. So calling the functions, as declared in the PSDK header, results in a crash in Windows. Casting them to function pointers with the correct calling convention succeeds.
Should I leave the prototypes incorrect in wintrust.h to match the PSDK, or should I fix them to make them more convenient for me to use?
Thanks, --Juan
On Wed, 15 Aug 2007, Juan Lang wrote: [...]
Should I leave the prototypes incorrect in wintrust.h to match the PSDK, or should I fix them to make them more convenient for me to use?
I think that's a case where we could diverge from the PSDK (with a comment explaining why). Otherwise the header is completely useless: we could not even make sure its prototypes match those of our implementation.
Btw, did you check this against the very latest PSDK? Could you provide the name of one of these functions?
I think that's a case where we could diverge from the PSDK (with a comment explaining why). Otherwise the header is completely useless: we could not even make sure its prototypes match those of our implementation.
Thanks Francois, I was hoping you'd check in.
Btw, did you check this against the very latest PSDK?
Well, I checked against a PSDK I installed a month ago. If there's a newer one, I haven't checked it.
Could you provide the name of one of these functions?
They're function pointers, actually. All the function pointer members of CRYPT_PROVIDER_FUNCTIONS in wintrust.h are declared without a calling convention. They need to be declared __stdcall. Is the default calling convention for VC++ __stdcall? If so, that'd explain the difference.
Thanks, --Juan