Opened 14 years ago

Closed 14 years ago

#1355 closed Bug (Fixed)

Data types mixed

Reported by: trancexx Owned by: Valik
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


With new version there are issue(s) with data types with DllCall() function.
If I ask for dword AutoIt returns int. For example:

$sFile = "NonExistingFile"

$aCall = DllCall("kernel32.dll", "dword", "CreateFileW", _
		"wstr", $sFile, _
		"dword", 0x80000000, _ ; GENERIC_READ
		"dword", 0, _ ; prevent sharing
		"ptr", 0, _
		"dword", 3, _ ; OPEN_EXISTING
		"dword", 0, _
		"ptr", 0)

$hFile = $aCall[0]

ConsoleWrite("! " & $hFile & @CRLF)
MsgBox(0, '$hFile is', $hFile & @CRLF)

Same thing is for any parameter. If I do "dword*", 0 , i get int value returned.
I could write an example with GdipBitmapGetPixel from gdiplus.dll if you need it to verify this additionally. For non-transparent white it will return -1 instead of asked (and proper) 4294967295 (0xFFFFFFFF).

Attachments (0)

Change History (4)

comment:1 Changed 14 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed
  • Version changed from to

AutoIt displays all values as signed integers. The values you are working with are unsigned. The same bits are set in either case. This is not a bug.

comment:2 Changed 14 years ago by anonymous

Ok, I see that.

This is a change in behavior. dword type with DllCall() no longer have sense, since it's treated as int.
I can find my way thru Bit functions and will switch to that. Even though that slows scripts further.

This ain't changed:

$tDword = DllStructCreate("dword")
DllStructSetData($tDword, 1, 0xFFFFFFFF)
ConsoleWrite(DllStructGetData($tDword, 1) & @CRLF)

It's a bad change from my perspective.

comment:3 Changed 14 years ago by Valik

  • Resolution No Bug deleted
  • Status changed from closed to reopened


comment:4 Changed 14 years ago by Valik

  • Milestone set to
  • Owner set to Valik
  • Resolution set to Fixed
  • Status changed from reopened to closed

Fixed by revision [5497] in version:

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Valik.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.