Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static DWORD WINAPI RunningTests(test_s *test)
- {
- PROCESS_INFORMATION procinfo;
- DWORD waitcode;
- DWORD exitcode;
- int status = 0, crashed = 0;
- char cmdLineString[MAX_NUMBER_OF_CHARS_IN_CMD_LINE]="";
- char *cmdLineStringPtr = cmdLineString;
- (test)->isCrashed = 0;
- CreateCmdLine((*test).testExePath, &cmdLineStringPtr);
- status = CreateProcessSimple(_T(cmdLineString), &procinfo);
- if (status == -1)
- {
- return 1;
- }
- waitcode = WaitForSingleObject(procinfo.hProcess,
- TIME_UNTIL_TIMED_OUT_IN_MILLISEC);
- if (waitcode == WAIT_TIMEOUT) /* Process is still alive */
- {
- strcpy((*test).status, "Timed Out");
- CloseHandle(procinfo.hProcess);
- CloseHandle(procinfo.hThread);
- return 0;
- }
- crashed = GetExitCodeProcess(procinfo.hProcess, &exitcode);
- if (crashed == 0) /* Process is crashed */
- {
- strcpy((*test).status, "Crashed");
- (*test).isCrashed = 1;
- (*test).returnedCrashedValue = exitcode;
- CloseHandle(procinfo.hProcess);
- CloseHandle(procinfo.hThread);
- return 0;
- }
- //strcpy((*test).status, "nadavosh");
- CloseHandle(procinfo.hProcess);
- CloseHandle(procinfo.hThread);
- return CompareFiles(&test);
- }
Add Comment
Please, Sign In to add comment