Re: DllCall description
Posted: 13 Jan 2019, 03:24
Let's help each other out
https://www.autohotkey.com/boards/
https://www.autohotkey.com/boards/viewtopic.php?f=37&t=60306
I'm not quite sure what you mean here.vvhitevvizard wrote: ↑13 Jan 2019, 03:24AHK's int32 data type should not use bits 32..63 and lower bits 0..31 contain a valid 32 bit result.
Alright, the matter relates only to the NumGet/NumPut/DllCall operands. Thx for the correction!
At the moment, scripts that use DllCall w/o retval declaration and expect ptr will fail on rare occasions due to ptr being truncated with AHK64.
Thats an assumption - it might or might not be hard to spot. Just like the inverse might or might not be hard to spot.Now let's imagine, the default retval size is changed from int (int32) to int64, scripts that run with AHK64 and expect int (int32) will either fail instantly in most cases (easy to pinpoint) if the callee doesn't clean up the upper DWORD or will work w/o issues if the callee does clean up full rax before returning eax.
Thats relying on undocumented features and continuing the current bad practice of incorrectly defining the return type.And I've seen quite a few system DLL functions that do xor rax, rax (clean up the whole rax) just before the final retval assignment even if they r expected to return just eax or even ax, al.
I think the best option here is to force the users to define a data type in all three cases and remove a default type.Anyways, I would just love the three NumGet/NumPut/DllCall to have a unified default retval. Easy to memorize.