- Timestamp:
- Apr 26, 2019 10:08:31 PM (6 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/SharedFolders/driver
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/file.cpp
r78329 r78338 555 555 556 556 NTSTATUS vbsfNtSetEndOfFile(IN OUT struct _RX_CONTEXT * RxContext, 557 IN OUT PLARGE_INTEGER pNewFileSize, 558 OUT PLARGE_INTEGER pNewAllocationSize) 557 IN uint64_t cbNewFileSize) 559 558 { 560 559 NTSTATUS Status = STATUS_SUCCESS; … … 570 569 int vrc; 571 570 572 Log(("VBOXSF: vbsfNtSetEndOfFile: New size = %RX64 (%p), pNewAllocationSize = %p\n",573 pNewFileSize->QuadPart, pNewFileSize, pNewAllocationSize));571 Log(("VBOXSF: vbsfNtSetEndOfFile: New size = %RX64\n", 572 cbNewFileSize)); 574 573 575 574 Assert(pVBoxFobx && pNetRootExtension); … … 584 583 585 584 RtlZeroMemory(pObjInfo, cbBuffer); 586 pObjInfo->cbObject = pNewFileSize->QuadPart;585 pObjInfo->cbObject = cbNewFileSize; 587 586 588 587 vrc = VbglR0SfFsInfo(&g_SfClient, &pNetRootExtension->map, pVBoxFobx->hFile, … … 597 596 pObjInfo->cbAllocated)); 598 597 599 /* Return new allocation size */ 600 pNewAllocationSize->QuadPart = pObjInfo->cbAllocated; 598 /** @todo update the file stats! */ 601 599 } 602 600 -
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/info.cpp
r78326 r78338 962 962 963 963 964 /** 965 * Handle NtQueryInformationFile and similar requests. 966 */ 964 967 NTSTATUS VBoxMRxQueryFileInfo(IN PRX_CONTEXT RxContext) 965 968 { … … 1270 1273 } 1271 1274 1275 static NTSTATUS vbsfNtSetBasicInfo(PMRX_VBOX_FOBX pVBoxFobx, PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension, 1276 PFILE_BASIC_INFORMATION pBasicInfo) 1277 { 1278 PSHFLFSOBJINFO pSHFLFileInfo; 1279 uint8_t *pHGCMBuffer = NULL; 1280 uint32_t cbBuffer = 0; 1281 uint32_t fModified; 1282 int vrc; 1283 1284 Log(("VBOXSF: MRxSetFileInfo: FileBasicInformation: CreationTime %RX64\n", pBasicInfo->CreationTime.QuadPart)); 1285 Log(("VBOXSF: MRxSetFileInfo: FileBasicInformation: LastAccessTime %RX64\n", pBasicInfo->LastAccessTime.QuadPart)); 1286 Log(("VBOXSF: MRxSetFileInfo: FileBasicInformation: LastWriteTime %RX64\n", pBasicInfo->LastWriteTime.QuadPart)); 1287 Log(("VBOXSF: MRxSetFileInfo: FileBasicInformation: ChangeTime %RX64\n", pBasicInfo->ChangeTime.QuadPart)); 1288 Log(("VBOXSF: MRxSetFileInfo: FileBasicInformation: FileAttributes %RX32\n", pBasicInfo->FileAttributes)); 1289 1290 /* 1291 * Note! If a timestamp value is non-zero, the client disables implicit updating of 1292 * that timestamp via this handle when reading, writing and changing attributes. 1293 * The special -1 value is used to just disable implicit updating without 1294 * modifying the timestamp. While the value is allowed for the CreationTime 1295 * field, it will be treated as zero. 1296 * 1297 * More clues can be found here: 1298 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/16023025-8a78-492f-8b96-c873b042ac50 1299 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/d4bc551b-7aaf-4b4f-ba0e-3a75e7c528f0#Appendix_A_86 1300 */ 1301 1302 /** @todo r=bird: The attempt at implementing the disable-timestamp-update 1303 * behaviour here needs a little adjusting. I'll get to that later. 1304 * 1305 * Reminders: 1306 * 1307 * 1. Drop VBOX_FOBX_F_INFO_CREATION_TIME. 1308 * 1309 * 2. Drop unused VBOX_FOBX_F_INFO_ATTRIBUTES. 1310 * 1311 * 3. Only act on VBOX_FOBX_F_INFO_CHANGE_TIME if modified attributes or grown 1312 * the file (?) so we don't cancel out updates by other parties (like the 1313 * host). 1314 * 1315 * 4. Only act on VBOX_FOBX_F_INFO_LASTWRITE_TIME if we've written to the file. 1316 * 1317 * 5. Only act on VBOX_FOBX_F_INFO_LASTACCESS_TIME if we've read from the file 1318 * or done whatever else might modify the access time. 1319 * 1320 * 6. Don't bother calling the host if there are only zeros and -1 values. 1321 * 1322 * 7. Client application should probably be allowed to modify the timestamps 1323 * explicitly using this API after disabling updating, given the wording of 1324 * the footnote referenced above. 1325 * 1326 * 8. Extend the host interface to let the host handle this crap instead as it 1327 * can do a better job, like on windows it's done implicitly if we let -1 1328 * pass thru IPRT. 1329 * 1330 * One worry here is that we hide timestamp updates made by the host or other 1331 * guest side processes. This could account for some of the issues we've been 1332 * having with the guest not noticing host side changes. 1333 */ 1334 1335 if (pBasicInfo->CreationTime.QuadPart == -1) 1336 { 1337 pVBoxFobx->fKeepCreationTime = TRUE; 1338 pVBoxFobx->SetFileInfoOnCloseFlags |= VBOX_FOBX_F_INFO_CREATION_TIME; 1339 } 1340 if (pBasicInfo->LastAccessTime.QuadPart == -1) 1341 { 1342 pVBoxFobx->fKeepLastAccessTime = TRUE; 1343 pVBoxFobx->SetFileInfoOnCloseFlags |= VBOX_FOBX_F_INFO_LASTACCESS_TIME; 1344 } 1345 if (pBasicInfo->LastWriteTime.QuadPart == -1) 1346 { 1347 pVBoxFobx->fKeepLastWriteTime = TRUE; 1348 pVBoxFobx->SetFileInfoOnCloseFlags |= VBOX_FOBX_F_INFO_LASTWRITE_TIME; 1349 } 1350 if (pBasicInfo->ChangeTime.QuadPart == -1) 1351 { 1352 pVBoxFobx->fKeepChangeTime = TRUE; 1353 pVBoxFobx->SetFileInfoOnCloseFlags |= VBOX_FOBX_F_INFO_CHANGE_TIME; 1354 } 1355 1356 cbBuffer = sizeof(SHFLFSOBJINFO); 1357 pHGCMBuffer = (uint8_t *)vbsfNtAllocNonPagedMem(cbBuffer); 1358 AssertReturn(pHGCMBuffer, STATUS_INSUFFICIENT_RESOURCES); 1359 RtlZeroMemory(pHGCMBuffer, cbBuffer); 1360 pSHFLFileInfo = (PSHFLFSOBJINFO)pHGCMBuffer; 1361 1362 Log(("VBOXSF: MrxSetFileInfo: FileBasicInformation: keeps %d %d %d %d\n", 1363 pVBoxFobx->fKeepCreationTime, pVBoxFobx->fKeepLastAccessTime, pVBoxFobx->fKeepLastWriteTime, pVBoxFobx->fKeepChangeTime)); 1364 1365 /* The properties, that need to be changed, are set to something other than zero */ 1366 fModified = 0; 1367 if (pBasicInfo->CreationTime.QuadPart && !pVBoxFobx->fKeepCreationTime) 1368 { 1369 RTTimeSpecSetNtTime(&pSHFLFileInfo->BirthTime, pBasicInfo->CreationTime.QuadPart); 1370 fModified |= VBOX_FOBX_F_INFO_CREATION_TIME; 1371 } 1372 /** @todo FsPerf need to check what is supposed to happen if modified 1373 * against after -1 is specified. */ 1374 if (pBasicInfo->LastAccessTime.QuadPart && !pVBoxFobx->fKeepLastAccessTime) 1375 { 1376 RTTimeSpecSetNtTime(&pSHFLFileInfo->AccessTime, pBasicInfo->LastAccessTime.QuadPart); 1377 fModified |= VBOX_FOBX_F_INFO_LASTACCESS_TIME; 1378 } 1379 if (pBasicInfo->LastWriteTime.QuadPart && !pVBoxFobx->fKeepLastWriteTime) 1380 { 1381 RTTimeSpecSetNtTime(&pSHFLFileInfo->ModificationTime, pBasicInfo->LastWriteTime.QuadPart); 1382 fModified |= VBOX_FOBX_F_INFO_LASTWRITE_TIME; 1383 } 1384 if (pBasicInfo->ChangeTime.QuadPart && !pVBoxFobx->fKeepChangeTime) 1385 { 1386 RTTimeSpecSetNtTime(&pSHFLFileInfo->ChangeTime, pBasicInfo->ChangeTime.QuadPart); 1387 fModified |= VBOX_FOBX_F_INFO_CHANGE_TIME; 1388 } 1389 if (pBasicInfo->FileAttributes) 1390 pSHFLFileInfo->Attr.fMode = NTToVBoxFileAttributes(pBasicInfo->FileAttributes); 1391 1392 Assert(pVBoxFobx && pNetRootExtension); 1393 vrc = VbglR0SfFsInfo(&g_SfClient, &pNetRootExtension->map, pVBoxFobx->hFile, 1394 SHFL_INFO_SET | SHFL_INFO_FILE, &cbBuffer, (PSHFLDIRINFO)pSHFLFileInfo); 1395 1396 NTSTATUS Status; 1397 if (RT_SUCCESS(vrc)) 1398 { 1399 vbsfNtCopyInfo(pVBoxFobx, pSHFLFileInfo, fModified); 1400 pVBoxFobx->SetFileInfoOnCloseFlags |= fModified; 1401 Status = STATUS_SUCCESS; 1402 } 1403 else 1404 Status = vbsfNtVBoxStatusToNt(vrc); 1405 vbsfNtFreeNonPagedMem(pHGCMBuffer); 1406 return Status; 1407 } 1408 1272 1409 NTSTATUS VBoxMRxSetFileInfo(IN PRX_CONTEXT RxContext) 1273 1410 { 1274 NTSTATUS Status = STATUS_SUCCESS;1275 1276 1411 RxCaptureFcb; 1277 1412 RxCaptureFobx; 1278 1279 1413 PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot); 1280 PMRX_VBOX_FOBX pVBoxFobx = VBoxMRxGetFileObjectExtension(capFobx); 1281 1282 FILE_INFORMATION_CLASS FunctionalityRequested = RxContext->Info.FileInformationClass; 1283 PVOID pInfoBuffer = (PVOID)RxContext->Info.Buffer; 1284 1285 int vrc; 1286 1287 uint8_t *pHGCMBuffer = NULL; 1288 uint32_t cbBuffer = 0; 1289 1290 Log(("VBOXSF: MrxSetFileInfo: pInfoBuffer %p\n", 1291 pInfoBuffer)); 1292 1293 switch (FunctionalityRequested) 1414 PMRX_VBOX_FOBX pVBoxFobx = VBoxMRxGetFileObjectExtension(capFobx); 1415 NTSTATUS Status = STATUS_SUCCESS; 1416 1417 Log(("VBOXSF: MrxSetFileInfo: Buffer=%p Length=%#x\n", 1418 RxContext->Info.Buffer, RxContext->Info.Length)); 1419 1420 switch (RxContext->Info.FileInformationClass) 1294 1421 { 1295 1422 case FileBasicInformation: 1296 1423 { 1297 PFILE_BASIC_INFORMATION pInfo = (PFILE_BASIC_INFORMATION)pInfoBuffer; 1298 PSHFLFSOBJINFO pSHFLFileInfo; 1299 uint32_t fModified; 1300 1301 Log(("VBOXSF: MRxSetFileInfo: FileBasicInformation: CreationTime %RX64\n", pInfo->CreationTime.QuadPart)); 1302 Log(("VBOXSF: MRxSetFileInfo: FileBasicInformation: LastAccessTime %RX64\n", pInfo->LastAccessTime.QuadPart)); 1303 Log(("VBOXSF: MRxSetFileInfo: FileBasicInformation: LastWriteTime %RX64\n", pInfo->LastWriteTime.QuadPart)); 1304 Log(("VBOXSF: MRxSetFileInfo: FileBasicInformation: ChangeTime %RX64\n", pInfo->ChangeTime.QuadPart)); 1305 Log(("VBOXSF: MRxSetFileInfo: FileBasicInformation: FileAttributes %RX32\n", pInfo->FileAttributes)); 1306 1307 /* 1308 * Note! If a timestamp value is non-zero, the client disables implicit updating of 1309 * that timestamp via this handle when reading, writing and changing attributes. 1310 * The special -1 value is used to just disable implicit updating without 1311 * modifying the timestamp. While the value is allowed for the CreationTime 1312 * field, it will be treated as zero. 1313 * 1314 * More clues can be found here: 1315 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/16023025-8a78-492f-8b96-c873b042ac50 1316 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/d4bc551b-7aaf-4b4f-ba0e-3a75e7c528f0#Appendix_A_86 1317 */ 1318 1319 /** @todo r=bird: The attempt at implementing the disable-timestamp-update 1320 * behaviour here needs a little adjusting. I'll get to that later. 1321 * 1322 * Reminders: 1323 * 1324 * 1. Drop VBOX_FOBX_F_INFO_CREATION_TIME. 1325 * 1326 * 2. Drop unused VBOX_FOBX_F_INFO_ATTRIBUTES. 1327 * 1328 * 3. Only act on VBOX_FOBX_F_INFO_CHANGE_TIME if modified attributes or grown 1329 * the file (?) so we don't cancel out updates by other parties (like the 1330 * host). 1331 * 1332 * 4. Only act on VBOX_FOBX_F_INFO_LASTWRITE_TIME if we've written to the file. 1333 * 1334 * 5. Only act on VBOX_FOBX_F_INFO_LASTACCESS_TIME if we've read from the file 1335 * or done whatever else might modify the access time. 1336 * 1337 * 6. Don't bother calling the host if there are only zeros and -1 values. 1338 * 1339 * 7. Client application should probably be allowed to modify the timestamps 1340 * explicitly using this API after disabling updating, given the wording of 1341 * the footnote referenced above. 1342 * 1343 * 8. Extend the host interface to let the host handle this crap instead as it 1344 * can do a better job, like on windows it's done implicitly if we let -1 1345 * pass thru IPRT. 1346 * 1347 * One worry here is that we hide timestamp updates made by the host or other 1348 * guest side processes. This could account for some of the issues we've been 1349 * having with the guest not noticing host side changes. 1350 */ 1351 1352 if (pInfo->CreationTime.QuadPart == -1) 1353 { 1354 pVBoxFobx->fKeepCreationTime = TRUE; 1355 pVBoxFobx->SetFileInfoOnCloseFlags |= VBOX_FOBX_F_INFO_CREATION_TIME; 1356 } 1357 if (pInfo->LastAccessTime.QuadPart == -1) 1358 { 1359 pVBoxFobx->fKeepLastAccessTime = TRUE; 1360 pVBoxFobx->SetFileInfoOnCloseFlags |= VBOX_FOBX_F_INFO_LASTACCESS_TIME; 1361 } 1362 if (pInfo->LastWriteTime.QuadPart == -1) 1363 { 1364 pVBoxFobx->fKeepLastWriteTime = TRUE; 1365 pVBoxFobx->SetFileInfoOnCloseFlags |= VBOX_FOBX_F_INFO_LASTWRITE_TIME; 1366 } 1367 if (pInfo->ChangeTime.QuadPart == -1) 1368 { 1369 pVBoxFobx->fKeepChangeTime = TRUE; 1370 pVBoxFobx->SetFileInfoOnCloseFlags |= VBOX_FOBX_F_INFO_CHANGE_TIME; 1371 } 1372 1373 cbBuffer = sizeof(SHFLFSOBJINFO); 1374 pHGCMBuffer = (uint8_t *)vbsfNtAllocNonPagedMem(cbBuffer); 1375 AssertReturn(pHGCMBuffer, STATUS_INSUFFICIENT_RESOURCES); 1376 RtlZeroMemory(pHGCMBuffer, cbBuffer); 1377 pSHFLFileInfo = (PSHFLFSOBJINFO)pHGCMBuffer; 1378 1379 Log(("VBOXSF: MrxSetFileInfo: FileBasicInformation: keeps %d %d %d %d\n", 1380 pVBoxFobx->fKeepCreationTime, pVBoxFobx->fKeepLastAccessTime, pVBoxFobx->fKeepLastWriteTime, pVBoxFobx->fKeepChangeTime)); 1381 1382 /* The properties, that need to be changed, are set to something other than zero */ 1383 fModified = 0; 1384 if (pInfo->CreationTime.QuadPart && !pVBoxFobx->fKeepCreationTime) 1385 { 1386 RTTimeSpecSetNtTime(&pSHFLFileInfo->BirthTime, pInfo->CreationTime.QuadPart); 1387 fModified |= VBOX_FOBX_F_INFO_CREATION_TIME; 1388 } 1389 /** @todo FsPerf need to check what is supposed to happen if modified 1390 * against after -1 is specified. */ 1391 if (pInfo->LastAccessTime.QuadPart && !pVBoxFobx->fKeepLastAccessTime) 1392 { 1393 RTTimeSpecSetNtTime(&pSHFLFileInfo->AccessTime, pInfo->LastAccessTime.QuadPart); 1394 fModified |= VBOX_FOBX_F_INFO_LASTACCESS_TIME; 1395 } 1396 if (pInfo->LastWriteTime.QuadPart && !pVBoxFobx->fKeepLastWriteTime) 1397 { 1398 RTTimeSpecSetNtTime(&pSHFLFileInfo->ModificationTime, pInfo->LastWriteTime.QuadPart); 1399 fModified |= VBOX_FOBX_F_INFO_LASTWRITE_TIME; 1400 } 1401 if (pInfo->ChangeTime.QuadPart && !pVBoxFobx->fKeepChangeTime) 1402 { 1403 RTTimeSpecSetNtTime(&pSHFLFileInfo->ChangeTime, pInfo->ChangeTime.QuadPart); 1404 fModified |= VBOX_FOBX_F_INFO_CHANGE_TIME; 1405 } 1406 if (pInfo->FileAttributes) 1407 pSHFLFileInfo->Attr.fMode = NTToVBoxFileAttributes(pInfo->FileAttributes); 1408 1409 Assert(pVBoxFobx && pNetRootExtension); 1410 vrc = VbglR0SfFsInfo(&g_SfClient, &pNetRootExtension->map, pVBoxFobx->hFile, 1411 SHFL_INFO_SET | SHFL_INFO_FILE, &cbBuffer, (PSHFLDIRINFO)pSHFLFileInfo); 1412 1413 if (RT_SUCCESS(vrc)) 1414 { 1415 vbsfNtCopyInfo(pVBoxFobx, pSHFLFileInfo, fModified); 1416 pVBoxFobx->SetFileInfoOnCloseFlags |= fModified; 1417 } 1418 else 1419 { 1420 Status = vbsfNtVBoxStatusToNt(vrc); 1421 goto end; 1422 } 1424 Assert(RxContext->Info.Length >= sizeof(FILE_BASIC_INFORMATION)); 1425 Status = vbsfNtSetBasicInfo(pVBoxFobx, pNetRootExtension, (PFILE_BASIC_INFORMATION)RxContext->Info.Buffer); 1423 1426 break; 1424 1427 } … … 1426 1429 case FileDispositionInformation: 1427 1430 { 1428 PFILE_DISPOSITION_INFORMATION pInfo = (PFILE_DISPOSITION_INFORMATION)pInfoBuffer; 1429 1431 PFILE_DISPOSITION_INFORMATION pInfo = (PFILE_DISPOSITION_INFORMATION)RxContext->Info.Buffer; 1430 1432 Log(("VBOXSF: MrxSetFileInfo: FileDispositionInformation: Delete = %d\n", 1431 1433 pInfo->DeleteFile)); … … 1438 1440 } 1439 1441 1440 case FilePositionInformation: 1441 { 1442 #ifdef LOG_ENABLED 1443 PFILE_POSITION_INFORMATION pInfo = (PFILE_POSITION_INFORMATION)pInfoBuffer; 1444 Log(("VBOXSF: MrxSetFileInfo: FilePositionInformation: CurrentByteOffset = 0x%RX64. Unsupported!\n", 1445 pInfo->CurrentByteOffset.QuadPart)); 1446 #endif 1447 1448 Status = STATUS_INVALID_PARAMETER; 1449 break; 1450 } 1451 1442 /* 1443 * Change the allocation size, leaving the EOF alone unless the file shrinks. 1444 * 1445 * There is no shared folder operation for this, so we only need to care 1446 * about adjusting EOF if the file shrinks. 1447 * 1448 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/d4bc551b-7aaf-4b4f-ba0e-3a75e7c528f0#Appendix_A_83 1449 */ 1452 1450 case FileAllocationInformation: 1453 1451 { 1454 PFILE_ALLOCATION_INFORMATION pInfo = (PFILE_ALLOCATION_INFORMATION)pInfoBuffer; 1455 1452 PFILE_ALLOCATION_INFORMATION pInfo = (PFILE_ALLOCATION_INFORMATION)RxContext->Info.Buffer; 1456 1453 Log(("VBOXSF: MrxSetFileInfo: FileAllocationInformation: new AllocSize = 0x%RX64, FileSize = 0x%RX64\n", 1457 1454 pInfo->AllocationSize.QuadPart, capFcb->Header.FileSize.QuadPart)); 1458 1455 1459 /* Check if the new allocation size changes the file size. */ 1460 if (pInfo->AllocationSize.QuadPart > capFcb->Header.FileSize.QuadPart) 1461 { 1462 /* Ignore this request and return success. Shared folders do not distinguish between 1463 * AllocationSize and FileSize. 1464 */ 1456 if (pInfo->AllocationSize.QuadPart >= capFcb->Header.FileSize.QuadPart) 1465 1457 Status = STATUS_SUCCESS; 1466 }1467 1458 else 1468 1459 { 1469 /* Treat the request as a EndOfFile update. */ 1470 LARGE_INTEGER NewAllocationSize; 1471 Status = vbsfNtSetEndOfFile(RxContext, &pInfo->AllocationSize, &NewAllocationSize); 1472 } 1473 1460 /** @todo get up to date EOF from host? We may risk accidentally growing the 1461 * file here if the host (or someone else) truncated it. */ 1462 Status = vbsfNtSetEndOfFile(RxContext, pInfo->AllocationSize.QuadPart); 1463 } 1474 1464 break; 1475 1465 } … … 1477 1467 case FileEndOfFileInformation: 1478 1468 { 1479 PFILE_END_OF_FILE_INFORMATION pInfo = (PFILE_END_OF_FILE_INFORMATION)pInfoBuffer; 1480 LARGE_INTEGER NewAllocationSize; 1481 1469 PFILE_END_OF_FILE_INFORMATION pInfo = (PFILE_END_OF_FILE_INFORMATION)RxContext->Info.Buffer; 1482 1470 Log(("VBOXSF: MrxSetFileInfo: FileEndOfFileInformation: new EndOfFile 0x%RX64, FileSize = 0x%RX64\n", 1483 1471 pInfo->EndOfFile.QuadPart, capFcb->Header.FileSize.QuadPart)); 1484 1472 1485 Status = vbsfNtSetEndOfFile(RxContext, &pInfo->EndOfFile, &NewAllocationSize); 1486 1487 Log(("VBOXSF: MrxSetFileInfo: FileEndOfFileInformation: AllocSize = 0x%RX64, Status 0x%08X\n", 1488 NewAllocationSize.QuadPart, Status)); 1489 1473 Status = vbsfNtSetEndOfFile(RxContext, pInfo->EndOfFile.QuadPart); 1474 1475 Log(("VBOXSF: MrxSetFileInfo: FileEndOfFileInformation: Status 0x%08X\n", 1476 Status)); 1490 1477 break; 1491 1478 } … … 1494 1481 { 1495 1482 #ifdef LOG_ENABLED 1496 PFILE_LINK_INFORMATION pInfo = (PFILE_LINK_INFORMATION ) pInfoBuffer;1483 PFILE_LINK_INFORMATION pInfo = (PFILE_LINK_INFORMATION )RxContext->Info.Buffer; 1497 1484 Log(("VBOXSF: MrxSetFileInfo: FileLinkInformation: ReplaceIfExists = %d, RootDirectory = 0x%x = [%.*ls]. Not implemented!\n", 1498 1485 pInfo->ReplaceIfExists, pInfo->RootDirectory, pInfo->FileNameLength / sizeof(WCHAR), pInfo->FileName)); … … 1506 1493 { 1507 1494 #ifdef LOG_ENABLED 1508 PFILE_RENAME_INFORMATION pInfo = (PFILE_RENAME_INFORMATION) pInfoBuffer;1495 PFILE_RENAME_INFORMATION pInfo = (PFILE_RENAME_INFORMATION)RxContext->Info.Buffer; 1509 1496 Log(("VBOXSF: MrxSetFileInfo: FileRenameInformation: ReplaceIfExists = %d, RootDirectory = 0x%x = [%.*ls]\n", 1510 1497 pInfo->ReplaceIfExists, pInfo->RootDirectory, pInfo->FileNameLength / sizeof(WCHAR), pInfo->FileName)); 1511 1498 #endif 1512 1499 1513 Status = vbsfNtRename(RxContext, FileRenameInformation, pInfoBuffer, RxContext->Info.Length); 1514 break; 1515 } 1500 Status = vbsfNtRename(RxContext, FileRenameInformation, RxContext->Info.Buffer, RxContext->Info.Length); 1501 break; 1502 } 1503 1504 /* The file position is handled by the RDBSS library (RxSetPositionInfo) 1505 and we should never see this request. */ 1506 case FilePositionInformation: 1507 AssertMsgFailed(("VBOXSF: MrxSetFileInfo: FilePositionInformation: CurrentByteOffset = 0x%RX64. Unsupported!\n", 1508 ((PFILE_POSITION_INFORMATION)RxContext->Info.Buffer)->CurrentByteOffset.QuadPart)); 1509 Status = STATUS_INVALID_PARAMETER; 1510 break; 1516 1511 1517 1512 default: 1518 Log(("VBOXSF: MrxSetFileInfo: Not supported F unctionalityRequested%d!\n",1519 FunctionalityRequested));1513 Log(("VBOXSF: MrxSetFileInfo: Not supported FileInformationClass: %d!\n", 1514 RxContext->Info.FileInformationClass)); 1520 1515 Status = STATUS_INVALID_PARAMETER; 1521 1516 break; 1522 1517 } 1523 1524 end:1525 if (pHGCMBuffer)1526 vbsfNtFreeNonPagedMem(pHGCMBuffer);1527 1518 1528 1519 Log(("VBOXSF: MrxSetFileInfo: Returned 0x%08X\n", Status)); -
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.h
r78330 r78338 221 221 222 222 NTSTATUS vbsfNtSetEndOfFile(IN OUT struct _RX_CONTEXT * RxContext, 223 IN OUT PLARGE_INTEGER pNewFileSize, 224 OUT PLARGE_INTEGER pNewAllocationSize); 223 IN uint64_t cbNewFileSize); 225 224 NTSTATUS vbsfNtRename(IN PRX_CONTEXT RxContext, 226 225 IN FILE_INFORMATION_CLASS FileInformationClass,
Note:
See TracChangeset
for help on using the changeset viewer.