Changeset 78363 in vbox for trunk/src/VBox
- Timestamp:
- May 1, 2019 6:56:33 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/file.cpp
r78355 r78363 249 249 #ifdef LOG_ENABLED 250 250 BOOLEAN AsyncIo = BooleanFlagOn(RxContext->Flags, RX_CONTEXT_FLAG_ASYNC_OPERATION); 251 LONGLONG FileSize; 252 RxGetFileSizeWithLock((PFCB)capFcb, &FileSize); 251 253 #endif 252 LONGLONG FileSize;253 254 RxGetFileSizeWithLock((PFCB)capFcb, &FileSize);255 254 256 255 Log(("VBOXSF: vbsfReadInternal: AsyncIo = %d, Fcb->FileSize = 0x%RX64\n", … … 261 260 ByteCount, ByteOffset, FileSize)); 262 261 263 /** @todo r=bird: This check is incorrect as we must let the host do these 264 * checks with up-to-date end-of-file data. What we've got cached here is 265 * potentially out of date. (This code is here because someone saw it in some 266 * sample, I suspect and didn't quite understand what it was all about. The 267 * thing is that when FCB_STATE_READCACHING_ENABLED is set, the caller 268 * already checks and the sample probably wanted to cover its bases. We, 269 * don't want to do that as already explained earlier.) */ 270 #ifdef FCB_STATE_READCACHING_ENABLED /* Correct spelling for Vista 6001 SDK. */ 271 if (!FlagOn(capFcb->FcbState, FCB_STATE_READCACHING_ENABLED)) 272 #else 273 if (!FlagOn(capFcb->FcbState, FCB_STATE_READCACHEING_ENABLED)) 274 #endif 275 { 276 if (ByteOffset >= FileSize) 277 { 278 Log(("VBOXSF: vbsfReadInternal: EOF\n")); 279 return STATUS_END_OF_FILE; 280 } 281 282 if (ByteCount > FileSize - ByteOffset) 283 ByteCount = (ULONG)(FileSize - ByteOffset); 284 } 285 286 /** @todo read 0 bytes == always success? */ 287 if ( !BufferMdl 288 || ByteCount == 0) 289 { 290 AssertFailed(); 291 return STATUS_INVALID_PARAMETER; 292 } 262 AssertReturn(BufferMdl, STATUS_INVALID_PARAMETER); 263 Assert(ByteCount > 0); /* ASSUME this is taken care of elsewhere already. */ 293 264 294 265 ctx.pClient = &g_SfClient;
Note:
See TracChangeset
for help on using the changeset viewer.