Before running my app, users have to supply a nt-userid and password.
Is there any way to check if the userid/password is correct (possibly using
a win32-api) ?
TIA
Wim Teuwens
--
pbm_hopethishelps,
Roy Kiesler [TeamSybase]
Sybase Developer Network (SDN) - http://sdn.sybase.com
"Wim Teuwens" <W...@anaXis.be> wrote in message
news:3bX$rTx6$GA....@forums.sybase.com...
Thanks for your input.
Using your information, I discovered that there's another usefull
api-function (found in the MSDN-library) called 'NetUserGetInfo'. It seems
that using this function with parameter 'Level=1' does return the password.
Hence, I have no clue in how to create a PB-function to get this
api-function return me the password.
Can you please help me with this one ?
Thx
Wim Teuwens
NetUserGetInfo
The NetUserGetInfo function retrieves information about a particular user
account on a server.
NET_API_STATUS NetUserGetInfo(
LPCWSTR servername,
LPCWSTR username,
DWORD level,
LPBYTE *bufptr
);
USER_INFO_1
The USER_INFO_1 structure contains information about a user account,
including account name, password data, privilege level, and the path to the
user's home directory.
typedef struct _USER_INFO_1 {
LPWSTR usri1_name;
LPWSTR usri1_password;
DWORD usri1_password_age;
DWORD usri1_priv;
LPWSTR usri1_home_dir;
LPWSTR usri1_comment;
DWORD usri1_flags;
LPWSTR usri1_script_path;
}USER_INFO_1, *PUSER_INFO_1, *LPUSER_INFO_1;
Members
usri1_name
Pointer to a Unicode string that specifies the name of the user account. For
the NetUserSetInfo function, this member is ignored.
usri1_password
Pointer to a Unicode string that specifies the password of the user
indicated by the usri1_name member. The length cannot exceed PWLEN bytes.
The NetUserEnum and NetUserGetInfo functions return a NULL pointer to
maintain password security.
By convention, Windows NT/Windows 2000 limits the length of passwords to
LM20_PWLEN characters. This convention allows LAN Manager, Windows 3.x,
Windows for Workgroups 3.x, Windows 95, and Windows 98 clients to access a
Windows NT/Windows 2000 server using the account.
....
Roy Kiesler [TeamSybase] <SPAM_FREE...@noblestar.com> wrote in message
news:p51EYAz6$GA....@forums.sybase.com...
Win32 PB
------------------
NET_API_STATUS long
LPWSTR REF blob (blob generated by AnsiToUnicode PowerScript
function)
LPCWSTR blob (blob generated by AnsiToUnicode PowerScript function)
DWORD ulong
I'm sorry, but I donot have a working sample for this API.
--
pbm_hopethishelps,
Roy Kiesler [TeamSybase]
Sybase Developer Network (SDN) - http://sdn.sybase.com
"Wim Teuwens" <W...@anaXis.be> wrote in message
news:anV7DF06$GA....@forums.sybase.com...