Page 1 of 1

How to get the structure data from the pointer returned

Posted: 29 Mar 2024, 22:43
by aalphaa
autohotkey v2 x64

Code: Select all

p := DllCall("libcurl-x64\curl_version", "Ptr")
How to get the string from p?
I already know

Code: Select all

str := DllCall("libcurl-x64\curl_version", "Astr")
After this call, str is the correct version string.

How to get the structure data from the pointer returned by the structure pointer of autohotkey v2 x64 dllcall?
For example, libcurl-x64\curl_easy_option_by_name function

[Mod edit: Added [code][/code] tags.]

Re: How to get the structure data from the pointer returned

Posted: 30 Mar 2024, 04:13
by just me

Re: How to get the structure data from the pointer returned

Posted: 31 Mar 2024, 20:32
by aalphaa
@just me Thanks.
I tried other parameter combinations such as
p := DllCall("libcurl-x64\curl_version", "ptr")
s := NumGet(p, "char")
or s := NumGet(p, "int")
or s := StrGet(p, "CP0")
and got the following errors
Critical Error: Invalid memory read/write.What could be wrong?

Re: How to get the structure data from the pointer returned  Topic is solved

Posted: 01 Apr 2024, 03:18
by just me
The pointer might point to memory inside the curl dll. Try to load the dll beforehand:

Code: Select all

HCURL := DllCall("LoadLibrary", "Str", "libcurl-x64.dll", "UPtr")

Re: How to get the structure data from the pointer returned

Posted: 01 Apr 2024, 04:19
by aalphaa
@just me Thank you very much