Changeset 41429 in vbox for trunk/src/VBox/HostDrivers/Support/testcase
- Timestamp:
- May 24, 2012 9:38:38 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 78155
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp
r38636 r41429 40 40 #include <iprt/alloc.h> 41 41 #include <iprt/time.h> 42 43 44 /** 45 * Makes a path to a file in the executable directory. 46 */ 47 static char *ExeDirFile(char *pszFile, const char *pszArgv0, const char *pszFilename) 48 { 49 char *psz; 50 char *psz2; 51 52 strcpy(pszFile, pszArgv0); 53 psz = strrchr(pszFile, '/'); 54 psz2 = strrchr(pszFile, '\\'); 55 if (psz < psz2) 56 psz = psz2; 57 if (!psz) 58 psz = strrchr(pszFile, ':'); 59 if (!psz) 60 { 61 strcpy(pszFile, "./"); 62 psz = &pszFile[1]; 63 } 64 strcpy(psz + 1, "VMMR0.r0"); 65 return pszFile; 66 } 42 #include <iprt/path.h> 43 67 44 68 45 int main(int argc, char **argv) … … 83 60 rcRet += rc != 0; 84 61 RTPrintf("tstInt: SUPR3Init -> rc=%Rrc\n", rc); 62 char szFile[RTPATH_MAX]; 85 63 if (!rc) 64 { 65 rc = RTPathExecDir(szFile, sizeof(szFile) - sizeof("/VMMR0.r0")); 66 } 67 char szAbsFile[RTPATH_MAX]; 68 if (RT_SUCCESS(rc)) 69 { 70 strcat(szFile, "/VMMR0.r0"); 71 rc = RTPathAbs(szFile, szAbsFile, sizeof(szAbsFile)); 72 } 73 if (RT_SUCCESS(rc)) 86 74 { 87 75 /* 88 76 * Load VMM code. 89 77 */ 90 char szFile[RTPATH_MAX]; 91 rc = SUPR3LoadVMM(ExeDirFile(szFile, argv[0], "VMMR0.r0")); 92 if (!rc) 78 rc = SUPR3LoadVMM(szAbsFile); 79 if (RT_SUCCESS(rc)) 93 80 { 94 81 /*
Note:
See TracChangeset
for help on using the changeset viewer.