- Timestamp:
- May 22, 2009 9:52:47 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 47626
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/path.h
r16516 r19924 346 346 347 347 /** 348 * Gets the p rogram path.348 * Gets the path to the directory containing the executable. 349 349 * 350 350 * @returns iprt status code. … … 352 352 * @param cchPath Buffer size in bytes. 353 353 */ 354 RTDECL(int) RTPath Program(char *pszPath, size_t cchPath);354 RTDECL(int) RTPathExecDir(char *pszPath, size_t cchPath); 355 355 356 356 /** … … 364 364 365 365 /** 366 * Gets the directory of shared libraries. This is not the same as 367 * RTPathAppPrivateArch() as Linux depends all shared libraries in 368 * a common global directory where ld.so can found them. 366 * Gets the directory of shared libraries. 367 * 368 * This is not the same as RTPathAppPrivateArch() as Linux depends all shared 369 * libraries in a common global directory where ld.so can found them. 369 370 * 370 371 * Linux: /usr/lib 371 372 * Windows: @<program files directory@>/@<application@> 372 * Old path: same as RTPath Program()373 * Old path: same as RTPathExecDir() 373 374 * 374 375 * @returns iprt status code. … … 384 385 * Linux: /usr/shared/@<application@> 385 386 * Windows: @<program files directory@>/@<application@> 386 * Old path: same as RTPath Program()387 * Old path: same as RTPathExecDir() 387 388 * 388 389 * @returns iprt status code. … … 398 399 * Linux: /usr/lib/@<application@> 399 400 * Windows: @<program files directory@>/@<application@> 400 * Old path: same as RTPath Program()401 * Old path: same as RTPathExecDir() 401 402 * 402 403 * @returns iprt status code. … … 411 412 * Linux: /usr/share/doc/@<application@> 412 413 * Windows: @<program files directory@>/@<application@> 413 * Old path: same as RTPath Program()414 * Old path: same as RTPathExecDir() 414 415 * 415 416 * @returns iprt status code. -
trunk/src/VBox/Devices/Network/testcase/tstIntNet-1.cpp
r19454 r19924 846 846 847 847 char szPath[RTPATH_MAX]; 848 rc = RTPath Program(szPath, sizeof(szPath) - sizeof("/../VMMR0.r0"));848 rc = RTPathExecDir(szPath, sizeof(szPath) - sizeof("/../VMMR0.r0")); 849 849 if (RT_FAILURE(rc)) 850 850 { 851 RTPrintf("tstIntNet-1: RTPath Program-> %Rrc\n", rc);851 RTPrintf("tstIntNet-1: RTPathExecDir -> %Rrc\n", rc); 852 852 return 1; 853 853 } -
trunk/src/VBox/Frontends/VBoxFB/VBoxFB.cpp
r19817 r19924 137 137 // get the path to the executable 138 138 char appPath [RTPATH_MAX]; 139 RTPath Program(appPath, RTPATH_MAX);139 RTPathExecDir (appPath, RTPATH_MAX); 140 140 141 141 nsCOMPtr<nsIFile> nsAppPath; -
trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h
r19892 r19924 79 79 # define supR3HardenedPathSharedLibs supR3HardenedStaticPathSharedLibs 80 80 # define supR3HardenedPathAppDocs supR3HardenedStaticPathAppDocs 81 # define supR3HardenedPath Program supR3HardenedStaticPathProgram81 # define supR3HardenedPathExecDir supR3HardenedStaticPathExecDir 82 82 # define supR3HardenedPathFilename supR3HardenedStaticPathFilename 83 83 # define supR3HardenedFatalV supR3HardenedStaticFatalV … … 274 274 /** @copydoc RTPathAppDocs */ 275 275 DECLHIDDEN(int) supR3HardenedPathAppDocs(char *pszPath, size_t cchPath); 276 /** @copydoc RTPath Program*/277 DECLHIDDEN(int) supR3HardenedPath Program(char *pszPath, size_t cchPath);276 /** @copydoc RTPathExecDir */ 277 DECLHIDDEN(int) supR3HardenedPathExecDir(char *pszPath, size_t cchPath); 278 278 /** @copydoc RTPathFilename */ 279 279 DECLHIDDEN(char *) supR3HardenedPathFilename(const char *pszPath); -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp
r15352 r19924 91 91 92 92 /** 93 * @copydoc RTPath Program93 * @copydoc RTPathExecDir 94 94 */ 95 DECLHIDDEN(int) supR3HardenedPath Program(char *pszPath, size_t cchPath)95 DECLHIDDEN(int) supR3HardenedPathExecDir(char *pszPath, size_t cchPath) 96 96 { 97 return RTPath Program(pszPath, cchPath);97 return RTPathExecDir(pszPath, cchPath); 98 98 } 99 99 -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r18499 r19924 235 235 236 236 #else 237 return supR3HardenedPath Program(pszPath, cchPath);237 return supR3HardenedPathExecDir(pszPath, cchPath); 238 238 #endif 239 239 } … … 255 255 256 256 #else 257 return supR3HardenedPath Program(pszPath, cchPath);257 return supR3HardenedPathExecDir(pszPath, cchPath); 258 258 #endif 259 259 } … … 275 275 276 276 #else 277 return supR3HardenedPath Program(pszPath, cchPath);277 return supR3HardenedPathExecDir(pszPath, cchPath); 278 278 #endif 279 279 } … … 295 295 296 296 #else 297 return supR3HardenedPath Program(pszPath, cchPath);297 return supR3HardenedPathExecDir(pszPath, cchPath); 298 298 #endif 299 299 } … … 329 329 # endif 330 330 if (cchLink < 0 || cchLink == sizeof(g_szSupLibHardenedExePath) - 1) 331 supR3HardenedFatal("supR3Hardened PathProgram: couldn't read \"%s\", errno=%d cchLink=%d\n",331 supR3HardenedFatal("supR3HardenedExecDir: couldn't read \"%s\", errno=%d cchLink=%d\n", 332 332 g_szSupLibHardenedExePath, errno, cchLink); 333 333 g_szSupLibHardenedExePath[cchLink] = '\0'; … … 339 339 const char *pszImageName = _dyld_get_image_name(0); 340 340 if (!pszImageName) 341 supR3HardenedFatal("supR3Hardened PathProgram: _dyld_get_image_name(0) failed\n");341 supR3HardenedFatal("supR3HardenedExecDir: _dyld_get_image_name(0) failed\n"); 342 342 size_t cchImageName = strlen(pszImageName); 343 343 if (!cchImageName || cchImageName >= sizeof(g_szSupLibHardenedExePath)) 344 supR3HardenedFatal("supR3Hardened PathProgram: _dyld_get_image_name(0) failed, cchImageName=%d\n", cchImageName);344 supR3HardenedFatal("supR3HardenedExecDir: _dyld_get_image_name(0) failed, cchImageName=%d\n", cchImageName); 345 345 memcpy(g_szSupLibHardenedExePath, pszImageName, cchImageName + 1); 346 346 … … 348 348 HMODULE hExe = GetModuleHandle(NULL); 349 349 if (!GetModuleFileName(hExe, &g_szSupLibHardenedExePath[0], sizeof(g_szSupLibHardenedExePath))) 350 supR3HardenedFatal("supR3Hardened PathProgram: GetModuleFileName failed, rc=%d\n", GetLastError());350 supR3HardenedFatal("supR3HardenedExecDir: GetModuleFileName failed, rc=%d\n", GetLastError()); 351 351 #else 352 352 # error needs porting. … … 381 381 382 382 /** 383 * @copydoc RTPath Program384 */ 385 DECLHIDDEN(int) supR3HardenedPath Program(char *pszPath, size_t cchPath)383 * @copydoc RTPathExecDir 384 */ 385 DECLHIDDEN(int) supR3HardenedPathExecDir(char *pszPath, size_t cchPath) 386 386 { 387 387 /* … … 401 401 } 402 402 403 supR3HardenedFatal("supR3HardenedPath Program: Buffer too small (%u < %u)\n", cchPath, cch);403 supR3HardenedFatal("supR3HardenedPathExecDir: Buffer too small (%u < %u)\n", cchPath, cch); 404 404 return VERR_BUFFER_OVERFLOW; 405 405 } -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
r18154 r19924 216 216 case kSupID_AppBin: /** @todo fix this AppBin crap (uncertain wtf some binaries actually are installed). */ 217 217 case kSupID_Bin: 218 rc = supR3HardenedPath Program(pszDst, cchDst);218 rc = supR3HardenedPathExecDir(pszDst, cchDst); 219 219 break; 220 220 case kSupID_SharedLib: … … 678 678 679 679 char szFilename[RTPATH_MAX]; 680 int rc2 = supR3HardenedPath Program(szFilename, sizeof(szFilename) - cchProgName - sizeof(SUPLIB_EXE_SUFF));680 int rc2 = supR3HardenedPathExecDir(szFilename, sizeof(szFilename) - cchProgName - sizeof(SUPLIB_EXE_SUFF)); 681 681 if (RT_SUCCESS(rc2)) 682 682 { -
trunk/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp
r13865 r19924 182 182 { 183 183 char szDriver[RTPATH_MAX]; 184 int rc = RTPath Program(szDriver, sizeof(szDriver) - sizeof("\\VBoxDrv.sys"));184 int rc = RTPathExecDir(szDriver, sizeof(szDriver) - sizeof("\\VBoxDrv.sys")); 185 185 if (RT_SUCCESS(rc)) 186 186 { … … 333 333 { 334 334 char szDriver[RTPATH_MAX]; 335 int rc = RTPath Program(szDriver, sizeof(szDriver) - sizeof("\\VBoxDrv.sys"));335 int rc = RTPathExecDir(szDriver, sizeof(szDriver) - sizeof("\\VBoxDrv.sys")); 336 336 if (RT_SUCCESS(rc)) 337 337 { -
trunk/src/VBox/Main/generic/NetIf-generic.cpp
r19433 r19924 43 43 44 44 char szAdpCtl[RTPATH_MAX]; 45 int rc = RTPath Program(szAdpCtl, sizeof(szAdpCtl) - sizeof("/" VBOXNETADPCTL_NAME));45 int rc = RTPathExecDir(szAdpCtl, sizeof(szAdpCtl) - sizeof("/" VBOXNETADPCTL_NAME)); 46 46 if (RT_FAILURE(rc)) 47 47 { … … 151 151 152 152 char szAdpCtl[RTPATH_MAX]; 153 int rc = RTPath Program(szAdpCtl, sizeof(szAdpCtl) - sizeof("/" VBOXNETADPCTL_NAME " add"));153 int rc = RTPathExecDir(szAdpCtl, sizeof(szAdpCtl) - sizeof("/" VBOXNETADPCTL_NAME " add")); 154 154 if (RT_FAILURE(rc)) 155 155 { -
trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
r19454 r19924 872 872 873 873 char szPath[RTPATH_MAX]; 874 rc = RTPath Program(szPath, sizeof(szPath) - sizeof("/VMMR0.r0"));874 rc = RTPathExecDir(szPath, sizeof(szPath) - sizeof("/VMMR0.r0")); 875 875 if (RT_FAILURE(rc)) 876 876 { -
trunk/src/VBox/Runtime/r3/init.cpp
r18997 r19924 78 78 79 79 /** The process path. 80 * This is used by RTPath Programand RTProcGetExecutableName and set by rtProcInitName. */80 * This is used by RTPathExecDir and RTProcGetExecutableName and set by rtProcInitName. */ 81 81 char g_szrtProcExePath[RTPATH_MAX]; 82 82 /** The length of g_szrtProcExePath. */ -
trunk/src/VBox/Runtime/r3/path.cpp
r16516 r19924 666 666 #ifndef RT_MINI 667 667 668 RTDECL(int) RTPath Program(char *pszPath, size_t cchPath)668 RTDECL(int) RTPathExecDir(char *pszPath, size_t cchPath) 669 669 { 670 670 AssertReturn(g_szrtProcExePath[0], VERR_WRONG_ORDER); … … 692 692 * Linux: /usr/shared/@<application@> 693 693 * Windows: @<program files directory@>/@<application@> 694 * Old path: same as RTPath Program()694 * Old path: same as RTPathExecDir() 695 695 * 696 696 */ … … 712 712 return rc; 713 713 #else 714 return RTPath Program(pszPath, cchPath);714 return RTPathExecDir(pszPath, cchPath); 715 715 #endif 716 716 } … … 723 723 * Linux: /usr/lib/@<application@> 724 724 * Windows: @<program files directory@>/@<application@> 725 * Old path: same as RTPath Program()725 * Old path: same as RTPathExecDir() 726 726 * 727 727 * @returns iprt status code. … … 746 746 return rc; 747 747 #else 748 return RTPath Program(pszPath, cchPath);748 return RTPathExecDir(pszPath, cchPath); 749 749 #endif 750 750 } … … 758 758 * Linux: /usr/lib 759 759 * Windows: @<program files directory@>/@<application@> 760 * Old path: same as RTPath Program()760 * Old path: same as RTPathExecDir() 761 761 * 762 762 * @returns iprt status code. … … 781 781 return rc; 782 782 #else 783 return RTPath Program(pszPath, cchPath);783 return RTPathExecDir(pszPath, cchPath); 784 784 #endif 785 785 } … … 791 791 * Linux: /usr/share/doc/@<application@> 792 792 * Windows: @<program files directory@>/@<application@> 793 * Old path: same as RTPath Program()793 * Old path: same as RTPathExecDir() 794 794 * 795 795 * @returns iprt status code. … … 814 814 return rc; 815 815 #else 816 return RTPath Program(pszPath, cchPath);816 return RTPathExecDir(pszPath, cchPath); 817 817 #endif 818 818 } -
trunk/src/VBox/Runtime/testcase/tstLdr-4.cpp
r19308 r19924 236 236 */ 237 237 char szPath[RTPATH_MAX]; 238 rc = RTPath Program(szPath, sizeof(szPath) - sizeof("/tstLdrObjR0.r0"));238 rc = RTPathExecDir(szPath, sizeof(szPath) - sizeof("/tstLdrObjR0.r0")); 239 239 if (RT_SUCCESS(rc)) 240 240 { … … 245 245 else 246 246 { 247 RTPrintf("tstLdr-4: RTPath Program-> %Rrc\n", rc);247 RTPrintf("tstLdr-4: RTPathExecDir -> %Rrc\n", rc); 248 248 cErrors++; 249 249 } -
trunk/src/VBox/Runtime/testcase/tstPath.cpp
r15813 r19924 63 63 64 64 /* 65 * RTPath Program, RTPathUserHome and RTProcGetExecutableName.65 * RTPathExecDir, RTPathUserHome and RTProcGetExecutableName. 66 66 */ 67 67 char szPath[RTPATH_MAX]; 68 CHECK_RC(RTPath Program(szPath, sizeof(szPath)));68 CHECK_RC(RTPathExecDir(szPath, sizeof(szPath))); 69 69 if (RT_SUCCESS(rc)) 70 RTPrintf(" Program={%s}\n", szPath);70 RTPrintf("ExecDir={%s}\n", szPath); 71 71 CHECK_RC(RTPathUserHome(szPath, sizeof(szPath))); 72 72 if (RT_SUCCESS(rc)) -
trunk/src/VBox/VMM/PDMLdr.cpp
r19015 r19924 978 978 if (!RT_SUCCESS(rc)) 979 979 { 980 AssertMsgFailed(("RTPath Program(,%d) failed rc=%d!\n", sizeof(szPath), rc));980 AssertMsgFailed(("RTPath[SharedLibs|AppPrivateArch](,%d) failed rc=%d!\n", sizeof(szPath), rc)); 981 981 return NULL; 982 982 } -
trunk/src/testcase/tstRunTestcases.cpp
r14831 r19924 264 264 { 265 265 char szPath[RTPATH_MAX]; 266 int rc = RTPath Program(szPath, sizeof(szPath) - sizeof("/.."));266 int rc = RTPathExecDir(szPath, sizeof(szPath) - sizeof("/..")); 267 267 if (RT_FAILURE(rc)) 268 268 { 269 RTPrintf("fatal error: RTPath Program-> %Rrc\n", rc);269 RTPrintf("fatal error: RTPathExecDir -> %Rrc\n", rc); 270 270 return 1; 271 271 }
Note:
See TracChangeset
for help on using the changeset viewer.