LogonUser from advapi32.dll 
Author Message
 LogonUser from advapi32.dll

Please help me!
        How should I call LogonUser from the advapi32.dll?
        How should I declare the function?
        In the program that I was trying to use it, seems to me that the
DLL was found but the function was not in it.

        Thanks in advance!



Tue, 12 Oct 1999 03:00:00 GMT  
 LogonUser from advapi32.dll

Quote:

> Please help me!
>         How should I call LogonUser from the advapi32.dll?
>         How should I declare the function?
>         In the program that I was trying to use it, seems to me that the
> DLL was found but the function was not in it.

>         Thanks in advance!

The following is one of the networkig functions I posted in
microsoft.public.vb.winapi.network (if you browse that newsgroup, you got to click
File/Get More Msg item several times to get all my postings in early April.

Jeff Hong YAN

PS: This function requires the user has permission as part of the system. You or your
user may or may not have this permission. But if you do, this function should work
without any problem.

Hi all,

The following is the function I use to validate user logon on Windows NT domain. User
account should be global account.

This function is useful if you want to implement an integrated user logon with the
Windows NT domain.

I welcome any comments and suggestions.

Rgds
Jeff Hong YAN

Option Explicit

'Author: Jeff Hong YAN
'Date: 1/21/97
'Description: Validate user id and password on Windows NT domain.
'This function works on NT Workstation
'If you want to crack a user account, this function is a start.

Private Declare Function LogonUserA Lib "advapi32.dll" _
    (ByVal lpszUsername As String, ByVal lpszDomain As String, _
     ByVal lpszPassword As String, ByVal dwLogonType As Long, _
     ByVal dwLogonProvider As Long, phToken As Long) As Long

'Logon type
Const LOGON32_LOGON_INTERACTIVE = 2
Const LOGON32_NETWORK = 3          
Const LOGON32_LOGON_BATCH = 4
Const LOGON32_LOGON_SERVICE = 5

'Provider
Const LOGON32_PROVIDER_WINNT35 = 1
Const LOGON32_PROVIDER_DEFAULT = 0

Function ValidateLogon(UserID As String, Pass As String, sDomainName As String) As
Boolean

Dim sUserID As String
Dim sPass   As String
Dim sDName  As String

Dim hToken  As Long
Dim lReturn As Long

sUserID = Trim$(UserID)
sPass = Trim$(Pass)
ValidateLogon = False

    lReturn = LogonUserA(sUserID, sDomainName, sPass, LOGON32_NETWORK ,  
LOGON32_PROVIDER_DEFAULT, hToken)
    If lReturn = 1 Then
        ValidateLogon = True
        Exit For
    End If

End Function



Wed, 13 Oct 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. LogonUser and advapi32.dll

2. LogonUser and advapi32.dll

3. LogonUser advapi32.dll function

4. Can't find DLL entry point OpenEventLog in advapi32.dll

5. LogonUser API call in Windows 95/98 / How do you use Secur32.dll/Security.dll

6. LogonUser API call in Windows 95/98 / How do you use Secur32.dll/Security.dll

7. Advapi32.dll

8. Help using advapi32.dll

9. ADVAPI32.DLL 05-08-98 or newer

10. Accessing the registry using advapi32.dll

11. Accessing the registry using advapi32.dll

12. GPF in AdvApi32.Dll - Help Anyone?

 

 
Powered by phpBB® Forum Software