#include <windows.h>
#include <stdio.h>
void f_defective()
{
STARTUPINFOA si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof( si ) );
si.cb = sizeof( si );
ZeroMemory( &pi, sizeof( pi ) );
if( !CreateProcessA( NULL,
"C:\\Program Files\\MyApp",
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi ) )
{
puts( "CreateProcess failed." );
return;
}
// Wait until child process exits.
WaitForSingleObject( pi.hProcess, INFINITE );
// Close process and thread handles.
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
}