Changes between Initial Version and Version 2 of Ticket #2015


Ignore:
Timestamp:
09/17/11 20:45:23 (13 years ago)
Author:
Valik
Comment:

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.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2015

    • Property Keywords dllcallbackregister added; dllcalladdress removed
    • Property Summary changed from DllCallAddress Corrupts float Type under x64 to DllCallbackRegister() mangles floating point numbers under x64
  • Ticket #2015 – Description

    initial v2  
    1 float type parameters are corrupted when passed to callbacks (and I assume any function) when run under AutoIt x64. x86 is unaffected.
     1Parameters of type "float" are mangled when passed to DllCallbackRegister() callback functions under x64.  The following script demonstrates the problem:
     2{{{
     3Local $hCallback = DllCallbackRegister("Callback", "none", "double;float;")
     4Local $pCallback = DllCallbackGetPtr($hCallback)
     5DLLCallAddress("none", $pCallback, "double", 1234, "float", 1234)
    26
    3 See this post:
    4 http://www.autoitscript.com/forum/topic/95366-latest-beta/page__view__findpost__p__926669
     7Func Callback($fDouble, $fFloat)
     8        ConsoleWrite("Double: " & $fDouble & @CRLF)
     9        ConsoleWrite("Float: " & $fFloat & @CRLF)
     10EndFunc
     11}}}
     12The double output is correct.  Float output is mangled and changes with each invocation.