I want to check if a username exists. For this i use the NetUserGetInfo function from netapi32.dll, but i allways get the returncode 2221 = NERR_UserNotFound = ret.
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
NetUserGetInfo netapi32.dll
Started by
krakos
, Sep 01 2009 14:20
3 replies to this topic
Posted 01 September 2009 - 14:20
CODE |
prototype LONG Netapi32.NetUserGetInfo( LPSTR, LPSTR, LONG, POINTER); result = UseDLL("netapi32.dll"); if(result < ISERR_SUCCESS) then MessageBox("Could not load netapi32.DLL.", SEVERE); return FALSE; endif; userName = "Administrator"; serverName = ""; ret = NetUserGetInfo(NULL, &userName, 0, p1); if(ret == 0) then return 1 else return 0; endif; UnUseDLL("netapi32.dll"); |
Can anybody explain me what i am doing wrong?
Thanks!
Posted 02 September 2009 - 08:42
Have you tried without the & sign?
Stefan Krüger
InstallSite.org twitter facebook
Posted 03 September 2009 - 09:07
Hello Stefan,
yes i tried it in different ways and other datatypes. If you use LPSTR the & sign must be there (Address of Pointer).
If nobody has an idea, im going to write a c# dll, which will do all the jobs for me.
Im a little bit suprised that such elementar thinks like checking a username, is such a big think with InstallScript.
Thanks for your reply.
yes i tried it in different ways and other datatypes. If you use LPSTR the & sign must be there (Address of Pointer).
If nobody has an idea, im going to write a c# dll, which will do all the jobs for me.
Im a little bit suprised that such elementar thinks like checking a username, is such a big think with InstallScript.
Thanks for your reply.
Posted 22 September 2009 - 22:05
Try LookupAccountName. It's in advapi32.dll and has an ansi version.