On Sat, Dec 26, 2009 at 1:57 PM, Erich Hoover ehoover@mines.edu wrote:
Are you using a real cmd.exe or the Wine cmd.exe? I encountered a problem at one point with using a real cmd.exe with CreateProcess, I never actually finished tracking it down though b/c it wasn't an issue with the Wine-included cmd.exe.
I wrote a telnet server that worked on Wine and Windows using CreateProcess. See if somthing like the following helps
const char *name = "c:\windows\system32\cmd.exe"; const char *cmd = NULL;
if (!CreateProcess((LPSTR) name, // executable module (LPSTR) cmd, // command line NULL, // process security attributes NULL, // primary thread security attributes TRUE, // handles are inherited DETACHED_PROCESS + // creation flags CREATE_NEW_PROCESS_GROUP, NULL, // use parent's environment NULL, // use parent's current directory &si, // startup info &piProcInfo)) { ErrorExit("Create process failed"); }
Thanks