﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
723	Structure problem	trancexx		"Unexpected behaviour with function DllStructureCreate()when created with pointer and ""dword"":
{{{
ConsoleWrite(""Binary data is 0x3378FF453D1133"" & @CRLF & @CRLF)

$structure_Binary_1 = DllStructCreate(""byte[7]"")
DllStructSetData($structure_Binary_1, 1, ""0x3378FF453D1133""); that is 0x3378 and 0xFF453D11, last byte 0x33 is just for testing 

; Testing on ""short;dword""
$struct_1 =  DllStructCreate(""short;dword"", DllStructGetPtr($structure_Binary_1))
ConsoleWrite(""Before align:"" & @CRLF)
ConsoleWrite(Binary(DllStructGetData($struct_1, 1)) & "" <-- Binary(short) - ok"" & @CRLF)
ConsoleWrite(Binary(DllStructGetData($struct_1, 2)) & "" <-- Binary(dword) - 0xFF is missing and 0x33 is there"" & @CRLF)

ConsoleWrite(@CRLF)


; New structure is ""short;dword"" with keyword align
$structure_Binary_2 = DllStructCreate(""byte[7]"")
DllStructSetData($structure_Binary_2, 1, ""0x3378FF453D1133"")

$struct_2 =  DllStructCreate(""align 1;short;dword"", DllStructGetPtr($structure_Binary_2)) ; or ""align 2""
ConsoleWrite(""After:"" & @CRLF)
ConsoleWrite(Binary(DllStructGetData($struct_2, 1)) & "" <-- Binary(short)"" & @CRLF)
ConsoleWrite(Binary(DllStructGetData($struct_2, 2)) & "" <-- Binary(dword), this appears ok"" & @CRLF)


ConsoleWrite(@CRLF)


; Testing on ""dword;short""
$structure_Binary_3 = DllStructCreate(""byte[7]"")
DllStructSetData($structure_Binary_3, 1, ""0x3378FF453D1133"")

$struct_3 =  DllStructCreate(""dword;short"", DllStructGetPtr($structure_Binary_3)) 
ConsoleWrite(""Reoganized (no align):"" & @CRLF)
ConsoleWrite(Binary(DllStructGetData($struct_3, 1)) & "" <-- Binary(dword) - ok"" & @CRLF)
ConsoleWrite(Binary(DllStructGetData($struct_3, 2)) & "" <-- Binary(short) - ok"" & @CRLF)
}}}
Thread on forum:
http://www.autoitscript.com/forum/index.php?showtopic=85213"	Bug	closed		AutoIt	3.2.12.1	Blocking	No Bug	DllStructureCreate(), align, DllStructGetPtr()	
