General information
Category:
Windows API functions
Title:
CreateProcessWithLogonW returns error
It seems to always complain either about wrong path or file name.
What's the problem? Has anyone used it successfully from VFP? Works just fine from VB but I have to incorporate it into VFP...
DECLARE INTEGER CreateProcessWithLogonW IN AdvApi32 AS CrPr ;
STRING lpUserName, ;
STRING lpDomain, ;
STRING lpPassword, ;
INTEGER dwLogonFlags, ;
STRING lpAppName, ;
STRING lpCmdLine, ;
INTEGER dwCreationFlags, ;
INTEGER lpEnvir, ;
STRING lpCurDir, ;
STRING @ lpStartupInfo, ;
STRING @ lpProcessInfo
cUserName = "MyName"+CHR(0)
cDomain = "MyDomain"+CHR(0)
cPassword = "MyPassword"+CHR(0)
cAppName = "C:\\WINNT\\system32\\cmd.exe"+CHR(0)
cCmdLine=CHR(0)
cCurrDir=CHR(0) && current drive and directory of new process, if null, new process has same drive as system service that creates the process
*---- 16 bytes (4 * 4)
cProcessInfo = REPL(CHR(0),16) && Receives identification information for new process
*---- Normal
cStartupInfo = CHR(68) + ;
REPL(CHR(0),43) + ;
CHR(1) + ;
REPL(CHR(0),3)+ ;
CHR(1) + ;
REPL(CHR(0),19)
IF 0 = CrPr(cUserName, cDomain, cPassword, LOGON_NETCREDENTIALS_ONLY, cAppName, ;
cCmdLine, 0, ;
0, cCurrDir, @cStartupInfo, @cProcessInfo)
* FORMAT_MESSAGE_FROM_SYSTEM 0x1000
* LANG_NEUTRAL 0x0
.......
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only