VirtualBox

Changeset 77037 in vbox for trunk/include


Ignore:
Timestamp:
Jan 29, 2019 6:46:05 PM (6 years ago)
Author:
vboxsync
Message:

VBoxGuestLibSharedFoldersInline.h: Updates. bugref:9172

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxGuestLibSharedFoldersInline.h

    r76720 r77037  
    497497
    498498
    499 /** Request structure for vboxSfOs2HostReqRename.  */
     499/** Request structure for VbglR0SfHostReqRenameWithSrcContig and
     500 *  VbglR0SfHostReqRenameWithSrcBuf. */
    500501typedef struct VBOXSFRENAMEWITHSRCBUFREQ
    501502{
     
    507508} VBOXSFRENAMEWITHSRCBUFREQ;
    508509
     510
    509511/**
    510512 * SHFL_FN_REMOVE request.
    511513 */
    512 DECLINLINE(int) VbglR0SfHostReqRenameWithSrcBuf(SHFLROOT idRoot, VBOXSFRENAMEWITHSRCBUFREQ *pReq,
    513                                                 PSHFLSTRING pSrcStr, uint32_t fFlags)
     514DECLINLINE(int) VbglR0SfHostReqRenameWithSrcContig(SHFLROOT idRoot, VBOXSFRENAMEWITHSRCBUFREQ *pReq,
     515                                                   PSHFLSTRING pSrcStr, RTGCPHYS64 PhysSrcStr, uint32_t fFlags)
    514516{
    515517    uint32_t const cbReq = RT_UOFFSETOF(VBOXSFRENAMEWITHSRCBUFREQ, StrDstPath.String)
     
    528530                                                    - sizeof(VBGLIOCIDCHGCMFASTCALL);
    529531        pReq->PgLst.flags                           = VBOX_HGCM_F_PARM_DIRECTION_TO_HOST;
    530         pReq->PgLst.aPages[0]                       = VbglR0PhysHeapGetPhysAddr(pSrcStr);
    531         pReq->PgLst.offFirstPage                    = (uint16_t)(pReq->PgLst.aPages[0] & PAGE_OFFSET_MASK);
    532         pReq->PgLst.aPages[0]                      &= ~(RTGCPHYS)PAGE_OFFSET_MASK;
     532        pReq->PgLst.offFirstPage                    = ((uint16_t)PhysSrcStr) & (uint16_t)(PAGE_OFFSET_MASK);
     533        pReq->PgLst.aPages[0]                       = PhysSrcStr & ~(RTGCPHYS64)PAGE_OFFSET_MASK;
    533534        pReq->PgLst.cPages                          = 1;
    534535    }
     
    562563        vrc = pReq->Call.header.result;
    563564    return vrc;
     565}
     566
     567
     568/**
     569 * SHFL_FN_REMOVE request.
     570 */
     571DECLINLINE(int) VbglR0SfHostReqRenameWithSrcBuf(SHFLROOT idRoot, VBOXSFRENAMEWITHSRCBUFREQ *pReq,
     572                                                PSHFLSTRING pSrcStr, uint32_t fFlags)
     573{
     574    return VbglR0SfHostReqRenameWithSrcContig(idRoot, pReq, pSrcStr, VbglR0PhysHeapGetPhysAddr(pSrcStr), fFlags);
    564575}
    565576
     
    946957}
    947958
    948 /** Request structure for vboxSfOs2HostReqListDir. */
     959/** Request structure for VbglR0SfHostReqListDirContig2x() and
     960 *  VbglR0SfHostReqListDir(). */
    949961typedef struct VBOXSFLISTDIRREQ
    950962{
     
    958970/**
    959971 * SHFL_FN_LIST request with separate string buffer and buffers for entries,
    960  * both allocated on the physical heap.
    961  */
    962 DECLINLINE(int) VbglR0SfHostReqListDir(SHFLROOT idRoot, VBOXSFLISTDIRREQ *pReq, uint64_t hHostDir,
    963                                        PSHFLSTRING pFilter, uint32_t fFlags, PSHFLDIRINFO pBuffer, uint32_t cbBuffer)
     972 * both physically contiguous allocations.
     973 */
     974DECLINLINE(int) VbglR0SfHostReqListDirContig2x(SHFLROOT idRoot, VBOXSFLISTDIRREQ *pReq, uint64_t hHostDir,
     975                                               PSHFLSTRING pFilter, RTGCPHYS64 PhysFilter, uint32_t fFlags,
     976                                               PSHFLDIRINFO pBuffer, RTGCPHYS64 PhysBuffer, uint32_t cbBuffer)
    964977{
    965978    VBGLIOCIDCHGCMFASTCALL_INIT(&pReq->Hdr, VbglR0PhysHeapGetPhysAddr(pReq), &pReq->Call, g_SfClient.idClient,
     
    9871000        {
    9881001            pReq->Parms.pStrFilter.u.PageList.size  = SHFLSTRING_HEADER_SIZE + pFilter->u16Size;
    989             RTGCPHYS32 const GCPhys       = VbglR0PhysHeapGetPhysAddr(pFilter);
    990             uint32_t const   offFirstPage = GCPhys & PAGE_OFFSET_MASK;
     1002            uint32_t const offFirstPage = (uint32_t)PhysFilter & PAGE_OFFSET_MASK;
    9911003            pReq->StrPgLst.offFirstPage             = (uint16_t)offFirstPage;
    992             pReq->StrPgLst.aPages[0]                = GCPhys - offFirstPage;
     1004            pReq->StrPgLst.aPages[0]                = PhysFilter - offFirstPage;
    9931005        }
    9941006        else
     
    10041016        pReq->BufPgLst.flags                        = VBOX_HGCM_F_PARM_DIRECTION_FROM_HOST;
    10051017        pReq->BufPgLst.cPages                       = 1;
    1006         RTGCPHYS32 const GCPhys       = VbglR0PhysHeapGetPhysAddr(pBuffer);
    1007         uint32_t const   offFirstPage = GCPhys & PAGE_OFFSET_MASK;
     1018        uint32_t const offFirstPage = (uint32_t)PhysBuffer & PAGE_OFFSET_MASK;
    10081019        pReq->BufPgLst.offFirstPage                 = (uint16_t)offFirstPage;
    1009         pReq->BufPgLst.aPages[0]                    = GCPhys - offFirstPage;
     1020        pReq->BufPgLst.aPages[0]                    = PhysBuffer - offFirstPage;
    10101021    }
    10111022    else
     
    10321043}
    10331044
     1045/**
     1046 * SHFL_FN_LIST request with separate string buffer and buffers for entries,
     1047 * both allocated on the physical heap.
     1048 */
     1049DECLINLINE(int) VbglR0SfHostReqListDir(SHFLROOT idRoot, VBOXSFLISTDIRREQ *pReq, uint64_t hHostDir,
     1050                                       PSHFLSTRING pFilter, uint32_t fFlags, PSHFLDIRINFO pBuffer, uint32_t cbBuffer)
     1051{
     1052    return VbglR0SfHostReqListDirContig2x(idRoot,
     1053                                          pReq,
     1054                                          hHostDir,
     1055                                          pFilter,
     1056                                          pFilter ? VbglR0PhysHeapGetPhysAddr(pFilter) : NIL_RTGCPHYS64,
     1057                                          fFlags,
     1058                                          pBuffer,
     1059                                          VbglR0PhysHeapGetPhysAddr(pBuffer),
     1060                                          cbBuffer);
     1061}
     1062
    10341063/** @} */
    10351064
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