ctypes.winapi_abi is for Win32 only. Even if Win64, it is used in mailTestUtils.js.
So depending on whether I'm running on win32 or win64, I'm supposed to write the ctypes definitions differently? Ouch, that sucks -- could we simply change the meaning of winapi_abi on win64 instead?
(In reply to comment #1) > So depending on whether I'm running on win32 or win64, I'm supposed to write > the ctypes definitions differently? Ouch, that sucks -- could we simply change > the meaning of winapi_abi on win64 instead? no winapi_abi on ctypes for Win64. But we consider to add winapi_abi as alias for compatibility of windows.
Yeah, that's what I meant. I'm still calling a Windows API, so it makes sense that winapi_abi is an alias to the x64 calling convention.
Created attachment 539916 [details] [diff] [review] patch that aliases stdcall_abi and winapi_abi to the win64 API (untested) What do you think? I've set off a Firefox x64 build.
Created attachment 539949 [details] [diff] [review] patch with tests, v1 The justification for stdcall being an alias to the win64 ABI is that that's how it's interpreted by MSVC: http://msdn.microsoft.com/en-us/library/zxk0tw93. "On Itanium Processor Family (IPF) and x64 processors, __stdcall is accepted and ignored by the compiler; on IPF, by convention, parameters are passed in register."
Similarly, since WINAPI is defined as __stdcall per <http://msdn.microsoft.com/en-us/library/aa383751>, WINAPI effectively becomes an alias too. I think this fundamentally makes sense because it allows the exact same code to run across Windows x86 and x64.
So for a given WINAPI function, will its binary signature be identical between Win32 and Win64? DWORDS, pointer sizes, the works?
The binary signature won't be identical, but so won't the binary version of the signature on the JS side. As long as you're not doing something stupid like storing pointers in longs, things should still match up on both ends. Changing product/component/summary to fit patch.
review ping? :)
Comment on attachment 539949 [details] [diff] [review] patch with tests, v1 Looks good. r=dwitte
Uh, not fixed yet. oops.
(this bug is definitely Windows-only)