- Timestamp:
- Jul 21, 2015 5:44:38 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/nt/direnum-r3-nt.cpp
r57020 r57049 258 258 * We do this in lazy fashion as some users of RTDirOpen will not actually 259 259 * list any files, just open it for various reasons. 260 * 261 * We also reduce the buffer size for networked devices as the windows 7-8.1, 262 * server 2012, ++ CIFS servers or/and IFSes screws up buffers larger than 64KB. 263 * There is an alternative hack below, btw. We'll leave both in for now. 260 264 */ 261 265 bool fFirst = false; 262 266 if (!pThis->pabBuffer) 263 267 { 268 pThis->cbBufferAlloc = _256K; 269 if (true) /** @todo skip for known local devices, like the boot device? */ 270 { 271 IO_STATUS_BLOCK Ios2 = RTNT_IO_STATUS_BLOCK_INITIALIZER; 272 FILE_FS_DEVICE_INFORMATION Info = { 0, 0 }; 273 NTSTATUS rcNt2 = NtQueryVolumeInformationFile(pThis->hDir, &Ios2, &Info, sizeof(Info), FileFsDeviceInformation); 274 if ( !NT_SUCCESS(rcNt2) 275 || (Info.Characteristics & FILE_REMOTE_DEVICE) 276 || Info.DeviceType == FILE_DEVICE_NETWORK 277 || Info.DeviceType == FILE_DEVICE_NETWORK_FILE_SYSTEM 278 || Info.DeviceType == FILE_DEVICE_NETWORK_REDIRECTOR 279 || Info.DeviceType == FILE_DEVICE_SMB) 280 pThis->cbBufferAlloc = _64K; 281 } 282 264 283 fFirst = false; 265 pThis->cbBufferAlloc = _256K;266 284 pThis->pabBuffer = (uint8_t *)RTMemAlloc(pThis->cbBufferAlloc); 267 285 if (!pThis->pabBuffer) … … 348 366 else 349 367 { 368 bool fRestartScan = false; 350 369 for (unsigned iRetry = 0; iRetry < 2; iRetry++) 351 370 { … … 358 377 if ( rcNt == STATUS_INVALID_PARAMETER 359 378 || rcNt == STATUS_INVALID_PARAMETER_7 379 || rcNt == STATUS_INVALID_NETWORK_RESPONSE 360 380 || iRetry != 0) 361 cbBuffer = RT_MIN(cbBuffer / 2, 0x10000); 381 { 382 cbBuffer = RT_MIN(cbBuffer / 2, _64K); 383 fRestartScan = true; 384 } 362 385 363 386 for (;;) … … 373 396 RTDIR_NT_SINGLE_RECORD /*ReturnSingleEntry */, 374 397 pThis->pNtFilterStr, 375 FALSE /*RestartScan */);398 fRestartScan); 376 399 if ( NT_SUCCESS(rcNt) 377 400 || cbBuffer == pThis->cbBufferAlloc
Note:
See TracChangeset
for help on using the changeset viewer.