VirtualBox

Changeset 50406 in vbox


Ignore:
Timestamp:
Feb 10, 2014 8:35:11 PM (11 years ago)
Author:
vboxsync
Message:

Some RTEnvGet cleanup, adding todos for the rest.

Location:
trunk/src/VBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp

    r47252 r50406  
    534534{
    535535    const char *pszEnvTemp;
    536 
     536/** @todo r=bird: This isn't up to scratch. The life time of an RTEnvGet
     537 *        return value is only up to the next RTEnv*, *getenv, *putenv,
     538 *        setenv call in _any_ process in the system and the it has known and
     539 *        documented code page issues.
     540 *
     541 *        Use RTEnvGetEx instead! */
    537542    if ((pszEnvTemp = RTEnvGet("VBOX_CAPTUREWIDTH")) != 0)
    538543    {
     
    650655    unsigned fCSAM  = ~0U;
    651656#ifdef VBOX_WITH_VIDEO_REC
    652     unsigned fVIDEOREC = 0;
     657    bool fVideoRec = 0;
    653658    unsigned long ulFrameWidth = 800;
    654659    unsigned long ulFrameHeight = 600;
    655     unsigned long ulBitRate = 300000;
    656     char pszMPEGFile[RTPATH_MAX];
     660    unsigned long ulBitRate = 300000; /** @todo r=bird: The COM type ULONG isn't unsigned long, it's 32-bit unsigned int. */
     661    char szMpegFile[RTPATH_MAX];
    657662    const char *pszFileNameParam = "VBox-%d.vob";
    658663#endif /* VBOX_WITH_VIDEO_REC */
    659664
    660     LogFlow (("VBoxHeadless STARTED.\n"));
    661     RTPrintf (VBOX_PRODUCT " Headless Interface " VBOX_VERSION_STRING "\n"
    662               "(C) 2008-" VBOX_C_YEAR " " VBOX_VENDOR "\n"
    663               "All rights reserved.\n\n");
     665    LogFlow(("VBoxHeadless STARTED.\n"));
     666    RTPrintf(VBOX_PRODUCT " Headless Interface " VBOX_VERSION_STRING "\n"
     667             "(C) 2008-" VBOX_C_YEAR " " VBOX_VENDOR "\n"
     668             "All rights reserved.\n\n");
    664669
    665670#ifdef VBOX_WITH_VIDEO_REC
     
    792797#ifdef VBOX_WITH_VIDEO_REC
    793798            case 'c':
    794                 fVIDEOREC = true;
     799                fVideoRec = true;
    795800                break;
    796801            case 'w':
     
    856861        return 1;
    857862    }
    858     RTStrPrintf(&pszMPEGFile[0], RTPATH_MAX, pszFileNameParam, RTProcSelf());
     863    RTStrPrintf(&szMpegFile[0], RTPATH_MAX, pszFileNameParam, RTProcSelf());
    859864#endif /* defined VBOX_WITH_VIDEO_REC */
    860865
     
    971976        PFNREGISTERVIDEORECFB pfnRegisterVideoRecFB;
    972977
    973         if (fVIDEOREC)
     978        if (fVideoRec)
    974979        {
    975980            HRESULT         rcc = S_OK;
     
    9951000                Log2(("VBoxHeadless: calling pfnRegisterVideoRecFB\n"));
    9961001                rcc = pfnRegisterVideoRecFB(ulFrameWidth, ulFrameHeight, ulBitRate,
    997                                          pszMPEGFile, &pFramebuffer);
     1002                                         szMpegFile, &pFramebuffer);
    9981003                if (rcc != S_OK)
    9991004                    LogError("Failed to initialise video capturing - make sure that the file format\n"
     
    10211026        {
    10221027# ifdef VBOX_WITH_VIDEO_REC
    1023             if (fVIDEOREC && uScreenId == 0)
     1028            if (fVideoRec && uScreenId == 0)
    10241029            {
    10251030                /* Already registered. */
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp

    r46658 r50406  
    168168#ifdef RT_OS_WINDOWS
    169169    /* default to DirectX if nothing else set */
    170     if (!RTEnvGet("SDL_VIDEODRIVER"))
     170    if (!RTEnvExist("SDL_VIDEODRIVER"))
    171171    {
    172172        _putenv("SDL_VIDEODRIVER=directx");
  • trunk/src/VBox/HostServices/SharedOpenGL/OpenGLTest/OpenGLTest.cpp

    r44529 r50406  
    3232bool RTCALL VBoxOglIs3DAccelerationSupported()
    3333{
    34     if (RTEnvGet("VBOX_CROGL_FORCE_SUPPORTED"))
     34    if (RTEnvExist("VBOX_CROGL_FORCE_SUPPORTED"))
    3535    {
    3636        LogRel(("VBOX_CROGL_FORCE_SUPPORTED is specified, skipping 3D test, and treating as supported\n"));
  • trunk/src/VBox/HostServices/SharedOpenGL/OpenGLTest/OpenGLTestDarwin.cpp

    r44529 r50406  
    3232bool RTCALL VBoxOglIs3DAccelerationSupported()
    3333{
    34     if (RTEnvGet("VBOX_CROGL_FORCE_SUPPORTED"))
     34    if (RTEnvExist("VBOX_CROGL_FORCE_SUPPORTED"))
    3535    {
    3636        LogRel(("VBOX_CROGL_FORCE_SUPPORTED is specified, skipping 3D test, and treating as supported\n"));
  • trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp

    r48694 r50406  
    177177    for (unsigned i = 0; i < RT_ELEMENTS(s_aProps); i++)
    178178    {
    179         const char *pszEnvValue = RTEnvGet(s_aProps[i].pszEnvName);
    180         if (pszEnvValue)
     179        char szEnvValue[8192];
     180        int rcEnv = RTEnvGetEx(RTENV_DEFAULT, s_aProps[i].pszEnvName, szEnvValue, sizeof(szEnvValue), NULL);
     181        if (RT_SUCCESS(rc))
    181182        {
    182             rc = RTDbgCfgChangeString(pUVM->dbgf.s.hDbgCfg, s_aProps[i].enmProp, RTDBGCFGOP_PREPEND, pszEnvValue);
     183            rc = RTDbgCfgChangeString(pUVM->dbgf.s.hDbgCfg, s_aProps[i].enmProp, RTDBGCFGOP_PREPEND, szEnvValue);
    183184            if (RT_FAILURE(rc))
    184185                return VMR3SetError(pUVM, rc, RT_SRC_POS,
    185                                     "DBGF Config Error: %s=%s -> %Rrc", s_aProps[i].pszEnvName, pszEnvValue, rc);
     186                                    "DBGF Config Error: %s=%s -> %Rrc", s_aProps[i].pszEnvName, szEnvValue, rc);
    186187        }
     188        else if (rc != VERR_ENV_VAR_NOT_FOUND)
     189            return VMR3SetError(pUVM, rc, RT_SRC_POS,
     190                                "DBGF Config Error: Error querying env.var. %s: %Rrc", s_aProps[i].pszEnvName, rc);
    187191
    188192        char *pszCfgValue;
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