bittware Posted July 22, 2010 Share Posted July 22, 2010 (edited) Hello experts, I want to combine several BYTEs(e.g. 0x55) and WORDs(e.g. 0xAAAA) into single data array and assign it to following function parameter $data_array $re_stat = DllCall($hDll, "int:cdecl", "sub_sdio_transfer", "ptr", $hSubHandle, "byte*", $data_array, "byte*", 0, "int", 3, "int", 0, "int", $SS_CONF) How can I achieve this? Thanks in advance! BRs, bittware Edited July 22, 2010 by bittware Link to comment Share on other sites More sharing options...
trancexx Posted July 22, 2010 Share Posted July 22, 2010 $tDataArray = DllStructCreate("align 1;byte SomeBytes[4];" & _ "word SomeUnsigned;" & _ "short SignedValue;" & _ "dword DwordValue;" & _ "byte MoreBytes[3];") $pDataArray = DllStructGetPtr($tDataArray) DllCall($hDll, "int:cdecl", "sub_sdio_transfer", "ptr", ..., "ptr", $pDataArray, ...)I added align primarily to confuse you further. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
bittware Posted July 22, 2010 Author Share Posted July 22, 2010 $tDataArray = DllStructCreate("align 1;byte SomeBytes[4];" & _ "word SomeUnsigned;" & _ "short SignedValue;" & _ "dword DwordValue;" & _ "byte MoreBytes[3];") $pDataArray = DllStructGetPtr($tDataArray) DllCall($hDll, "int:cdecl", "sub_sdio_transfer", "ptr", ..., "ptr", $pDataArray, ...) I added align primarily to confuse you further. You are awesome! Must take my hat off. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now