VirtualBox

Changeset 51095 in vbox


Ignore:
Timestamp:
Apr 17, 2014 9:05:11 AM (11 years ago)
Author:
vboxsync
Message:

Main: code adjustment

File:
1 edited

Legend:

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

    r51092 r51095  
    3333#include <iprt/time.h>
    3434#include <iprt/cpp/utils.h>
     35#include <iprt/alloca.h>
    3536
    3637#include <VBox/vmm/pdmdrv.h>
     
    36333634        return VERR_INVALID_STATE;
    36343635
    3635     struct {
    3636         VBOXCRCMDCTL_HGCM data;
    3637         VBOXHGCMSVCPARM aParms[4];
    3638     } s;
    3639 
    3640     s.data.Hdr.enmType = VBOXCRCMDCTL_TYPE_HGCM;
    3641     s.data.Hdr.u32Function = SHCRGL_HOST_FN_VIEWPORT_CHANGED;
    3642 
    3643     s.data.aParms[0].type = VBOX_HGCM_SVC_PARM_32BIT;
    3644     s.data.aParms[0].u.uint32 = aScreenId;
    3645 
    3646     s.data.aParms[1].type = VBOX_HGCM_SVC_PARM_32BIT;
    3647     s.data.aParms[1].u.uint32 = x;
    3648 
    3649     s.data.aParms[2].type = VBOX_HGCM_SVC_PARM_32BIT;
    3650     s.data.aParms[2].u.uint32 = y;
    3651 
    3652     s.data.aParms[3].type = VBOX_HGCM_SVC_PARM_32BIT;
    3653     s.data.aParms[3].u.uint32 = width;
    3654 
    3655     s.data.aParms[4].type = VBOX_HGCM_SVC_PARM_32BIT;
    3656     s.data.aParms[4].u.uint32 = height;
    3657 
    3658     return crCtlSubmitSync(&s.data.Hdr, RT_OFFSETOF(VBOXCRCMDCTL_HGCM, aParms[5]));
     3636    size_t cbData = RT_UOFFSETOF(VBOXCRCMDCTL_HGCM, aParms[5]);
     3637    VBOXCRCMDCTL_HGCM *pData = (VBOXCRCMDCTL_HGCM*)alloca(cbData);
     3638
     3639    pData->Hdr.enmType = VBOXCRCMDCTL_TYPE_HGCM;
     3640    pData->Hdr.u32Function = SHCRGL_HOST_FN_VIEWPORT_CHANGED;
     3641
     3642    pData->aParms[0].type = VBOX_HGCM_SVC_PARM_32BIT;
     3643    pData->aParms[0].u.uint32 = aScreenId;
     3644
     3645    pData->aParms[1].type = VBOX_HGCM_SVC_PARM_32BIT;
     3646    pData->aParms[1].u.uint32 = x;
     3647
     3648    pData->aParms[2].type = VBOX_HGCM_SVC_PARM_32BIT;
     3649    pData->aParms[2].u.uint32 = y;
     3650
     3651    pData->aParms[3].type = VBOX_HGCM_SVC_PARM_32BIT;
     3652    pData->aParms[3].u.uint32 = width;
     3653
     3654    pData->aParms[4].type = VBOX_HGCM_SVC_PARM_32BIT;
     3655    pData->aParms[4].u.uint32 = height;
     3656
     3657    return crCtlSubmitSync(&pData->Hdr, cbData);
    36593658}
    36603659#endif
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