Sign in to follow this  
Followers 0
ANGRO

Struct alignment on 4 Bytes

7 posts in this topic

$a  = DllStructCreate("dword;int;dword;int;int;char[257];dword;uint;uint")
DllStructSetData($a,1,292);dwSize                                        alignment on 4 Bytes!!!!!!!!
DllStructSetData($a,2,0);hwndOwner
DllStructSetData($a,3,$RASEDFLAG_NewPhoneEntry);dwFlags
DllStructSetData($a,4,0);xDlg
DllStructSetData($a,5,0);yDlg
DllStructSetData($a,6,0);szEntry
DllStructSetData($a,7,0);dwError
DllStructSetData($a,8,0);reserved
DllStructSetData($a,9,0);reserved2

$Dll_X = DllCall("Rasdlg.dll", "int", "RasEntryDlg", "str", 0, "str", 0, "ptr", DllStructGetPtr($a))
MsgBox(48,"Error 2","Error: "&@error&" | "&"Size: "&DllStructGetSize($a))

Share this post


Link to post
Share on other sites



Dunno much about Dll's... but

maybe char[257]

is Char(257)

?

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Valuater

No. Error DllStructCreate

Confuzzled

In an example all works. DllStructSetData ($a, 1,292); dwSize it is aligned in hand-held.

Why AutoIT it does not do itself ????

Or I not correctly write a code.

Edited by ANGRO

Share this post


Link to post
Share on other sites

The utility is not necessary to me. To me it is necessary WINAPI !!!!!!!!!!!

It is error AutoIT or mine?

Share this post


Link to post
Share on other sites

Dunno much about Dll's... but

maybe char[257]

is Char(257)

?

8)

Val... you don't know what your talking about...hehe!!

Chr(257)

8)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0