VirtualBox

Ignore:
Timestamp:
Oct 12, 2015 1:46:16 PM (9 years ago)
Author:
vboxsync
Message:

VBoxGuestLib: u32ClientI[Dd] -> idClient. Some cleanups.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp

    r58154 r58183  
    314314
    315315    int rc, rc2 = VERR_UNRESOLVED_ERROR;
    316     uint32_t u32ClientId = 0;
     316    HGCMCLIENTID idClient = 0;
    317317    const char *pszPattern = VIDEO_PROP_PREFIX"*";
    318318    PVBGLR3GUESTPROPENUM pHandle = NULL;
     
    321321
    322322    AssertPtrReturn(pcScreen, VERR_INVALID_POINTER);
    323     rc = VbglR3GuestPropConnect(&u32ClientId);
    324     if (RT_SUCCESS(rc))
    325         rc = VbglR3GuestPropEnum(u32ClientId, &pszPattern, 1, &pHandle,
    326                                  &pszName, NULL, NULL, NULL);
     323    rc = VbglR3GuestPropConnect(&idClient);
     324    if (RT_SUCCESS(rc))
     325        rc = VbglR3GuestPropEnum(idClient, &pszPattern, 1, &pHandle, &pszName, NULL, NULL, NULL);
    327326    if (u32ClientId != 0)
    328327        rc2 = VbglR3GuestPropDisconnect(u32ClientId);
     
    333332        uint32_t cScreen;
    334333
    335         rc = RTStrToUInt32Full(pszName + sizeof(VIDEO_PROP_PREFIX) - 1, 10,
    336                                &cScreen);
     334        rc = RTStrToUInt32Full(pszName + sizeof(VIDEO_PROP_PREFIX) - 1, 10, &cScreen);
    337335        if (RT_SUCCESS(rc))  /* There may be similar properties with text. */
    338336            cHighestScreen = RT_MAX(cHighestScreen, cScreen);
     
    366364    using namespace guestProp;
    367365
    368     uint32_t u32ClientId = 0;
     366    HGCMCLIENTID idClient = 0;
    369367    unsigned cx2, cy2, cBits2, x2, y2, cHighestScreen, cHighestScreen2;
    370368    bool fEnabled2;
     
    374372    rc = VbglR3VideoModeGetHighestSavedScreen(&cHighestScreen);
    375373    if (RT_SUCCESS(rc))
    376         rc = VbglR3GuestPropConnect(&u32ClientId);
     374        rc = VbglR3GuestPropConnect(&idClient);
    377375    if (RT_SUCCESS(rc))
    378376    {
     
    382380        RTStrPrintf(szModeParms, sizeof(szModeParms), "%ux%ux%u,%ux%u,%u", cx, cy, cBits, x, y, (unsigned) fEnabled);
    383381
    384         rc = VbglR3GuestPropWriteValue(u32ClientId, szModeName, szModeParms);
     382        rc = VbglR3GuestPropWriteValue(idClient, szModeName, szModeParms);
    385383        /* Write out the mode using the legacy name too, in case the user
    386384         * re-installs older Additions. */
     
    388386        {
    389387            RTStrPrintf(szModeParms, sizeof(szModeParms), "%ux%ux%u", cx, cy, cBits);
    390             VbglR3GuestPropWriteValue(u32ClientId, VIDEO_PROP_PREFIX "SavedMode", szModeParms);
     388            VbglR3GuestPropWriteValue(idClient, VIDEO_PROP_PREFIX "SavedMode", szModeParms);
    391389        }
    392390    }
    393     if (u32ClientId != 0)
    394         rc2 = VbglR3GuestPropDisconnect(u32ClientId);
     391    if (idClient != 0)
     392        rc2 = VbglR3GuestPropDisconnect(idClient);
    395393    if (rc == VINF_PERMISSION_DENIED)
    396394        return rc;
     
    440438    using namespace guestProp;
    441439
    442 /*
    443  * First we retrieve the video mode which is saved as a string in the
    444  * guest property store.
    445  */
     440    /*
     441     * First we retrieve the video mode which is saved as a string in the
     442     * guest property store.
     443     */
    446444    /* The buffer for VbglR3GuestPropReadValue.  If this is too small then
    447445     * something is wrong with the data stored in the property. */
    448446    char szModeParms[1024];
    449     uint32_t u32ClientId = 0;
     447    HGCMCLIENTID idClient = 0;
    450448    int cMatches;
    451449    unsigned cx, cy, cBits;
     
    456454    int rc2 = VERR_UNRESOLVED_ERROR;
    457455
    458     rc = VbglR3GuestPropConnect(&u32ClientId);
     456    rc = VbglR3GuestPropConnect(&idClient);
    459457    if (RT_SUCCESS(rc))
    460458    {
     
    462460        char szModeName[MAX_NAME_LEN];
    463461        RTStrPrintf(szModeName, sizeof(szModeName), VIDEO_PROP_PREFIX "%u", idScreen);
    464         rc = VbglR3GuestPropReadValue(u32ClientId, szModeName, szModeParms,
    465                                       sizeof(szModeParms), NULL);
     462        rc = VbglR3GuestPropReadValue(idClient, szModeName, szModeParms, sizeof(szModeParms), NULL);
    466463        /* Try legacy single screen name. */
    467464        if (rc == VERR_NOT_FOUND && idScreen == 0)
    468             rc = VbglR3GuestPropReadValue(u32ClientId,
     465            rc = VbglR3GuestPropReadValue(idClient,
    469466                                          VIDEO_PROP_PREFIX"SavedMode",
    470467                                          szModeParms, sizeof(szModeParms),
    471468                                          NULL);
    472469    }
    473     if (u32ClientId != 0)
    474         rc2 = VbglR3GuestPropDisconnect(u32ClientId);
     470    if (idClient != 0)
     471        rc2 = VbglR3GuestPropDisconnect(idClient);
    475472    if (RT_SUCCESS(rc))
    476473        rc = rc2;
    477474
    478 /*
    479  * Now we convert the string returned to numeric values.
    480  */
     475    /*
     476     * Now we convert the string returned to numeric values.
     477     */
    481478    if (RT_SUCCESS(rc))
    482479    {
    483480        char c1, c2;
    484         cMatches = sscanf(szModeParms, "%5ux%5ux%2u%c%5ux%5u,%1u%c", &cx, &cy, &cBits,
    485                           &c1, &x, &y, &fEnabled, &c2);
     481        cMatches = sscanf(szModeParms, "%5ux%5ux%2u%c%5ux%5u,%1u%c", &cx, &cy, &cBits, &c1, &x, &y, &fEnabled, &c2);
    486482        if ((cMatches == 7 && c1 == ',') || cMatches == 3)
    487483            rc = VINF_SUCCESS;
     
    491487            rc = VERR_PARSE_ERROR;
    492488    }
    493 /*
    494  * And clean up and return the values if we successfully obtained them.
    495  */
     489
     490    /*
     491     * And clean up and return the values if we successfully obtained them.
     492     */
    496493    if (RT_SUCCESS(rc))
    497494    {
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