VirtualBox

Changeset 98824 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Mar 2, 2023 5:06:36 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156144
Message:

Guest Control: Made the directory entry reading really dynamic by letting the guest tell us the size it reports to the guest (limited by GSTCTL_DIRENTRY_MAX_SIZE). Re-introduced the #pragma pack(1) because we need the structures on mixed bitness (32 / 64 or vice versa) with the same size. bugref:9783

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp

    r98818 r98824  
    516516        case GUEST_DIR_NOTIFYTYPE_READ:
    517517        {
    518             ASSERT_GUEST_MSG_STMT_BREAK(pSvcCbData->mParms == 7, ("mParms=%u\n", pSvcCbData->mParms),
     518            ASSERT_GUEST_MSG_STMT_BREAK(pSvcCbData->mParms == 6, ("mParms=%u\n", pSvcCbData->mParms),
    519519                                        vrc = VERR_WRONG_PARAMETER_COUNT);
    520520            ASSERT_GUEST_MSG_STMT_BREAK(pSvcCbData->mpaParms[idx].type == VBOX_HGCM_SVC_PARM_PTR,
     
    525525            vrc = HGCMSvcGetPv(&pSvcCbData->mpaParms[idx++], (void **)&pEntry, &cbEntry);
    526526            AssertRCBreak(vrc);
    527             AssertBreakStmt(   cbEntry >= sizeof(GSTCTLDIRENTRYEX)
     527            AssertBreakStmt(   cbEntry >= RT_UOFFSETOF(GSTCTLDIRENTRYEX, szName[2])
    528528                            && cbEntry <= GSTCTL_DIRENTRY_MAX_SIZE, VERR_INVALID_PARAMETER);
    529529            dataCb.u.read.pEntry  = (PGSTCTLDIRENTRYEX)RTMemDup(pEntry, cbEntry);
     
    775775        HGCMSvcSetU32(&paParms[i++], pEvent->ContextID());
    776776        HGCMSvcSetU32(&paParms[i++], mObjectID /* Guest directory handle */);
    777         HGCMSvcSetU32(&paParms[i++], GSTCTL_DIRENTRY_MAX_SIZE);
    778777
    779778        vrc = sendMessage(HOST_MSG_DIR_READ, i, paParms);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette