bittware 0 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 Share this post Link to post Share on other sites
trancexx 1,013 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 Share this post Link to post Share on other sites
bittware 0 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. Share this post Link to post Share on other sites