VirtualBox

儲存庫 vbox 的更動 62806


忽略:
時間撮記:
2016-8-1 上午10:04:34 (8 年 以前)
作者:
vboxsync
訊息:

HostServices: warnings

位置:
trunk/src/VBox/HostServices/SharedFolders/testcase
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp

    r62489 r62806  
    130130extern int testRTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate)
    131131{
     132    RT_NOREF2(fMode, fCreate);
    132133 /* RTPrintf("%s: pszPath=%s, fMode=0x%llx\n", __PRETTY_FUNCTION__, pszPath,
    133134             LLUIFY(fMode)); */
     
    161162static RTTIMESPEC testRTDirQueryInfoATime;
    162163
    163 extern int testRTDirQueryInfo(PRTDIR pDir, PRTFSOBJINFO pObjInfo,
    164                                RTFSOBJATTRADD enmAdditionalAttribs)
    165 {
     164extern int testRTDirQueryInfo(PRTDIR pDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs)
     165{
     166    RT_NOREF1(enmAdditionalAttribs);
    166167 /* RTPrintf("%s: pDir=%p, enmAdditionalAttribs=0x%llx\n", __PRETTY_FUNCTION__,
    167168             pDir, LLUIFY(enmAdditionalAttribs)); */
     
    173174}
    174175
    175 extern int testRTDirRemove(const char *pszPath) { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; }
     176extern int testRTDirRemove(const char *pszPath)
     177{
     178    RT_NOREF1(pszPath);
     179    RTPrintf("%s\n", __PRETTY_FUNCTION__);
     180    return 0;
     181}
    176182
    177183static PRTDIR testRTDirReadExDir;
    178184
    179 extern int testRTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry,
    180                             size_t *pcbDirEntry,
    181                             RTFSOBJATTRADD enmAdditionalAttribs,
    182                             uint32_t fFlags)
    183 {
     185extern int testRTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry,
     186                           RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
     187{
     188    RT_NOREF4(pDirEntry, pcbDirEntry, enmAdditionalAttribs, fFlags);
    184189 /* RTPrintf("%s: pDir=%p, pcbDirEntry=%d, enmAdditionalAttribs=%llu, fFlags=0x%llx\n",
    185190             __PRETTY_FUNCTION__, pDir, pcbDirEntry ? (int) *pcbDirEntry : -1,
     
    191196static RTTIMESPEC testRTDirSetTimesATime;
    192197
    193 extern int testRTDirSetTimes(PRTDIR pDir, PCRTTIMESPEC pAccessTime,
    194                                 PCRTTIMESPEC pModificationTime,
    195                                 PCRTTIMESPEC pChangeTime,
    196                                 PCRTTIMESPEC pBirthTime)
    197 {
     198extern int testRTDirSetTimes(PRTDIR pDir, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
     199                             PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime)
     200{
     201    RT_NOREF4(pDir, pModificationTime, pChangeTime, pBirthTime);
    198202 /* RTPrintf("%s: pDir=%p, *pAccessTime=%lli, *pModificationTime=%lli, *pChangeTime=%lli, *pBirthTime=%lli\n",
    199203             __PRETTY_FUNCTION__, pDir,
     
    219223}
    220224
    221 extern int  testRTFileDelete(const char *pszFilename) { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; }
     225extern int  testRTFileDelete(const char *pszFilename)
     226{
     227    RT_NOREF1(pszFilename);
     228    RTPrintf("%s\n", __PRETTY_FUNCTION__);
     229    return 0;
     230}
    222231
    223232static RTFILE testRTFileFlushFile;
     
    235244static uint64_t testRTFileLockSize;
    236245
    237 extern int  testRTFileLock(RTFILE hFile, unsigned fLock, int64_t offLock,
    238                             uint64_t cbLock)
     246extern int  testRTFileLock(RTFILE hFile, unsigned fLock, int64_t offLock, uint64_t cbLock)
    239247{
    240248 /* RTPrintf("%s: hFile=%p, fLock=%u, offLock=%lli, cbLock=%llu\n",
     
    252260static RTFILE testRTFileOpenpFile;
    253261
    254 extern int  testRTFileOpen(PRTFILE pFile, const char *pszFilename,
    255                             uint64_t fOpen)
     262extern int  testRTFileOpen(PRTFILE pFile, const char *pszFilename, uint64_t fOpen)
    256263{
    257264 /* RTPrintf("%s, pszFilename=%s, fOpen=0x%llx\n", __PRETTY_FUNCTION__,
     
    270277extern int  testRTFileQueryInfo(RTFILE hFile, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs)
    271278{
     279    RT_NOREF1(enmAdditionalAttribs);
    272280 /* RTPrintf("%s, hFile=%p, enmAdditionalAttribs=0x%llx\n",
    273281             __PRETTY_FUNCTION__, hFile, LLUIFY(enmAdditionalAttribs)); */
     
    283291static const char *testRTFileReadData;
    284292
    285 extern int  testRTFileRead(RTFILE File, void *pvBuf, size_t cbToRead,
    286                             size_t *pcbRead)
    287 {
     293extern int  testRTFileRead(RTFILE File, void *pvBuf, size_t cbToRead, size_t *pcbRead)
     294{
     295    RT_NOREF1(File);
    288296 /* RTPrintf("%s : File=%p, cbToRead=%llu\n", __PRETTY_FUNCTION__, File,
    289297             LLUIFY(cbToRead)); */
     
    295303}
    296304
    297 extern int testRTFileSeek(RTFILE hFile, int64_t offSeek, unsigned uMethod,
    298                            uint64_t *poffActual)
    299 {
     305extern int testRTFileSeek(RTFILE hFile, int64_t offSeek, unsigned uMethod, uint64_t *poffActual)
     306{
     307    RT_NOREF3(hFile, offSeek, uMethod);
    300308 /* RTPrintf("%s : hFile=%p, offSeek=%llu, uMethod=%u\n", __PRETTY_FUNCTION__,
    301309             hFile, LLUIFY(offSeek), uMethod); */
     
    309317extern int testRTFileSetMode(RTFILE File, RTFMODE fMode)
    310318{
     319    RT_NOREF1(File);
    311320 /* RTPrintf("%s: fMode=%llu\n", __PRETTY_FUNCTION__, LLUIFY(fMode)); */
    312321    testRTFileSetFMode = fMode;
     
    328337static RTTIMESPEC testRTFileSetTimesATime;
    329338
    330 extern int testRTFileSetTimes(RTFILE File, PCRTTIMESPEC pAccessTime,
    331                                PCRTTIMESPEC pModificationTime,
    332                                PCRTTIMESPEC pChangeTime,
    333                                PCRTTIMESPEC pBirthTime)
    334 {
     339extern int testRTFileSetTimes(RTFILE File, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
     340                              PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime)
     341{
     342    RT_NOREF4(File, pModificationTime, pChangeTime, pBirthTime);
    335343 /* RTPrintf("%s: pFile=%p, *pAccessTime=%lli, *pModificationTime=%lli, *pChangeTime=%lli, *pBirthTime=%lli\n",
    336344             __PRETTY_FUNCTION__,
     
    363371static char testRTFileWriteData[256];
    364372
    365 extern int  testRTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite,
    366                              size_t *pcbWritten)
    367 {
     373extern int  testRTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten)
     374{
     375    RT_NOREF2(File, cbToWrite);
    368376 /* RTPrintf("%s: File=%p, pvBuf=%.*s, cbToWrite=%llu\n", __PRETTY_FUNCTION__,
    369377             File, cbToWrite, (const char *)pvBuf, LLUIFY(cbToWrite)); */
     
    374382}
    375383
    376 extern int testRTFsQueryProperties(const char *pszFsPath,
    377                                       PRTFSPROPERTIES pProperties)
    378 {
     384extern int testRTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProperties)
     385{
     386    RT_NOREF1(pszFsPath);
    379387 /* RTPrintf("%s, pszFsPath=%s\n", __PRETTY_FUNCTION__, pszFsPath);
    380388    RT_ZERO(*pProperties); */
     
    385393
    386394extern 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}
     400extern 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
     407extern int testRTPathQueryInfoEx(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
     408{
     409    RT_NOREF3(pszPath, enmAdditionalAttribs, fFlags);
    397410 /* RTPrintf("%s: pszPath=%s, enmAdditionalAttribs=0x%x, fFlags=0x%x\n",
    398411             __PRETTY_FUNCTION__, pszPath, (unsigned) enmAdditionalAttribs,
     
    403416
    404417extern 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
     424extern 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}
    409430
    410431
     
    414435
    415436/* Sub-tests for testMappingsQuery(). */
    416 void testMappingsQuerySimple(RTTEST hTest) {}
    417 void testMappingsQueryTooFewBuffers(RTTEST hTest) {}
    418 void testMappingsQueryAutoMount(RTTEST hTest) {}
    419 void testMappingsQueryArrayWrongSize(RTTEST hTest) {}
     437void testMappingsQuerySimple(RTTEST hTest) { RT_NOREF1(hTest); }
     438void testMappingsQueryTooFewBuffers(RTTEST hTest) { RT_NOREF1(hTest); }
     439void testMappingsQueryAutoMount(RTTEST hTest) { RT_NOREF1(hTest); }
     440void testMappingsQueryArrayWrongSize(RTTEST hTest) { RT_NOREF1(hTest); }
    420441
    421442/* Sub-tests for testMappingsQueryName(). */
    422 void testMappingsQueryNameValid(RTTEST hTest) {}
    423 void testMappingsQueryNameInvalid(RTTEST hTest) {}
    424 void testMappingsQueryNameBadBuffer(RTTEST hTest) {}
     443void testMappingsQueryNameValid(RTTEST hTest) { RT_NOREF1(hTest); }
     444void testMappingsQueryNameInvalid(RTTEST hTest) { RT_NOREF1(hTest); }
     445void testMappingsQueryNameBadBuffer(RTTEST hTest) { RT_NOREF1(hTest); }
    425446
    426447/* 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) {}
     448void testMapFolderValid(RTTEST hTest) { RT_NOREF1(hTest); }
     449void testMapFolderInvalid(RTTEST hTest) { RT_NOREF1(hTest); }
     450void testMapFolderTwice(RTTEST hTest) { RT_NOREF1(hTest); }
     451void testMapFolderDelimiter(RTTEST hTest) { RT_NOREF1(hTest); }
     452void testMapFolderCaseSensitive(RTTEST hTest) { RT_NOREF1(hTest); }
     453void testMapFolderCaseInsensitive(RTTEST hTest) { RT_NOREF1(hTest); }
     454void testMapFolderBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    434455
    435456/* Sub-tests for testUnmapFolder(). */
    436 void testUnmapFolderValid(RTTEST hTest) {}
    437 void testUnmapFolderInvalid(RTTEST hTest) {}
    438 void testUnmapFolderBadParameters(RTTEST hTest) {}
     457void testUnmapFolderValid(RTTEST hTest) { RT_NOREF1(hTest); }
     458void testUnmapFolderInvalid(RTTEST hTest) { RT_NOREF1(hTest); }
     459void testUnmapFolderBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    439460
    440461/* Sub-tests for testCreate(). */
    441 void testCreateBadParameters(RTTEST hTest) {}
     462void testCreateBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    442463
    443464/* Sub-tests for testClose(). */
    444 void testCloseBadParameters(RTTEST hTest) {}
     465void testCloseBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    445466
    446467/* Sub-tests for testRead(). */
    447 void testReadBadParameters(RTTEST hTest) {}
     468void testReadBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    448469
    449470/* Sub-tests for testWrite(). */
    450 void testWriteBadParameters(RTTEST hTest) {}
     471void testWriteBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    451472
    452473/* Sub-tests for testLock(). */
    453 void testLockBadParameters(RTTEST hTest) {}
     474void testLockBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    454475
    455476/* Sub-tests for testFlush(). */
    456 void testFlushBadParameters(RTTEST hTest) {}
     477void testFlushBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    457478
    458479/* Sub-tests for testDirList(). */
    459 void testDirListBadParameters(RTTEST hTest) {}
     480void testDirListBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    460481
    461482/* Sub-tests for testReadLink(). */
    462 void testReadLinkBadParameters(RTTEST hTest) {}
     483void testReadLinkBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    463484
    464485/* Sub-tests for testFSInfo(). */
    465 void testFSInfoBadParameters(RTTEST hTest) {}
     486void testFSInfoBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    466487
    467488/* Sub-tests for testRemove(). */
    468 void testRemoveBadParameters(RTTEST hTest) {}
     489void testRemoveBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    469490
    470491/* Sub-tests for testRename(). */
    471 void testRenameBadParameters(RTTEST hTest) {}
     492void testRenameBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    472493
    473494/* Sub-tests for testSymlink(). */
    474 void testSymlinkBadParameters(RTTEST hTest) {}
     495void testSymlinkBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    475496
    476497/* Sub-tests for testMappingsAdd(). */
    477 void testMappingsAddBadParameters(RTTEST hTest) {}
     498void testMappingsAddBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    478499
    479500/* Sub-tests for testMappingsRemove(). */
    480 void testMappingsRemoveBadParameters(RTTEST hTest) {}
     501void testMappingsRemoveBadParameters(RTTEST hTest) { RT_NOREF1(hTest); }
    481502
    482503struct TESTSHFLSTRING
     
    542563                                  SHFLROOT root, const char *pcszFolderName)
    543564{
     565    RT_NOREF1(hTest);
    544566    VBOXHGCMSVCPARM aParms[RT_MAX(SHFL_CPARMS_UNMAP_FOLDER,
    545567                                  SHFL_CPARMS_REMOVE_MAPPING)];
     
    793815    RTTEST_CHECK_RC_OK(hTest, rc);
    794816    testRTFileReadData = pcszReadData;
    795     rc = readFile(&svcTable, Root, Handle, 0, strlen(pcszReadData) + 1,
     817    rc = readFile(&svcTable, Root, Handle, 0, (uint32_t)strlen(pcszReadData) + 1,
    796818                  &cbRead, acBuf, (uint32_t)sizeof(acBuf));
    797819    RTTEST_CHECK_RC_OK(hTest, rc);
     
    11431165int main(int argc, char **argv)
    11441166{
    1145     RTEXITCODE rcExit = RTTestInitAndCreate(RTPathFilename(argv[0]),
    1146                                             &g_hTest);
     1167    RT_NOREF1(argc);
     1168    RTEXITCODE rcExit = RTTestInitAndCreate(RTPathFilename(argv[0]), &g_hTest);
    11471169    if (rcExit != RTEXITCODE_SUCCESS)
    11481170        return rcExit;
  • trunk/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp

    r62489 r62806  
    5555static int iDirFile = 0;
    5656
    57 static const char *pszDirList[] =
    58 {
    59 "c:",
    60 "c:\\test dir",
    61 "c:\\test dir\\SUBDIR",
     57static const char *g_apszDirs[] =
     58{
     59    "c:",
     60    "c:\\test dir",
     61    "c:\\test dir\\SUBDIR",
    6262};
    6363
    64 static const char *pszDirListC[] =
    65 {
    66 ".",
    67 "..",
    68 "test dir"
     64static const char *g_apszDirsC[] =
     65{
     66    ".",
     67    "..",
     68    "test dir"
    6969};
    7070
    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",
     71static 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",
    8888};
    8989
    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",
     90static 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",
    106106};
    107107
    108108int rtDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter)
    109109{
     110    RT_NOREF1(enmFilter);
    110111    if (!strcmp(pszPath, "c:\\*"))
    111112        iDirList = 1;
     
    123124int rtDirClose(PRTDIR pDir)
    124125{
     126    RT_NOREF1(pDir);
    125127    iDirFile = 0;
    126128    return VINF_SUCCESS;
     
    129131int rtDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
    130132{
    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;
    152154    }
    153155    return VINF_SUCCESS;
     
    156158int rtPathQueryInfo(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs)
    157159{
     160    RT_NOREF2(pObjInfo, enmAdditionalAttribs);
    158161    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]))
    165167            return VINF_SUCCESS;
    166168    }
    167169
    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]))
    188191            return VINF_SUCCESS;
    189192    }
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette