VirtualBox

Ignore:
Timestamp:
Nov 21, 2024 4:12:02 PM (8 weeks ago)
Author:
vboxsync
Message:

iprt/cdefs.h,SUPDrvIOC.h,VBoxGuestR0Lib: Added a RT_UOFFSETOF_FLEX_ARRAY macro for calculating the size of structures ending with an variables length arrays. Only tested on windows... bugref:10585

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibHGCMInternal.cpp

    r107089 r107091  
    437437                    {
    438438                        size_t const cPages = RTR0MemObjSize(hObj) >> PAGE_SHIFT;
    439                         *pcbExtra += RT_UOFFSETOF_DYN(HGCMPageListInfo, aPages)
    440                                      + RT_SIZEOFMEMB(HGCMPageListInfo, aPages) * cPages;
     439                        *pcbExtra += RT_UOFFSETOF_FLEX_ARRAY(HGCMPageListInfo, aPages, cPages);
    441440                    }
    442441                }
     
    647646                        }
    648647
    649                         offExtra += (uint32_t)(RT_UOFFSETOF_DYN(HGCMPageListInfo, aPages)
    650                                     + RT_SIZEOFMEMB(HGCMPageListInfo, aPages) * cPages);
     648                        offExtra += (uint32_t)RT_UOFFSETOF_FLEX_ARRAY(HGCMPageListInfo, aPages, cPages);
    651649                    }
    652650                    else
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