Replaced ExecShellWait with ExecShellWaitEx, which returns either the process handle or the error code. Also removed WaitForProc, which is now replaced by WaitForProcEx.