VirtualBox

Changeset 66099 in vbox


Ignore:
Timestamp:
Mar 14, 2017 7:06:16 PM (8 years ago)
Author:
vboxsync
Message:

SharedFolders: Some adjustments necessary for flexible array syntax in SHFLSTRING.

Location:
trunk/src/VBox/HostServices/SharedFolders
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp

    r66038 r66099  
    755755
    756756static int listDir(VBOXHGCMSVCFNTABLE *psvcTable, SHFLROOT root,
    757                    SHFLHANDLE handle, uint32_t fFlags, uint32_t cb,
     757                   SHFLHANDLE handle, uint32_t fFlags,
    758758                   const char *pcszPath, void *pvBuf, uint32_t cbBuf,
    759759                   uint32_t resumePoint, uint32_t *pcFiles)
     
    766766    aParms[1].setUInt64(handle);
    767767    aParms[2].setUInt32(fFlags);
    768     aParms[3].setUInt32(cb);
     768    aParms[3].setUInt32(cbBuf);
    769769    if (pcszPath)
    770770    {
     
    10201020    PRTDIR pDir = (PRTDIR)&g_aTestDirHandles[g_iNextDirHandle++ % RT_ELEMENTS(g_aTestDirHandles)];
    10211021    SHFLHANDLE Handle;
    1022     SHFLDIRINFO DirInfo;
     1022    union
     1023    {
     1024        SHFLDIRINFO DirInfo;
     1025        uint8_t     abBuffer[sizeof(SHFLDIRINFO) + 2 * sizeof(RTUTF16)];
     1026    } Buf;
    10231027    uint32_t cFiles;
    10241028    int rc;
     
    10311035                    SHFL_CF_DIRECTORY | SHFL_CF_ACCESS_READ, &Handle, NULL);
    10321036    RTTEST_CHECK_RC_OK(hTest, rc);
    1033     rc = listDir(&svcTable, Root, Handle, 0, sizeof (SHFLDIRINFO), NULL,
    1034                  &DirInfo, sizeof(DirInfo), 0, &cFiles);
     1037    rc = listDir(&svcTable, Root, Handle, 0, NULL, &Buf.DirInfo, sizeof(Buf), 0, &cFiles);
    10351038    RTTEST_CHECK_RC(hTest, rc, VERR_NO_MORE_FILES);
    10361039    RTTEST_CHECK_MSG(hTest, g_testRTDirReadExDir == pDir, (hTest, "Dir=%p\n", g_testRTDirReadExDir));
  • trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp

    r66038 r66099  
    16151615    SHFLVOLINFO   *pSFDEntry;
    16161616    char          *pszFullPath = NULL;
    1617     SHFLSTRING     dummy;
     1617    union
     1618    {
     1619        SHFLSTRING  Dummy;
     1620        uint8_t     abDummy[SHFLSTRING_HEADER_SIZE + sizeof(RTUTF16)];
     1621    } Buf;
    16181622
    16191623    if (pcbBuffer == 0 || pBuffer == 0 || *pcbBuffer < sizeof(SHFLVOLINFO))
     
    16291633    pSFDEntry   = (PSHFLVOLINFO)pBuffer;
    16301634
    1631     ShflStringInitBuffer(&dummy, sizeof(dummy));
    1632     dummy.String.ucs2[0] = '\0';
    1633     rc = vbsfBuildFullPath(pClient, root, &dummy, sizeof(dummy), &pszFullPath, NULL);
     1635    ShflStringInitBuffer(&Buf.Dummy, sizeof(Buf));
     1636    Buf.Dummy.String.ucs2[0] = '\0';
     1637    rc = vbsfBuildFullPath(pClient, root, &Buf.Dummy, sizeof(Buf), &pszFullPath, NULL);
    16341638
    16351639    if (RT_SUCCESS(rc))
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