VirtualBox

Changeset 77054 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Jan 30, 2019 5:40:43 PM (6 years ago)
Author:
vboxsync
Message:

linux/vboxsf: Started converting the code to use the more efficient interfaces in VBoxGuestLibSharedFoldersInline.h. Some minor fixes and cleanups. bugref:9172

File:
1 edited

Legend:

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

    r77037 r77054  
    7272} VBOXSFMAPFOLDERWITHBUFREQ;
    7373
     74
    7475/**
    7576 * SHFL_FN_MAP_FOLDER request.
    7677 */
    77 DECLINLINE(int) VbglR0SfHostReqMapFolderWithBuf(VBOXSFMAPFOLDERWITHBUFREQ *pReq, PSHFLSTRING pStrName,
    78                                                 RTUTF16 wcDelimiter, bool fCaseSensitive)
     78DECLINLINE(int) VbglR0SfHostReqMapFolderWithContig(VBOXSFMAPFOLDERWITHBUFREQ *pReq, PSHFLSTRING pStrName, RTGCPHYS64 PhysStrName,
     79                                                   RTUTF16 wcDelimiter, bool fCaseSensitive)
    7980{
    8081    VBGLIOCIDCHGCMFASTCALL_INIT(&pReq->Hdr, VbglR0PhysHeapGetPhysAddr(pReq), &pReq->Call, g_SfClient.idClient,
     
    9697        pReq->Parms.pStrName.u.PageList.offset  = RT_UOFFSETOF(VBOXSFMAPFOLDERWITHBUFREQ, PgLst) - sizeof(VBGLIOCIDCHGCMFASTCALL);
    9798        pReq->PgLst.flags                       = VBOX_HGCM_F_PARM_DIRECTION_BOTH;
    98         pReq->PgLst.aPages[0]                   = VbglR0PhysHeapGetPhysAddr(pStrName);
    99         pReq->PgLst.offFirstPage                = (uint16_t)(pReq->PgLst.aPages[0] & PAGE_OFFSET_MASK);
    100         pReq->PgLst.aPages[0]                  &= ~(RTGCPHYS)PAGE_OFFSET_MASK;
     99        pReq->PgLst.offFirstPage                = (uint16_t)PhysStrName & (uint16_t)(PAGE_OFFSET_MASK);
     100        pReq->PgLst.aPages[0]                   = PhysStrName & ~(RTGCPHYS64)PAGE_OFFSET_MASK;
    101101        pReq->PgLst.cPages                      = 1;
    102102    }
     
    112112        vrc = pReq->Call.header.result;
    113113    return vrc;
     114}
     115
     116/**
     117 * SHFL_FN_MAP_FOLDER request.
     118 */
     119DECLINLINE(int) VbglR0SfHostReqMapFolderWithContigSimple(PSHFLSTRING pStrName, RTGCPHYS64 PhysStrName,
     120                                                         RTUTF16 wcDelimiter, bool fCaseSensitive, SHFLROOT *pidRoot)
     121{
     122    VBOXSFMAPFOLDERWITHBUFREQ *pReq = (VBOXSFMAPFOLDERWITHBUFREQ *)VbglR0PhysHeapAlloc(sizeof(*pReq));
     123    if (pReq)
     124    {
     125        int rc = VbglR0SfHostReqMapFolderWithContig(pReq, pStrName, PhysStrName, wcDelimiter, fCaseSensitive);
     126        *pidRoot = RT_SUCCESS(rc) ? pReq->Parms.id32Root.u.value32 : SHFL_ROOT_NIL;
     127        VbglR0PhysHeapFree(pReq);
     128        return rc;
     129    }
     130    *pidRoot = SHFL_ROOT_NIL;
     131    return VERR_NO_MEMORY;
     132}
     133
     134
     135/**
     136 * SHFL_FN_MAP_FOLDER request.
     137 */
     138DECLINLINE(int) VbglR0SfHostReqMapFolderWithBuf(VBOXSFMAPFOLDERWITHBUFREQ *pReq, PSHFLSTRING pStrName,
     139                                                RTUTF16 wcDelimiter, bool fCaseSensitive)
     140{
     141    return VbglR0SfHostReqMapFolderWithContig(pReq, pStrName, VbglR0PhysHeapGetPhysAddr(pStrName), wcDelimiter, fCaseSensitive);
    114142}
    115143
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