Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CreateProcessWithLogonW returns error
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
CreateProcessWithLogonW returns error
Divers
Thread ID:
00875077
Message ID:
00875077
Vues:
96
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
Fil
Voir

Click here to load this message in the networking platform