Changeset 99483 in vbox for trunk/src/VBox/Runtime/testcase/tstRTProcCreateEx.cpp
- Timestamp:
- Apr 20, 2023 10:16:10 AM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstRTProcCreateEx.cpp
r99151 r99483 107 107 const char *pszCWD = argv[2]; 108 108 109 RTStrmPrintf(g_pStdOut, "childcwd: Called with CWD '%s'\n", pszCWD); 110 111 if (!RTStrICmp(pszCWD, "<cwd-not-specified>")) /* Bail out early if no CWD has been explicitly specified. */ 112 return RTEXITCODE_SUCCESS; 113 109 114 /* Validate if we really are in the CWD the parent told us. */ 110 115 char szCWD[RTPATH_MAX]; … … 155 160 g_szExecName, 156 161 "--testcase-child-cwd", 157 "< invalid-cwd>",162 "<cwd-not-specified>", 158 163 pszAsUser, 159 164 NULL … … 171 176 VERR_INVALID_PARAMETER); 172 177 178 /* Invalid flag combinations. Windows flags ignored elsewhere. */ 179 #ifdef RT_OS_WINDOWS 180 int rc = VERR_INVALID_PARAMETER; 181 #else 182 int rc = VERR_INVALID_POINTER; /* Due to missing pvExtraData. */ 183 #endif 184 fFlags = RTPROC_FLAGS_CWD | RTPROC_FLAGS_DESIRED_SESSION_ID | RTPROC_FLAGS_SERVICE; 185 RTTESTI_CHECK_RC_RETV(RTProcCreateEx(g_szExecName, apszArgs, RTENV_DEFAULT, fFlags, 186 NULL, NULL, NULL, pszAsUser, pszPassword, 187 NULL, &hProc), rc); 188 189 /* Windows-only flags. Ignored elsewhere. */ 190 #ifdef RT_OS_WINDOWS 191 rc = VERR_INVALID_POINTER; 192 #else 193 rc = VINF_SUCCESS; 194 #endif 195 fFlags = RTPROC_FLAGS_DESIRED_SESSION_ID | RTPROC_FLAGS_SERVICE; 196 RTTESTI_CHECK_RC_RETV(RTProcCreateEx(g_szExecName, apszArgs, RTENV_DEFAULT, fFlags, 197 NULL, NULL, NULL, pszAsUser, pszPassword, 198 NULL, &hProc), rc); 199 173 200 /* RTPROC_FLAGS_CWD set, but CWD missing as pvExtradata. */ 174 201 fFlags = RTPROC_FLAGS_CWD; … … 176 203 NULL, NULL, NULL, pszAsUser, pszPassword, 177 204 NULL, &hProc), 178 VINF_SUCCESS); 179 180 /* CWD is "<invalid-cwd>" from above, should fail. */ 181 RTPROCSTATUS ProcStatus = { -1, RTPROCEXITREASON_ABEND }; 182 RTTESTI_CHECK_RC(RTProcWait(hProc, RTPROCWAIT_FLAGS_BLOCK, &ProcStatus), VINF_SUCCESS); 205 VERR_INVALID_POINTER); 183 206 184 207 char szCWD[RTPATH_MAX]; … … 193 216 (void *)szCWD /* pvExtraData (CWD) */, &hProc), 194 217 VINF_SUCCESS); 218 RTPROCSTATUS ProcStatus = { -1, RTPROCEXITREASON_ABEND }; 195 219 RTTESTI_CHECK_RC(RTProcWait(hProc, RTPROCWAIT_FLAGS_BLOCK, &ProcStatus), VINF_SUCCESS); 196 220 if (ProcStatus.enmReason != RTPROCEXITREASON_NORMAL || ProcStatus.iStatus != 0)
Note:
See TracChangeset
for help on using the changeset viewer.