Changeset 2708 for trunk/src/lib/nt/ntdir.c
- Timestamp:
- Nov 21, 2013, 11:26:40 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/nt/ntdir.c
r2702 r2708 92 92 93 93 94 /** 95 * Alternative opendir, with extra stat() info returned by readdir(). 96 */ 97 BirdDir_T *birdDirOpenExtraInfo(const char *pszPath) 98 { 99 return birdDirOpenInternal(pszPath, NULL, 0 /*fMinimalInfo*/); 100 } 101 102 94 103 static int birdDirReadMore(BirdDir_T *pDir) 95 104 { … … 229 238 { 230 239 fSkipEntry = 1; 240 pDir->fHaveData = 0; 231 241 continue; 232 242 } 233 243 234 pEntry->d_ino = 0;235 pEntry->d_s ize = 0;244 memset(&pEntry->d_stat, 0, sizeof(pEntry->d_stat)); 245 pEntry->d_stat.st_mode = S_IFMT; 236 246 pEntry->d_type = DT_UNKNOWN; 237 pEntry->d_dirsymlink = 0;238 247 pEntry->d_reclen = 0; 239 248 pEntry->d_namlen = 0; … … 246 255 } 247 256 248 //case MyFileIdBothDirectoryInformation: 249 //{ 250 // MY_FILE_BOTH_DIR_INFORMATION 251 // 252 //} 257 case MyFileIdFullDirectoryInformation: 258 { 259 MY_FILE_ID_FULL_DIR_INFORMATION *pInfo = (MY_FILE_ID_FULL_DIR_INFORMATION *)&pDir->pabBuf[pDir->offBuf]; 260 if ( pDir->offBuf >= pDir->cbBuf - MIN_SIZEOF_MY_FILE_ID_FULL_DIR_INFORMATION 261 || pInfo->FileNameLength >= pDir->cbBuf 262 || pDir->offBuf + pInfo->FileNameLength + MIN_SIZEOF_MY_FILE_ID_FULL_DIR_INFORMATION > pDir->cbBuf) 263 { 264 fSkipEntry = 1; 265 pDir->fHaveData = 0; 266 continue; 267 } 268 269 pEntry->d_type = DT_UNKNOWN; 270 pEntry->d_reclen = 0; 271 pEntry->d_namlen = 0; 272 if (birdDirCopyNameToEntry(pInfo->FileName, pInfo->FileNameLength, pEntry) != 0) 273 fSkipEntry = 1; 274 birdStatFillFromFileIdFullDirInfo(&pEntry->d_stat, pInfo, pEntry->d_name); 275 pEntry->d_stat.st_dev = pDir->uDev; 276 switch (pEntry->d_stat.st_mode & S_IFMT) 277 { 278 case S_IFREG: pEntry->d_type = DT_REG; break; 279 case S_IFDIR: pEntry->d_type = DT_DIR; break; 280 case S_IFLNK: pEntry->d_type = DT_LNK; break; 281 case S_IFIFO: pEntry->d_type = DT_FIFO; break; 282 case S_IFCHR: pEntry->d_type = DT_CHR; break; 283 default: 284 #ifndef NDEBUG 285 __debugbreak(); 286 #endif 287 pEntry->d_type = DT_UNKNOWN; 288 break; 289 } 290 291 cbMinCur = MIN_SIZEOF_MY_FILE_ID_FULL_DIR_INFORMATION + pInfo->FileNameLength; 292 offNext = pInfo->NextEntryOffset; 293 break; 294 } 253 295 254 296 default:
Note:
See TracChangeset
for help on using the changeset viewer.