Jump to content

DllCall('netapi32.dll','int','NetUserGetGroups....


Andre
 Share

Recommended Posts

Hi,

has anyone got an example with

DllCall('netapi32.dll','int','NetUserGetGroups....................

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
Share on other sites

The parameters require a pointer to a string, or str_ptr. Since there is no such thing a str_ptr included in autoit, then it is not possisble (at this time) to use this api from autoit.

Jon, this has to be at least 4 times that myself and other users have needed a str_ptr to be included in autoit. Please add this functionality.

EDIT: References for Jon:

http://www.autoitscript.com/forum/index.ph...topic=6999&st=0 (last post on that page by me)

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

http://www.autoitscript.com/forum/index.ph...opic=6545&st=15

(I am sure with prodding I could find that one other reference as well.)

Edited by this-is-me
Who else would I be?
Link to comment
Share on other sites

  • Administrators

The parameters require a pointer to a string, or str_ptr. Since there is no such thing a str_ptr included in autoit, then it is not possisble (at this time) to use this api from autoit.

Jon, this has to be at least 4 times that myself and other users have needed a str_ptr to be included in autoit. Please add this functionality.

EDIT: Refer

A string is actually a string pointer.

(Any of the examples above should work with the str type, if the string is changed by the function then you will be able to read the change as with usual _ptr types)

Link to comment
Share on other sites

Hi,

Thnx for the reactions.

I've tried DLLCall with simple API Calls.

Can someone post an example with the NetUserGetGroups if possible with the current version of course :lmao:

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
Share on other sites

The parameters require a pointer to a string, or str_ptr. Since there is no such thing a str_ptr included in autoit, then it is not possisble (at this time) to use this api from autoit.

Jon, this has to be at least 4 times that myself and other users have needed a str_ptr to be included in autoit. Please add this functionality.

EDIT: References for Jon:

http://www.autoitscript.com/forum/index.ph...topic=6999&st=0 (last post on that page by me)

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

http://www.autoitscript.com/forum/index.ph...opic=6545&st=15

(I am sure with prodding I could find that one other reference as well.)

<{POST_SNAPBACK}>

I'm just marveling at the tone of this message. It's like "Jon, are you ever going to get off your ass about this? People are asking for just this functionality, see? So why haven't you done anything about it?"

Putting aside that you couldn't convey exactly what it is you feel has been requested, I'm going to be charitible and guess that you don't know what a nightmare it is you're asking for, this-is-me. The types that are implemented for DllCall() weren't chosen because they were the easiest to do, it was because that one can predict and provide what is meant when one sees one of those types in a function declaration. I hope that makes sense.

As is discussed in the topics quoted by you, this-is-me, a pointer-to-a-string-pointer, though it may seem clear-cut in a DLL function prototype, can mean several different things; that it wants a NULL pointer that it will assign to an array of strings to give back to you; that it wants an array of strings from you; that it wants a single string from you; that it wants a NULL pointer that it will assign to a singe string to give back to you; that it wants a specifically formatted string from you or it wets the bed. None of these things are evident or can be conveyed by foo(PSTR* bar). Again, I hope that this makes sense.

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 did not mean at all to come across as you have seemed to recieve this DaveF. Jon said that anything that goes into autoit is a popularity contest. This means that there must be good grounds for adding any functionality in the first place. I am mearly pointing out to Jon the number of times that someone has needed to have this available to them. The main reason I have pointed this out is that I remember no other point at which Jon explained directly why he has or has not added this. If nothing else, it would have served as a reminder to Jon if he was planning this but never had a chance to implement it. As for the tone, I had no such tone in mind. It is easy when reading a reply to inflect a tone that would have not been shown had that person been face-to-face. As for the implementation, I thank you for your comments on how hard it would be and what obstacles would be faced. I see now that unless at least 10 or 15 people need something different than a plain str, it will not be added, so I relent from "reminding" Jon to do it.

Who else would I be?
Link to comment
Share on other sites

  • Administrators

I did not mean at all to come across as you have seemed to recieve this DaveF. Jon said that anything that goes into autoit is a popularity contest. This means that there must be good grounds for adding any functionality in the first place. I am mearly pointing out to Jon the number of times that someone has needed to have this available to them. The main reason I have pointed this out is that I remember no other point at which Jon explained directly why he has or has not added this. If nothing else, it would have served as a reminder to Jon if he was planning this but never had a chance to implement it. As for the tone, I had no such tone in mind. It is easy when reading a reply to inflect a tone that would have not been shown had that person been face-to-face. As for the implementation, I thank you for your comments on how hard it would be and what obstacles would be faced. I see now that unless at least 10 or 15 people need something different than a plain str, it will not be added, so I relent from "reminding" Jon to do it.

I can't spent all day debugging everyone's DllCalls :lmao:

From your list of three links.

1. RegLoadKey

LONG RegLoadKey(

HKEY hKey,

LPCTSTR lpSubKey,

LPCTSTR lpFile

);

LPCTSTR = pointer to a C string = "str" = no problem

2. "Some APIs" mentioned. No example.

3. ReportEvent

BOOL ReportEvent(

HANDLE hEventLog,

WORD wType,

WORD wCategory,

DWORD dwEventID,

PSID lpUserSid,

WORD wNumStrings,

DWORD dwDataSize,

LPCTSTR* lpStrings,

LPVOID lpRawData

);

LPCTSTR* lpStrings. This wants an array of strings as input (you can't tell this from the prototype, only the description) So even if I added a pointer to a pointer type that gives us nothing. We still don't have a way of getting that info into the function call. Well we could make it accept an array but there would be no way to judge the size required for each element or the number of dimension. Then there's the problem of getting the return. We already return modified params in an array so would have to go down the array-in-a-array route. That's assuming that the function call actually wanted an array of strings and not just a pointer to a pointer so it could reallocate some memory. Coupled with the fact that A LPCTSTR* is a pretty uncommon and to make it work would need a type of "str_ptr_ptr:single_dim_array:30_elements:alloc_65535_byte_per_element". Yes I was thinking about a str:size mod so so that we could control string sizes better but that seems a little overkill. If anyone can think up a way of describing structures and a way of providing data to them in a way that doesn't result in my programming DllCall for the REST OF MY LIFE then shoot. As it is I'm happy with providing the basic data types that work for 90% of the API.

I think I',m going to write a GUI with a "should we implement" equation, based on general usefulness, code bloat, popularity and difficulty o:)

Link to comment
Share on other sites

Jon, I can think of ways of describing types which would kick major ass. I think it might have a side effect of giving people a rocket launcher to shoot themself in the foot with, though. However, I don't think it would be quite as hard as I originall thought.

Its amazing what kind of things you can dream up when you play with PE Headers :lmao:

TypeCreate("RECT", "bottom", "long", "top", "long", "left", "long", "right", "long")
$rect = TypeGet("Rect")
$rect->bottom = 10
$rect->top = 100
$rect->left = 10
$rect->right = 294

This would basically allow you to describe any C-structure and access all its members in a typical C-like syntax (I'd prefer something other than . because it will be used with COM).

What do you think, Jon? Something to think about in the future (After I regain my sanity)?

Link to comment
Share on other sites

Nobody got an clue ?

I thought it was possible but correct me if i'm wrong :lmao:

<{POST_SNAPBACK}>

Andre, can we know what you're planning to use the function call for? I tried coding a wrapper DLL for it but couldn't get that to work, and even the example command-line app at MSDN won't run on a Win 2003 server.

Do you just need a list of the groups that a Windows user belongs to on a local machine or do you really need to query a server?

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

VALIK THE MAN! If you can get this working, it will fulfill my dream of an almost complete breakthrough on autoit. With this and COM, autoit would accell much farther that a simple "scripting language".

<{POST_SNAPBACK}>

Don't get your hopes up yet. There are several issues. First of all, Jon hasn't said whether or not he would even accept something like that. Second, there are a couple technical aspects to figure out. Third, finding time/motivation to write the code. Fourth, I'm hesitant to even do it because it'll be very easy to shoot yourself in the foot with it and it won't be with a pistol. I'm talking Rocket-launcher type weaponry. It would require the user to at least grasp the ability to convert Win32 types (WORD, BYTE, DWORD, et all) to their C origins (unsigned short, unsigned char, long). It gets even fuzzier with strings/arrays of stuff.

And I'm not even going to think any further on it until I finish up what I'm currently working on.

Link to comment
Share on other sites

@DaveF

I was just wondering if that was possible to query an server.

At the moment we are using vbscript in our companies logonscript.

I know there are "external" ways to perform such tasks but it might be nice if ik could be written in "pure" AutoIt :lmao:

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
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...