VirtualBox

Ignore:
Timestamp:
Mar 2, 2023 5:06:36 PM (2 years ago)
Author:
vboxsync
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/Additions/common/VBoxGuest/lib/VBoxGuestR3LibGuestCtrl.cpp

    r98818 r98824  
    10711071 * @param   pCtx                Guest control command context to use.
    10721072 * @param   puHandle            Where to return the directory handle to rewind.
    1073  * @param   pcbDirEntry         Where to return the directory entry size.
    1074  */
    1075 VBGLR3DECL(int) VbglR3GuestCtrlDirGetRead(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle, uint32_t *pcbDirEntry)
    1076 {
    1077     AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
    1078     AssertReturn(pCtx->uNumParms == 5, VERR_INVALID_PARAMETER);
     1073 */
     1074VBGLR3DECL(int) VbglR3GuestCtrlDirGetRead(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle)
     1075{
     1076    AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
     1077    AssertReturn(pCtx->uNumParms == 2, VERR_INVALID_PARAMETER);
    10791078
    10801079    AssertPtrReturn(puHandle, VERR_INVALID_POINTER);
    1081     AssertPtrReturn(pcbDirEntry, VERR_INVALID_POINTER);
    10821080
    10831081    int rc;
     
    10881086        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_DIR_READ);
    10891087        VbglHGCMParmUInt32Set(&Msg.handle, 0);
    1090         VbglHGCMParmUInt32Set(&Msg.max_entry_size, 0);
    10911088
    10921089        rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
     
    10951092            Msg.context.GetUInt32(&pCtx->uContextID);
    10961093            Msg.handle.GetUInt32(puHandle);
    1097             Msg.max_entry_size.GetUInt32(pcbDirEntry);
    10981094        }
    10991095    } while (rc == VERR_INTERRUPTED && g_fVbglR3GuestCtrlHavePeekGetCancel);
     
    22742270 * @param   uRc                 Guest rc of operation (note: IPRT-style signed int).
    22752271 * @param   pEntry              Directory entry to send.
    2276  * @param   cbSize              Size (in bytes) of \a pDirEntry to send.
    2277  *                              This might be needed as the size can be bigger than GSTCTLDIRENTRYEX.
     2272 * @param   cbSize              Size (in bytes) of the OFFSET(GSTCTLDIRENTRYEX, szName[pEntry->cbName + 1]).
    22782273 *                              See RTDirReadEx() for more information.
    22792274 * @param   pszUser             Associated user ID (owner, uid) as a string.
     
    23092304 * @param   uRc                 Guest rc of operation (note: IPRT-style signed int).
    23102305 * @param   pEntry              Directory entry to send.
    2311  * @param   cbSize              Size (in bytes) of \a pDirEntry to send.
    2312  *                              This might be needed as the size can be bigger than GSTCTLDIRENTRYEX.
     2306 * @param   cbSize              Size (in bytes) of the OFFSET(GSTCTLDIRENTRYEX, szName[pEntry->cbName + 1]).
    23132307 *                              See RTDirReadEx() for more information.
    23142308 */
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