Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2198 closed Bug (No Bug)

DllStructGetData causes crash

Reported by: JFX Owned by:
Milestone: Component: AutoIt
Version: 3.3.8.1 Severity: None
Keywords: Cc:

Description

DllStructGetData sometimes crashes on a wchar Structure.
Only happens on the first run, never in a loop.
Also happens rarely so push F5 a "few" times.

$ret = DllCall("shell32.dll", "ptr", "CommandLineToArgvW", "wstr", $CmdLineRaw, "int*", 0)
If @error Or Not $ret[0] Then Exit 1
$tPtr = DllStructCreate("ptr", $ret[0])
$retarr = DllStructGetData($tPtr, 1)
$tBuffer = DllStructCreate("wchar[4095]", $retarr)

;crash occurs here
$aRet = DllStructGetData($tBuffer, 1)
DllCall("kernel32.dll", "ptr", "LocalFree", "ptr", $ret[0])

Attachments (0)

Change History (2)

comment:1 by Valik, 14 years ago

Resolution: No Bug
Status: newclosed

Your code is garbage. We cannot protect you from writing shitty code.

comment:2 by JFX, 14 years ago

hmm was just a small reproduce form this one here:

http://www.autoitscript.com/forum/topic/67275-dllcall-and-commandlinetoargvw-return-value/page__view__findpost__p__497994

So I assume the DllStructCreate("wchar[4095]", $retarr) is the wrong thing here?
I should never create a (w)char struct in a place, were i don't know what it contains?

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


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