Code: Select all
hwid_buffer := 0
output_size := DllCall("interception.dll\interception_get_hardware_id", "Ptr", context, "Int", 1, "Ptr", &hwid_buffer, "UInt", 4, "Cdecl UInt")
MsgBox % "hw_id : " . ErrorLevel
MsgBox % hwid_buffer
MsgBox % output_size
Code: Select all
unsigned int interception_get_hardware_id(InterceptionContext context, InterceptionDevice device, void *hardware_id_buffer, unsigned int buffer_size)
Code: Select all
typedef void *InterceptionContext;
typedef int InterceptionDevice;
As to what happens with this call: ErrorLevel is set to 0, so the call is apparently successful. However, hwid_buffer and output_size are both 0; neither should be as far as I'm concerned. The original function can be seen in this file.
Hope some of you can point out something I'm doing wrong! I wasn't sure how to pass the pointer to hwid_buffer, but from what I could find it seemed like this was the right way to do it :/
Original Post
I'm trying to access some strings stored in memory by a DLL call. Here's my current code:
Code: Select all
context := DllCall("interception.dll\interception_create_context")
MsgBox % context
handle1 := NumGet(context,0,"Ptr")
MsgBox % handle1
MsgBox % StrGet(handle1)
DllCall("interception.dll\interception_destroy_context", Ptr, context)
Can anyone see what I might be doing wrong here? I'm not massively experienced with DllCalls, but I think I understand the basic concepts, and have some experience with pointers etc. from C programming. Thanks for any help.
EDIT: For some reference, the return type of interception_create_context(void) is defined like this:
Code: Select all
typedef void *InterceptionContext;
Code: Select all
typedef struct
{
void *handle;
void *unempty;
} *InterceptionDeviceArray;
EDIT: From some googling, it looks like this exit code is an Access Violation - I'm thinking from looking at the DLL source code that what I'm trying to access may not be accessible to other programs :/ Which seems like it defeats the point of having it as a DLL?
EDIT: I realised that perhaps the stuff loaded into memory can only be accessed by the DLL through further DLL calls rather than directly in memory. I'll look into this a bit further then.