- Timestamp:
- Aug 1, 2007 1:16:09 PM (17 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedFolders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp
r3959 r3960 202 202 strcpy(pDirEntry->szName, pszFullPath); 203 203 strcat(pDirEntry->szName, "\\*"); 204 rc = rtDirOpenFiltered (&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT);204 rc = RTDirOpenFiltered (&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT); 205 205 *(pszStartComponent-1) = RTPATH_DELIMITER; 206 206 if (VBOX_FAILURE(rc)) … … 211 211 uint32_t cbDirEntrySize = cbDirEntry; 212 212 213 rc = rtDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING);213 rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING); 214 214 if (rc == VERR_NO_MORE_FILES) 215 215 break; … … 238 238 RTMemFree(pDirEntry); 239 239 240 rtDirClose(hSearch);240 RTDirClose(hSearch); 241 241 return rc; 242 242 } -
trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp
r3955 r3960 94 94 LogFlowFunc(("%s, %s, %s\n", pszFullPath, delimLast, delimSecondLast)); 95 95 } 96 #if 0 96 97 97 static int vbsfCorrectCasing(char *pszFullPath, char *pszStartComponent) 98 98 { 99 PRTDIRENTRYEX pDirEntry = 0, pDirEntryOrg;100 uint32_t cbDirEntry, cb BufferOrg;99 PRTDIRENTRYEX pDirEntry = NULL; 100 uint32_t cbDirEntry, cbComponent; 101 101 int rc = VERR_FILE_NOT_FOUND; 102 RTDIR hSearch; 102 PRTDIR hSearch; 103 104 cbComponent = strlen(pszStartComponent); 103 105 104 106 cbDirEntry = 4096; 105 pDirEntry Org = pDirEntry= (PRTDIRENTRYEX)RTMemAlloc(cbDirEntry);107 pDirEntry = (PRTDIRENTRYEX)RTMemAlloc(cbDirEntry); 106 108 if (pDirEntry == 0) 107 109 { … … 111 113 112 114 /** @todo this is quite inefficient, especially for directories with many files */ 113 rc = RTDirOpenFiltered (&hSearch, pszFullPath, RTDIRFILTER_WINNT); 115 Assert(pszFullPath < pszStartComponent-1); 116 Assert(*(pszStartComponent-1) == RTPATH_DELIMITER); 117 *(pszStartComponent-1) = 0; 118 strcpy(pDirEntry->szName, pszFullPath); 119 strcat(pDirEntry->szName, "\\*"); 120 rc = RTDirOpenFiltered (&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT); 121 *(pszStartComponent-1) = RTPATH_DELIMITER; 114 122 if (VBOX_FAILURE(rc)) 115 123 goto end; … … 118 126 { 119 127 uint32_t cbDirEntrySize = cbDirEntry; 120 uint32_t cbNeeded; 121 122 pDirEntry = pDirEntryOrg; 123 124 rc = RTDirReadEx(DirHandle, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING); 128 129 rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING); 125 130 if (rc == VERR_NO_MORE_FILES) 126 {127 *pIndex = 0; /* listing completed */128 131 break; 129 }130 132 131 133 if (VINF_SUCCESS != rc && rc != VWRN_NO_DIRENT_INFO) … … 137 139 continue; 138 140 } 139 140 } 141 Assert(rc != VINF_SUCCESS); 141 if ( pDirEntry->cbName == cbComponent 142 && !RTStrICmp(pszStartComponent, &pDirEntry->szName[0])) 143 { 144 Log(("Found original name %s (%s)\n", &pDirEntry->szName[0], pszStartComponent)); 145 strcpy(pszStartComponent, &pDirEntry->szName[0]); 146 rc = VINF_SUCCESS; 147 break; 148 } 149 } 150 Assert(VBOX_SUCCESS(rc)); 142 151 143 152 end: … … 148 157 return rc; 149 158 } 150 #endif151 159 152 160 static int vbsfBuildFullPath (SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pPath, … … 301 309 { 302 310 RTFSOBJINFO info; 303 rc = RTPathQueryInfo 311 rc = RTPathQueryInfo(pszFullPath, &info, RTFSOBJATTRADD_NOTHING); 304 312 if (rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND) 305 313 { 306 314 uint32_t len = strlen(pszFullPath); 307 315 char *src = pszFullPath + len - 1; 308 316 309 317 Log(("Handle case insenstive guest fs on top of host case sensitive fs for %s\n", pszFullPath)); 310 318 … … 338 346 { 339 347 char *end = src; 348 bool fEndOfString = true; 340 349 341 350 while(*end) … … 345 354 end++; 346 355 } 347 if (!*end) 348 break; 349 350 *end = 0; 351 352 rc = RTPathQueryInfo(src, &info, RTFSOBJATTRADD_NOTHING); 353 Assert(rc == VINF_SUCCESS || rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND); 356 357 if (*end == RTPATH_DELIMITER) 358 { 359 fEndOfString = false; 360 *end = 0; 361 rc = RTPathQueryInfo(src, &info, RTFSOBJATTRADD_NOTHING); 362 Assert(rc == VINF_SUCCESS || rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND); 363 } 364 else 365 rc = VERR_FILE_NOT_FOUND; 366 354 367 if (rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND) 355 368 { … … 359 372 break; 360 373 } 374 375 if (fEndOfString) 376 break; 361 377 362 378 *end = RTPATH_DELIMITER;
Note:
See TracChangeset
for help on using the changeset viewer.