Jump to content
Sign in to follow this  


Recommended Posts


I am trying to access some dll functions that require a structure be populated and then returns the results in the same structure.

I am looking for help in the following places. I am not attempting to get anyone to do this for me, I just need help getting off dead-center:

1. What is the best "substitute" for a structure. A string? An Array?

2. I can call the RtlMoveMemory from kernel.dll, but need to be able to copy bytes starting at an offset from the start of the structure. ( ie ->destination + 4, for 4 bytes)

;Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _

; (Destination As Any, Source As Any, ByVal Length As Long)

Again, I am not asking anyone to create this for, just help with how to simulate a structure and then access the data within the simulation.

However, to aid in your discussion, here is one of the functions I am attempting to call.

DWORD RasSetEntryDialParams(

LPTSTR lpszPhonebook,

// pointer to the full path and filename of the phonebook file

LPRASDIALPARAMS lprasdialparams,

// pointer to a structure with the new connection parameters

BOOL fRemovePassword

// indicates whether to remove password from entrys parameters );

typedef struct tagRASDIALPARAMSA {

DWORD dwSize;

CHAR szEntryName[RAS_MaxEntryName + 1];

CHAR szPhoneNumber[RAS_MaxPhoneNumber + 1];

CHAR szCallbackNumber[RAS_MaxCallbackNumber + 1];

CHAR szUserName[uNLEN + 1];

CHAR szPassword[PWLEN + 1];

CHAR szDomain[DNLEN + 1];

#if (WINVER >= 0x401)

DWORD dwSubEntry;

ULONG_PTR dwCallbackId;



EDI: Or if any of you gurus want to wrap this into a cleaner dll that I can access the individual parameters?

Edited by ShelbySue

Share this post

Link to post
Share on other sites

Dunno how you would build it in AutoIt, but you could make a dll wrapper for it using C/C++....

Write a function thats takes a bunch of strings, builds the struct calls the real dll functions, and destructs the returned struct back into strings.

Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs

Share this post

Link to post
Share on other sites

Well I don't know if this is what you'r getting at but to do a structure to a library call is done in this manner... the ending _ character is a kind of new line char...

$var = DllCall(library,hwnd,Func to call in library,_



"int",value )

The Hwnd & Int etc. is keywords that indicate to Autoit what to expect, well you can look these up else where - This would be how you normally insert a structure into a dll library call...

Kåre :)

Edited by kjactive

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.