Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Verifying NT password

36 views
Skip to first unread message

Wim Teuwens

unread,
Jul 11, 2000, 3:00:00 AM7/11/00
to
Hi,

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

Roy Kiesler [TeamSybase]

unread,
Jul 11, 2000, 3:00:00 AM7/11/00
to
You can use either the LogonUserA() API or the NetUserChangePassword() API
to change the current password to itself. If you use the later API, be aware
of Unicode issues.

--
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...

Wim Teuwens

unread,
Jul 11, 2000, 3:00:00 AM7/11/00
to
Roy,

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...

Roy Kiesler [TeamSybase]

unread,
Jul 11, 2000, 3:00:00 AM7/11/00
to
Declare a global structure USER_INFO_1 and declare a local external function
based on the following:

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...

0 new messages