Jump to content

Dll Sub Structs


Oxin8
 Share

Recommended Posts

I was wondering if anyone in here had ideas for how I could create a DllStruct within another Struct and get the altered Struct returned and retrieve the data.

Little pseudo example:

struct1 = dwordA

struct2 = dwordB & struct1

dllcall(some function that alters the struct, ptr, dllstructgetptr(struct2)

now get the altered dwordA

sorry about crappy example...

Link to comment
Share on other sites

I was wondering if anyone in here had ideas for how I could create a DllStruct within another Struct and get the altered Struct returned and retrieve the data.

Little pseudo example:

struct1 = dwordA

struct2 = dwordB & struct1

dllcall(some function that alters the struct, ptr, dllstructgetptr(struct2)

now get the altered dwordA

sorry about crappy example...

first define the struct2 with the 2 dword

$struct2=DllStructCreate("dword;dword")

Then remap the second dword to struct1

$struct1=DllStructCreate("dword",DllStructGetPtr($struct2,2))

you can now use struct1 and struct2 when you need

Link to comment
Share on other sites

:lmao:

What's the prototype for the function that you're calling? What's the prototype for the structure? Does the call to DllCall fail or succeed? If it succeeds have you tried a DllCall to GetLastError, a-la:

$errorCall = DllCall(@SystemDir & "\kernel32.dll", "int", "GetLastError")

...to get the last Win32 system error?

Please post enough of your code to show the building of the struct and tha calling of the DLL function; no one call steal your killer app if you post only that much...

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

i haven't been home yet to try the get last error thing but the api call i'm talking about would be XInputGetState. It uses a XINPUT_STATE structure with a XINPUT_GAMEPAD structure within it. I know the function called correctly because the XINPUT_STATE packetnum changes when I press a button. This was awhile ago and since I've been getting more and more into API programming I wanted to see if it could be done. I ended up writting a vb wrapper dll and it works fine. All the code is in my _XInput UDF located at:

http://www.autoitscript.com/forum/index.php?showtopic=20161

Link to comment
Share on other sites

Ejoc, the original author of the DllStruct functions, posted this UDF for the purpose of accessing substructs. I haven't used it, so I can't attest to its functionality...

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...