Jump to content

Recommended Posts

Posted (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 by bittware
Posted

$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

Posted

$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.

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
×
×
  • Create New...