Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Api-Call raises error

Status
Not open for further replies.

stwi1974

Programmer
Jan 29, 2002
17
DE
Hi all!

I'm developing with VB6.4 SP4 on W2K.
I'm trying to start a process with with different access as the current user logged in.
I figured out the following previous api-call of "CreateProcessAsUser":
The declaration is:
Public Declare Function LogonUser Lib "kernel32" Alias "LogOnUserA" (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
and the call is:
lLogOn = LogonUser("Username", "Domain", "Password", LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, mpHToken)

In further threads i got the information that there is an error using the Api-Text-Viewer. So i should use
"Advapi32.dll" instead of "kernel32". I tried, but also failed with error 453: DLL-EntryPoint LogOnUserA not found in kernel32 (or advapi32.dll). The change didnt matter at all.

Thanks for all help!

 
Simple Question. Are You Declaring your
LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT
Constants? Anything is possible, the problem is I only have one lifetime.
 
There are two LogonUser's present in advapi32.dll. They are:

LogonUserA and LogonUserW. I don't know about the parameters for them, as these were obtained through disassembling the advapi32.dll module.

You might also try the following:
-Using the call straight, IE no Alias (I've had this work sometimes)
-Upgrading the service pack :)


Above is the link for the service pack upgrade. Good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top