VirtualBox

Changeset 58192 in vbox for trunk/src


Ignore:
Timestamp:
Oct 12, 2015 2:33:34 PM (9 years ago)
Author:
vboxsync
Message:

VBoxGuestR0LibSharedFolders.*: Spaces.

Location:
trunk/src/VBox/Additions/common/VBoxGuestLib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.c

    r58178 r58192  
    5151#define SHFL_CPARMS_SET_SYMLINKS 0
    5252
    53 #define VBOX_INIT_CALL(a, b, c)          \
    54     LogFunc(("%s, u32ClientID=%d\n", "SHFL_FN_" # b, \
    55             (c)->ulClientID)); \
    56     (a)->result      = VINF_SUCCESS;     \
    57     (a)->u32ClientID = (c)->ulClientID;  \
    58     (a)->u32Function = SHFL_FN_##b;      \
     53#define VBOX_INIT_CALL(a, b, c) \
     54    LogFunc(("%s, u32ClientID=%d\n", "SHFL_FN_" # b, (c)->ulClientID)); \
     55    (a)->result      = VINF_SUCCESS; \
     56    (a)->u32ClientID = (c)->ulClientID; \
     57    (a)->u32Function = SHFL_FN_##b; \
    5958    (a)->cParms      = SHFL_CPARMS_##b
    6059
    6160
    6261
    63 DECLVBGL(int) vboxInit (void)
    64 {
    65     int rc = VINF_SUCCESS;
    66 
    67     rc = VbglInitClient();
    68     return rc;
    69 }
    70 
    71 DECLVBGL(void) vboxUninit (void)
    72 {
    73     VbglTerminate ();
    74 }
    75 
    76 DECLVBGL(int) vboxConnect (PVBSFCLIENT pClient)
     62DECLVBGL(int) vboxInit(void)
     63{
     64    return VbglInitClient();
     65}
     66
     67DECLVBGL(void) vboxUninit(void)
     68{
     69    VbglTerminate();
     70}
     71
     72DECLVBGL(int) vboxConnect(PVBSFCLIENT pClient)
    7773{
    7874    int rc;
     
    8682    strcpy (data.Loc.u.host.achName, "VBoxSharedFolders");
    8783
    88     rc = VbglHGCMConnect (&pClient->handle, &data);
    89 
     84    rc = VbglHGCMConnect(&pClient->handle, &data);
    9085/*    Log(("VBOXSF: VBoxSF::vboxConnect: VbglHGCMConnect rc = %#x, result = %#x\n",
    91          rc, data.result));
    92 */
    93     if (RT_SUCCESS (rc))
    94     {
     86         rc, data.result)); */
     87    if (RT_SUCCESS(rc))
    9588        rc = data.result;
    96     }
    97 
    98     if (RT_SUCCESS (rc))
     89    if (RT_SUCCESS(rc))
    9990    {
    10091        pClient->ulClientID = data.u32ClientID;
     
    10495}
    10596
    106 DECLVBGL(void) vboxDisconnect (PVBSFCLIENT pClient)
     97DECLVBGL(void) vboxDisconnect(PVBSFCLIENT pClient)
    10798{
    10899    int rc;
     
    117108    data.u32ClientID = pClient->ulClientID;
    118109
    119     rc = VbglHGCMDisconnect (pClient->handle, &data);
     110    rc = VbglHGCMDisconnect(pClient->handle, &data);
    120111    NOREF(rc);
    121112/*    Log(("VBOXSF: VBoxSF::vboxDisconnect: "
    122          "VbglHGCMDisconnect rc = %#x, result = %#x\n", rc, data.result));
    123 */
     113         "VbglHGCMDisconnect rc = %#x, result = %#x\n", rc, data.result)); */
    124114    return;
    125115}
    126116
    127 DECLVBGL(int) vboxCallQueryMappings (PVBSFCLIENT pClient, SHFLMAPPING paMappings[],
    128                                      uint32_t *pcMappings)
    129 {
    130     int rc = VINF_SUCCESS;
    131 
     117DECLVBGL(int) vboxCallQueryMappings(PVBSFCLIENT pClient, SHFLMAPPING paMappings[], uint32_t *pcMappings)
     118{
     119    int rc;
    132120    VBoxSFQueryMappings data;
    133121
     
    141129
    142130    data.mappings.type                   = VMMDevHGCMParmType_LinAddr;
    143     data.mappings.u.Pointer.size         = sizeof (SHFLMAPPING) * *pcMappings;
     131    data.mappings.u.Pointer.size         = sizeof(SHFLMAPPING) * *pcMappings;
    144132    data.mappings.u.Pointer.u.linearAddr = (uintptr_t)&paMappings[0];
    145133
    146134/*    Log(("VBOXSF: in ifs difference %d\n",
    147          (char *)&data.flags.type - (char *)&data.callInfo.cParms));
    148 */
    149     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    150 
    151 /*
    152     Log(("VBOXSF: VBoxSF::vboxCallQueryMappings: "
    153          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    154 */
    155     if (RT_SUCCESS (rc))
    156     {
    157         rc = data.callInfo.result;
    158     }
    159 
    160     if (RT_SUCCESS (rc))
    161     {
     135         (char *)&data.flags.type - (char *)&data.callInfo.cParms)); */
     136    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
     137/*    Log(("VBOXSF: VBoxSF::vboxCallQueryMappings: "
     138         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
     139    if (RT_SUCCESS(rc))
     140        rc = data.callInfo.result;
     141    if (RT_SUCCESS(rc))
    162142        *pcMappings = data.numberOfMappings.u.value32;
    163     }
    164 
    165     return rc;
    166 }
    167 
    168 DECLVBGL(int) vboxCallQueryMapName (PVBSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size)
    169 {
    170     int rc = VINF_SUCCESS;
    171 
     143
     144    return rc;
     145}
     146
     147DECLVBGL(int) vboxCallQueryMapName(PVBSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size)
     148{
     149    int rc;
    172150    VBoxSFQueryMapName data;
    173151
     
    181159    data.name.u.Pointer.u.linearAddr = (uintptr_t)pString;
    182160
    183     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    184 
     161    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    185162/*    Log(("VBOXSF: VBoxSF::vboxCallQueryMapName: "
    186          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    187 */
    188     if (RT_SUCCESS (rc))
    189     {
    190         rc = data.callInfo.result;
    191     }
    192 
    193     return rc;
    194 }
    195 
    196 DECLVBGL(int) vboxCallMapFolder(PVBSFCLIENT pClient, PSHFLSTRING szFolderName,
    197                                 PVBSFMAP pMap)
    198 {
    199     int rc = VINF_SUCCESS;
    200 
     163         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
     164    if (RT_SUCCESS(rc))
     165        rc = data.callInfo.result;
     166
     167    return rc;
     168}
     169
     170DECLVBGL(int) vboxCallMapFolder(PVBSFCLIENT pClient, PSHFLSTRING szFolderName, PVBSFMAP pMap)
     171{
     172    int rc;
    201173    VBoxSFMapFolder data;
    202174
     
    204176
    205177    data.path.type                    = VMMDevHGCMParmType_LinAddr;
    206     data.path.u.Pointer.size          = ShflStringSizeOfBuffer (szFolderName);
     178    data.path.u.Pointer.size          = ShflStringSizeOfBuffer(szFolderName);
    207179    data.path.u.Pointer.u.linearAddr  = (uintptr_t)szFolderName;
    208180
     
    220192#endif
    221193
    222     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    223 
     194    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    224195/*    Log(("VBOXSF: VBoxSF::vboxCallMapFolder: "
    225          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    226 */
    227     if (RT_SUCCESS (rc))
     196         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
     197    if (RT_SUCCESS(rc))
    228198    {
    229199        pMap->root = data.root.u.value32;
     
    247217        OldData.delimiter.u.value32          = RTPATH_DELIMITER;
    248218
    249         rc = VbglHGCMCall (pClient->handle, &OldData.callInfo, sizeof (OldData));
    250 
    251         if (RT_SUCCESS (rc))
     219        rc = VbglHGCMCall(pClient->handle, &OldData.callInfo, sizeof(OldData));
     220        if (RT_SUCCESS(rc))
    252221        {
    253222            pMap->root = OldData.root.u.value32;
     
    260229DECLVBGL(int) vboxCallUnmapFolder(PVBSFCLIENT pClient, PVBSFMAP pMap)
    261230{
    262     int rc = VINF_SUCCESS;
    263 
     231    int rc;
    264232    VBoxSFUnmapFolder data;
    265233
     
    269237    data.root.u.value32                 = pMap->root;
    270238
    271     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    272 
     239    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    273240/*    Log(("VBOXSF: VBoxSF::vboxCallUnmapFolder: "
    274          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    275 */
    276     if (RT_SUCCESS (rc))
    277     {
    278         rc         = data.callInfo.result;
    279     }
    280     return rc;
    281 }
    282 
    283 DECLVBGL(int) vboxCallCreate (PVBSFCLIENT pClient, PVBSFMAP pMap,
    284                               PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms)
     241         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
     242    if (RT_SUCCESS(rc))
     243        rc = data.callInfo.result;
     244    return rc;
     245}
     246
     247DECLVBGL(int) vboxCallCreate(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms)
    285248{
    286249    /** @todo copy buffers to physical or mapped memory. */
    287     int rc = VINF_SUCCESS;
    288 
     250    int rc;
    289251    VBoxSFCreate data;
    290252
     
    299261
    300262    data.parms.type                   = VMMDevHGCMParmType_LinAddr;
    301     data.parms.u.Pointer.size         = sizeof (SHFLCREATEPARMS);
     263    data.parms.u.Pointer.size         = sizeof(SHFLCREATEPARMS);
    302264    data.parms.u.Pointer.u.linearAddr = (uintptr_t)pCreateParms;
    303265
    304     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    305 
     266    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    306267/*    Log(("VBOXSF: VBoxSF::vboxCallCreate: "
    307          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    308 */
    309     if (RT_SUCCESS (rc))
    310     {
    311         rc = data.callInfo.result;
    312     }
    313     return rc;
    314 }
    315 
    316 DECLVBGL(int) vboxCallClose (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE Handle)
    317 {
    318     int rc = VINF_SUCCESS;
    319 
     268         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
     269    if (RT_SUCCESS(rc))
     270        rc = data.callInfo.result;
     271    return rc;
     272}
     273
     274DECLVBGL(int) vboxCallClose(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE Handle)
     275{
     276    int rc;
    320277    VBoxSFClose data;
    321278
     
    328285    data.handle.u.value64               = Handle;
    329286
    330     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    331 
     287    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    332288/*    Log(("VBOXSF: VBoxSF::vboxCallClose: "
    333          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    334 */
    335     if (RT_SUCCESS (rc))
    336     {
    337         rc = data.callInfo.result;
    338     }
    339 
     289         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
     290    if (RT_SUCCESS(rc))
     291        rc = data.callInfo.result;
    340292    return rc;
    341293}
     
    354306
    355307    data.path.type                      = VMMDevHGCMParmType_LinAddr_In;
    356     data.path.u.Pointer.size            = ShflStringSizeOfBuffer (pParsedPath);
     308    data.path.u.Pointer.size            = ShflStringSizeOfBuffer(pParsedPath);
    357309    data.path.u.Pointer.u.linearAddr    = (uintptr_t)pParsedPath;
    358310
     
    360312    data.flags.u.value32                = flags;
    361313
    362     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    363 
     314    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    364315/*    Log(("VBOXSF: VBoxSF::vboxCallRemove: "
    365          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    366 */
     316         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
    367317    if (RT_SUCCESS (rc))
    368     {
    369         rc = data.callInfo.result;
    370     }
    371 
    372     return rc;
    373 }
    374 
    375 DECLVBGL(int) vboxCallRename (PVBSFCLIENT pClient, PVBSFMAP pMap,
    376                               PSHFLSTRING pSrcPath, PSHFLSTRING pDestPath, uint32_t flags)
    377 {
    378     int rc = VINF_SUCCESS;
    379 
     318        rc = data.callInfo.result;
     319    return rc;
     320}
     321
     322DECLVBGL(int) vboxCallRename(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pSrcPath, PSHFLSTRING pDestPath, uint32_t flags)
     323{
     324    int rc;
    380325    VBoxSFRename data;
    381326
     
    386331
    387332    data.src.type                       = VMMDevHGCMParmType_LinAddr_In;
    388     data.src.u.Pointer.size             = ShflStringSizeOfBuffer (pSrcPath);
     333    data.src.u.Pointer.size             = ShflStringSizeOfBuffer(pSrcPath);
    389334    data.src.u.Pointer.u.linearAddr     = (uintptr_t)pSrcPath;
    390335
    391336    data.dest.type                      = VMMDevHGCMParmType_LinAddr_In;
    392     data.dest.u.Pointer.size            = ShflStringSizeOfBuffer (pDestPath);
     337    data.dest.u.Pointer.size            = ShflStringSizeOfBuffer(pDestPath);
    393338    data.dest.u.Pointer.u.linearAddr    = (uintptr_t)pDestPath;
    394339
     
    396341    data.flags.u.value32                = flags;
    397342
    398     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    399 
     343    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    400344/*    Log(("VBOXSF: VBoxSF::vboxCallRename: "
    401          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    402 */
     345         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
    403346    if (RT_SUCCESS (rc))
    404     {
    405         rc = data.callInfo.result;
    406     }
     347        rc = data.callInfo.result;
    407348    return rc;
    408349}
     
    411352                           uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked)
    412353{
    413     int rc = VINF_SUCCESS;
    414 
     354    int rc;
    415355    VBoxSFRead data;
    416356
     
    430370    data.buffer.u.Pointer.u.linearAddr  = (uintptr_t)pBuffer;
    431371
    432     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    433 
     372    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    434373/*    Log(("VBOXSF: VBoxSF::vboxCallRead: "
    435          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    436 */
    437     if (RT_SUCCESS (rc))
     374         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
     375    if (RT_SUCCESS(rc))
    438376    {
    439377        rc = data.callInfo.result;
     
    492430                            uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked)
    493431{
    494     int rc = VINF_SUCCESS;
    495 
     432    int rc;
    496433    VBoxSFWrite data;
    497434
     
    507444    data.cb.type                        = VMMDevHGCMParmType_32bit;
    508445    data.cb.u.value32                   = *pcbBuffer;
    509     data.buffer.type                    = (fLocked) ? VMMDevHGCMParmType_LinAddr_Locked_In : VMMDevHGCMParmType_LinAddr_In;
     446    data.buffer.type                    = fLocked ? VMMDevHGCMParmType_LinAddr_Locked_In : VMMDevHGCMParmType_LinAddr_In;
    510447    data.buffer.u.Pointer.size          = *pcbBuffer;
    511448    data.buffer.u.Pointer.u.linearAddr  = (uintptr_t)pBuffer;
    512449
    513     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    514 
     450    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    515451/*    Log(("VBOXSF: VBoxSF::vboxCallWrite: "
    516          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    517 */
    518     if (RT_SUCCESS (rc))
     452         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
     453    if (RT_SUCCESS(rc))
    519454    {
    520455        rc = data.callInfo.result;
     
    559494        pPgLst->aPages[iPage] = PhysBuffer;
    560495
    561     rc = VbglHGCMCall (pClient->handle, &pData->callInfo, cbData);
    562     if (RT_SUCCESS (rc))
     496    rc = VbglHGCMCall(pClient->handle, &pData->callInfo, cbData);
     497    if (RT_SUCCESS(rc))
    563498    {
    564499        rc = pData->callInfo.result;
     
    606541        pPgLst->aPages[iPage] = paPages[iPage];
    607542
    608     rc = VbglHGCMCall (pClient->handle, &pData->callInfo, cbData);
    609     if (RT_SUCCESS (rc))
     543    rc = VbglHGCMCall(pClient->handle, &pData->callInfo, cbData);
     544    if (RT_SUCCESS(rc))
    610545    {
    611546        rc = pData->callInfo.result;
     
    619554DECLVBGL(int) vboxCallFlush(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile)
    620555{
    621     int rc = VINF_SUCCESS;
    622 
     556    int rc;
    623557    VBoxSFFlush data;
    624558
     
    631565    data.handle.u.value64               = hFile;
    632566
    633     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    634 
     567    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    635568/*    Log(("VBOXSF: VBoxSF::vboxCallFlush: "
    636          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    637 */
    638     if (RT_SUCCESS (rc))
    639     {
    640         rc = data.callInfo.result;
    641     }
    642     return rc;
    643 }
    644 
    645 DECLVBGL(int) vboxCallDirInfo (
     569         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
     570    if (RT_SUCCESS(rc))
     571        rc = data.callInfo.result;
     572    return rc;
     573}
     574
     575DECLVBGL(int) vboxCallDirInfo(
    646576    PVBSFCLIENT pClient,
    647577    PVBSFMAP pMap,
     
    654584    uint32_t *pcFiles)
    655585{
    656     int rc = VINF_SUCCESS;
    657 
     586    int rc;
    658587    VBoxSFList data;
    659588
     
    670599    data.cb.u.value32                   = *pcbBuffer;
    671600    data.path.type                      = VMMDevHGCMParmType_LinAddr_In;
    672     data.path.u.Pointer.size            =
    673         (ParsedPath) ? ShflStringSizeOfBuffer(ParsedPath) : 0;
     601    data.path.u.Pointer.size            = ParsedPath ? ShflStringSizeOfBuffer(ParsedPath) : 0;
    674602    data.path.u.Pointer.u.linearAddr    = (uintptr_t) ParsedPath;
    675603
     
    683611    data.cFiles.u.value32               = 0; /* out parameters only */
    684612
    685     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    686 
     613    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    687614/*    Log(("VBOXSF: VBoxSF::vboxCallDirInfo: "
    688          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    689 */
    690     if (RT_SUCCESS (rc))
    691     {
    692         rc = data.callInfo.result;
    693     }
     615         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
     616    if (RT_SUCCESS(rc))
     617        rc = data.callInfo.result;
    694618    *pcbBuffer = data.cb.u.value32;
    695619    *pcFiles   = data.cFiles.u.value32;
     
    700624                             uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer)
    701625{
    702     int rc = VINF_SUCCESS;
    703 
     626    int rc;
    704627    VBoxSFInformation data;
    705628
     
    719642    data.info.u.Pointer.u.linearAddr    = (uintptr_t)pBuffer;
    720643
    721     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    722 
     644    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    723645/*    Log(("VBOXSF: VBoxSF::vboxCallFileInfo: "
    724          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    725 */
    726     if (RT_SUCCESS (rc))
     646         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
     647    if (RT_SUCCESS(rc))
    727648    {
    728649        rc = data.callInfo.result;
     
    735656                           uint64_t offset, uint64_t cbSize, uint32_t fLock)
    736657{
    737     int rc = VINF_SUCCESS;
    738 
     658    int rc;
    739659    VBoxSFLock data;
    740660
     
    754674    data.flags.u.value32                = fLock;
    755675
    756     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    757 
     676    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    758677/*    Log(("VBOXSF: VBoxSF::vboxCallLock: "
    759          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    760 */
     678         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
    761679    if (RT_SUCCESS (rc))
    762     {
    763         rc = data.callInfo.result;
    764     }
    765     return rc;
    766 }
    767 
    768 DECLVBGL(int) vboxCallSetUtf8 (PVBSFCLIENT pClient)
    769 {
    770     int rc = VINF_SUCCESS;
    771 
     680        rc = data.callInfo.result;
     681    return rc;
     682}
     683
     684DECLVBGL(int) vboxCallSetUtf8(PVBSFCLIENT pClient)
     685{
     686    int rc;
    772687    VBoxGuestHGCMCallInfo callInfo;
    773688
    774     VBOX_INIT_CALL (&callInfo, SET_UTF8, pClient);
    775     rc = VbglHGCMCall (pClient->handle, &callInfo, sizeof (callInfo));
    776     if (RT_SUCCESS (rc))
    777     {
     689    VBOX_INIT_CALL(&callInfo, SET_UTF8, pClient);
     690    rc = VbglHGCMCall(pClient->handle, &callInfo, sizeof(callInfo));
     691    if (RT_SUCCESS(rc))
    778692        rc = callInfo.result;
    779     }
    780     return rc;
    781 }
    782 
    783 DECLVBGL(int) vboxReadLink (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath,
    784                             uint32_t cbBuffer, uint8_t *pBuffer)
    785 {
    786     int rc = VINF_SUCCESS;
    787 
     693    return rc;
     694}
     695
     696DECLVBGL(int) vboxReadLink(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, uint32_t cbBuffer, uint8_t *pBuffer)
     697{
     698    int rc;
    788699    VBoxSFReadLink data;
    789700
     
    801712    data.buffer.u.Pointer.u.linearAddr  = (uintptr_t)pBuffer;
    802713
    803     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    804 
     714    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    805715/*    Log(("VBOXSF: VBoxSF::vboxCallReadline: "
    806          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    807 */
     716         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
    808717    if (RT_SUCCESS (rc))
    809     {
    810         rc = data.callInfo.result;
    811     }
    812     return rc;
    813 }
    814 
    815 DECLVBGL(int) vboxCallSymlink (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath,
    816                                PSHFLFSOBJINFO pBuffer)
    817 {
    818     int rc = VINF_SUCCESS;
    819 
     718        rc = data.callInfo.result;
     719    return rc;
     720}
     721
     722DECLVBGL(int) vboxCallSymlink(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath,
     723                              PSHFLFSOBJINFO pBuffer)
     724{
     725    int rc;
    820726    VBoxSFSymlink data;
    821727
     
    837743    data.info.u.Pointer.u.linearAddr    = (uintptr_t)pBuffer;
    838744
    839     rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data));
    840 
     745    rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data));
    841746/*    Log(("VBOXSF: VBoxSF::vboxCallSymlink: "
    842          "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result));
    843 */
     747         "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */
    844748    if (RT_SUCCESS (rc))
    845     {
    846         rc = data.callInfo.result;
    847     }
    848     return rc;
    849 }
    850 
    851 DECLVBGL(int) vboxCallSetSymlinks (PVBSFCLIENT pClient)
    852 {
    853     int rc = VINF_SUCCESS;
    854 
     749        rc = data.callInfo.result;
     750    return rc;
     751}
     752
     753DECLVBGL(int) vboxCallSetSymlinks(PVBSFCLIENT pClient)
     754{
     755    int rc;
    855756    VBoxGuestHGCMCallInfo callInfo;
    856757
    857     VBOX_INIT_CALL (&callInfo, SET_SYMLINKS, pClient);
    858     rc = VbglHGCMCall (pClient->handle, &callInfo, sizeof (callInfo));
    859     if (RT_SUCCESS (rc))
    860     {
     758    VBOX_INIT_CALL(&callInfo, SET_SYMLINKS, pClient);
     759    rc = VbglHGCMCall(pClient->handle, &callInfo, sizeof(callInfo));
     760    if (RT_SUCCESS(rc))
    861761        rc = callInfo.result;
    862     }
    863762    return rc;
    864763}
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.h

    r56294 r58192  
    2929
    3030#include <VBox/VBoxGuestLib.h>
     31#if 0 /* aparently no longer needed (see below) */
    3132#ifndef _NTIFS_
    3233# ifdef RT_OS_WINDOWS
     
    5556# endif
    5657#endif
     58#endif
    5759
    58 #if defined(RT_OS_WINDOWS) && 0
    59 /** @todo remove this legacy and use VBox/log.h and/or iprt/log.h. */
    60 /* => Done.  The next person who needs logging in Windows guests will have the
    61  *    honour of making it work. */
    62 # ifdef DEBUG
    63 #  define LOG_ENABLED
    64 # endif
    65 # include "VBoxGuestLog.h"
    66 #endif
    6760#if defined(RT_OS_WINDOWS)
    6861# include <VBox/log.h>
     
    8780
    8881
     82#if 0 /* Apparently unused cruft from old windows shared folder driver? */
    8983#define VBSF_DRIVE_LETTER_FIRST   L'A'
    9084#define VBSF_DRIVE_LETTER_LAST    L'Z'
     
    133127struct _MRX_VBOX_DEVICE_EXTENSION;
    134128typedef struct _MRX_VBOX_DEVICE_EXTENSION *PMRX_VBOX_DEVICE_EXTENSION;
     129#endif
    135130
    136 DECLVBGL(int)  vboxInit (void);
    137 DECLVBGL(void) vboxUninit (void);
    138 DECLVBGL(int)  vboxConnect (PVBSFCLIENT pClient);
    139 DECLVBGL(void) vboxDisconnect (PVBSFCLIENT pClient);
     131DECLVBGL(int)  vboxInit(void);
     132DECLVBGL(void) vboxUninit(void);
     133DECLVBGL(int)  vboxConnect(PVBSFCLIENT pClient);
     134DECLVBGL(void) vboxDisconnect(PVBSFCLIENT pClient);
    140135
    141 DECLVBGL(int) vboxCallQueryMappings (PVBSFCLIENT pClient, SHFLMAPPING paMappings[], uint32_t *pcMappings);
     136DECLVBGL(int) vboxCallQueryMappings(PVBSFCLIENT pClient, SHFLMAPPING paMappings[], uint32_t *pcMappings);
    142137
    143 DECLVBGL(int) vboxCallQueryMapName (PVBSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size);
     138DECLVBGL(int) vboxCallQueryMapName(PVBSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size);
    144139
    145140/**
     
    166161 *       as additional information.
    167162 */
    168 DECLVBGL(int) vboxCallCreate (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms);
     163DECLVBGL(int) vboxCallCreate(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms);
    169164
    170 DECLVBGL(int) vboxCallClose (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE Handle);
    171 DECLVBGL(int) vboxCallRemove (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, uint32_t flags);
    172 DECLVBGL(int) vboxCallRename (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pSrcPath, PSHFLSTRING pDestPath, uint32_t flags);
    173 DECLVBGL(int) vboxCallFlush (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile);
     165DECLVBGL(int) vboxCallClose(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE Handle);
     166DECLVBGL(int) vboxCallRemove(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, uint32_t flags);
     167DECLVBGL(int) vboxCallRename(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pSrcPath, PSHFLSTRING pDestPath, uint32_t flags);
     168DECLVBGL(int) vboxCallFlush(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile);
    174169
    175 DECLVBGL(int) vboxCallRead (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
     170DECLVBGL(int) vboxCallRead(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
    176171DECLVBGL(int) VbglR0SharedFolderReadPageList(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile,
    177172                                             uint64_t offset, uint32_t *pcbBuffer,
    178173                                             uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages);
    179 DECLVBGL(int) vboxCallWrite (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
     174DECLVBGL(int) vboxCallWrite(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
    180175DECLVBGL(int) VbglR0SfWritePhysCont(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, RTCCPHYS PhysBuffer);
    181176DECLVBGL(int) VbglR0SharedFolderWritePageList(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile,
     
    183178                                              uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages);
    184179
    185 DECLVBGL(int) vboxCallLock (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint64_t cbSize, uint32_t fLock);
     180DECLVBGL(int) vboxCallLock(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint64_t cbSize, uint32_t fLock);
    186181
    187 DECLVBGL(int) vboxCallDirInfo (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile,PSHFLSTRING ParsedPath, uint32_t flags,
    188                                uint32_t index, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer, uint32_t *pcFiles);
    189 DECLVBGL(int) vboxCallFSInfo (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer);
     182DECLVBGL(int) vboxCallDirInfo(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile,PSHFLSTRING ParsedPath, uint32_t flags,
     183                              uint32_t index, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer, uint32_t *pcFiles);
     184DECLVBGL(int) vboxCallFSInfo(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer);
    190185
    191 DECLVBGL(int) vboxCallMapFolder (PVBSFCLIENT pClient, PSHFLSTRING szFolderName, PVBSFMAP pMap);
    192 DECLVBGL(int) vboxCallUnmapFolder (PVBSFCLIENT pClient, PVBSFMAP pMap);
    193 DECLVBGL(int) vboxCallSetUtf8 (PVBSFCLIENT pClient);
     186DECLVBGL(int) vboxCallMapFolder(PVBSFCLIENT pClient, PSHFLSTRING szFolderName, PVBSFMAP pMap);
     187DECLVBGL(int) vboxCallUnmapFolder(PVBSFCLIENT pClient, PVBSFMAP pMap);
     188DECLVBGL(int) vboxCallSetUtf8(PVBSFCLIENT pClient);
    194189
    195 DECLVBGL(int) vboxReadLink (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING ParsedPath, uint32_t pcbBuffer, uint8_t *pBuffer);
    196 DECLVBGL(int) vboxCallSymlink (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath, PSHFLFSOBJINFO pBuffer);
    197 DECLVBGL(int) vboxCallSetSymlinks (PVBSFCLIENT pClient);
     190DECLVBGL(int) vboxReadLink(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING ParsedPath, uint32_t pcbBuffer, uint8_t *pBuffer);
     191DECLVBGL(int) vboxCallSymlink(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath, PSHFLFSOBJINFO pBuffer);
     192DECLVBGL(int) vboxCallSetSymlinks(PVBSFCLIENT pClient);
    198193
    199194#endif /* !___VBoxGuestLib_VBoxGuestR0LibSharedFolders_h */
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