Modify

Opened 14 years ago

Closed 14 years ago

#1355 closed Bug (Fixed)

Data types mixed

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

Description

With new 3.3.2.0 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 3.3.0.0 to 3.3.2.0

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

Ugh.

comment:4 Changed 14 years ago by Valik

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

Fixed by revision [5497] in version: 3.3.3.0

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

Action
as closed The owner will remain Valik.
Author


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

 
Note: See TracTickets for help on using tickets.