VirtualBox

Ignore:
Timestamp:
Jul 5, 2007 12:56:04 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
22672
Message:

Extension checks

Location:
trunk/src/VBox/HostServices/SharedOpenGL
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/gldrv.h

    r3459 r3460  
    150150void vboxglDrvSwapBuffers(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
    151151
     152bool vboxDrvIsExtensionAvailable(char *pszExtFunctionName);
     153
    152154#endif /* __VBOXGLWIN__H */
  • trunk/src/VBox/HostServices/SharedOpenGL/gllindrv.cpp

    r3338 r3460  
    216216    pClient->lastretval = 0; /** @todo */
    217217}
     218
     219bool vboxDrvIsExtensionAvailable(char *pszExtFunctionName)
     220{
     221    return false;
     222}
     223
  • trunk/src/VBox/HostServices/SharedOpenGL/glwindrv.cpp

    r3438 r3460  
    416416        ReleaseDC(0, pClient->hdc);
    417417}
     418
     419bool vboxDrvIsExtensionAvailable(char *pszExtFunctionName)
     420{
     421    return !!wglGetProcAddress(pszExtFunctionName);
     422}
  • trunk/src/VBox/HostServices/SharedOpenGL/service.cpp

    r3444 r3460  
    257257        }
    258258
     259        case VBOXOGL_FN_GLCHECKEXT:
     260        {
     261            Log(("svcCall: VBOXOGL_FN_GLCHECKEXT\n"));
     262
     263            /* Verify parameter count and types. */
     264            if (cParms != VBOXOGL_CPARMS_GLCHECKEXT)
     265            {
     266                rc = VERR_INVALID_PARAMETER;
     267            }
     268            else
     269            if (    paParms[0].type != VBOX_HGCM_SVC_PARM_PTR       /* pszExtFnName */
     270               )
     271            {
     272                rc = VERR_INVALID_PARAMETER;
     273            }
     274            else
     275            {
     276                /* Fetch parameters. */
     277                char    *pszExtFnName = (char *)paParms[0].u.pointer.addr;
     278                uint32_t cbExtFnName  = paParms[0].u.pointer.size;
     279
     280                /* sanity checks */
     281                if (    cbExtFnName > 256
     282                    ||  pszExtFnName[cbExtFnName-1] != 0
     283                   )
     284                {
     285                    rc = VERR_INVALID_PARAMETER;
     286                }
     287                else
     288                {
     289                    /* Execute the function. */
     290                    if (vboxDrvIsExtensionAvailable(pszExtFnName))
     291                        rc = VINF_SUCCESS;
     292                    else
     293                        rc = VERR_FILE_NOT_FOUND;
     294
     295                    if (VBOX_SUCCESS(rc))
     296                    {
     297                        /* Update parameters.*/
     298                    }
     299                }
     300            }
     301            break;
     302        }
     303
    259304        default:
    260305        {
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