Opened on Sep 16, 2011 at 6:00:47 PM
Last modified on Dec 30, 2011 at 4:55:23 PM
#2015 closed Bug
DllCallbackRegister() mangles floating point numbers under x64 — at Version 2
| Reported by: | wraithdu | Owned by: | |
|---|---|---|---|
| Milestone: | 3.3.9.0 | Component: | AutoIt |
| Version: | 3.3.7.15 | Severity: | None |
| Keywords: | dllcallbackregister x64 float | Cc: |
Description (last modified by )
Parameters of type "float" are mangled when passed to DllCallbackRegister() callback functions under x64. The following script demonstrates the problem:
Local $hCallback = DllCallbackRegister("Callback", "none", "double;float;")
Local $pCallback = DllCallbackGetPtr($hCallback)
DLLCallAddress("none", $pCallback, "double", 1234, "float", 1234)
Func Callback($fDouble, $fFloat)
ConsoleWrite("Double: " & $fDouble & @CRLF)
ConsoleWrite("Float: " & $fFloat & @CRLF)
EndFunc
The double output is correct. Float output is mangled and changes with each invocation.
Change History (2)
comment:2 by , on Sep 17, 2011 at 8:45:23 PM
| Description: | modified (diff) |
|---|---|
| Keywords: | dllcallbackregister added; dllcalladdress removed |
| Summary: | DllCallAddress Corrupts float Type under x64 → DllCallbackRegister() mangles floating point numbers under x64 |
This is NOT a problem with DllCall() or DllCallAddress(). This is a bug with DllCallbackRegister(). I'm changing the description accordingly. The example script I am going to add is representative of a way to reproduce the problem. I have confirmed with my own DLL that DllCall() does not corrupt the data.

I suppose, there are some erros in the fastcall-implementation for the XMM-Registers either in DllCallAddress or DllCallback.