If this holds true for 100% of all future cases, it is ok with INFINITE, as it will for sure not jeopardize the complete process. Things change if it's only for 99% sure to end correctly. Then you could take some appropriate measures for those dull 1%.
No, not WaitForSingleObject(), but the process it is waiting for, how sure are you it will certainly end? 100%? What kind of object is ShExecInfo.hProcess?
the GNU Compiler it's called 2 times, that uses the WaitForSingleObject().. then i execute the test.exe using, too, the WaitForSingleObject() function...
i can't call the test.exe before the compiler close the file.
or better, i can't create the exe file before create the object file.
that's why i must use the WaitForSingleObject() function... i use the 'INFINITE'... here i don't need use, i belive, the milliseconds