VirtualBox

Changeset 72906 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Jul 4, 2018 10:22:16 PM (7 years ago)
Author:
vboxsync
Message:

com::Guid: be optimistic, test for RT_SUCCESS when parsing strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/Guid.h

    r72905 r72906  
    427427        {
    428428            int rc = ::RTUuidFromStr(&mUuid, that);
    429             if (RT_FAILURE(rc))
     429            if (RT_SUCCESS(rc))
     430                updateState();
     431            else
    430432                makeInvalid();
     433        }
     434        dbg_refresh();
     435    }
     436
     437    void initBSTR(CBSTR that)
     438    {
     439        if (!that || !*that)
     440        {
     441            makeClear();
     442        }
     443        else
     444        {
     445            int rc = ::RTUuidFromUtf16(&mUuid, that);
     446            if (RT_SUCCESS(rc))
     447                updateState();
    431448            else
    432                 updateState();
    433         }
    434         dbg_refresh();
    435     }
    436 
    437     void initBSTR(CBSTR that)
    438     {
    439         if (!that || !*that)
    440         {
    441             makeClear();
    442         }
    443         else
    444         {
    445             int rc = ::RTUuidFromUtf16(&mUuid, that);
    446             if (RT_FAILURE(rc))
    447449                makeInvalid();
    448             else
    449                 updateState();
    450450        }
    451451        dbg_refresh();
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