VirtualBox

Changeset 38193 in vbox for trunk/src/VBox/Additions/WINNT


Ignore:
Timestamp:
Jul 27, 2011 9:34:56 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
73157
Message:

Windows guest shared folders: implement SetFileAllocationInformation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/SharedFolders/redirector/sys/fileinfo.c

    r33994 r38193  
    15891589    {
    15901590        PFILE_ALLOCATION_INFORMATION pAllocInfo = (PFILE_ALLOCATION_INFORMATION)pBuffer;
    1591 
    1592         Log(("VBOXSF: VBoxMRxSetFileInformation: FileAllocationInformation: AllocSize = %RX64\n", pAllocInfo->AllocationSize.QuadPart));
    1593 
    1594         /* Pretend success */
    1595         Status = STATUS_SUCCESS;
     1591        LARGE_INTEGER NewAllocationSize;
     1592
     1593        Log(("VBOXSF: VBoxMRxSetFileInformation: FileAllocationInformation: new AllocSize = %RX64, FileSize = %RX64\n",
     1594             pAllocInfo->AllocationSize.QuadPart, capFcb->Header.FileSize.QuadPart));
     1595
     1596        /* Check if the new allocation size changes the file size. */
     1597        if (pAllocInfo->AllocationSize.QuadPart > capFcb->Header.FileSize.QuadPart)
     1598        {
     1599            /* Ignore this request and return success. Shared folders do not distinguish between
     1600             * AllocationSize and FileSize.
     1601             */
     1602            Status = STATUS_SUCCESS;
     1603        }
     1604        else
     1605        {
     1606            /* Treat the request as a EndOfFile update. */
     1607            Status = VBoxMRxSetEndOfFile(RxContext, &pAllocInfo->AllocationSize, &NewAllocationSize);
     1608        }
     1609
    15961610        break;
    15971611    }
     
    16021616        LARGE_INTEGER NewAllocationSize;
    16031617
    1604         Log(("VBOXSF: VBoxMRxSetFileInformation: FileEndOfFileInformation: FileSize = %RX64\n", capFcb->Header.AllocationSize.QuadPart));
    1605         if (pEndOfFileInfo->EndOfFile.QuadPart > capFcb->Header.AllocationSize.QuadPart)
     1618        Log(("VBOXSF: VBoxMRxSetFileInformation: FileEndOfFileInformation: new EndOfFile %RX64, FileSize = %RX64\n",
     1619             pEndOfFileInfo->EndOfFile.QuadPart, capFcb->Header.FileSize.QuadPart));
     1620        if (pEndOfFileInfo->EndOfFile.QuadPart > capFcb->Header.FileSize.QuadPart)
    16061621        {
    16071622            Status = VBoxMRxExtendFile(RxContext, &pEndOfFileInfo->EndOfFile, &NewAllocationSize);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette