Day 192: executing system command

On Windows you need to call CloseHandle not only on process handle hProcess, but also on thread handle hThread.

It's in the docs - https://msdn.microsoft.com/en-us/...ary/windows/desktop/ms684873.aspx
If the function succeeds, be sure to call the CloseHandle function to close the hProcess and hThread handles when you are finished with them. Otherwise, when the child process exits, the system cannot clean up the process structures for the child process because the parent process still has open handles to the child process.

You can close this handle immediately after CreateProcess returns, no need to wait until process terminates.
Thanks Martins... I'll try to remember on tomorrow's stream.

- Casey
Could we make the arguments to DEBUGExecuteSystemCommand less platform dependant? Wouldn't it be sufficient to just pass an enum with a command, like "build"?

I did manage to implement support for this on Linux (and presumably OS X) but it is not particularly pretty.

/Kim