vbox的更動 62806 路徑 trunk/src/VBox/HostServices
- 時間撮記:
- 2016-8-1 上午10:04:34 (8 年 以前)
- 位置:
- trunk/src/VBox/HostServices/SharedFolders/testcase
- 檔案:
-
- 修改 2 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp
r62489 r62806 130 130 extern int testRTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate) 131 131 { 132 RT_NOREF2(fMode, fCreate); 132 133 /* RTPrintf("%s: pszPath=%s, fMode=0x%llx\n", __PRETTY_FUNCTION__, pszPath, 133 134 LLUIFY(fMode)); */ … … 161 162 static RTTIMESPEC testRTDirQueryInfoATime; 162 163 163 extern int testRTDirQueryInfo(PRTDIR pDir, PRTFSOBJINFO pObjInfo, 164 RTFSOBJATTRADD enmAdditionalAttribs) 165 { 164 extern int testRTDirQueryInfo(PRTDIR pDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs) 165 { 166 RT_NOREF1(enmAdditionalAttribs); 166 167 /* RTPrintf("%s: pDir=%p, enmAdditionalAttribs=0x%llx\n", __PRETTY_FUNCTION__, 167 168 pDir, LLUIFY(enmAdditionalAttribs)); */ … … 173 174 } 174 175 175 extern int testRTDirRemove(const char *pszPath) { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; } 176 extern int testRTDirRemove(const char *pszPath) 177 { 178 RT_NOREF1(pszPath); 179 RTPrintf("%s\n", __PRETTY_FUNCTION__); 180 return 0; 181 } 176 182 177 183 static PRTDIR testRTDirReadExDir; 178 184 179 extern int testRTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, 180 size_t *pcbDirEntry, 181 RTFSOBJATTRADD enmAdditionalAttribs, 182 uint32_t fFlags) 183 { 185 extern int testRTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, 186 RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags) 187 { 188 RT_NOREF4(pDirEntry, pcbDirEntry, enmAdditionalAttribs, fFlags); 184 189 /* RTPrintf("%s: pDir=%p, pcbDirEntry=%d, enmAdditionalAttribs=%llu, fFlags=0x%llx\n", 185 190 __PRETTY_FUNCTION__, pDir, pcbDirEntry ? (int) *pcbDirEntry : -1, … … 191 196 static RTTIMESPEC testRTDirSetTimesATime; 192 197 193 extern int testRTDirSetTimes(PRTDIR pDir, PCRTTIMESPEC pAccessTime, 194 PCRTTIMESPEC pModificationTime, 195 PCRTTIMESPEC pChangeTime, 196 PCRTTIMESPEC pBirthTime) 197 { 198 extern int testRTDirSetTimes(PRTDIR pDir, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, 199 PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime) 200 { 201 RT_NOREF4(pDir, pModificationTime, pChangeTime, pBirthTime); 198 202 /* RTPrintf("%s: pDir=%p, *pAccessTime=%lli, *pModificationTime=%lli, *pChangeTime=%lli, *pBirthTime=%lli\n", 199 203 __PRETTY_FUNCTION__, pDir, … … 219 223 } 220 224 221 extern int testRTFileDelete(const char *pszFilename) { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; } 225 extern int testRTFileDelete(const char *pszFilename) 226 { 227 RT_NOREF1(pszFilename); 228 RTPrintf("%s\n", __PRETTY_FUNCTION__); 229 return 0; 230 } 222 231 223 232 static RTFILE testRTFileFlushFile; … … 235 244 static uint64_t testRTFileLockSize; 236 245 237 extern int testRTFileLock(RTFILE hFile, unsigned fLock, int64_t offLock, 238 uint64_t cbLock) 246 extern int testRTFileLock(RTFILE hFile, unsigned fLock, int64_t offLock, uint64_t cbLock) 239 247 { 240 248 /* RTPrintf("%s: hFile=%p, fLock=%u, offLock=%lli, cbLock=%llu\n", … … 252 260 static RTFILE testRTFileOpenpFile; 253 261 254 extern int testRTFileOpen(PRTFILE pFile, const char *pszFilename, 255 uint64_t fOpen) 262 extern int testRTFileOpen(PRTFILE pFile, const char *pszFilename, uint64_t fOpen) 256 263 { 257 264 /* RTPrintf("%s, pszFilename=%s, fOpen=0x%llx\n", __PRETTY_FUNCTION__, … … 270 277 extern int testRTFileQueryInfo(RTFILE hFile, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs) 271 278 { 279 RT_NOREF1(enmAdditionalAttribs); 272 280 /* RTPrintf("%s, hFile=%p, enmAdditionalAttribs=0x%llx\n", 273 281 __PRETTY_FUNCTION__, hFile, LLUIFY(enmAdditionalAttribs)); */ … … 283 291 static const char *testRTFileReadData; 284 292 285 extern int testRTFileRead(RTFILE File, void *pvBuf, size_t cbToRead, 286 size_t *pcbRead) 287 { 293 extern int testRTFileRead(RTFILE File, void *pvBuf, size_t cbToRead, size_t *pcbRead) 294 { 295 RT_NOREF1(File); 288 296 /* RTPrintf("%s : File=%p, cbToRead=%llu\n", __PRETTY_FUNCTION__, File, 289 297 LLUIFY(cbToRead)); */ … … 295 303 } 296 304 297 extern int testRTFileSeek(RTFILE hFile, int64_t offSeek, unsigned uMethod, 298 uint64_t *poffActual) 299 { 305 extern int testRTFileSeek(RTFILE hFile, int64_t offSeek, unsigned uMethod, uint64_t *poffActual) 306 { 307 RT_NOREF3(hFile, offSeek, uMethod); 300 308 /* RTPrintf("%s : hFile=%p, offSeek=%llu, uMethod=%u\n", __PRETTY_FUNCTION__, 301 309 hFile, LLUIFY(offSeek), uMethod); */ … … 309 317 extern int testRTFileSetMode(RTFILE File, RTFMODE fMode) 310 318 { 319 RT_NOREF1(File); 311 320 /* RTPrintf("%s: fMode=%llu\n", __PRETTY_FUNCTION__, LLUIFY(fMode)); */ 312 321 testRTFileSetFMode = fMode; … … 328 337 static RTTIMESPEC testRTFileSetTimesATime; 329 338 330 extern int testRTFileSetTimes(RTFILE File, PCRTTIMESPEC pAccessTime, 331 PCRTTIMESPEC pModificationTime, 332 PCRTTIMESPEC pChangeTime, 333 PCRTTIMESPEC pBirthTime) 334 { 339 extern int testRTFileSetTimes(RTFILE File, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, 340 PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime) 341 { 342 RT_NOREF4(File, pModificationTime, pChangeTime, pBirthTime); 335 343 /* RTPrintf("%s: pFile=%p, *pAccessTime=%lli, *pModificationTime=%lli, *pChangeTime=%lli, *pBirthTime=%lli\n", 336 344 __PRETTY_FUNCTION__, … … 363 371 static char testRTFileWriteData[256]; 364 372 365 extern int testRTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite, 366 size_t *pcbWritten) 367 { 373 extern int testRTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten) 374 { 375 RT_NOREF2(File, cbToWrite); 368 376 /* RTPrintf("%s: File=%p, pvBuf=%.*s, cbToWrite=%llu\n", __PRETTY_FUNCTION__, 369 377 File, cbToWrite, (const char *)pvBuf, LLUIFY(cbToWrite)); */ … … 374 382 } 375 383 376 extern int testRTFsQueryProperties(const char *pszFsPath, 377 PRTFSPROPERTIES pProperties) 378 { 384 extern int testRTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProperties) 385 { 386 RT_NOREF1(pszFsPath); 379 387 /* RTPrintf("%s, pszFsPath=%s\n", __PRETTY_FUNCTION__, pszFsPath); 380 388 RT_ZERO(*pProperties); */ … … 385 393 386 394 extern int testRTFsQuerySerial(const char *pszFsPath, uint32_t *pu32Serial) 387 { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; } 388 extern int testRTFsQuerySizes(const char *pszFsPath, PRTFOFF pcbTotal, 389 RTFOFF *pcbFree, uint32_t *pcbBlock, 390 uint32_t *pcbSector) { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; } 391 392 extern int testRTPathQueryInfoEx(const char *pszPath, 393 PRTFSOBJINFO pObjInfo, 394 RTFSOBJATTRADD enmAdditionalAttribs, 395 uint32_t fFlags) 396 { 395 { 396 RT_NOREF2(pszFsPath, pu32Serial); 397 RTPrintf("%s\n", __PRETTY_FUNCTION__); 398 return 0; 399 } 400 extern int testRTFsQuerySizes(const char *pszFsPath, PRTFOFF pcbTotal, RTFOFF *pcbFree, uint32_t *pcbBlock, uint32_t *pcbSector) 401 { 402 RT_NOREF5(pszFsPath, pcbTotal, pcbFree, pcbBlock, pcbSector); 403 RTPrintf("%s\n", __PRETTY_FUNCTION__); 404 return 0; 405 } 406 407 extern int testRTPathQueryInfoEx(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags) 408 { 409 RT_NOREF3(pszPath, enmAdditionalAttribs, fFlags); 397 410 /* RTPrintf("%s: pszPath=%s, enmAdditionalAttribs=0x%x, fFlags=0x%x\n", 398 411 __PRETTY_FUNCTION__, pszPath, (unsigned) enmAdditionalAttribs, … … 403 416 404 417 extern int testRTSymlinkDelete(const char *pszSymlink, uint32_t fDelete) 405 { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; } 406 extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget, 407 size_t cbTarget, uint32_t fRead) 408 { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; } 418 { 419 RT_NOREF2(pszSymlink, fDelete); 420 RTPrintf("%s\n", __PRETTY_FUNCTION__); 421 return 0; 422 } 423 424 extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead) 425 { 426 RT_NOREF4(pszSymlink, pszTarget, cbTarget, fRead); 427 RTPrintf("%s\n", __PRETTY_FUNCTION__); 428 return 0; 429 } 409 430 410 431 … … 414 435 415 436 /* Sub-tests for testMappingsQuery(). */ 416 void testMappingsQuerySimple(RTTEST hTest) { }417 void testMappingsQueryTooFewBuffers(RTTEST hTest) { }418 void testMappingsQueryAutoMount(RTTEST hTest) { }419 void testMappingsQueryArrayWrongSize(RTTEST hTest) { }437 void testMappingsQuerySimple(RTTEST hTest) { RT_NOREF1(hTest); } 438 void testMappingsQueryTooFewBuffers(RTTEST hTest) { RT_NOREF1(hTest); } 439 void testMappingsQueryAutoMount(RTTEST hTest) { RT_NOREF1(hTest); } 440 void testMappingsQueryArrayWrongSize(RTTEST hTest) { RT_NOREF1(hTest); } 420 441 421 442 /* Sub-tests for testMappingsQueryName(). */ 422 void testMappingsQueryNameValid(RTTEST hTest) { }423 void testMappingsQueryNameInvalid(RTTEST hTest) { }424 void testMappingsQueryNameBadBuffer(RTTEST hTest) { }443 void testMappingsQueryNameValid(RTTEST hTest) { RT_NOREF1(hTest); } 444 void testMappingsQueryNameInvalid(RTTEST hTest) { RT_NOREF1(hTest); } 445 void testMappingsQueryNameBadBuffer(RTTEST hTest) { RT_NOREF1(hTest); } 425 446 426 447 /* Sub-tests for testMapFolder(). */ 427 void testMapFolderValid(RTTEST hTest) { }428 void testMapFolderInvalid(RTTEST hTest) { }429 void testMapFolderTwice(RTTEST hTest) { }430 void testMapFolderDelimiter(RTTEST hTest) { }431 void testMapFolderCaseSensitive(RTTEST hTest) { }432 void testMapFolderCaseInsensitive(RTTEST hTest) { }433 void testMapFolderBadParameters(RTTEST hTest) { }448 void testMapFolderValid(RTTEST hTest) { RT_NOREF1(hTest); } 449 void testMapFolderInvalid(RTTEST hTest) { RT_NOREF1(hTest); } 450 void testMapFolderTwice(RTTEST hTest) { RT_NOREF1(hTest); } 451 void testMapFolderDelimiter(RTTEST hTest) { RT_NOREF1(hTest); } 452 void testMapFolderCaseSensitive(RTTEST hTest) { RT_NOREF1(hTest); } 453 void testMapFolderCaseInsensitive(RTTEST hTest) { RT_NOREF1(hTest); } 454 void testMapFolderBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 434 455 435 456 /* Sub-tests for testUnmapFolder(). */ 436 void testUnmapFolderValid(RTTEST hTest) { }437 void testUnmapFolderInvalid(RTTEST hTest) { }438 void testUnmapFolderBadParameters(RTTEST hTest) { }457 void testUnmapFolderValid(RTTEST hTest) { RT_NOREF1(hTest); } 458 void testUnmapFolderInvalid(RTTEST hTest) { RT_NOREF1(hTest); } 459 void testUnmapFolderBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 439 460 440 461 /* Sub-tests for testCreate(). */ 441 void testCreateBadParameters(RTTEST hTest) { }462 void testCreateBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 442 463 443 464 /* Sub-tests for testClose(). */ 444 void testCloseBadParameters(RTTEST hTest) { }465 void testCloseBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 445 466 446 467 /* Sub-tests for testRead(). */ 447 void testReadBadParameters(RTTEST hTest) { }468 void testReadBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 448 469 449 470 /* Sub-tests for testWrite(). */ 450 void testWriteBadParameters(RTTEST hTest) { }471 void testWriteBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 451 472 452 473 /* Sub-tests for testLock(). */ 453 void testLockBadParameters(RTTEST hTest) { }474 void testLockBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 454 475 455 476 /* Sub-tests for testFlush(). */ 456 void testFlushBadParameters(RTTEST hTest) { }477 void testFlushBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 457 478 458 479 /* Sub-tests for testDirList(). */ 459 void testDirListBadParameters(RTTEST hTest) { }480 void testDirListBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 460 481 461 482 /* Sub-tests for testReadLink(). */ 462 void testReadLinkBadParameters(RTTEST hTest) { }483 void testReadLinkBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 463 484 464 485 /* Sub-tests for testFSInfo(). */ 465 void testFSInfoBadParameters(RTTEST hTest) { }486 void testFSInfoBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 466 487 467 488 /* Sub-tests for testRemove(). */ 468 void testRemoveBadParameters(RTTEST hTest) { }489 void testRemoveBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 469 490 470 491 /* Sub-tests for testRename(). */ 471 void testRenameBadParameters(RTTEST hTest) { }492 void testRenameBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 472 493 473 494 /* Sub-tests for testSymlink(). */ 474 void testSymlinkBadParameters(RTTEST hTest) { }495 void testSymlinkBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 475 496 476 497 /* Sub-tests for testMappingsAdd(). */ 477 void testMappingsAddBadParameters(RTTEST hTest) { }498 void testMappingsAddBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 478 499 479 500 /* Sub-tests for testMappingsRemove(). */ 480 void testMappingsRemoveBadParameters(RTTEST hTest) { }501 void testMappingsRemoveBadParameters(RTTEST hTest) { RT_NOREF1(hTest); } 481 502 482 503 struct TESTSHFLSTRING … … 542 563 SHFLROOT root, const char *pcszFolderName) 543 564 { 565 RT_NOREF1(hTest); 544 566 VBOXHGCMSVCPARM aParms[RT_MAX(SHFL_CPARMS_UNMAP_FOLDER, 545 567 SHFL_CPARMS_REMOVE_MAPPING)]; … … 793 815 RTTEST_CHECK_RC_OK(hTest, rc); 794 816 testRTFileReadData = pcszReadData; 795 rc = readFile(&svcTable, Root, Handle, 0, strlen(pcszReadData) + 1,817 rc = readFile(&svcTable, Root, Handle, 0, (uint32_t)strlen(pcszReadData) + 1, 796 818 &cbRead, acBuf, (uint32_t)sizeof(acBuf)); 797 819 RTTEST_CHECK_RC_OK(hTest, rc); … … 1143 1165 int main(int argc, char **argv) 1144 1166 { 1145 RT EXITCODE rcExit = RTTestInitAndCreate(RTPathFilename(argv[0]),1146 1167 RT_NOREF1(argc); 1168 RTEXITCODE rcExit = RTTestInitAndCreate(RTPathFilename(argv[0]), &g_hTest); 1147 1169 if (rcExit != RTEXITCODE_SUCCESS) 1148 1170 return rcExit; -
trunk/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp
r62489 r62806 55 55 static int iDirFile = 0; 56 56 57 static const char * pszDirList[] =58 { 59 "c:",60 "c:\\test dir",61 "c:\\test dir\\SUBDIR",57 static const char *g_apszDirs[] = 58 { 59 "c:", 60 "c:\\test dir", 61 "c:\\test dir\\SUBDIR", 62 62 }; 63 63 64 static const char * pszDirListC[] =65 { 66 ".",67 "..",68 "test dir"64 static const char *g_apszDirsC[] = 65 { 66 ".", 67 "..", 68 "test dir" 69 69 }; 70 70 71 static const char * pszDirListTestdir[] =72 { 73 ".",74 "..",75 "SUBDIR",76 "a.bat",77 "aTestJe.bat",78 "aTestje.bat",79 "b.bat",80 "c.bat",81 "d.bat",82 "e.bat",83 "f.bat",84 "g.bat",85 "h.bat",86 "x.bat",87 "z.bat",71 static const char *g_apszTestdirEntries[] = 72 { 73 ".", 74 "..", 75 "SUBDIR", 76 "a.bat", 77 "aTestJe.bat", 78 "aTestje.bat", 79 "b.bat", 80 "c.bat", 81 "d.bat", 82 "e.bat", 83 "f.bat", 84 "g.bat", 85 "h.bat", 86 "x.bat", 87 "z.bat", 88 88 }; 89 89 90 static const char * pszDirListSUBDIR[] =91 { 92 ".",93 "..",94 "a.bat",95 "aTestJe.bat",96 "aTestje.bat",97 "b.bat",98 "c.bat",99 "d.bat",100 "e.bat",101 "f.bat",102 "g.bat",103 "h.bat",104 "x.bat",105 "z.bat",90 static const char *g_apszSUBDIREntries[] = 91 { 92 ".", 93 "..", 94 "a.bat", 95 "aTestJe.bat", 96 "aTestje.bat", 97 "b.bat", 98 "c.bat", 99 "d.bat", 100 "e.bat", 101 "f.bat", 102 "g.bat", 103 "h.bat", 104 "x.bat", 105 "z.bat", 106 106 }; 107 107 108 108 int rtDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter) 109 109 { 110 RT_NOREF1(enmFilter); 110 111 if (!strcmp(pszPath, "c:\\*")) 111 112 iDirList = 1; … … 123 124 int rtDirClose(PRTDIR pDir) 124 125 { 126 RT_NOREF1(pDir); 125 127 iDirFile = 0; 126 128 return VINF_SUCCESS; … … 129 131 int rtDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags) 130 132 { 131 NOREF(fFlags);132 switch (iDirList)133 { 134 case 1:135 if (iDirFile == RT_ELEMENTS(pszDirListC))136 return VERR_NO_MORE_FILES;137 pDirEntry->cbName = (uint16_t)strlen(pszDirListC[iDirFile]);138 strcpy(pDirEntry->szName, pszDirListC[iDirFile++]);139 break;140 case 2:141 if (iDirFile == RT_ELEMENTS(pszDirListTestdir))142 return VERR_NO_MORE_FILES;143 pDirEntry->cbName = (uint16_t)strlen(pszDirListTestdir[iDirFile]);144 strcpy(pDirEntry->szName, pszDirListTestdir[iDirFile++]);145 break;146 case 3:147 if (iDirFile == RT_ELEMENTS(pszDirListSUBDIR))148 return VERR_NO_MORE_FILES;149 pDirEntry->cbName = (uint16_t)strlen(pszDirListSUBDIR[iDirFile]);150 strcpy(pDirEntry->szName, pszDirListSUBDIR[iDirFile++]);151 break;133 RT_NOREF4(pDir, pcbDirEntry, enmAdditionalAttribs, fFlags); 134 switch (iDirList) 135 { 136 case 1: 137 if (iDirFile == RT_ELEMENTS(g_apszDirsC)) 138 return VERR_NO_MORE_FILES; 139 pDirEntry->cbName = (uint16_t)strlen(g_apszDirsC[iDirFile]); 140 strcpy(pDirEntry->szName, g_apszDirsC[iDirFile++]); 141 break; 142 case 2: 143 if (iDirFile == RT_ELEMENTS(g_apszTestdirEntries)) 144 return VERR_NO_MORE_FILES; 145 pDirEntry->cbName = (uint16_t)strlen(g_apszTestdirEntries[iDirFile]); 146 strcpy(pDirEntry->szName, g_apszTestdirEntries[iDirFile++]); 147 break; 148 case 3: 149 if (iDirFile == RT_ELEMENTS(g_apszSUBDIREntries)) 150 return VERR_NO_MORE_FILES; 151 pDirEntry->cbName = (uint16_t)strlen(g_apszSUBDIREntries[iDirFile]); 152 strcpy(pDirEntry->szName, g_apszSUBDIREntries[iDirFile++]); 153 break; 152 154 } 153 155 return VINF_SUCCESS; … … 156 158 int rtPathQueryInfo(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs) 157 159 { 160 RT_NOREF2(pObjInfo, enmAdditionalAttribs); 158 161 int cMax; 159 const char **ppszDirList; 160 161 /* first try pszDirList */ 162 for (unsigned int i=0;i<RT_ELEMENTS(pszDirList);i++) 163 { 164 if(!strcmp(pszPath, pszDirList[i])) 162 163 /* first try g_apszDirs */ 164 for (unsigned int i=0;i<RT_ELEMENTS(g_apszDirs);i++) 165 { 166 if(!strcmp(pszPath, g_apszDirs[i])) 165 167 return VINF_SUCCESS; 166 168 } 167 169 168 switch(iDirList) 169 { 170 case 1: 171 cMax = RT_ELEMENTS(pszDirListC); 172 ppszDirList = pszDirListC; 173 break; 174 case 2: 175 cMax = RT_ELEMENTS(pszDirListTestdir); 176 ppszDirList = pszDirListTestdir; 177 break; 178 case 3: 179 cMax = RT_ELEMENTS(pszDirListSUBDIR); 180 ppszDirList = pszDirListSUBDIR; 181 break; 182 default: 183 return VERR_FILE_NOT_FOUND; 184 } 185 for (int i=0;i<cMax;i++) 186 { 187 if(!strcmp(pszPath, ppszDirList[i])) 170 const char **papszDirList; 171 switch (iDirList) 172 { 173 case 1: 174 cMax = RT_ELEMENTS(g_apszDirsC); 175 papszDirList = g_apszDirsC; 176 break; 177 case 2: 178 cMax = RT_ELEMENTS(g_apszTestdirEntries); 179 papszDirList = g_apszTestdirEntries; 180 break; 181 case 3: 182 cMax = RT_ELEMENTS(g_apszSUBDIREntries); 183 papszDirList = g_apszSUBDIREntries; 184 break; 185 default: 186 return VERR_FILE_NOT_FOUND; 187 } 188 for (int i = 0; i < cMax; i++) 189 { 190 if (!strcmp(pszPath, papszDirList[i])) 188 191 return VINF_SUCCESS; 189 192 }
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器