Page 1 of 1

Why is it inconsistent when using structures as dllcall's arguments

Posted: 22 Sep 2021, 04:29
by thqby
This is ahk code.

Code: Select all

VarSetCapacity(variant, 8+A_PtrSize*2, 0)
NumPut(VT_I4 := 3, variant, 0, "ushort")
NumPut(UIA_EditControlTypeId := 50004, variant, 8, "int")
if (A_PtrSize = 4)
   DllCall(NumGet(NumGet(IUIAutomation+0)+23*A_PtrSize), "ptr", IUIAutomation, "int", UIA_ControlTypePropertyId := 30003, "int64", NumGet(variant, 0, "int64"), "int64", NumGet(variant, 8, "int64"), "ptr*", condition2)
else
   DllCall(NumGet(NumGet(IUIAutomation+0)+23*A_PtrSize), "ptr", IUIAutomation, "int", UIA_ControlTypePropertyId := 30003, "ptr", &variant, "ptr*", condition2)
WINAPI Header definition: IUIAutomation::CreatePropertyCondition(PROPERTYID propertyId, VARIANT value, IUIAutomationCondition **newCondition)
I know that the structure can be split into multiple corresponding values and passed to the dllcall, why is the 64 bit passed into the pointer?

Re: Why is it inconsistent when using structures as dllcall's arguments

Posted: 22 Sep 2021, 05:26
by thqby

Re: Why is it inconsistent when using structures as dllcall's arguments

Posted: 24 Sep 2021, 20:48
by swagfag
theres also old threads about this viewtopic.php?f=76&t=60442