Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win32 possible bug #19

Open
schadov opened this issue Feb 25, 2014 · 1 comment
Open

Win32 possible bug #19

schadov opened this issue Feb 25, 2014 · 1 comment

Comments

@schadov
Copy link

schadov commented Feb 25, 2014

(LPSTR) command,// Command line

you can't do that with a const char* in general case because this parameter is actually being written to by windows runtime. It's better to copy the cmd line.

@schadov
Copy link
Author

schadov commented Feb 25, 2014

if(!CreateProcess(NULL, // No module name (use command line)
(LPSTR) command,// Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi) // Pointer to PROCESS_INFORMATION structure
)

I meant this chunk of code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant