VirtualBox

Changeset 9920 in vbox


Ignore:
Timestamp:
Jun 25, 2008 2:19:31 PM (17 years ago)
Author:
vboxsync
Message:

Corrected hungarian spelling. Added a todo.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxGuest.h

    r9918 r9920  
    15651565VBGLR3DECL(int)     VbglR3DisplayChangeWaitEvent(uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits, uint32_t *piDisplay);
    15661566VBGLR3DECL(bool)    VbglR3HostLikesVideoMode(uint32_t cx, uint32_t cy, uint32_t cBits);
    1567 VBGLR3DECL(int)     VbglR3SaveVideoMode(char *pszName, uint32_t cx, uint32_t cy, uint32_t cBits);
    1568 VBGLR3DECL(int)     VbglR3RetrieveVideoMode(char *pszName, uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits);
     1567VBGLR3DECL(int)     VbglR3SaveVideoMode(const char *pszName, uint32_t cx, uint32_t cy, uint32_t cBits);
     1568VBGLR3DECL(int)     VbglR3RetrieveVideoMode(const char *pszName, uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits);
    15691569/** @}  */
    15701570
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp

    r9830 r9920  
    236236/**
    237237 * Save video mode parameters to the registry.
    238  * 
     238 *
    239239 * @returns iprt status value
    240240 * @param   pszName the name to save the mode parameters under
     
    243243 * @param   cBits   bits per pixel for the mode
    244244 */
    245 VBGLR3DECL(int) VbglR3SaveVideoMode(char *pszName, uint32_t cx, uint32_t cy, uint32_t cBits)
     245VBGLR3DECL(int) VbglR3SaveVideoMode(const char *pszName, uint32_t cx, uint32_t cy, uint32_t cBits)
    246246{
    247247    using namespace svcInfo;
    248248
    249     char pcModeName[KEY_MAX_LEN];
    250     char pcModeParms[KEY_MAX_VALUE_LEN];
     249    char szModeName[KEY_MAX_LEN];
     250    char szModeParms[KEY_MAX_VALUE_LEN];
    251251    uint32_t u32ClientId = 0;
    252     RTStrPrintf(pcModeName, sizeof(pcModeName), "VideoMode/%s", pszName);
    253     RTStrPrintf(pcModeParms, sizeof(pcModeParms), "%dx%dx%d", cx, cy, cBits);
     252    RTStrPrintf(szModeName, sizeof(szModeName), "VideoMode/%s", pszName);
     253    RTStrPrintf(szModeParms, sizeof(szModeParms), "%dx%dx%d", cx, cy, cBits);
    254254    int rc = VbglR3InfoSvcConnect(&u32ClientId);
    255255    if (RT_SUCCESS(rc))
    256         rc = VbglR3InfoSvcWriteKey(u32ClientId, pcModeName, pcModeParms);
     256        rc = VbglR3InfoSvcWriteKey(u32ClientId, szModeName, szModeParms);
    257257    if (u32ClientId != 0)
    258258        VbglR3InfoSvcDisconnect(u32ClientId);  /* Return value ignored, because what can we do anyway? */
     
    263263/**
    264264 * Retrieve video mode parameters from the registry.
    265  * 
     265 *
    266266 * @returns iprt status value
    267267 * @param   pszName the name under which the mode parameters are saved
     
    270270 * @param   pcBits  where to store the bits per pixel for the mode
    271271 */
    272 VBGLR3DECL(int) VbglR3RetrieveVideoMode(char *pszName, uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits)
     272VBGLR3DECL(int) VbglR3RetrieveVideoMode(const char *pszName, uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits)
    273273{
    274274    using namespace svcInfo;
    275275
    276     char pcModeName[KEY_MAX_LEN];
    277     char pcModeParms[KEY_MAX_VALUE_LEN];
     276    char szModeParms[KEY_MAX_VALUE_LEN];
    278277    char *pszNext;
    279278    uint32_t u32ClientId = 0;
    280279    uint32_t cx, cy, cBits;
    281280
    282     RTStrPrintf(pcModeName, sizeof(pcModeName), "VideoMode/%s", pszName);
    283281    int rc = VbglR3InfoSvcConnect(&u32ClientId);
    284282    if (RT_SUCCESS(rc))
    285         rc = VbglR3InfoSvcReadKey(u32ClientId, pcModeName, pcModeParms,
    286                                   sizeof(pcModeParms), NULL);
     283    {
     284        char szModeName[KEY_MAX_LEN];
     285        RTStrPrintf(szModeName, sizeof(szModeName), "VideoMode/%s", pszName);
     286        rc = VbglR3InfoSvcReadKey(u32ClientId, szModeName, szModeParms,
     287                                  sizeof(szModeParms), NULL); /** @todo add a VbglR3InfoSvcReadKeyF/FV that does the RTStrPrintf for you. */
     288    }
     289/** @todo r=bird: this is kind of ugly.
     290 * What about just fixing the format as "CXxCYxCBITS" and then split it up into three strings by searching for the
     291 * two 'x'es. And then apply RTStrToUInt32Full to these in turn.
     292 * Also, the use of VERR_INVALID_PARAMETER seems inappropriate and confusing here. */
    287293    if (RT_SUCCESS(rc))
    288294        /* Extract the width from the string */
    289         rc = RTStrToUInt32Ex(pcModeParms, &pszNext, 10, &cx);
     295        rc = RTStrToUInt32Ex(szModeParms, &pszNext, 10, &cx);
    290296    if (   (VWRN_NUMBER_TOO_BIG == rc)
    291297        || (VWRN_NEGATIVE_UNSIGNED == rc)
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