VirtualBox

Changeset 93973 in vbox for trunk/include/VBox/GuestHost


Ignore:
Timestamp:
Feb 28, 2022 11:40:28 AM (3 years ago)
Author:
vboxsync
Message:

Validation Kit/HGCM: Split out the HGCM testing (mocking) framework into an own header, added documentation, more code for generalizing this [build fix].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/GuestHost/HGCMMock.h

    r93972 r93973  
    3131 */
    3232
    33 #ifndef VBOX_INCLUDED_HGCMMock_h
    34 #define VBOX_INCLUDED_HGCMMock_h
     33#ifndef VBOX_INCLUDED_GuestHost_HGCMMock_h
     34#define VBOX_INCLUDED_GuestHost_HGCMMock_h
    3535#ifndef RT_WITHOUT_PRAGMA_ONCE
    3636# pragma once
     
    397397    PTSTHGCMMOCKSVC pSvc = TstHgcmMockSvcInst();
    398398
    399     for (size_t i = 0; RT_ELEMENTS(pSvc->aHgcmClient); i++)
     399    size_t i = 0;
     400    for (i; RT_ELEMENTS(pSvc->aHgcmClient); i++)
    400401    {
    401402        PTSTHGCMMOCKCLIENT pClient = &pSvc->aHgcmClient[i];
     
    694695VBGLR3DECL(int) VbglR3HGCMCall(PVBGLIOCHGCMCALL pInfo, size_t cbInfo)
    695696{
     697    RT_NOREF(cbInfo);
     698
    696699    AssertMsg(pInfo->Hdr.cbIn  == cbInfo, ("cbIn=%#x cbInfo=%#zx\n", pInfo->Hdr.cbIn, cbInfo));
    697700    AssertMsg(pInfo->Hdr.cbOut == cbInfo, ("cbOut=%#x cbInfo=%#zx\n", pInfo->Hdr.cbOut, cbInfo));
     
    700703    HGCMFunctionParameter *offSrcParms = VBGL_HGCM_GET_CALL_PARMS(pInfo);
    701704    PVBOXHGCMSVCPARM       paDstParms  = (PVBOXHGCMSVCPARM)RTMemAlloc(pInfo->cParms * sizeof(VBOXHGCMSVCPARM));
    702     for (uint16_t i = 0; i < pInfo->cParms; i++)
     705
     706    uint16_t i = 0;
     707    for (i; i < pInfo->cParms; i++)
    703708    {
    704709        switch (offSrcParms->type)
     
    743748        offSrcParms = VBGL_HGCM_GET_CALL_PARMS(pInfo);
    744749
    745         for (uint16_t i = 0; i < pInfo->cParms; i++)
     750        uint16_t i = 0;
     751        for (; i < pInfo->cParms; i++)
    746752        {
    747753            paDstParms[i].type = offSrcParms->type;
     
    781787#endif /* IN_RING3 */
    782788
    783 #endif /* !VBOX_INCLUDED_HGCMMock_h */
     789#endif /* !VBOX_INCLUDED_GuestHost_HGCMMock_h */
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