- Timestamp:
- Jan 24, 2023 12:15:49 PM (23 months ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/.scm-settings
r98280 r98281 56 56 /src-client/*cpp: --no-rc-use 57 57 /src-global/*cpp: --no-rc-use 58 /src-helper-apps/*cpp: --no-rc-use 58 59 59 60 # IDL and XML -
trunk/src/VBox/Main/src-helper-apps/OpenGLTest/OpenGLTest.cpp
r98103 r98281 50 50 static char pszVBoxPath[RTPATH_MAX]; 51 51 const char *papszArgs[4] = { NULL, "-test", "3D", NULL}; 52 int rc;53 RTPROCESS Process;54 RTPROCSTATUS ProcStatus;55 uint64_t StartTS;56 52 57 53 #ifdef __SANITIZE_ADDRESS__ … … 63 59 RTEnvPutEx(env, "ASAN_OPTIONS=detect_leaks=0"); /* If this fails we will notice later */ 64 60 #endif 65 rc = RTPathExecDir(pszVBoxPath, RTPATH_MAX); AssertRCReturn(rc, false); 61 int vrc = RTPathExecDir(pszVBoxPath, RTPATH_MAX); 62 AssertRCReturn(vrc, false); 66 63 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 67 rc = RTPathAppend(pszVBoxPath, RTPATH_MAX, "VBoxTestOGL.exe");64 vrc = RTPathAppend(pszVBoxPath, RTPATH_MAX, "VBoxTestOGL.exe"); 68 65 #else 69 rc = RTPathAppend(pszVBoxPath, RTPATH_MAX, "VBoxTestOGL");66 vrc = RTPathAppend(pszVBoxPath, RTPATH_MAX, "VBoxTestOGL"); 70 67 #endif 71 68 papszArgs[0] = pszVBoxPath; /* argv[0] */ 72 AssertRCReturn( rc, false);69 AssertRCReturn(vrc, false); 73 70 71 RTPROCESS Process; 74 72 #ifndef __SANITIZE_ADDRESS__ 75 rc = RTProcCreate(pszVBoxPath, papszArgs, RTENV_DEFAULT, 0, &Process);73 vrc = RTProcCreate(pszVBoxPath, papszArgs, RTENV_DEFAULT, 0, &Process); 76 74 #else 77 rc = RTProcCreate(pszVBoxPath, papszArgs, env, 0, &Process);75 vrc = RTProcCreate(pszVBoxPath, papszArgs, env, 0, &Process); 78 76 RTEnvDestroy(env); 79 77 #endif 80 if (RT_FAILURE( rc))78 if (RT_FAILURE(vrc)) 81 79 return false; 82 80 83 StartTS = RTTimeMilliTS();81 uint64_t StartTS = RTTimeMilliTS(); 84 82 83 RTPROCSTATUS ProcStatus = {0}; 85 84 while (1) 86 85 { 87 rc = RTProcWait(Process, RTPROCWAIT_FLAGS_NOBLOCK, &ProcStatus);88 if ( rc != VERR_PROCESS_RUNNING)86 vrc = RTProcWait(Process, RTPROCWAIT_FLAGS_NOBLOCK, &ProcStatus); 87 if (vrc != VERR_PROCESS_RUNNING) 89 88 break; 90 89 … … 101 100 } 102 101 103 if (RT_SUCCESS(rc)) 104 { 105 if ((ProcStatus.enmReason==RTPROCEXITREASON_NORMAL) && (ProcStatus.iStatus==0)) 106 { 102 if (RT_SUCCESS(vrc)) 103 if ( ProcStatus.enmReason == RTPROCEXITREASON_NORMAL 104 && ProcStatus.iStatus == 0) 107 105 return true; 108 }109 }110 106 111 107 return false; -
trunk/src/VBox/Main/src-helper-apps/OpenGLTest/OpenGLTestApp.cpp
r98103 r98281 164 164 DECLINLINE(PFNRT) vboxTestOglGetProc(const char *pszSymbol) 165 165 { 166 int rc;166 int vrc; 167 167 168 168 #ifdef RT_OS_WINDOWS … … 170 170 if (s_hOpenGL32 == NULL) 171 171 { 172 rc = RTLdrLoadSystem("opengl32", /* fNoUnload = */ true, &s_hOpenGL32);173 if (RT_FAILURE( rc))172 vrc = RTLdrLoadSystem("opengl32", /* fNoUnload = */ true, &s_hOpenGL32); 173 if (RT_FAILURE(vrc)) 174 174 s_hOpenGL32 = NULL; 175 175 } … … 181 181 if (s_hOpenGL32 != NULL) 182 182 { 183 rc = RTLdrGetSymbol(s_hOpenGL32, "wglGetProcAddress", (void **)&s_wglGetProcAddress);184 if (RT_FAILURE( rc))183 vrc = RTLdrGetSymbol(s_hOpenGL32, "wglGetProcAddress", (void **)&s_wglGetProcAddress); 184 if (RT_FAILURE(vrc)) 185 185 s_wglGetProcAddress = NULL; 186 186 } … … 195 195 196 196 /* Might be an exported symbol. */ 197 rc = RTLdrGetSymbol(s_hOpenGL32, pszSymbol, (void **)&p);198 if (RT_SUCCESS( rc))197 vrc = RTLdrGetSymbol(s_hOpenGL32, pszSymbol, (void **)&p); 198 if (RT_SUCCESS(vrc)) 199 199 return p; 200 200 } … … 204 204 { 205 205 static const char s_szLibGL[] = "libGL.so.1"; 206 rc = RTLdrLoadEx(s_szLibGL, &s_hGL, RTLDRLOAD_FLAGS_GLOBAL | RTLDRLOAD_FLAGS_NO_UNLOAD, NULL);207 if (RT_FAILURE( rc))206 vrc = RTLdrLoadEx(s_szLibGL, &s_hGL, RTLDRLOAD_FLAGS_GLOBAL | RTLDRLOAD_FLAGS_NO_UNLOAD, NULL); 207 if (RT_FAILURE(vrc)) 208 208 { 209 209 s_hGL = NULL; … … 216 216 if (s_glXGetProcAddress == NULL) 217 217 { 218 rc = RTLdrGetSymbol(s_hGL, "glXGetProcAddress", (void **)&s_glXGetProcAddress);219 if (RT_FAILURE( rc))218 vrc = RTLdrGetSymbol(s_hGL, "glXGetProcAddress", (void **)&s_glXGetProcAddress); 219 if (RT_FAILURE(vrc)) 220 220 { 221 221 s_glXGetProcAddress = NULL; … … 229 229 230 230 /* Might be an exported symbol. */ 231 rc = RTLdrGetSymbol(s_hGL, pszSymbol, (void **)&p);232 if (RT_SUCCESS( rc))231 vrc = RTLdrGetSymbol(s_hGL, pszSymbol, (void **)&p); 232 if (RT_SUCCESS(vrc)) 233 233 return p; 234 234 #endif … … 390 390 RTR3InitExe(argc, &argv, 0); 391 391 392 int rc = 0;392 int vrc = 0; 393 393 if (argc < 2) 394 394 { 395 395 /* backwards compatibility: check 3D */ 396 rc = vboxCheck3DAccelerationSupported();396 vrc = vboxCheck3DAccelerationSupported(); 397 397 } 398 398 else … … 409 409 410 410 RTGETOPTSTATE State; 411 rc = RTGetOptInit(&State, argc, argv, &s_aOptionDefs[0], RT_ELEMENTS(s_aOptionDefs), 1, 0);412 AssertRCReturn( rc, 49);411 vrc = RTGetOptInit(&State, argc, argv, &s_aOptionDefs[0], RT_ELEMENTS(s_aOptionDefs), 1, 0); 412 AssertRCReturn(vrc, 49); 413 413 414 414 #ifdef VBOX_WITH_VIDEOHWACCEL 415 bool bTest2D = false;416 #endif 417 bool bTest3D = false;418 #ifdef VBOXGLTEST_WITH_LOGGING 419 bool bLog = false;420 bool bLogSuffix = false;415 bool fTest2D = false; 416 #endif 417 bool fTest3D = false; 418 #ifdef VBOXGLTEST_WITH_LOGGING 419 bool fLog = false; 420 bool fLogSuffix = false; 421 421 const char * pLog = NULL; 422 422 #endif … … 425 425 { 426 426 RTGETOPTUNION Val; 427 rc = RTGetOpt(&State, &Val);428 if (! rc)427 vrc = RTGetOpt(&State, &Val); 428 if (!vrc) 429 429 break; 430 switch ( rc)430 switch (vrc) 431 431 { 432 432 case 't': 433 433 if (!strcmp(Val.psz, "3D") || !strcmp(Val.psz, "3d")) 434 bTest3D = true;434 fTest3D = true; 435 435 #ifdef VBOX_WITH_VIDEOHWACCEL 436 436 else if (!strcmp(Val.psz, "2D") || !strcmp(Val.psz, "2d")) 437 bTest2D = true;437 fTest2D = true; 438 438 #endif 439 439 else … … 443 443 #ifdef VBOXGLTEST_WITH_LOGGING 444 444 case 'l': 445 bLog = true;445 fLog = true; 446 446 pLog = Val.psz; 447 447 break; 448 448 case 'L': 449 bLog = true;449 fLog = true; 450 450 pLog = NULL; 451 451 break; … … 478 478 case VINF_GETOPT_NOT_OPTION: 479 479 default: 480 return RTGetOptPrintError( rc, &Val);480 return RTGetOptPrintError(vrc, &Val); 481 481 } 482 482 } … … 486 486 */ 487 487 #ifdef VBOXGLTEST_WITH_LOGGING 488 if (! bLog)488 if (!fLog) 489 489 { 490 490 /* check the VBOXGLTEST_LOG env var */ 491 491 pLog = RTEnvGet("VBOXGLTEST_LOG"); 492 492 if(pLog) 493 bLog = true;494 bLogSuffix = true;495 } 496 if ( bLog)497 rc = vboxInitLogging(pLog, bLogSuffix);493 fLog = true; 494 fLogSuffix = true; 495 } 496 if (fLog) 497 vrc = vboxInitLogging(pLog, fLogSuffix); 498 498 else 499 499 #endif 500 rc = vboxInitQuietMode();500 vrc = vboxInitQuietMode(); 501 501 502 502 /* 503 503 * Do the job. 504 504 */ 505 if (! rc && bTest3D)506 rc = vboxCheck3DAccelerationSupported();505 if (!vrc && fTest3D) 506 vrc = vboxCheck3DAccelerationSupported(); 507 507 508 508 #ifdef VBOX_WITH_VIDEOHWACCEL 509 if (! rc && bTest2D)510 rc = vboxCheck2DVideoAccelerationSupported();509 if (!vrc && fTest2D) 510 vrc = vboxCheck2DVideoAccelerationSupported(); 511 511 #endif 512 512 } 513 513 514 514 /*RTR3Term();*/ 515 return rc;515 return vrc; 516 516 517 517 } -
trunk/src/VBox/Main/src-helper-apps/OpenGLTest/OpenGLTestDarwin.cpp
r98103 r98281 102 102 static RTONCE s_Once = RTONCE_INITIALIZER; 103 103 static bool s_fCached = false; 104 int rc = RTOnce(&s_Once, vboxOglIsOfflineRenderingAppropriateOnce, &s_fCached);105 AssertRC( rc);104 int vrc = RTOnce(&s_Once, vboxOglIsOfflineRenderingAppropriateOnce, &s_fCached); 105 AssertRC(vrc); 106 106 return s_fCached; 107 107 } -
trunk/src/VBox/Main/src-helper-apps/OpenGLTest/VBoxGLSupportInfo.cpp
r98103 r98281 356 356 void VBoxGLInfo::initExtSupport(const MY_QOpenGLContext &context) 357 357 { 358 int rc = 0;358 int vrc = VINF_SUCCESS; 359 359 do 360 360 { 361 rc = 0;362 361 mMultiTexNumSupported = 1; /* default, 1 means not supported */ 363 362 if(mGLVersion >= 0x010201) /* ogl >= 1.2.1 */ 364 363 { 365 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_ACTIVE_TEXTURE, ActiveTexture, rc);366 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_MULTI_TEX_COORD2I, MultiTexCoord2i, rc);367 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_MULTI_TEX_COORD2D, MultiTexCoord2d, rc);368 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_MULTI_TEX_COORD2F, MultiTexCoord2f, rc);364 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_ACTIVE_TEXTURE, ActiveTexture, vrc); 365 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_MULTI_TEX_COORD2I, MultiTexCoord2i, vrc); 366 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_MULTI_TEX_COORD2D, MultiTexCoord2d, vrc); 367 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_MULTI_TEX_COORD2F, MultiTexCoord2f, vrc); 369 368 } 370 369 else if(m_GL_ARB_multitexture) 371 370 { 372 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_ACTIVE_TEXTURE, ActiveTexture, rc);373 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_MULTI_TEX_COORD2I, MultiTexCoord2i, rc);374 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_MULTI_TEX_COORD2D, MultiTexCoord2d, rc);375 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_MULTI_TEX_COORD2F, MultiTexCoord2f, rc);371 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_ACTIVE_TEXTURE, ActiveTexture, vrc); 372 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_MULTI_TEX_COORD2I, MultiTexCoord2i, vrc); 373 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_MULTI_TEX_COORD2D, MultiTexCoord2d, vrc); 374 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_MULTI_TEX_COORD2F, MultiTexCoord2f, vrc); 376 375 } 377 376 else … … 380 379 } 381 380 382 if(RT_FAILURE( rc))381 if(RT_FAILURE(vrc)) 383 382 break; 384 383 … … 403 402 do 404 403 { 405 rc = 0;404 vrc = 0; 406 405 mPBOSupported = false; 407 406 408 407 if(m_GL_ARB_pixel_buffer_object) 409 408 { 410 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_GEN_BUFFERS, GenBuffers, rc);411 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_DELETE_BUFFERS, DeleteBuffers, rc);412 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_BIND_BUFFER, BindBuffer, rc);413 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_BUFFER_DATA, BufferData, rc);414 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_MAP_BUFFER, MapBuffer, rc);415 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNMAP_BUFFER, UnmapBuffer, rc);409 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_GEN_BUFFERS, GenBuffers, vrc); 410 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_DELETE_BUFFERS, DeleteBuffers, vrc); 411 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_BIND_BUFFER, BindBuffer, vrc); 412 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_BUFFER_DATA, BufferData, vrc); 413 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_MAP_BUFFER, MapBuffer, vrc); 414 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNMAP_BUFFER, UnmapBuffer, vrc); 416 415 } 417 416 else … … 420 419 } 421 420 422 if(RT_FAILURE( rc))421 if(RT_FAILURE(vrc)) 423 422 break; 424 423 … … 428 427 do 429 428 { 430 rc = 0;429 vrc = 0; 431 430 mFragmentShaderSupported = false; 432 431 433 432 if(mGLVersion >= 0x020000) /* if ogl >= 2.0*/ 434 433 { 435 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_CREATE_SHADER, CreateShader, rc);436 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_SHADER_SOURCE, ShaderSource, rc);437 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_COMPILE_SHADER, CompileShader, rc);438 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_DELETE_SHADER, DeleteShader, rc);439 440 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_CREATE_PROGRAM, CreateProgram, rc);441 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_ATTACH_SHADER, AttachShader, rc);442 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_DETACH_SHADER, DetachShader, rc);443 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_LINK_PROGRAM, LinkProgram, rc);444 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_USE_PROGRAM, UseProgram, rc);445 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_DELETE_PROGRAM, DeleteProgram, rc);446 447 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_IS_SHADER, IsShader, rc);448 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_GET_SHADERIV, GetShaderiv, rc);449 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_IS_PROGRAM, IsProgram, rc);450 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_GET_PROGRAMIV, GetProgramiv, rc);451 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_GET_ATTACHED_SHADERS, GetAttachedShaders, rc);452 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_GET_SHADER_INFO_LOG, GetShaderInfoLog, rc);453 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_GET_PROGRAM_INFO_LOG, GetProgramInfoLog, rc);454 455 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_GET_UNIFORM_LOCATION, GetUniformLocation, rc);456 457 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM1F, Uniform1f, rc);458 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM2F, Uniform2f, rc);459 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM3F, Uniform3f, rc);460 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM4F, Uniform4f, rc);461 462 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM1I, Uniform1i, rc);463 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM2I, Uniform2i, rc);464 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM3I, Uniform3i, rc);465 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM4I, Uniform4i, rc);434 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_CREATE_SHADER, CreateShader, vrc); 435 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_SHADER_SOURCE, ShaderSource, vrc); 436 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_COMPILE_SHADER, CompileShader, vrc); 437 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_DELETE_SHADER, DeleteShader, vrc); 438 439 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_CREATE_PROGRAM, CreateProgram, vrc); 440 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_ATTACH_SHADER, AttachShader, vrc); 441 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_DETACH_SHADER, DetachShader, vrc); 442 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_LINK_PROGRAM, LinkProgram, vrc); 443 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_USE_PROGRAM, UseProgram, vrc); 444 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_DELETE_PROGRAM, DeleteProgram, vrc); 445 446 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_IS_SHADER, IsShader, vrc); 447 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_GET_SHADERIV, GetShaderiv, vrc); 448 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_IS_PROGRAM, IsProgram, vrc); 449 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_GET_PROGRAMIV, GetProgramiv, vrc); 450 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_GET_ATTACHED_SHADERS, GetAttachedShaders, vrc); 451 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_GET_SHADER_INFO_LOG, GetShaderInfoLog, vrc); 452 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_GET_PROGRAM_INFO_LOG, GetProgramInfoLog, vrc); 453 454 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_GET_UNIFORM_LOCATION, GetUniformLocation, vrc); 455 456 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM1F, Uniform1f, vrc); 457 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM2F, Uniform2f, vrc); 458 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM3F, Uniform3f, vrc); 459 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM4F, Uniform4f, vrc); 460 461 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM1I, Uniform1i, vrc); 462 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM2I, Uniform2i, vrc); 463 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM3I, Uniform3i, vrc); 464 VBOXVHWA_PFNINIT_SAME(context, PFNVBOXVHWA_UNIFORM4I, Uniform4i, vrc); 466 465 } 467 466 else if(m_GL_ARB_shader_objects && m_GL_ARB_fragment_shader) 468 467 { 469 VBOXVHWA_PFNINIT_OBJECT_ARB(context, PFNVBOXVHWA_CREATE_SHADER, CreateShader, rc);470 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_SHADER_SOURCE, ShaderSource, rc);471 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_COMPILE_SHADER, CompileShader, rc);472 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_DELETE_SHADER, DeleteShader, DeleteObjectARB, rc);473 474 VBOXVHWA_PFNINIT_OBJECT_ARB(context, PFNVBOXVHWA_CREATE_PROGRAM, CreateProgram, rc);475 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_ATTACH_SHADER, AttachShader, AttachObjectARB, rc);476 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_DETACH_SHADER, DetachShader, DetachObjectARB, rc);477 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_LINK_PROGRAM, LinkProgram, rc);478 VBOXVHWA_PFNINIT_OBJECT_ARB(context, PFNVBOXVHWA_USE_PROGRAM, UseProgram, rc);479 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_DELETE_PROGRAM, DeleteProgram, DeleteObjectARB, rc);480 481 /// @todo VBOXVHWA_PFNINIT(PFNVBOXVHWA_IS_SHADER, IsShader, rc);482 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_GET_SHADERIV, GetShaderiv, GetObjectParameterivARB, rc);483 /// @todo VBOXVHWA_PFNINIT(PFNVBOXVHWA_IS_PROGRAM, IsProgram, rc);484 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_GET_PROGRAMIV, GetProgramiv, GetObjectParameterivARB, rc);485 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_GET_ATTACHED_SHADERS, GetAttachedShaders, GetAttachedObjectsARB, rc);486 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_GET_SHADER_INFO_LOG, GetShaderInfoLog, GetInfoLogARB, rc);487 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_GET_PROGRAM_INFO_LOG, GetProgramInfoLog, GetInfoLogARB, rc);488 489 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_GET_UNIFORM_LOCATION, GetUniformLocation, rc);490 491 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM1F, Uniform1f, rc);492 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM2F, Uniform2f, rc);493 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM3F, Uniform3f, rc);494 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM4F, Uniform4f, rc);495 496 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM1I, Uniform1i, rc);497 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM2I, Uniform2i, rc);498 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM3I, Uniform3i, rc);499 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM4I, Uniform4i, rc);468 VBOXVHWA_PFNINIT_OBJECT_ARB(context, PFNVBOXVHWA_CREATE_SHADER, CreateShader, vrc); 469 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_SHADER_SOURCE, ShaderSource, vrc); 470 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_COMPILE_SHADER, CompileShader, vrc); 471 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_DELETE_SHADER, DeleteShader, DeleteObjectARB, vrc); 472 473 VBOXVHWA_PFNINIT_OBJECT_ARB(context, PFNVBOXVHWA_CREATE_PROGRAM, CreateProgram, vrc); 474 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_ATTACH_SHADER, AttachShader, AttachObjectARB, vrc); 475 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_DETACH_SHADER, DetachShader, DetachObjectARB, vrc); 476 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_LINK_PROGRAM, LinkProgram, vrc); 477 VBOXVHWA_PFNINIT_OBJECT_ARB(context, PFNVBOXVHWA_USE_PROGRAM, UseProgram, vrc); 478 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_DELETE_PROGRAM, DeleteProgram, DeleteObjectARB, vrc); 479 480 /// @todo VBOXVHWA_PFNINIT(PFNVBOXVHWA_IS_SHADER, IsShader, vrc); 481 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_GET_SHADERIV, GetShaderiv, GetObjectParameterivARB, vrc); 482 /// @todo VBOXVHWA_PFNINIT(PFNVBOXVHWA_IS_PROGRAM, IsProgram, vrc); 483 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_GET_PROGRAMIV, GetProgramiv, GetObjectParameterivARB, vrc); 484 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_GET_ATTACHED_SHADERS, GetAttachedShaders, GetAttachedObjectsARB, vrc); 485 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_GET_SHADER_INFO_LOG, GetShaderInfoLog, GetInfoLogARB, vrc); 486 VBOXVHWA_PFNINIT(context, PFNVBOXVHWA_GET_PROGRAM_INFO_LOG, GetProgramInfoLog, GetInfoLogARB, vrc); 487 488 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_GET_UNIFORM_LOCATION, GetUniformLocation, vrc); 489 490 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM1F, Uniform1f, vrc); 491 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM2F, Uniform2f, vrc); 492 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM3F, Uniform3f, vrc); 493 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM4F, Uniform4f, vrc); 494 495 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM1I, Uniform1i, vrc); 496 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM2I, Uniform2i, vrc); 497 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM3I, Uniform3i, vrc); 498 VBOXVHWA_PFNINIT_ARB(context, PFNVBOXVHWA_UNIFORM4I, Uniform4i, vrc); 500 499 } 501 500 else … … 504 503 } 505 504 506 if(RT_FAILURE( rc))505 if(RT_FAILURE(vrc)) 507 506 break; 508 507 … … 512 511 do 513 512 { 514 rc = 0;513 vrc = 0; 515 514 mFBOSupported = false; 516 515 517 516 if(m_GL_EXT_framebuffer_object) 518 517 { 519 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_IS_FRAMEBUFFER, IsFramebuffer, rc);520 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_BIND_FRAMEBUFFER, BindFramebuffer, rc);521 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_DELETE_FRAMEBUFFERS, DeleteFramebuffers, rc);522 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_GEN_FRAMEBUFFERS, GenFramebuffers, rc);523 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_CHECK_FRAMEBUFFER_STATUS, CheckFramebufferStatus, rc);524 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_FRAMEBUFFER_TEXTURE1D, FramebufferTexture1D, rc);525 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_FRAMEBUFFER_TEXTURE2D, FramebufferTexture2D, rc);526 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_FRAMEBUFFER_TEXTURE3D, FramebufferTexture3D, rc);527 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_GET_FRAMEBUFFER_ATTACHMENT_PARAMETRIV, GetFramebufferAttachmentParameteriv, rc);518 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_IS_FRAMEBUFFER, IsFramebuffer, vrc); 519 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_BIND_FRAMEBUFFER, BindFramebuffer, vrc); 520 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_DELETE_FRAMEBUFFERS, DeleteFramebuffers, vrc); 521 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_GEN_FRAMEBUFFERS, GenFramebuffers, vrc); 522 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_CHECK_FRAMEBUFFER_STATUS, CheckFramebufferStatus, vrc); 523 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_FRAMEBUFFER_TEXTURE1D, FramebufferTexture1D, vrc); 524 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_FRAMEBUFFER_TEXTURE2D, FramebufferTexture2D, vrc); 525 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_FRAMEBUFFER_TEXTURE3D, FramebufferTexture3D, vrc); 526 VBOXVHWA_PFNINIT_EXT(context, PFNVBOXVHWA_GET_FRAMEBUFFER_ATTACHMENT_PARAMETRIV, GetFramebufferAttachmentParameteriv, vrc); 528 527 } 529 528 else … … 532 531 } 533 532 534 if(RT_FAILURE( rc))533 if(RT_FAILURE(vrc)) 535 534 break; 536 535 … … 625 624 static char pszVBoxPath[RTPATH_MAX]; 626 625 const char *papszArgs[] = { NULL, "-test", "2D", NULL}; 627 int rc; 626 627 int vrc = RTPathExecDir(pszVBoxPath, RTPATH_MAX); AssertRCReturn(vrc, false); 628 # if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 629 vrc = RTPathAppend(pszVBoxPath, RTPATH_MAX, "VBoxTestOGL.exe"); 630 # else 631 vrc = RTPathAppend(pszVBoxPath, RTPATH_MAX, "VBoxTestOGL"); 632 # endif 633 papszArgs[0] = pszVBoxPath; /* argv[0] */ 634 AssertRCReturn(vrc, false); 635 628 636 RTPROCESS Process; 629 RTPROCSTATUS ProcStatus; 630 uint64_t StartTS; 631 632 rc = RTPathExecDir(pszVBoxPath, RTPATH_MAX); AssertRCReturn(rc, false); 633 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 634 rc = RTPathAppend(pszVBoxPath, RTPATH_MAX, "VBoxTestOGL.exe"); 635 #else 636 rc = RTPathAppend(pszVBoxPath, RTPATH_MAX, "VBoxTestOGL"); 637 #endif 638 papszArgs[0] = pszVBoxPath; /* argv[0] */ 639 AssertRCReturn(rc, false); 640 641 rc = RTProcCreate(pszVBoxPath, papszArgs, RTENV_DEFAULT, 0, &Process); 642 if (RT_FAILURE(rc)) 637 vrc = RTProcCreate(pszVBoxPath, papszArgs, RTENV_DEFAULT, 0, &Process); 638 if (RT_FAILURE(vrc)) 643 639 { 644 640 VBOXQGLLOGREL(("2D support test failed: failed to create a test process\n")); … … 646 642 } 647 643 648 StartTS = RTTimeMilliTS(); 649 644 uint64_t const StartTS = RTTimeMilliTS(); 645 646 RTPROCSTATUS ProcStatus = {0}; 650 647 while (1) 651 648 { 652 rc = RTProcWait(Process, RTPROCWAIT_FLAGS_NOBLOCK, &ProcStatus);653 if ( rc != VERR_PROCESS_RUNNING)649 vrc = RTProcWait(Process, RTPROCWAIT_FLAGS_NOBLOCK, &ProcStatus); 650 if (vrc != VERR_PROCESS_RUNNING) 654 651 break; 655 652 … … 665 662 } 666 663 667 if (RT_SUCCESS( rc))664 if (RT_SUCCESS(vrc)) 668 665 { 669 666 if ((ProcStatus.enmReason==RTPROCEXITREASON_NORMAL) && (ProcStatus.iStatus==0)) … … 674 671 } 675 672 676 VBOXQGLLOGREL(("2D support test failed: err code (%Rra)\n", rc));673 VBOXQGLLOGREL(("2D support test failed: err code (%Rra)\n", vrc)); 677 674 678 675 return false; -
trunk/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp
r98103 r98281 173 173 */ 174 174 char szCorrect[RTPATH_MAX]; 175 int rc = RTPathAppPrivateNoArch(szCorrect, sizeof(szCorrect));176 if (RT_FAILURE( rc))175 int vrc = RTPathAppPrivateNoArch(szCorrect, sizeof(szCorrect)); 176 if (RT_FAILURE(vrc)) 177 177 return false; 178 rc = RTPathAppend(szCorrect, sizeof(szCorrect), VBOX_EXTPACK_CERT_DIR);179 if (RT_FAILURE( rc))178 vrc = RTPathAppend(szCorrect, sizeof(szCorrect), VBOX_EXTPACK_CERT_DIR); 179 if (RT_FAILURE(vrc)) 180 180 return false; 181 181 … … 196 196 */ 197 197 char szCorrect[RTPATH_MAX]; 198 int rc = RTPathAppPrivateArchTop(szCorrect, sizeof(szCorrect));199 if (RT_FAILURE( rc))198 int vrc = RTPathAppPrivateArchTop(szCorrect, sizeof(szCorrect)); 199 if (RT_FAILURE(vrc)) 200 200 return false; 201 rc = RTPathAppend(szCorrect, sizeof(szCorrect), VBOX_EXTPACK_INSTALL_DIR);202 if (RT_FAILURE( rc))201 vrc = RTPathAppend(szCorrect, sizeof(szCorrect), VBOX_EXTPACK_INSTALL_DIR); 202 if (RT_FAILURE(vrc)) 203 203 return false; 204 204 … … 221 221 { 222 222 /** @todo May have to undo 555 modes here later. */ 223 int rc = RTDirRemoveRecursive(pszDir, RTDIRRMREC_F_CONTENT_AND_DIR);224 if (RT_FAILURE( rc))223 int vrc = RTDirRemoveRecursive(pszDir, RTDIRRMREC_F_CONTENT_AND_DIR); 224 if (RT_FAILURE(vrc)) 225 225 return RTMsgErrorExit(RTEXITCODE_FAILURE, 226 226 "Failed to delete the %sextension pack directory: %Rrc ('%s')", 227 fTemporary ? "temporary " : "", rc, pszDir);227 fTemporary ? "temporary " : "", vrc, pszDir); 228 228 return RTEXITCODE_SUCCESS; 229 229 } … … 240 240 for (;;) 241 241 { 242 int rc = RTDirRename(pszSrc, pszDst, fFlags);243 if ( ( rc != VERR_ACCESS_DENIED244 && rc != VERR_SHARING_VIOLATION)242 int vrc = RTDirRename(pszSrc, pszDst, fFlags); 243 if ( ( vrc != VERR_ACCESS_DENIED 244 && vrc != VERR_SHARING_VIOLATION) 245 245 || RTTimeNanoTS() - nsNow > RT_NS_15SEC) 246 return rc;246 return vrc; 247 247 RTThreadSleep(128); 248 248 } … … 263 263 VM processes from picking it up. */ 264 264 char szExtPackUnInstDir[RTPATH_MAX]; 265 int rc = RTStrCopy(szExtPackUnInstDir, sizeof(szExtPackUnInstDir), pszExtPackDir);266 if (RT_SUCCESS( rc))267 rc = RTStrCat(szExtPackUnInstDir, sizeof(szExtPackUnInstDir), "-_-uninst");268 if (RT_FAILURE( rc))269 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to construct temporary extension pack path: %Rrc", rc);270 271 rc = CommonDirRenameWrapper(pszExtPackDir, szExtPackUnInstDir, RTPATHRENAME_FLAGS_NO_REPLACE);272 if ( rc == VERR_ALREADY_EXISTS)265 int vrc = RTStrCopy(szExtPackUnInstDir, sizeof(szExtPackUnInstDir), pszExtPackDir); 266 if (RT_SUCCESS(vrc)) 267 vrc = RTStrCat(szExtPackUnInstDir, sizeof(szExtPackUnInstDir), "-_-uninst"); 268 if (RT_FAILURE(vrc)) 269 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to construct temporary extension pack path: %Rrc", vrc); 270 271 vrc = CommonDirRenameWrapper(pszExtPackDir, szExtPackUnInstDir, RTPATHRENAME_FLAGS_NO_REPLACE); 272 if (vrc == VERR_ALREADY_EXISTS) 273 273 { 274 274 /* Automatic cleanup and try again. It's in theory possible that we're … … 277 277 installation directory.) */ 278 278 RemoveExtPackDir(szExtPackUnInstDir, false /*fTemporary*/); 279 rc = CommonDirRenameWrapper(pszExtPackDir, szExtPackUnInstDir, RTPATHRENAME_FLAGS_NO_REPLACE);280 } 281 if (RT_FAILURE( rc))279 vrc = CommonDirRenameWrapper(pszExtPackDir, szExtPackUnInstDir, RTPATHRENAME_FLAGS_NO_REPLACE); 280 } 281 if (RT_FAILURE(vrc)) 282 282 return RTMsgErrorExit(RTEXITCODE_FAILURE, 283 283 "Failed to rename the extension pack directory: %Rrc\n" 284 "If the problem persists, try running the command: VBoxManage extpack cleanup", rc);284 "If the problem persists, try running the command: VBoxManage extpack cleanup", vrc); 285 285 286 286 /* Recursively delete the directory content. */ … … 299 299 { 300 300 char szError[8192]; 301 int rc = VBoxExtPackOpenTarFss(hTarballFile, szError, sizeof(szError), phTarFss, NULL);302 if (RT_FAILURE( rc))301 int vrc = VBoxExtPackOpenTarFss(hTarballFile, szError, sizeof(szError), phTarFss, NULL); 302 if (RT_FAILURE(vrc)) 303 303 { 304 304 Assert(szError[0]); … … 324 324 RTMsgInfo("Setting permissions..."); 325 325 #if !defined(RT_OS_WINDOWS) 326 int rc = RTPathSetMode(pszDir, 0755);327 if (RT_FAILURE( rc))328 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to set directory permissions: %Rrc ('%s')", rc, pszDir);326 int vrc = RTPathSetMode(pszDir, 0755); 327 if (RT_FAILURE(vrc)) 328 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to set directory permissions: %Rrc ('%s')", vrc, pszDir); 329 329 #else 330 330 /** @todo TrustedInstaller? */ … … 347 347 { 348 348 char szError[8192]; 349 int rc = VBoxExtPackValidateMember(pszName, enmType, hVfsObj, szError, sizeof(szError));350 if (RT_FAILURE( rc))349 int vrc = VBoxExtPackValidateMember(pszName, enmType, hVfsObj, szError, sizeof(szError)); 350 if (RT_FAILURE(vrc)) 351 351 { 352 352 Assert(szError[0]); … … 378 378 RTERRINFOSTATIC ErrInfo; 379 379 RTErrInfoInitStatic(&ErrInfo); 380 int rc = SUPR3HardenedVerifyDir(pszDir, true /*fRecursive*/, true /*fCheckFiles*/, &ErrInfo.Core);381 if (RT_FAILURE( rc))382 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Hardening check failed with %Rrc: %s", rc, ErrInfo.Core.pszMsg);380 int vrc = SUPR3HardenedVerifyDir(pszDir, true /*fRecursive*/, true /*fCheckFiles*/, &ErrInfo.Core); 381 if (RT_FAILURE(vrc)) 382 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Hardening check failed with %Rrc: %s", vrc, ErrInfo.Core.pszMsg); 383 383 return RTEXITCODE_SUCCESS; 384 384 } … … 398 398 */ 399 399 RTFSOBJINFO ObjInfo; 400 int rc = RTVfsObjQueryInfo(hVfsObj, &ObjInfo, RTFSOBJATTRADD_NOTHING);401 if (RT_FAILURE( rc))402 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsObjQueryInfo failed on '%s': %Rrc", pszDstDirName, rc);400 int vrc = RTVfsObjQueryInfo(hVfsObj, &ObjInfo, RTFSOBJATTRADD_NOTHING); 401 if (RT_FAILURE(vrc)) 402 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsObjQueryInfo failed on '%s': %Rrc", pszDstDirName, vrc); 403 403 ObjInfo.Attr.fMode &= ~(RTFS_UNIX_IWOTH | RTFS_UNIX_IWGRP); 404 404 405 rc = RTDirCreate(pszDstDirName, ObjInfo.Attr.fMode, 0);406 if (RT_FAILURE( rc))407 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create directory '%s': %Rrc", pszDstDirName, rc);405 vrc = RTDirCreate(pszDstDirName, ObjInfo.Attr.fMode, 0); 406 if (RT_FAILURE(vrc)) 407 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create directory '%s': %Rrc", pszDstDirName, vrc); 408 408 409 409 #ifndef RT_OS_WINDOWS … … 411 411 * Because of umask, we have to apply the mode again. 412 412 */ 413 rc = RTPathSetMode(pszDstDirName, ObjInfo.Attr.fMode);414 if (RT_FAILURE( rc))415 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to set directory permissions on '%s': %Rrc", pszDstDirName, rc);413 vrc = RTPathSetMode(pszDstDirName, ObjInfo.Attr.fMode); 414 if (RT_FAILURE(vrc)) 415 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to set directory permissions on '%s': %Rrc", pszDstDirName, vrc); 416 416 #else 417 417 /** @todo Ownership tricks on windows? */ … … 438 438 */ 439 439 RTFSOBJINFO ObjInfo; 440 int rc = RTVfsIoStrmQueryInfo(hVfsIosSrc, &ObjInfo, RTFSOBJATTRADD_NOTHING);441 if (RT_FAILURE( rc))442 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsIoStrmQueryInfo failed with %Rrc on '%s'", rc, pszDstFilename);440 int vrc = RTVfsIoStrmQueryInfo(hVfsIosSrc, &ObjInfo, RTFSOBJATTRADD_NOTHING); 441 if (RT_FAILURE(vrc)) 442 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsIoStrmQueryInfo failed with %Rrc on '%s'", vrc, pszDstFilename); 443 443 444 444 /* … … 447 447 uint32_t fFlags = RTFILE_O_WRITE | RTFILE_O_DENY_ALL | RTFILE_O_CREATE | (0600 << RTFILE_O_CREATE_MODE_SHIFT); 448 448 RTFILE hFile; 449 rc = RTFileOpen(&hFile, pszDstFilename, fFlags);450 if (RT_FAILURE( rc))451 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create '%s': %Rrc", pszDstFilename, rc);449 vrc = RTFileOpen(&hFile, pszDstFilename, fFlags); 450 if (RT_FAILURE(vrc)) 451 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create '%s': %Rrc", pszDstFilename, vrc); 452 452 453 453 /* … … 456 456 */ 457 457 RTVFSIOSTREAM hVfsIosDst2; 458 rc = RTVfsIoStrmFromRTFile(hFile, fFlags, true /*fLeaveOpen*/, &hVfsIosDst2);459 if (RT_SUCCESS( rc))458 vrc = RTVfsIoStrmFromRTFile(hFile, fFlags, true /*fLeaveOpen*/, &hVfsIosDst2); 459 if (RT_SUCCESS(vrc)) 460 460 { 461 461 RTVFSIOSTREAM hVfsIosDst; 462 rc = RTManifestEntryAddPassthruIoStream(hUnpackManifest, hVfsIosDst2, pszName,463 RTMANIFEST_ATTR_SIZE | RTMANIFEST_ATTR_SHA256,464 false /*fReadOrWrite*/, &hVfsIosDst);462 vrc = RTManifestEntryAddPassthruIoStream(hUnpackManifest, hVfsIosDst2, pszName, 463 RTMANIFEST_ATTR_SIZE | RTMANIFEST_ATTR_SHA256, 464 false /*fReadOrWrite*/, &hVfsIosDst); 465 465 RTVfsIoStrmRelease(hVfsIosDst2); 466 if (RT_SUCCESS( rc))466 if (RT_SUCCESS(vrc)) 467 467 { 468 468 /* 469 469 * Pump the data thru. 470 470 */ 471 rc = RTVfsUtilPumpIoStreams(hVfsIosSrc, hVfsIosDst, (uint32_t)RT_MIN(ObjInfo.cbObject, _1G));472 if (RT_SUCCESS( rc))471 vrc = RTVfsUtilPumpIoStreams(hVfsIosSrc, hVfsIosDst, (uint32_t)RT_MIN(ObjInfo.cbObject, _1G)); 472 if (RT_SUCCESS(vrc)) 473 473 { 474 rc = RTManifestPtIosAddEntryNow(hVfsIosDst);475 if (RT_SUCCESS( rc))474 vrc = RTManifestPtIosAddEntryNow(hVfsIosDst); 475 if (RT_SUCCESS(vrc)) 476 476 { 477 477 RTVfsIoStrmRelease(hVfsIosDst); … … 482 482 */ 483 483 ObjInfo.Attr.fMode &= ~(RTFS_UNIX_IWOTH | RTFS_UNIX_IWGRP); 484 rc = RTFileSetMode(hFile, ObjInfo.Attr.fMode);484 vrc = RTFileSetMode(hFile, ObjInfo.Attr.fMode); 485 485 /** @todo Windows needs to do more here, I think. */ 486 if (RT_SUCCESS( rc))486 if (RT_SUCCESS(vrc)) 487 487 { 488 488 RTFileClose(hFile); … … 490 490 } 491 491 492 RTMsgError("Failed to set the mode of '%s' to %RTfmode: %Rrc", pszDstFilename, ObjInfo.Attr.fMode, rc);492 RTMsgError("Failed to set the mode of '%s' to %RTfmode: %Rrc", pszDstFilename, ObjInfo.Attr.fMode, vrc); 493 493 } 494 494 else 495 RTMsgError("RTManifestPtIosAddEntryNow failed for '%s': %Rrc", pszDstFilename, rc);495 RTMsgError("RTManifestPtIosAddEntryNow failed for '%s': %Rrc", pszDstFilename, vrc); 496 496 } 497 497 else 498 RTMsgError("RTVfsUtilPumpIoStreams failed for '%s': %Rrc", pszDstFilename, rc);498 RTMsgError("RTVfsUtilPumpIoStreams failed for '%s': %Rrc", pszDstFilename, vrc); 499 499 RTVfsIoStrmRelease(hVfsIosDst); 500 500 } 501 501 else 502 RTMsgError("RTManifestEntryAddPassthruIoStream failed: %Rrc", rc);502 RTMsgError("RTManifestEntryAddPassthruIoStream failed: %Rrc", vrc); 503 503 } 504 504 else 505 RTMsgError("RTVfsIoStrmFromRTFile failed: %Rrc", rc);505 RTMsgError("RTVfsIoStrmFromRTFile failed: %Rrc", vrc); 506 506 RTFileClose(hFile); 507 507 return RTEXITCODE_FAILURE; … … 532 532 */ 533 533 char szDstPath[RTPATH_MAX]; 534 int rc = RTPathAbs(pszDirDst, szDstPath, sizeof(szDstPath) - VBOX_EXTPACK_MAX_MEMBER_NAME_LENGTH - 2);535 if (RT_FAILURE( rc))536 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathAbs('%s',,) failed: %Rrc", pszDirDst, rc);534 int vrc = RTPathAbs(pszDirDst, szDstPath, sizeof(szDstPath) - VBOX_EXTPACK_MAX_MEMBER_NAME_LENGTH - 2); 535 if (RT_FAILURE(vrc)) 536 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathAbs('%s',,) failed: %Rrc", pszDirDst, vrc); 537 537 size_t offDstPath = RTPathStripTrailingSlash(szDstPath); 538 538 szDstPath[offDstPath++] = '/'; … … 548 548 549 549 RTMANIFEST hUnpackManifest; 550 rc = RTManifestCreate(0 /*fFlags*/, &hUnpackManifest);551 if (RT_SUCCESS( rc))550 vrc = RTManifestCreate(0 /*fFlags*/, &hUnpackManifest); 551 if (RT_SUCCESS(vrc)) 552 552 { 553 553 /* … … 562 562 RTVFSOBJ hVfsObj; 563 563 RTVFSOBJTYPE enmType; 564 rc = RTVfsFsStrmNext(hTarFss, &pszName, &enmType, &hVfsObj);565 if (RT_FAILURE( rc))564 vrc = RTVfsFsStrmNext(hTarFss, &pszName, &enmType, &hVfsObj); 565 if (RT_FAILURE(vrc)) 566 566 { 567 if ( rc != VERR_EOF)568 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsFsStrmNext failed: %Rrc", rc);567 if (vrc != VERR_EOF) 568 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsFsStrmNext failed: %Rrc", vrc); 569 569 break; 570 570 } … … 578 578 { 579 579 szDstPath[offDstPath] = '\0'; 580 rc = RTStrCopy(&szDstPath[offDstPath], sizeof(szDstPath) - offDstPath, pszAdjName);581 if (RT_SUCCESS( rc))580 vrc = RTStrCopy(&szDstPath[offDstPath], sizeof(szDstPath) - offDstPath, pszAdjName); 581 if (RT_SUCCESS(vrc)) 582 582 { 583 583 if ( enmType == RTVFSOBJTYPE_FILE … … 592 592 } 593 593 else 594 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "Name is too long: '%s' (%Rrc)", pszAdjName, rc);594 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "Name is too long: '%s' (%Rrc)", pszAdjName, vrc); 595 595 } 596 596 … … 611 611 { 612 612 char szError[RTPATH_MAX]; 613 rc = RTManifestEqualsEx(hUnpackManifest, hValidManifest, NULL /*papszIgnoreEntries*/, NULL /*papszIgnoreAttr*/,614 0 /*fFlags*/, szError, sizeof(szError));615 if (RT_SUCCESS( rc))613 vrc = RTManifestEqualsEx(hUnpackManifest, hValidManifest, NULL /*papszIgnoreEntries*/, NULL /*papszIgnoreAttr*/, 614 0 /*fFlags*/, szError, sizeof(szError)); 615 if (RT_SUCCESS(vrc)) 616 616 rcExit = RTEXITCODE_SUCCESS; 617 else if ( rc == VERR_NOT_EQUAL && szError[0])617 else if (vrc == VERR_NOT_EQUAL && szError[0]) 618 618 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "Manifest mismatch: %s", szError); 619 619 else 620 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTManifestEqualsEx failed: %Rrc", rc);620 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTManifestEqualsEx failed: %Rrc", vrc); 621 621 } 622 622 #if 0 … … 658 658 659 659 char szError[8192]; 660 int rc = VBoxExtPackValidateTarball(hTarballFile, pszExtPackName, pszTarball, pszTarballDigest,661 szError, sizeof(szError), phValidManifest, NULL /*phXmlFile*/, NULL /*pStrDigest*/);662 if (RT_FAILURE( rc))660 int vrc = VBoxExtPackValidateTarball(hTarballFile, pszExtPackName, pszTarball, pszTarballDigest, 661 szError, sizeof(szError), phValidManifest, NULL /*phXmlFile*/, NULL /*pStrDigest*/); 662 if (RT_FAILURE(vrc)) 663 663 { 664 664 Assert(szError[0]); … … 695 695 */ 696 696 RTFSOBJINFO ObjInfo; 697 int rc = RTFileQueryInfo(hTarballFile, &ObjInfo, RTFSOBJATTRADD_UNIX);698 if (RT_FAILURE( rc))699 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTFileQueryInfo failed with %Rrc on '%s'", rc, pszTarball);697 int vrc = RTFileQueryInfo(hTarballFile, &ObjInfo, RTFSOBJATTRADD_UNIX); 698 if (RT_FAILURE(vrc)) 699 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTFileQueryInfo failed with %Rrc on '%s'", vrc, pszTarball); 700 700 if (!RTFS_IS_FILE(ObjInfo.Attr.fMode)) 701 701 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Not a regular file: %s", pszTarball); … … 704 704 { 705 705 RTFSOBJINFO ObjInfo2; 706 rc = RTFileQueryInfo(hTarballFileOpt, &ObjInfo2, RTFSOBJATTRADD_UNIX);707 if (RT_FAILURE( rc))708 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTFileQueryInfo failed with %Rrc on --tarball-fd", rc);706 vrc = RTFileQueryInfo(hTarballFileOpt, &ObjInfo2, RTFSOBJATTRADD_UNIX); 707 if (RT_FAILURE(vrc)) 708 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTFileQueryInfo failed with %Rrc on --tarball-fd", vrc); 709 709 if ( ObjInfo.Attr.u.Unix.INodeIdDevice != ObjInfo2.Attr.u.Unix.INodeIdDevice 710 710 || ObjInfo.Attr.u.Unix.INodeId != ObjInfo2.Attr.u.Unix.INodeId) … … 716 716 */ 717 717 char szFinalPath[RTPATH_MAX]; 718 rc = RTPathJoin(szFinalPath, sizeof(szFinalPath), pszBaseDir, pszMangledName);719 if (RT_FAILURE( rc))718 vrc = RTPathJoin(szFinalPath, sizeof(szFinalPath), pszBaseDir, pszMangledName); 719 if (RT_FAILURE(vrc)) 720 720 return RTMsgErrorExit(RTEXITCODE_FAILURE, 721 "Failed to construct the path to the final extension pack directory: %Rrc", rc);721 "Failed to construct the path to the final extension pack directory: %Rrc", vrc); 722 722 723 723 char szTmpPath[RTPATH_MAX]; 724 rc = RTPathJoin(szTmpPath, sizeof(szTmpPath) - 64, pszBaseDir, pszMangledName);725 if (RT_SUCCESS( rc))724 vrc = RTPathJoin(szTmpPath, sizeof(szTmpPath) - 64, pszBaseDir, pszMangledName); 725 if (RT_SUCCESS(vrc)) 726 726 { 727 727 size_t cchTmpPath = strlen(szTmpPath); 728 728 RTStrPrintf(&szTmpPath[cchTmpPath], sizeof(szTmpPath) - cchTmpPath, "-_-inst-%u", (uint32_t)RTProcSelf()); 729 729 } 730 if (RT_FAILURE( rc))730 if (RT_FAILURE(vrc)) 731 731 return RTMsgErrorExit(RTEXITCODE_FAILURE, 732 "Failed to construct the path to the temporary extension pack directory: %Rrc", rc);732 "Failed to construct the path to the temporary extension pack directory: %Rrc", vrc); 733 733 734 734 /* 735 735 * Check that they don't exist at this point in time, unless fReplace=true. 736 736 */ 737 rc = RTPathQueryInfoEx(szFinalPath, &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);738 if (RT_SUCCESS( rc) && RTFS_IS_DIRECTORY(ObjInfo.Attr.fMode))737 vrc = RTPathQueryInfoEx(szFinalPath, &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); 738 if (RT_SUCCESS(vrc) && RTFS_IS_DIRECTORY(ObjInfo.Attr.fMode)) 739 739 { 740 740 if (!fReplace) … … 742 742 "The extension pack is already installed. You must uninstall the old one first."); 743 743 } 744 else if (RT_SUCCESS( rc))744 else if (RT_SUCCESS(vrc)) 745 745 return RTMsgErrorExit(RTEXITCODE_FAILURE, 746 746 "Found non-directory file system object where the extension pack would be installed ('%s')", 747 747 szFinalPath); 748 else if ( rc != VERR_FILE_NOT_FOUND &&rc != VERR_PATH_NOT_FOUND)749 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Unexpected RTPathQueryInfoEx status code %Rrc for '%s'", rc, szFinalPath);750 751 rc = RTPathQueryInfoEx(szTmpPath, &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);752 if ( rc != VERR_FILE_NOT_FOUND &&rc != VERR_PATH_NOT_FOUND)753 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Unexpected RTPathQueryInfoEx status code %Rrc for '%s'", rc, szFinalPath);748 else if (vrc != VERR_FILE_NOT_FOUND && vrc != VERR_PATH_NOT_FOUND) 749 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Unexpected RTPathQueryInfoEx status code %Rrc for '%s'", vrc, szFinalPath); 750 751 vrc = RTPathQueryInfoEx(szTmpPath, &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); 752 if (vrc != VERR_FILE_NOT_FOUND && vrc != VERR_PATH_NOT_FOUND) 753 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Unexpected RTPathQueryInfoEx status code %Rrc for '%s'", vrc, szFinalPath); 754 754 755 755 /* … … 762 762 * Because of umask, we have to apply the mode again. 763 763 */ 764 rc = RTPathSetMode(pszBaseDir, 0755);765 if (RT_FAILURE( rc))766 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to set directory permissions on '%s': %Rrc", pszBaseDir, rc);764 vrc = RTPathSetMode(pszBaseDir, 0755); 765 if (RT_FAILURE(vrc)) 766 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to set directory permissions on '%s': %Rrc", pszBaseDir, vrc); 767 767 #else 768 768 /** @todo Ownership tricks on windows? */ 769 769 #endif 770 rc = RTDirCreate(szTmpPath, 0700, 0);771 if (RT_FAILURE( rc))772 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create temporary directory: %Rrc ('%s')", rc, szTmpPath);770 vrc = RTDirCreate(szTmpPath, 0700, 0); 771 if (RT_FAILURE(vrc)) 772 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create temporary directory: %Rrc ('%s')", vrc, szTmpPath); 773 773 774 774 RTMANIFEST hValidManifest = NIL_RTMANIFEST; … … 784 784 if (rcExit == RTEXITCODE_SUCCESS) 785 785 { 786 rc = CommonDirRenameWrapper(szTmpPath, szFinalPath, RTPATHRENAME_FLAGS_NO_REPLACE);787 if ( RT_FAILURE( rc)786 vrc = CommonDirRenameWrapper(szTmpPath, szFinalPath, RTPATHRENAME_FLAGS_NO_REPLACE); 787 if ( RT_FAILURE(vrc) 788 788 && fReplace 789 789 && RTDirExists(szFinalPath)) … … 792 792 rcExit = CommonUninstallWorker(szFinalPath); 793 793 if (rcExit == RTEXITCODE_SUCCESS) 794 rc = CommonDirRenameWrapper(szTmpPath, szFinalPath, RTPATHRENAME_FLAGS_NO_REPLACE);794 vrc = CommonDirRenameWrapper(szTmpPath, szFinalPath, RTPATHRENAME_FLAGS_NO_REPLACE); 795 795 } 796 if (RT_SUCCESS( rc))796 if (RT_SUCCESS(vrc)) 797 797 RTMsgInfo("Successfully installed '%s' (%s)", pszName, pszTarball); 798 798 else if (rcExit == RTEXITCODE_SUCCESS) 799 799 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, 800 800 "Failed to rename the temporary directory to the final one: %Rrc ('%s' -> '%s')", 801 rc, szTmpPath, szFinalPath);801 vrc, szTmpPath, szFinalPath); 802 802 } 803 803 … … 841 841 }; 842 842 RTGETOPTSTATE GetState; 843 int rc = RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 0, 0 /*fFlags*/);844 if (RT_FAILURE( rc))845 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptInit failed: %Rrc\n", rc);843 int vrc = RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 0, 0 /*fFlags*/); 844 if (RT_FAILURE(vrc)) 845 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptInit failed: %Rrc\n", vrc); 846 846 847 847 const char *pszBaseDir = NULL; … … 895 895 if (hNative != ValueUnion.u64) 896 896 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "The --tarball-fd value is out of range: %#RX64", ValueUnion.u64); 897 rc = RTFileFromNative(&hTarballFileOpt, hNative);898 if (RT_FAILURE( rc))899 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "RTFileFromNative failed on --target-fd value: %Rrc", rc);897 vrc = RTFileFromNative(&hTarballFileOpt, hNative); 898 if (RT_FAILURE(vrc)) 899 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "RTFileFromNative failed on --target-fd value: %Rrc", vrc); 900 900 break; 901 901 } … … 912 912 913 913 uint8_t abDigest[RTSHA256_HASH_SIZE]; 914 rc = RTSha256FromString(pszTarballDigest, abDigest);915 if (RT_FAILURE( rc))916 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Bad SHA-256 string: %Rrc", rc);914 vrc = RTSha256FromString(pszTarballDigest, abDigest); 915 if (RT_FAILURE(vrc)) 916 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Bad SHA-256 string: %Rrc", vrc); 917 917 break; 918 918 } … … 946 946 RTEXITCODE rcExit; 947 947 RTFILE hTarballFile; 948 rc = RTFileOpen(&hTarballFile, pszTarball, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE);949 if (RT_SUCCESS( rc))948 vrc = RTFileOpen(&hTarballFile, pszTarball, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE); 949 if (RT_SUCCESS(vrc)) 950 950 { 951 951 rcExit = DoInstall2(pszBaseDir, pszCertDir, pszTarball, pszTarballDigest, hTarballFile, hTarballFileOpt, … … 954 954 } 955 955 else 956 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to open the extension pack tarball: %Rrc ('%s')", rc, pszTarball);956 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to open the extension pack tarball: %Rrc ('%s')", vrc, pszTarball); 957 957 958 958 delete pstrMangledName; … … 983 983 }; 984 984 RTGETOPTSTATE GetState; 985 int rc = RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 0, 0 /*fFlags*/);986 if (RT_FAILURE( rc))987 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptInit failed: %Rrc\n", rc);985 int vrc = RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 0, 0 /*fFlags*/); 986 if (RT_FAILURE(vrc)) 987 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptInit failed: %Rrc\n", vrc); 988 988 989 989 const char *pszBaseDir = NULL; … … 1042 1042 /* Check that it exists. */ 1043 1043 char szExtPackDir[RTPATH_MAX]; 1044 rc = RTPathJoin(szExtPackDir, sizeof(szExtPackDir), pszBaseDir, strMangledName.c_str());1045 if (RT_FAILURE( rc))1046 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to construct extension pack path: %Rrc", rc);1044 vrc = RTPathJoin(szExtPackDir, sizeof(szExtPackDir), pszBaseDir, strMangledName.c_str()); 1045 if (RT_FAILURE(vrc)) 1046 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to construct extension pack path: %Rrc", vrc); 1047 1047 1048 1048 if (!RTDirExists(szExtPackDir)) … … 1079 1079 }; 1080 1080 RTGETOPTSTATE GetState; 1081 int rc = RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 0, 0 /*fFlags*/);1082 if (RT_FAILURE( rc))1083 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptInit failed: %Rrc\n", rc);1081 int vrc = RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 0, 0 /*fFlags*/); 1082 if (RT_FAILURE(vrc)) 1083 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptInit failed: %Rrc\n", vrc); 1084 1084 1085 1085 const char *pszBaseDir = NULL; … … 1113 1113 */ 1114 1114 RTDIR hDir; 1115 rc = RTDirOpen(&hDir, pszBaseDir);1116 if (RT_FAILURE( rc))1117 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed open the base directory: %Rrc ('%s')", rc, pszBaseDir);1115 vrc = RTDirOpen(&hDir, pszBaseDir); 1116 if (RT_FAILURE(vrc)) 1117 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed open the base directory: %Rrc ('%s')", vrc, pszBaseDir); 1118 1118 1119 1119 uint32_t cCleaned = 0; … … 1122 1122 { 1123 1123 RTDIRENTRYEX Entry; 1124 rc = RTDirReadEx(hDir, &Entry, NULL /*pcbDirEntry*/, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);1125 if (RT_FAILURE( rc))1124 vrc = RTDirReadEx(hDir, &Entry, NULL /*pcbDirEntry*/, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); 1125 if (RT_FAILURE(vrc)) 1126 1126 { 1127 if ( rc != VERR_NO_MORE_FILES)1128 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTDirReadEx returns %Rrc", rc);1127 if (vrc != VERR_NO_MORE_FILES) 1128 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTDirReadEx returns %Rrc", vrc); 1129 1129 break; 1130 1130 } … … 1150 1150 */ 1151 1151 char szPath[RTPATH_MAX]; 1152 rc = RTPathJoin(szPath, sizeof(szPath), pszBaseDir, Entry.szName);1153 if (RT_SUCCESS( rc))1152 vrc = RTPathJoin(szPath, sizeof(szPath), pszBaseDir, Entry.szName); 1153 if (RT_SUCCESS(vrc)) 1154 1154 { 1155 1155 RTEXITCODE rcExit2 = RemoveExtPackDir(szPath, true /*fTemporary*/); … … 1160 1160 } 1161 1161 else 1162 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathJoin failed with %Rrc for '%s'", rc, Entry.szName);1162 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathJoin failed with %Rrc for '%s'", vrc, Entry.szName); 1163 1163 cCleaned++; 1164 1164 } … … 1205 1205 for (unsigned i = 0; i < RT_ELEMENTS(s_apszPaths); i++) 1206 1206 { 1207 int rc = RTPathJoin(pszPath, cbPath, s_apszPaths[i], pszName);1208 if (RT_SUCCESS( rc))1207 int vrc = RTPathJoin(pszPath, cbPath, s_apszPaths[i], pszName); 1208 if (RT_SUCCESS(vrc)) 1209 1209 { 1210 1210 RTFSOBJINFO ObjInfo; 1211 rc = RTPathQueryInfoEx(pszPath, &ObjInfo, RTFSOBJATTRADD_UNIX, RTPATH_F_FOLLOW_LINK);1212 if (RT_SUCCESS( rc))1211 vrc = RTPathQueryInfoEx(pszPath, &ObjInfo, RTFSOBJATTRADD_UNIX, RTPATH_F_FOLLOW_LINK); 1212 if (RT_SUCCESS(vrc)) 1213 1213 { 1214 1214 if (!(ObjInfo.Attr.fMode & RTFS_UNIX_IWOTH)) … … 1233 1233 static void CopyFileToStdXxx(RTFILE hSrc, PRTSTREAM pDst, bool fComplain) 1234 1234 { 1235 int rc;1235 int vrc; 1236 1236 for (;;) 1237 1237 { 1238 1238 char abBuf[0x1000]; 1239 1239 size_t cbRead; 1240 rc = RTFileRead(hSrc, abBuf, sizeof(abBuf), &cbRead);1241 if (RT_FAILURE( rc))1240 vrc = RTFileRead(hSrc, abBuf, sizeof(abBuf), &cbRead); 1241 if (RT_FAILURE(vrc)) 1242 1242 { 1243 RTMsgError("RTFileRead failed: %Rrc", rc);1243 RTMsgError("RTFileRead failed: %Rrc", vrc); 1244 1244 break; 1245 1245 } 1246 1246 if (!cbRead) 1247 1247 break; 1248 rc = RTStrmWrite(pDst, abBuf, cbRead);1249 if (RT_FAILURE( rc))1248 vrc = RTStrmWrite(pDst, abBuf, cbRead); 1249 if (RT_FAILURE(vrc)) 1250 1250 { 1251 1251 if (fComplain) 1252 RTMsgError("RTStrmWrite failed: %Rrc", rc);1252 RTMsgError("RTStrmWrite failed: %Rrc", vrc); 1253 1253 break; 1254 1254 } 1255 1255 } 1256 rc = RTStrmFlush(pDst);1257 if (RT_FAILURE( rc) && fComplain)1258 RTMsgError("RTStrmFlush failed: %Rrc", rc);1256 vrc = RTStrmFlush(pDst); 1257 if (RT_FAILURE(vrc) && fComplain) 1258 RTMsgError("RTStrmFlush failed: %Rrc", vrc); 1259 1259 } 1260 1260 … … 1291 1291 Info.hwnd = NULL; 1292 1292 Info.lpVerb = L"runas"; 1293 int rc = RTStrToUtf16(pszExecPath, (PRTUTF16 *)&Info.lpFile);1294 if (RT_SUCCESS( rc))1293 int vrc = RTStrToUtf16(pszExecPath, (PRTUTF16 *)&Info.lpFile); 1294 if (RT_SUCCESS(vrc)) 1295 1295 { 1296 1296 char *pszCmdLine; 1297 rc = RTGetOptArgvToString(&pszCmdLine, &papszArgs[cSuArgs + 1], RTGETOPTARGV_CNV_QUOTE_MS_CRT);1298 if (RT_SUCCESS( rc))1297 vrc = RTGetOptArgvToString(&pszCmdLine, &papszArgs[cSuArgs + 1], RTGETOPTARGV_CNV_QUOTE_MS_CRT); 1298 if (RT_SUCCESS(vrc)) 1299 1299 { 1300 rc = RTStrToUtf16(pszCmdLine, (PRTUTF16 *)&Info.lpParameters);1301 if (RT_SUCCESS( rc))1300 vrc = RTStrToUtf16(pszCmdLine, (PRTUTF16 *)&Info.lpParameters); 1301 if (RT_SUCCESS(vrc)) 1302 1302 { 1303 1303 Info.lpDirectory = NULL; … … 1318 1318 { 1319 1319 uint64_t u64Hwnd; 1320 rc = RTStrToUInt64Ex(pszArg + sizeof("hwnd=") - 1, NULL, 0, &u64Hwnd);1321 if (RT_SUCCESS( rc))1320 vrc = RTStrToUInt64Ex(pszArg + sizeof("hwnd=") - 1, NULL, 0, &u64Hwnd); 1321 if (RT_SUCCESS(vrc)) 1322 1322 { 1323 1323 HWND hwnd = (HWND)(uintptr_t)u64Hwnd; … … 1385 1385 } 1386 1386 else 1387 RTMsgError("RTStrToUtf16 failed: %Rc", rc);1387 RTMsgError("RTStrToUtf16 failed: %Rc", vrc); 1388 1388 1389 1389 #elif defined(RT_OS_DARWIN) 1390 1390 RT_NOREF(pszDisplayInfoHack); 1391 1391 char szIconName[RTPATH_MAX]; 1392 int rc = RTPathAppPrivateArch(szIconName, sizeof(szIconName));1393 if (RT_SUCCESS( rc))1394 rc = RTPathAppend(szIconName, sizeof(szIconName), "../Resources/virtualbox.png");1395 if (RT_FAILURE( rc))1396 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to construct icon path: %Rrc", rc);1392 int vrc = RTPathAppPrivateArch(szIconName, sizeof(szIconName)); 1393 if (RT_SUCCESS(vrc)) 1394 vrc = RTPathAppend(szIconName, sizeof(szIconName), "../Resources/virtualbox.png"); 1395 if (RT_FAILURE(vrc)) 1396 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to construct icon path: %Rrc", vrc); 1397 1397 1398 1398 AuthorizationRef AuthRef; … … 1471 1471 */ 1472 1472 char *pszCmdLine; 1473 int rc = RTGetOptArgvToString(&pszCmdLine, &papszArgs[cSuArgs], RTGETOPTARGV_CNV_QUOTE_BOURNE_SH);1474 if (RT_FAILURE( rc))1475 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptArgvToString failed: %Rrc", rc);1473 int vrc = RTGetOptArgvToString(&pszCmdLine, &papszArgs[cSuArgs], RTGETOPTARGV_CNV_QUOTE_BOURNE_SH); 1474 if (RT_FAILURE(vrc)) 1475 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptArgvToString failed: %Rrc", vrc); 1476 1476 1477 1477 /* … … 1579 1579 */ 1580 1580 RTPROCESS hProcess; 1581 rc = RTProcCreateEx(papszArgs[iSuArg], &papszArgs[iSuArg], RTENV_DEFAULT, 0 /*fFlags*/, NULL /*phStdIn*/,1582 NULL /*phStdOut*/, NULL /*phStdErr*/, NULL /*pszAsUser*/, NULL /*pszPassword*/, NULL /* pvExtraData*/,1583 &hProcess);1584 if (RT_SUCCESS( rc))1581 vrc = RTProcCreateEx(papszArgs[iSuArg], &papszArgs[iSuArg], RTENV_DEFAULT, 0 /*fFlags*/, NULL /*phStdIn*/, 1582 NULL /*phStdOut*/, NULL /*phStdErr*/, NULL /*pszAsUser*/, NULL /*pszPassword*/, NULL /* pvExtraData*/, 1583 &hProcess); 1584 if (RT_SUCCESS(vrc)) 1585 1585 { 1586 1586 RTPROCSTATUS Status; 1587 rc = RTProcWait(hProcess, RTPROCWAIT_FLAGS_BLOCK, &Status);1588 if (RT_SUCCESS( rc))1587 vrc = RTProcWait(hProcess, RTPROCWAIT_FLAGS_BLOCK, &Status); 1588 if (RT_SUCCESS(vrc)) 1589 1589 { 1590 1590 if (Status.enmReason == RTPROCEXITREASON_NORMAL) … … 1594 1594 } 1595 1595 else 1596 RTMsgError("Error while waiting for '%s': %Rrc", papszArgs[iSuArg], rc);1596 RTMsgError("Error while waiting for '%s': %Rrc", papszArgs[iSuArg], vrc); 1597 1597 } 1598 1598 else 1599 RTMsgError("Failed to execute '%s': %Rrc", papszArgs[iSuArg], rc);1599 RTMsgError("Failed to execute '%s': %Rrc", papszArgs[iSuArg], vrc); 1600 1600 } 1601 1601 RTStrFree(pszCmdLine); … … 1628 1628 */ 1629 1629 char szTempDir[RTPATH_MAX - sizeof("/stderr")]; 1630 int rc = RTPathTemp(szTempDir, sizeof(szTempDir));1631 if (RT_FAILURE( rc))1632 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathTemp failed: %Rrc", rc);1633 rc = RTPathAppend(szTempDir, sizeof(szTempDir), "VBoxExtPackHelper-XXXXXX");1634 if (RT_FAILURE( rc))1635 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathAppend failed: %Rrc", rc);1636 rc = RTDirCreateTemp(szTempDir, 0700);1637 if (RT_FAILURE( rc))1638 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTDirCreateTemp failed: %Rrc", rc);1630 int vrc = RTPathTemp(szTempDir, sizeof(szTempDir)); 1631 if (RT_FAILURE(vrc)) 1632 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathTemp failed: %Rrc", vrc); 1633 vrc = RTPathAppend(szTempDir, sizeof(szTempDir), "VBoxExtPackHelper-XXXXXX"); 1634 if (RT_FAILURE(vrc)) 1635 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathAppend failed: %Rrc", vrc); 1636 vrc = RTDirCreateTemp(szTempDir, 0700); 1637 if (RT_FAILURE(vrc)) 1638 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTDirCreateTemp failed: %Rrc", vrc); 1639 1639 1640 1640 RTEXITCODE rcExit = RTEXITCODE_FAILURE; 1641 1641 char szStdOut[RTPATH_MAX]; 1642 1642 char szStdErr[RTPATH_MAX]; 1643 rc = RTPathJoin(szStdOut, sizeof(szStdOut), szTempDir, "stdout");1644 if (RT_SUCCESS( rc))1645 rc = RTPathJoin(szStdErr, sizeof(szStdErr), szTempDir, "stderr");1646 if (RT_SUCCESS( rc))1643 vrc = RTPathJoin(szStdOut, sizeof(szStdOut), szTempDir, "stdout"); 1644 if (RT_SUCCESS(vrc)) 1645 vrc = RTPathJoin(szStdErr, sizeof(szStdErr), szTempDir, "stderr"); 1646 if (RT_SUCCESS(vrc)) 1647 1647 { 1648 1648 RTFILE hStdOut; 1649 rc = RTFileOpen(&hStdOut, szStdOut, RTFILE_O_READWRITE | RTFILE_O_CREATE | RTFILE_O_DENY_NONE1650 | (0600 << RTFILE_O_CREATE_MODE_SHIFT));1651 if (RT_SUCCESS( rc))1649 vrc = RTFileOpen(&hStdOut, szStdOut, RTFILE_O_READWRITE | RTFILE_O_CREATE | RTFILE_O_DENY_NONE 1650 | (0600 << RTFILE_O_CREATE_MODE_SHIFT)); 1651 if (RT_SUCCESS(vrc)) 1652 1652 { 1653 1653 RTFILE hStdErr; 1654 rc = RTFileOpen(&hStdErr, szStdErr, RTFILE_O_READWRITE | RTFILE_O_CREATE | RTFILE_O_DENY_NONE1655 | (0600 << RTFILE_O_CREATE_MODE_SHIFT));1656 if (RT_SUCCESS( rc))1654 vrc = RTFileOpen(&hStdErr, szStdErr, RTFILE_O_READWRITE | RTFILE_O_CREATE | RTFILE_O_DENY_NONE 1655 | (0600 << RTFILE_O_CREATE_MODE_SHIFT)); 1656 if (RT_SUCCESS(vrc)) 1657 1657 { 1658 1658 /* … … 1815 1815 1816 1816 RTFSOBJINFO ObjInfo; 1817 int rc = RTPathQueryInfoEx(szExecPath, &ObjInfo, RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK);1818 if (RT_FAILURE( rc))1817 int vrc = RTPathQueryInfoEx(szExecPath, &ObjInfo, RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK); 1818 if (RT_FAILURE(vrc)) 1819 1819 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathQueryInfoEx failed"); 1820 1820 … … 1833 1833 */ 1834 1834 #ifdef RT_OS_WINDOWS 1835 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_UTF8_ARGV); /* WinMain gives us UTF-8, see below. */1835 int vrc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_UTF8_ARGV); /* WinMain gives us UTF-8, see below. */ 1836 1836 #else 1837 int rc = RTR3InitExe(argc, &argv, 0);1838 #endif 1839 if (RT_FAILURE( rc))1840 return RTMsgInitFailure( rc);1837 int vrc = RTR3InitExe(argc, &argv, 0); 1838 #endif 1839 if (RT_FAILURE(vrc)) 1840 return RTMsgInitFailure(vrc); 1841 1841 1842 1842 SUPR3HardenedVerifyInit(); 1843 1843 RTERRINFOSTATIC ErrInfo; 1844 1844 RTErrInfoInitStatic(&ErrInfo); 1845 rc = SUPR3HardenedVerifySelf(argv[0], true /*fInternal*/, &ErrInfo.Core);1846 if (RT_FAILURE( rc))1845 vrc = SUPR3HardenedVerifySelf(argv[0], true /*fInternal*/, &ErrInfo.Core); 1846 if (RT_FAILURE(vrc)) 1847 1847 return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s", ErrInfo.Core.pszMsg); 1848 1848 … … 1875 1875 }; 1876 1876 RTGETOPTSTATE GetState; 1877 rc = RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 1, 0 /*fFlags*/);1878 if (RT_FAILURE( rc))1879 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptInit failed: %Rrc\n", rc);1877 vrc = RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 1, 0 /*fFlags*/); 1878 if (RT_FAILURE(vrc)) 1879 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptInit failed: %Rrc\n", vrc); 1880 1880 for (;;) 1881 1881 { … … 1943 1943 # ifdef RT_OS_WINDOWS 1944 1944 PRTUTF16 pwszName = NULL; 1945 rc = RTStrToUtf16(ValueUnion.psz, &pwszName);1946 if (RT_FAILURE( rc))1947 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Error converting '%s' to UTF-16: %Rrc\n", ValueUnion.psz, rc);1945 vrc = RTStrToUtf16(ValueUnion.psz, &pwszName); 1946 if (RT_FAILURE(vrc)) 1947 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Error converting '%s' to UTF-16: %Rrc\n", ValueUnion.psz, vrc); 1948 1948 FILE *pFile = _wfreopen(pwszName, L"r+", ch == OPT_STDOUT ? stdout : stderr); 1949 1949 RTUtf16Free(pwszName); … … 1953 1953 if (!pFile) 1954 1954 { 1955 rc = RTErrConvertFromErrno(errno);1956 return RTMsgErrorExit(RTEXITCODE_FAILURE, "freopen on '%s': %Rrc", ValueUnion.psz, rc);1955 vrc = RTErrConvertFromErrno(errno); 1956 return RTMsgErrorExit(RTEXITCODE_FAILURE, "freopen on '%s': %Rrc", ValueUnion.psz, vrc); 1957 1957 } 1958 1958 break; … … 1985 1985 NOREF(hPrevInstance); NOREF(nShowCmd); NOREF(lpCmdLine); 1986 1986 1987 int rc = RTR3InitExeNoArguments(0);1988 if (RT_FAILURE( rc))1989 return RTMsgInitFailure( rc);1987 int vrc = RTR3InitExeNoArguments(0); 1988 if (RT_FAILURE(vrc)) 1989 return RTMsgInitFailure(vrc); 1990 1990 1991 1991 LPWSTR pwszCmdLine = GetCommandLineW(); … … 1994 1994 1995 1995 char *pszCmdLine; 1996 rc = RTUtf16ToUtf8(pwszCmdLine, &pszCmdLine); /* leaked */1997 if (RT_FAILURE( rc))1998 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to convert the command line: %Rrc", rc);1996 vrc = RTUtf16ToUtf8(pwszCmdLine, &pszCmdLine); /* leaked */ 1997 if (RT_FAILURE(vrc)) 1998 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to convert the command line: %Rrc", vrc); 1999 1999 2000 2000 int cArgs; 2001 2001 char **papszArgs; 2002 rc = RTGetOptArgvFromString(&papszArgs, &cArgs, pszCmdLine, RTGETOPTARGV_CNV_QUOTE_MS_CRT, NULL); 2003 if (RT_SUCCESS(rc)) 2004 { 2005 2006 rc = main(cArgs, papszArgs); 2002 vrc = RTGetOptArgvFromString(&papszArgs, &cArgs, pszCmdLine, RTGETOPTARGV_CNV_QUOTE_MS_CRT, NULL); 2003 if (RT_SUCCESS(vrc)) 2004 { 2005 vrc = main(cArgs, papszArgs); 2007 2006 2008 2007 RTGetOptArgvFree(papszArgs); 2009 2008 } 2010 2009 else 2011 rc = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptArgvFromString failed: %Rrc",rc);2010 vrc = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptArgvFromString failed: %Rrc", vrc); 2012 2011 RTStrFree(pszCmdLine); 2013 2012 2014 return rc;2015 } 2016 #endif 2017 2013 return vrc; 2014 } 2015 #endif 2016
Note:
See TracChangeset
for help on using the changeset viewer.