Modify

Opened 14 years ago

Closed 12 years ago

#2066 closed Bug (Fixed)

bad dllStructSetData return for int

Reported by: J-Paul Mesnage Owned by: Jon
Milestone: 3.3.9.21 Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: Cc:

Description (last modified by J-Paul Mesnage)

running the following script show a little discrepancy of a int64 return instead of an int32

Local $struct = DLLStructCreate("int")
$n=DllStructSetData($struct,1,1)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $n = ' & $n & " " & VarGettype($n) & @crlf & '>Error code: ' & @error & '    Extended code: 0x' & Hex( @extended) & @crlf) ;### Debug Console
$n=DLLStructGetData($struct,1)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $n = ' & $n & " " & VarGettype($n) & @crlf & '>Error code: ' & @error & '    Extended code: 0x' & Hex( @extended) & @crlf) ;### Debug Console

same under beta 23

Environment(Language:040C Keyboard:0000040C OS:WIN_7/Service Pack 1 CPU:X64 OS:X86)

Attachments (0)

Change History (6)

comment:1 by J-Paul Mesnage, 14 years ago

Description: modified (diff)

comment:2 by jchd, 14 years ago

More unexpected readback types running .23 beta on x86.

DllStruct type  --> returned type  :  expected type
; int		-->	Int64		Int32 (already mentionned)
; long		-->	Int64		Int32
; bool		-->	Int64		Int32
; int_ptr	-->	Int64		Ptr
; uint_ptr	-->	Int64		Ptr
; long_ptr	-->	Int64		Ptr
; ulong_ptr	-->	Int64		Ptr
; lresult	-->	Int64		Ptr
; lparam	-->	Int64		Ptr
; wparam	-->	Int64		Ptr

comment:3 by J-Paul Mesnage, 14 years ago

In fact long, bool are alias of int
for unsigned 32-bit type as they cannot be stored without lost of precision the int64 is returned. This apply to wparam whish is unsigned
*_ptr does not mean ptr but ptr size
so when solving for int

DllStruct type  --> returned type  :  expected type
; int		-->	Int64		Int32 (already mentionned)
; long		-->	Int64		Int32
; bool		-->	Int64		Int32
; int_ptr	-->	Int64		int32
; uint_ptr	-->	Int64		int64 (unsigned)
; long_ptr	-->	Int64		int32
; ulong_ptr	-->	Int64		int64 (unsigned)
; lresult	-->	Int64		int32
; lparam	-->	Int64		int32
; wparam	-->	Int64		int64 (ulong_ptr)

this will change under x64 as ptr will are 64-bit

comment:4 by Jon, 13 years ago

Resolution: Rejected
Status: newclosed

comment:5 by J-Paul Mesnage, 12 years ago

Resolution: Rejected
Status: closedreopened

comment:6 by Jon, 12 years ago

Milestone: 3.3.9.21
Owner: set to Jon
Resolution: Fixed
Status: reopenedclosed

Fixed by revision [8962] in version: 3.3.9.21

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.