Information générale
Catégorie:
Fonctions Windows API
Titre:
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
.......
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement