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

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
aalphaa
Posts: 3
Joined: 25 Mar 2024, 01:38

How to get the structure data from the pointer returned

29 Mar 2024, 22:43

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.]
aalphaa
Posts: 3
Joined: 25 Mar 2024, 01:38

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

31 Mar 2024, 20:32

@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?
just me
Posts: 9466
Joined: 02 Oct 2013, 08:51
Location: Germany

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

01 Apr 2024, 03:18

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")

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: FalseShepard, hiahkforum, w_i_k_i_d and 40 guests