VirtualBox

Ignore:
Timestamp:
Jul 13, 2009 8:54:34 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
49976
Message:

crOpenGL: add protocol version check(4108), add max connected clients check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp

    r18637 r21523  
    131131    g_pFrameBuffer->COMGETTER(WinId)(&g_winId);
    132132    renderspuSetWindowId((uint32_t)g_winId);
    133     crVBoxServerAddClient(u32ClientID);
     133    rc = crVBoxServerAddClient(u32ClientID);
    134134#endif
    135135
     
    222222}
    223223
     224static void svcClientVersionUnsupported(uint32_t minor, uint32_t major)
     225{
     226    LogRel(("SHARED_CROPENGL: unsupported client version %d.%d\n", minor, major));
     227    /*todo add warning window*/
     228}
     229
    224230static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID, void *pvClient, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    225231{
     
    264270
    265271                /* Execute the function. */
    266                 crVBoxServerClientWrite(u32ClientID, pBuffer, cbBuffer);
     272                rc = crVBoxServerClientWrite(u32ClientID, pBuffer, cbBuffer);
     273                if (!RT_SUCCESS(rc))
     274                {
     275                    Assert(VERR_NOT_SUPPORTED==rc);
     276                    svcClientVersionUnsupported(0, 0);
     277                }
     278
    267279            }
    268280            break;
     
    297309                /* Update parameters.*/
    298310                paParms[0].u.pointer.size = cbBuffer; //@todo guest doesn't see this change somehow?
     311            } else if (VERR_NOT_SUPPORTED==rc)
     312            {
     313                svcClientVersionUnsupported(0, 0);
    299314            }
    300315
     
    332347
    333348                /* Execute the function. */
    334                 crVBoxServerClientWrite(u32ClientID, pBuffer, cbBuffer);
     349                rc = crVBoxServerClientWrite(u32ClientID, pBuffer, cbBuffer);
     350                if (!RT_SUCCESS(rc))
     351                {
     352                    Assert(VERR_NOT_SUPPORTED==rc);
     353                    svcClientVersionUnsupported(0, 0);
     354                }
     355
    335356                rc = crVBoxServerClientRead(u32ClientID, pWriteback, &cbWriteback);
    336357
     
    343364                paParms[2].u.uint32 = cbWriteback;
    344365            }
     366            break;
     367        }
     368
     369        case SHCRGL_GUEST_FN_SET_VERSION:
     370        {
     371            Log(("svcCall: SHCRGL_GUEST_FN_SET_VERSION\n"));
     372
     373            /* Verify parameter count and types. */
     374            if (cParms != SHCRGL_CPARMS_SET_VERSION)
     375            {
     376                rc = VERR_INVALID_PARAMETER;
     377            }
     378            else
     379            if (    paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT     /* vMajor */
     380                 || paParms[1].type != VBOX_HGCM_SVC_PARM_32BIT     /* vMinor */
     381               )
     382            {
     383                rc = VERR_INVALID_PARAMETER;
     384            }
     385            else
     386            {
     387                /* Fetch parameters. */
     388                uint32_t vMajor    = paParms[0].u.uint32;
     389                uint32_t vMinor    = paParms[1].u.uint32;
     390
     391                /* Execute the function. */
     392                rc = crVBoxServerClientSetVersion(u32ClientID, vMajor, vMinor);
     393
     394                if (!RT_SUCCESS(rc))
     395                {
     396                    /*@todo, add warning window*/
     397                    svcClientVersionUnsupported(vMajor, vMinor);
     398                }
     399            }
     400
    345401            break;
    346402        }
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