I’m a newbie in c++ and trying to use debug apis, but i can’t even start. Because i couldn’t run any exe by CreateProcess api. It doesn’t give any compile error, but does return false. Do you have any suggestions?
LPCWSTR appName = LPCWSTR("C:\\TEST.EXE");
LPSTARTUPINFO sInfo = LPSTARTUPINFO();
LPPROCESS_INFORMATION pInfo = LPPROCESS_INFORMATION();
if (CreateProcess(appName,NULL,NULL,NULL,FALSE,CREATE_SUSPENDED,NULL,NULL,sInfo,pInfo))
{
printf("done!");
}
else
{
printf("error!");
}
sInfoandpInfoare not pointing to valid memory (and error code87means The parameter is incorrect.). Change to:and pass the addresses of the objects to
CreateProcess()(i.e.&sInfo, &pInfo).