VirtualBox

Changeset 76716 in vbox for trunk/include


Ignore:
Timestamp:
Jan 8, 2019 11:36:02 PM (6 years ago)
Author:
vboxsync
Message:

os2/VBoxSF,Vbgl: Promoted the fast host request wrappers to generic status. bugref:9172

File:
1 copied

Legend:

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

    r76715 r76716  
    1 /** $Id$ */
     1/* $Id$ */
    22/** @file
    3  * VBoxSF - OS/2 Shared Folder IFS, Internal Header.
     3 * VBoxGuestLib - Shared Folders Host Request Helpers (ring-0).
    44 */
    55
    66/*
    7  * Copyright (c) 2007 knut st. osmundsen <[email protected]>
     7 * Copyright (C) 2006-2019 Oracle Corporation
    88 *
    99 * Permission is hereby granted, free of charge, to any person
     
    2222 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    2323 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    24  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
     24 * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    2525 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
    2626 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     
    2929 */
    3030
    31 #ifndef GA_INCLUDED_SRC_os2_VBoxSF_VBoxSFInternal_h
    32 #define GA_INCLUDED_SRC_os2_VBoxSF_VBoxSFInternal_h
     31#ifndef VBOX_INCLUDED_VBoxGuestLibSharedFoldersInline_h
     32#define VBOX_INCLUDED_VBoxGuestLibSharedFoldersInline_h
    3333#ifndef RT_WITHOUT_PRAGMA_ONCE
    3434# pragma once
    3535#endif
    3636
    37 
    38 #define INCL_BASE
    39 #define INCL_ERROR
    40 #define INCL_LONGLONG
    41 #define OS2EMX_PLAIN_CHAR
    42 #include <os2ddk/bsekee.h>
    43 #include <os2ddk/devhlp.h>
    44 #include <os2ddk/unikern.h>
    45 #include <os2ddk/fsd.h>
    46 #undef RT_MAX
    47 
    4837#include <iprt/types.h>
    4938#include <iprt/assert.h>
    50 #include <iprt/list.h>
     39#include <VBox/shflsvc.h>
     40#include <VBox/VBoxGuest.h>
     41#include <VBox/VBoxGuestLib.h>
    5142#include <VBox/VBoxGuestLibSharedFolders.h>
    52 #include <VBox/VBoxGuest.h>
    53 
    54 
    55 /** Allocation header used by RTMemAlloc.
    56  * This should be subtracted from round numbers. */
    57 #define ALLOC_HDR_SIZE  (0x10 + 4)
    58 
    59 
    60 /**
    61  * A shared folder
    62  */
    63 typedef struct VBOXSFFOLDER
    64 {
    65     /** For the shared folder list. */
    66     RTLISTNODE          ListEntry;
    67     /** Magic number (VBOXSFFOLDER_MAGIC). */
    68     uint32_t            u32Magic;
    69     /** Number of active references to this folder. */
    70     uint32_t volatile   cRefs;
    71     /** Number of open files referencing this folder.   */
    72     uint32_t volatile   cOpenFiles;
    73     /** Number of open searches referencing this folder.   */
    74     uint32_t volatile   cOpenSearches;
    75     /** Number of drives this is attached to. */
    76     uint8_t volatile    cDrives;
    77 
    78     /** The host folder handle. */
    79     SHFLROOT            idHostRoot;
    80 
    81     /** OS/2 volume handle. */
    82     USHORT              hVpb;
    83 
    84     /** The length of the name and tag, including zero terminators and such. */
    85     uint16_t            cbNameAndTag;
    86     /** The length of the folder name. */
    87     uint8_t             cchName;
    88     /** The shared folder name.  If there is a tag it follows as a second string. */
    89     char                szName[RT_FLEXIBLE_ARRAY];
    90 } VBOXSFFOLDER;
    91 /** Pointer to a shared folder. */
    92 typedef VBOXSFFOLDER *PVBOXSFFOLDER;
    93 /** Magic value for VBOXSFVP (Neal Town Stephenson). */
    94 #define VBOXSFFOLDER_MAGIC      UINT32_C(0x19591031)
    95 
    96 /** The shared mutex protecting folders list, drives and the connection. */
    97 extern MutexLock_t      g_MtxFolders;
    98 /** List of active folder (PVBOXSFFOLDER). */
    99 extern RTLISTANCHOR     g_FolderHead;
    100 
    101 
    102 /**
    103  * VBoxSF Volume Parameter Structure.
    104  *
    105  * @remarks Overlays the 36 byte VPFSD structure (fsd.h).
    106  * @note    No self pointer as the kernel may reallocate these.
    107  */
    108 typedef struct VBOXSFVP
    109 {
    110     /** Magic value (VBOXSFVP_MAGIC). */
    111     uint32_t         u32Magic;
    112     /** The folder. */
    113     PVBOXSFFOLDER    pFolder;
    114 } VBOXSFVP;
    115 AssertCompile(sizeof(VBOXSFVP) <= sizeof(VPFSD));
    116 /** Pointer to a VBOXSFVP struct. */
    117 typedef VBOXSFVP *PVBOXSFVP;
    118 /** Magic value for VBOXSFVP (Laurence van Cott Niven). */
    119 #define VBOXSFVP_MAGIC          UINT32_C(0x19380430)
    120 
    121 
    122 /**
    123  * VBoxSF Current Directory Structure.
    124  *
    125  * @remark  Overlays the 8 byte CDFSD structure (fsd.h).
    126  */
    127 typedef struct VBOXSFCD
    128 {
    129     uint32_t u32Dummy;
    130 } VBOXSFCD;
    131 AssertCompile(sizeof(VBOXSFCD) <= sizeof(CDFSD));
    132 /** Pointer to a VBOXSFCD struct. */
    133 typedef VBOXSFCD *PVBOXSFCD;
    134 
    135 
    136 /**
    137  * VBoxSF System File Structure.
    138  *
    139  * @remark  Overlays the 30 byte SFFSD structure (fsd.h).
    140  */
    141 typedef struct VBOXSFSYFI
    142 {
    143     /** Magic value (VBOXSFSYFI_MAGIC). */
    144     uint32_t            u32Magic;
    145     /** Self pointer for quick 16:16 to flat translation. */
    146     struct VBOXSFSYFI  *pSelf;
    147     /** The host file handle. */
    148     SHFLHANDLE          hHostFile;
    149     /** The shared folder (referenced). */
    150     PVBOXSFFOLDER       pFolder;
    151 } VBOXSFSYFI;
    152 AssertCompile(sizeof(VBOXSFSYFI) <= sizeof(SFFSD));
    153 /** Pointer to a VBOXSFSYFI struct. */
    154 typedef VBOXSFSYFI *PVBOXSFSYFI;
    155 /** Magic value for VBOXSFSYFI (Jon Ellis Meacham). */
    156 #define VBOXSFSYFI_MAGIC         UINT32_C(0x19690520)
    157 
    158 
    159 /** Request structure for vboxSfOs2HostReqListDir. */
    160 typedef struct VBOXSFLISTDIRREQ
    161 {
    162     VBGLIOCIDCHGCMFASTCALL  Hdr;
    163     VMMDevHGCMCall          Call;
    164     VBoxSFParmList          Parms;
    165     HGCMPageListInfo        StrPgLst;
    166     HGCMPageListInfo        BufPgLst;
    167 } VBOXSFLISTDIRREQ;
    168 
    169 /**
    170  * More file search data (on physical heap).
    171  */
    172 typedef struct VBOXSFFSBUF /**< @todo rename as is no longer buffer. */
    173 {
    174     /** The request (must be first). */
    175     VBOXSFLISTDIRREQ    Req;
    176     /** A magic number (VBOXSFFSBUF_MAGIC). */
    177     uint32_t            u32Magic;
    178     /** The filter string (full path), NULL if all files are request. */
    179     PSHFLSTRING         pFilter;
    180     /** Size of the buffer for directory entries. */
    181     uint32_t            cbBuf;
    182     /** Buffer for directory entries on the physical heap. */
    183     PSHFLDIRINFO        pBuf;
    184     /** Must have attributes (shifted down DOS attributes).  */
    185     uint8_t             fMustHaveAttribs;
    186     /** Non-matching attributes (shifted down DOS attributes).  */
    187     uint8_t             fExcludedAttribs;
    188     /** Set if FF_ATTR_LONG_FILENAME. */
    189     bool                fLongFilenames : 1;
    190     uint8_t             bPadding1;
    191     /** The local time offset to use for this search. */
    192     int16_t             cMinLocalTimeDelta;
    193     uint8_t             abPadding2[2];
    194     /** Number of valid bytes in the buffer. */
    195     uint32_t            cbValid;
    196     /** Number of entries left in the buffer.   */
    197     uint32_t            cEntriesLeft;
    198     /** The next entry. */
    199     PSHFLDIRINFO        pEntry;
    200     //uint32_t            uPadding3;
    201     /** Staging area for staging a full FILEFINDBUF4L (+ 32 safe bytes). */
    202     uint8_t             abStaging[RT_ALIGN_32(sizeof(FILEFINDBUF4L) + 32, 8)];
    203 } VBOXSFFSBUF;
    204 /** Pointer to a file search buffer. */
    205 typedef VBOXSFFSBUF *PVBOXSFFSBUF;
    206 /** Magic number for VBOXSFFSBUF (Robert Anson Heinlein). */
    207 #define VBOXSFFSBUF_MAGIC       UINT32_C(0x19070707)
    208 
    209 
    210 /**
    211  * VBoxSF File Search Structure.
    212  *
    213  * @remark  Overlays the 24 byte FSFSD structure (fsd.h).
    214  * @note    No self pointer as the kernel may reallocate these.
    215  */
    216 typedef struct VBOXSFFS
    217 {
    218     /** Magic value (VBOXSFFS_MAGIC). */
    219     uint32_t            u32Magic;
    220     /** The last file position position. */
    221     uint32_t            offLastFile;
    222     /** The host directory handle. */
    223     SHFLHANDLE          hHostDir;
    224     /** The shared folder (referenced). */
    225     PVBOXSFFOLDER       pFolder;
    226     /** Search data buffer. */
    227     PVBOXSFFSBUF        pBuf;
    228 } VBOXSFFS;
    229 AssertCompile(sizeof(VBOXSFFS) <= sizeof(FSFSD));
    230 /** Pointer to a VBOXSFFS struct. */
    231 typedef VBOXSFFS *PVBOXSFFS;
    232 /** Magic number for VBOXSFFS (Isaak Azimov). */
    233 #define VBOXSFFS_MAGIC          UINT32_C(0x19200102)
    234 
    235 
    236 extern VBGLSFCLIENT g_SfClient;
    237 extern uint32_t g_fHostFeatures;
    238 
    239 void        vboxSfOs2InitFileBuffers(void);
    240 PSHFLSTRING vboxSfOs2StrAlloc(size_t cwcLength);
    241 PSHFLSTRING vboxSfOs2StrDup(PCSHFLSTRING pSrc);
    242 void        vboxSfOs2StrFree(PSHFLSTRING pStr);
    243 
    244 APIRET      vboxSfOs2ResolvePath(const char *pszPath, PVBOXSFCD pCdFsd, LONG offCurDirEnd,
    245                                  PVBOXSFFOLDER *ppFolder, PSHFLSTRING *ppStrFolderPath);
    246 APIRET      vboxSfOs2ResolvePathEx(const char *pszPath, PVBOXSFCD pCdFsd, LONG offCurDirEnd, uint32_t offStrInBuf,
    247                                    PVBOXSFFOLDER *ppFolder, void **ppvBuf);
    248 void        vboxSfOs2ReleasePathAndFolder(PSHFLSTRING pStrPath, PVBOXSFFOLDER pFolder);
    249 void        vboxSfOs2ReleaseFolder(PVBOXSFFOLDER pFolder);
    250 APIRET      vboxSfOs2ConvertStatusToOs2(int vrc, APIRET rcDefault);
    251 int16_t     vboxSfOs2GetLocalTimeDelta(void);
    252 void        vboxSfOs2DateTimeFromTimeSpec(FDATE *pDosDate, FTIME *pDosTime, RTTIMESPEC SrcTimeSpec, int16_t cMinLocalTimeDelta);
    253 PRTTIMESPEC vboxSfOs2DateTimeToTimeSpec(FDATE DosDate, FTIME DosTime, int16_t cMinLocalTimeDelta, PRTTIMESPEC pDstTimeSpec);
    254 APIRET      vboxSfOs2FileStatusFromObjInfo(PBYTE pbDst, ULONG cbDst, ULONG uLevel, SHFLFSOBJINFO const *pSrc);
    255 APIRET      vboxSfOs2SetInfoCommonWorker(PVBOXSFFOLDER pFolder, SHFLHANDLE hHostFile, ULONG fAttribs,
    256                                          PFILESTATUS pTimestamps, PSHFLFSOBJINFO pObjInfoBuf, uint32_t offObjInfoInAlloc);
    257 APIRET      vboxSfOs2MakeEmptyEaList(PEAOP pEaOp, ULONG uLevel);
    258 APIRET      vboxSfOs2MakeEmptyEaListEx(PEAOP pEaOp, ULONG uLevel, uint32_t *pcbWritten, ULONG *poffError);
    259 
    260 DECLASM(PVBOXSFVP) Fsh32GetVolParams(USHORT hVbp, PVPFSI *ppVpFsi /*optional*/);
    261 
    262 
    263 /** @name Host request helpers
     43#include <VBox/VMMDev.h>
     44#include <iprt/errcore.h>
     45
     46
     47/** @defgroup grp_vboxguest_lib_r0_sf_inline    Shared Folders Host Request Helpers
     48 * @ingroup grp_vboxguest_lib_r0
    26449 *
    26550 * @todo generalize these and put back into VbglR0Sf.
     
    26752 * @{  */
    26853
    269 #include <iprt/err.h>
    270 
    271 /** Request structure for vboxSfOs2HostReqMapFolderWithBuf.  */
     54/** VMMDEV_HVF_XXX (set during init). */
     55extern uint32_t g_fHostFeatures;
     56extern VBGLSFCLIENT g_SfClient; /**< Move this into the parameters. */
     57
     58/** Request structure for VbglR0SfHostReqMapFolderWithBuf.  */
    27259typedef struct VBOXSFMAPFOLDERWITHBUFREQ
    27360{
     
    28168 * SHFL_FN_MAP_FOLDER request.
    28269 */
    283 DECLINLINE(int) vboxSfOs2HostReqMapFolderWithBuf(VBOXSFMAPFOLDERWITHBUFREQ *pReq, PSHFLSTRING pStrName,
    284                                                  RTUTF16 wcDelimiter, bool fCaseSensitive)
     70DECLINLINE(int) VbglR0SfHostReqMapFolderWithBuf(VBOXSFMAPFOLDERWITHBUFREQ *pReq, PSHFLSTRING pStrName,
     71                                                RTUTF16 wcDelimiter, bool fCaseSensitive)
    28572{
    28673    VBGLIOCIDCHGCMFASTCALL_INIT(&pReq->Hdr, VbglR0PhysHeapGetPhysAddr(pReq), &pReq->Call, g_SfClient.idClient,
     
    334121 * SHFL_FN_UNMAP_FOLDER request.
    335122 */
    336 DECLINLINE(int) vboxSfOs2HostReqUnmapFolderSimple(uint32_t idRoot)
     123DECLINLINE(int) VbglR0SfHostReqUnmapFolderSimple(uint32_t idRoot)
    337124{
    338125    VBOXSFUNMAPFOLDERREQ *pReq = (VBOXSFUNMAPFOLDERREQ *)VbglR0PhysHeapAlloc(sizeof(*pReq));
     
    356143
    357144
    358 /** Request structure for vboxSfOs2HostReqCreate.  */
     145/** Request structure for VbglR0SfHostReqCreate.  */
    359146typedef struct VBOXSFCREATEREQ
    360147{
     
    369156 * SHFL_FN_CREATE request.
    370157 */
    371 DECLINLINE(int) vboxSfOs2HostReqCreate(SHFLROOT idRoot, VBOXSFCREATEREQ *pReq)
     158DECLINLINE(int) VbglR0SfHostReqCreate(SHFLROOT idRoot, VBOXSFCREATEREQ *pReq)
    372159{
    373160    uint32_t const cbReq = g_fHostFeatures & VMMDEV_HVF_HGCM_EMBEDDED_BUFFERS
     
    410197
    411198
    412 /** Request structure for vboxSfOs2HostReqClose.  */
     199/** Request structure for VbglR0SfHostReqClose.  */
    413200typedef struct VBOXSFCLOSEREQ
    414201{
     
    421208 * SHFL_FN_CLOSE request.
    422209 */
    423 DECLINLINE(int) vboxSfOs2HostReqClose(SHFLROOT idRoot, VBOXSFCLOSEREQ *pReq, uint64_t hHostFile)
     210DECLINLINE(int) VbglR0SfHostReqClose(SHFLROOT idRoot, VBOXSFCLOSEREQ *pReq, uint64_t hHostFile)
    424211{
    425212    VBGLIOCIDCHGCMFASTCALL_INIT(&pReq->Hdr, VbglR0PhysHeapGetPhysAddr(pReq), &pReq->Call, g_SfClient.idClient,
     
    441228 * SHFL_FN_CLOSE request, allocate request buffer.
    442229 */
    443 DECLINLINE(int) vboxSfOs2HostReqCloseSimple(SHFLROOT idRoot, uint64_t hHostFile)
     230DECLINLINE(int) VbglR0SfHostReqCloseSimple(SHFLROOT idRoot, uint64_t hHostFile)
    444231{
    445232    VBOXSFCLOSEREQ *pReq = (VBOXSFCLOSEREQ *)VbglR0PhysHeapAlloc(sizeof(*pReq));
    446233    if (pReq)
    447234    {
    448         int vrc = vboxSfOs2HostReqClose(idRoot, pReq, hHostFile);
     235        int vrc = VbglR0SfHostReqClose(idRoot, pReq, hHostFile);
    449236        VbglR0PhysHeapFree(pReq);
    450237        return vrc;
     
    454241
    455242
    456 /** Request structure for vboxSfOs2HostReqQueryVolInfo.  */
     243/** Request structure for VbglR0SfHostReqQueryVolInfo.  */
    457244typedef struct VBOXSFVOLINFOREQ
    458245{
     
    466253 * SHFL_FN_INFORMATION[SHFL_INFO_VOLUME | SHFL_INFO_GET] request.
    467254 */
    468 DECLINLINE(int) vboxSfOs2HostReqQueryVolInfo(SHFLROOT idRoot, VBOXSFVOLINFOREQ *pReq, uint64_t hHostFile)
     255DECLINLINE(int) VbglR0SfHostReqQueryVolInfo(SHFLROOT idRoot, VBOXSFVOLINFOREQ *pReq, uint64_t hHostFile)
    469256{
    470257    uint32_t const cbReq = g_fHostFeatures & VMMDEV_HVF_HGCM_EMBEDDED_BUFFERS
     
    506293
    507294
    508 /** Request structure for vboxSfOs2HostReqSetObjInfo & vboxSfOs2HostReqQueryObjInfo. */
     295/** Request structure for VbglR0SfHostReqSetObjInfo & VbglR0SfHostReqQueryObjInfo. */
    509296typedef struct VBOXSFOBJINFOREQ
    510297{
     
    518305 * SHFL_FN_INFORMATION[SHFL_INFO_GET | SHFL_INFO_FILE] request.
    519306 */
    520 DECLINLINE(int) vboxSfOs2HostReqQueryObjInfo(SHFLROOT idRoot, VBOXSFOBJINFOREQ *pReq, uint64_t hHostFile)
     307DECLINLINE(int) VbglR0SfHostReqQueryObjInfo(SHFLROOT idRoot, VBOXSFOBJINFOREQ *pReq, uint64_t hHostFile)
    521308{
    522309    uint32_t const cbReq = g_fHostFeatures & VMMDEV_HVF_HGCM_EMBEDDED_BUFFERS
     
    561348 * SHFL_FN_INFORMATION[SHFL_INFO_SET | SHFL_INFO_FILE] request.
    562349 */
    563 DECLINLINE(int) vboxSfOs2HostReqSetObjInfo(SHFLROOT idRoot, VBOXSFOBJINFOREQ *pReq, uint64_t hHostFile)
     350DECLINLINE(int) VbglR0SfHostReqSetObjInfo(SHFLROOT idRoot, VBOXSFOBJINFOREQ *pReq, uint64_t hHostFile)
    564351{
    565352    uint32_t const cbReq = g_fHostFeatures & VMMDEV_HVF_HGCM_EMBEDDED_BUFFERS
     
    601388
    602389
    603 /** Request structure for vboxSfOs2HostReqSetObjInfo.  */
     390/** Request structure for VbglR0SfHostReqSetObjInfo.  */
    604391typedef struct VBOXSFOBJINFOWITHBUFREQ
    605392{
     
    614401 * buffer (on the physical heap).
    615402 */
    616 DECLINLINE(int) vboxSfOs2HostReqSetObjInfoWithBuf(SHFLROOT idRoot, VBOXSFOBJINFOWITHBUFREQ *pReq, uint64_t hHostFile,
    617                                                   PSHFLFSOBJINFO pObjInfo, uint32_t offObjInfoInAlloc)
     403DECLINLINE(int) VbglR0SfHostReqSetObjInfoWithBuf(SHFLROOT idRoot, VBOXSFOBJINFOWITHBUFREQ *pReq, uint64_t hHostFile,
     404                                                 PSHFLFSOBJINFO pObjInfo, uint32_t offObjInfoInAlloc)
    618405{
    619406    VBGLIOCIDCHGCMFASTCALL_INIT(&pReq->Hdr, VbglR0PhysHeapGetPhysAddr(pReq), &pReq->Call, g_SfClient.idClient,
     
    657444
    658445
    659 /** Request structure for vboxSfOs2HostReqRemove.  */
     446/** Request structure for VbglR0SfHostReqRemove.  */
    660447typedef struct VBOXSFREMOVEREQ
    661448{
     
    669456 * SHFL_FN_REMOVE request.
    670457 */
    671 DECLINLINE(int) vboxSfOs2HostReqRemove(SHFLROOT idRoot, VBOXSFREMOVEREQ *pReq, uint32_t fFlags)
     458DECLINLINE(int) VbglR0SfHostReqRemove(SHFLROOT idRoot, VBOXSFREMOVEREQ *pReq, uint32_t fFlags)
    672459{
    673460    uint32_t const cbReq = RT_UOFFSETOF(VBOXSFREMOVEREQ, StrPath.String)
     
    716503 * SHFL_FN_REMOVE request.
    717504 */
    718 DECLINLINE(int) vboxSfOs2HostReqRenameWithSrcBuf(SHFLROOT idRoot, VBOXSFRENAMEWITHSRCBUFREQ *pReq,
    719                                                  PSHFLSTRING pSrcStr, uint32_t fFlags)
     505DECLINLINE(int) VbglR0SfHostReqRenameWithSrcBuf(SHFLROOT idRoot, VBOXSFRENAMEWITHSRCBUFREQ *pReq,
     506                                                PSHFLSTRING pSrcStr, uint32_t fFlags)
    720507{
    721508    uint32_t const cbReq = RT_UOFFSETOF(VBOXSFRENAMEWITHSRCBUFREQ, StrDstPath.String)
     
    771558
    772559
    773 /** Request structure for vboxSfOs2HostReqFlush.  */
     560/** Request structure for VbglR0SfHostReqFlush.  */
    774561typedef struct VBOXSFFLUSHREQ
    775562{
     
    782569 * SHFL_FN_FLUSH request.
    783570 */
    784 DECLINLINE(int) vboxSfOs2HostReqFlush(SHFLROOT idRoot, VBOXSFFLUSHREQ *pReq, uint64_t hHostFile)
     571DECLINLINE(int) VbglR0SfHostReqFlush(SHFLROOT idRoot, VBOXSFFLUSHREQ *pReq, uint64_t hHostFile)
    785572{
    786573    VBGLIOCIDCHGCMFASTCALL_INIT(&pReq->Hdr, VbglR0PhysHeapGetPhysAddr(pReq), &pReq->Call, g_SfClient.idClient,
     
    802589 * SHFL_FN_FLUSH request, allocate request buffer.
    803590 */
    804 DECLINLINE(int) vboxSfOs2HostReqFlushSimple(SHFLROOT idRoot, uint64_t hHostFile)
     591DECLINLINE(int) VbglR0SfHostReqFlushSimple(SHFLROOT idRoot, uint64_t hHostFile)
    805592{
    806593    VBOXSFFLUSHREQ *pReq = (VBOXSFFLUSHREQ *)VbglR0PhysHeapAlloc(sizeof(*pReq));
    807594    if (pReq)
    808595    {
    809         int vrc = vboxSfOs2HostReqFlush(idRoot, pReq, hHostFile);
     596        int vrc = VbglR0SfHostReqFlush(idRoot, pReq, hHostFile);
    810597        VbglR0PhysHeapFree(pReq);
    811598        return vrc;
     
    815602
    816603
    817 /** Request structure for vboxSfOs2HostReqSetFileSize.  */
     604/** Request structure for VbglR0SfHostReqSetFileSize.  */
    818605typedef struct VBOXSFSETFILESIZEREQ
    819606{
     
    826613 * SHFL_FN_SET_FILE_SIZE request.
    827614 */
    828 DECLINLINE(int) vboxSfOs2HostReqSetFileSize(SHFLROOT idRoot, VBOXSFSETFILESIZEREQ *pReq,
    829                                             uint64_t hHostFile, uint64_t cbNewSize)
     615DECLINLINE(int) VbglR0SfHostReqSetFileSize(SHFLROOT idRoot, VBOXSFSETFILESIZEREQ *pReq, uint64_t hHostFile, uint64_t cbNewSize)
    830616{
    831617    VBGLIOCIDCHGCMFASTCALL_INIT(&pReq->Hdr, VbglR0PhysHeapGetPhysAddr(pReq), &pReq->Call, g_SfClient.idClient,
     
    850636 * SHFL_FN_SET_FILE_SIZE request, allocate request buffer.
    851637 */
    852 DECLINLINE(int) vboxSfOs2HostReqSetFileSizeSimple(SHFLROOT idRoot, uint64_t hHostFile, uint64_t cbNewSize)
     638DECLINLINE(int) VbglR0SfHostReqSetFileSizeSimple(SHFLROOT idRoot, uint64_t hHostFile, uint64_t cbNewSize)
    853639{
    854640    VBOXSFSETFILESIZEREQ *pReq = (VBOXSFSETFILESIZEREQ *)VbglR0PhysHeapAlloc(sizeof(*pReq));
    855641    if (pReq)
    856642    {
    857         int vrc = vboxSfOs2HostReqSetFileSize(idRoot, pReq, hHostFile, cbNewSize);
     643        int vrc = VbglR0SfHostReqSetFileSize(idRoot, pReq, hHostFile, cbNewSize);
    858644        VbglR0PhysHeapFree(pReq);
    859645        return vrc;
     
    863649
    864650
    865 /** Request structure for vboxSfOs2HostReqReadEmbedded. */
     651/** Request structure for VbglR0SfHostReqReadEmbedded. */
    866652typedef struct VBOXSFREADEMBEDDEDREQ
    867653{
     
    875661 * SHFL_FN_READ request using embedded data buffer.
    876662 */
    877 DECLINLINE(int) vboxSfOs2HostReqReadEmbedded(SHFLROOT idRoot, VBOXSFREADEMBEDDEDREQ *pReq, uint64_t hHostFile,
    878                                              uint64_t offRead, uint32_t cbToRead)
     663DECLINLINE(int) VbglR0SfHostReqReadEmbedded(SHFLROOT idRoot, VBOXSFREADEMBEDDEDREQ *pReq, uint64_t hHostFile,
     664                                            uint64_t offRead, uint32_t cbToRead)
    879665{
    880666    uint32_t const cbReq = RT_UOFFSETOF(VBOXSFREADEMBEDDEDREQ, abData[0])
     
    916702
    917703
    918 /** Request structure for vboxSfOs2HostReqRead & vboxSfOs2HostReqReadContig. */
     704/** Request structure for vboxSfOs2HostReqRead & VbglR0SfHostReqReadContig. */
    919705typedef struct VBOXSFREADPGLSTREQ
    920706{
     
    928714 * SHFL_FN_READ request using page list for data buffer (caller populated).
    929715 */
    930 DECLINLINE(int) vboxSfOs2HostReqReadPgLst(SHFLROOT idRoot, VBOXSFREADPGLSTREQ *pReq, uint64_t hHostFile,
    931                                           uint64_t offRead, uint32_t cbToRead, uint32_t cPages)
     716DECLINLINE(int) VbglR0SfHostReqReadPgLst(SHFLROOT idRoot, VBOXSFREADPGLSTREQ *pReq, uint64_t hHostFile,
     717                                         uint64_t offRead, uint32_t cbToRead, uint32_t cPages)
    932718{
    933719    VBGLIOCIDCHGCMFASTCALL_INIT(&pReq->Hdr, VbglR0PhysHeapGetPhysAddr(pReq), &pReq->Call, g_SfClient.idClient,
     
    966752 * SHFL_FN_READ request using a physically contiguous buffer.
    967753 */
    968 DECLINLINE(int) vboxSfOs2HostReqReadContig(SHFLROOT idRoot, VBOXSFREADPGLSTREQ *pReq, uint64_t hHostFile,
     754DECLINLINE(int) VbglR0SfHostReqReadContig(SHFLROOT idRoot, VBOXSFREADPGLSTREQ *pReq, uint64_t hHostFile,
    969755                                          uint64_t offRead, uint32_t cbToRead, void *pvBuffer, RTGCPHYS64 PhysBuffer)
    970756{
     
    1009795
    1010796
    1011 /** Request structure for vboxSfOs2HostReqWriteEmbedded. */
     797/** Request structure for VbglR0SfHostReqWriteEmbedded. */
    1012798typedef struct VBOXSFWRITEEMBEDDEDREQ
    1013799{
     
    1021807 * SHFL_FN_WRITE request using embedded data buffer.
    1022808 */
    1023 DECLINLINE(int) vboxSfOs2HostReqWriteEmbedded(SHFLROOT idRoot, VBOXSFWRITEEMBEDDEDREQ *pReq, uint64_t hHostFile,
    1024                                               uint64_t offWrite, uint32_t cbToWrite)
     809DECLINLINE(int) VbglR0SfHostReqWriteEmbedded(SHFLROOT idRoot, VBOXSFWRITEEMBEDDEDREQ *pReq, uint64_t hHostFile,
     810                                             uint64_t offWrite, uint32_t cbToWrite)
    1025811{
    1026812    uint32_t const cbReq = RT_UOFFSETOF(VBOXSFWRITEEMBEDDEDREQ, abData[0])
     
    1062848
    1063849
    1064 /** Request structure for vboxSfOs2HostReqWrite and vboxSfOs2HostReqWriteContig. */
     850/** Request structure for vboxSfOs2HostReqWrite and VbglR0SfHostReqWriteContig. */
    1065851typedef struct VBOXSFWRITEPGLSTREQ
    1066852{
     
    1074860 * SHFL_FN_WRITE request using page list for data buffer (caller populated).
    1075861 */
    1076 DECLINLINE(int) vboxSfOs2HostReqWritePgLst(SHFLROOT idRoot, VBOXSFWRITEPGLSTREQ *pReq, uint64_t hHostFile,
    1077                                            uint64_t offWrite, uint32_t cbToWrite, uint32_t cPages)
     862DECLINLINE(int) VbglR0SfHostReqWritePgLst(SHFLROOT idRoot, VBOXSFWRITEPGLSTREQ *pReq, uint64_t hHostFile,
     863                                          uint64_t offWrite, uint32_t cbToWrite, uint32_t cPages)
    1078864{
    1079865    VBGLIOCIDCHGCMFASTCALL_INIT(&pReq->Hdr, VbglR0PhysHeapGetPhysAddr(pReq), &pReq->Call, g_SfClient.idClient,
     
    1112898 * SHFL_FN_WRITE request using a physically contiguous buffer.
    1113899 */
    1114 DECLINLINE(int) vboxSfOs2HostReqWriteContig(SHFLROOT idRoot, VBOXSFWRITEPGLSTREQ *pReq, uint64_t hHostFile,
    1115                                             uint64_t offWrite, uint32_t cbToWrite, void const *pvBuffer, RTGCPHYS64 PhysBuffer)
     900DECLINLINE(int) VbglR0SfHostReqWriteContig(SHFLROOT idRoot, VBOXSFWRITEPGLSTREQ *pReq, uint64_t hHostFile,
     901                                           uint64_t offWrite, uint32_t cbToWrite, void const *pvBuffer, RTGCPHYS64 PhysBuffer)
    1116902{
    1117903    VBGLIOCIDCHGCMFASTCALL_INIT(&pReq->Hdr, VbglR0PhysHeapGetPhysAddr(pReq), &pReq->Call, g_SfClient.idClient,
     
    1153939}
    1154940
     941/** Request structure for vboxSfOs2HostReqListDir. */
     942typedef struct VBOXSFLISTDIRREQ
     943{
     944    VBGLIOCIDCHGCMFASTCALL  Hdr;
     945    VMMDevHGCMCall          Call;
     946    VBoxSFParmList          Parms;
     947    HGCMPageListInfo        StrPgLst;
     948    HGCMPageListInfo        BufPgLst;
     949} VBOXSFLISTDIRREQ;
    1155950
    1156951/**
     
    1158953 * both allocated on the physical heap.
    1159954 */
    1160 DECLINLINE(int) vboxSfOs2HostReqListDir(SHFLROOT idRoot, VBOXSFLISTDIRREQ *pReq, uint64_t hHostDir,
    1161                                         PSHFLSTRING pFilter, uint32_t fFlags, PSHFLDIRINFO pBuffer, uint32_t cbBuffer)
     955DECLINLINE(int) VbglR0SfHostReqListDir(SHFLROOT idRoot, VBOXSFLISTDIRREQ *pReq, uint64_t hHostDir,
     956                                       PSHFLSTRING pFilter, uint32_t fFlags, PSHFLDIRINFO pBuffer, uint32_t cbBuffer)
    1162957{
    1163958    VBGLIOCIDCHGCMFASTCALL_INIT(&pReq->Hdr, VbglR0PhysHeapGetPhysAddr(pReq), &pReq->Call, g_SfClient.idClient,
     
    12321027/** @} */
    12331028
    1234 #endif /* !GA_INCLUDED_SRC_os2_VBoxSF_VBoxSFInternal_h */
    1235 
     1029#endif /* !VBOX_INCLUDED_VBoxGuestLibSharedFoldersInline_h */
     1030
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