Changeset 27387 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Mar 15, 2010 10:40:34 PM (15 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/process-win.cpp
r27385 r27387 296 296 { 297 297 CloseHandle(ProcInfo.hThread); 298 CloseHandle(ProcInfo.hProcess);299 298 if (phProcess) 299 { 300 /** @todo Remember the process handle and pick it up in RTProcWait. */ 300 301 *phProcess = ProcInfo.dwProcessId; 302 } 303 else 304 CloseHandle(ProcInfo.hProcess); 301 305 rc = VINF_SUCCESS; 302 306 } -
trunk/src/VBox/Runtime/testcase/tstRTProcCreateEx.cpp
r26824 r27387 54 54 55 55 56 static const char * const g_apszArgs4[] = 57 { 58 /* 0 */ "non existing non executable file", 59 /* 1 */ "--testcase-child-4", 60 /* 2 */ "a b", 61 /* 3 */ " cdef", 62 /* 4 */ "ghijkl ", 63 /* 5 */ "\"", 64 /* 6 */ "\\", 65 /* 7 */ "\\\"", 66 /* 8 */ "\\\"\\", 67 /* 9 */ "\\\\\"\\", 68 NULL 69 }; 70 71 static int tstRTCreateProcEx4Child(int argc, char **argv) 72 { 73 int rc = RTR3Init(); 74 if (rc) 75 return RTMsgInitFailure(rc); 76 77 for (int i = 0; i < argc; i++) 78 if (strcmp(argv[i], g_apszArgs4[i])) 79 { 80 RTStrmPrintf(g_pStdErr, 81 "child4: argv[%2u]='%s'\n" 82 "child4: expected='%s'\n", 83 i, argv[i], g_apszArgs4[i]); 84 rc++; 85 } 86 return rc; 87 } 88 89 static void tstRTCreateProcEx4(void) 90 { 91 RTTestISub("Argument with spaces and stuff"); 92 93 RTPROCESS hProc; 94 RTTESTI_CHECK_RC_RETV(RTProcCreateEx(g_szExecName, g_apszArgs4, RTENV_DEFAULT, 0 /*fFlags*/, NULL, 95 NULL, NULL, NULL, &hProc), VINF_SUCCESS); 96 RTPROCSTATUS ProcStatus = { -1, RTPROCEXITREASON_ABEND }; 97 RTTESTI_CHECK_RC(RTProcWait(hProc, RTPROCWAIT_FLAGS_BLOCK, &ProcStatus), VINF_SUCCESS); 98 99 if (ProcStatus.enmReason != RTPROCEXITREASON_NORMAL || ProcStatus.iStatus != 0) 100 RTTestIFailed("enmReason=%d iStatus=%d", ProcStatus.enmReason, ProcStatus.iStatus); 101 else 102 RTTestIPassed(NULL); 103 } 104 105 56 106 static int tstRTCreateProcEx3Child(void) 57 107 { … … 123 173 } 124 174 175 125 176 static int tstRTCreateProcEx2Child(void) 126 177 { … … 263 314 if (argc == 2 && !strcmp(argv[1], "--testcase-child-3")) 264 315 return tstRTCreateProcEx3Child(); 316 if (argc >= 5 && !strcmp(argv[1], "--testcase-child-4")) 317 return tstRTCreateProcEx4Child(argc, argv); 265 318 if (argc != 1) 266 319 return 99; … … 281 334 tstRTCreateProcEx2(); 282 335 tstRTCreateProcEx3(); 283 /** @todo Cover files, pszAsUser, arguments with spaces, ++ */ 336 tstRTCreateProcEx4(); 337 /** @todo Cover files, pszAsUser, ++ */ 284 338 285 339 /*
Note:
See TracChangeset
for help on using the changeset viewer.