VirtualBox

Changeset 19743 in vbox


Ignore:
Timestamp:
May 15, 2009 2:45:51 PM (16 years ago)
Author:
vboxsync
Message:

cbinding: UUID check in tstXPCOMCCall.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/cbinding/tstXPCOMCCall.c

    r19728 r19743  
    4848int volatile g_refcount = 0;
    4949
     50/* #define for printing nsID type UUID's */
     51
     52#define printUUID(iid) \
     53{\
     54    printf(#iid ": {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n",\
     55           (unsigned)(iid)->m0,\
     56           (unsigned)(iid)->m1,\
     57           (unsigned)(iid)->m2,\
     58           (unsigned)(iid)->m3[0],\
     59           (unsigned)(iid)->m3[1],\
     60           (unsigned)(iid)->m3[2],\
     61           (unsigned)(iid)->m3[3],\
     62           (unsigned)(iid)->m3[4],\
     63           (unsigned)(iid)->m3[5],\
     64           (unsigned)(iid)->m3[6],\
     65           (unsigned)(iid)->m3[7]);\
     66}\
     67
    5068/**
    5169 * Callback functions
     
    246264{
    247265    IConsoleCallback *that = (IConsoleCallback *)pThis;
     266    const nsID ivirtualboxCallbackUUID = IVIRTUALBOXCALLBACK_IID;
    248267
    249268    /* match iid */
    250     ++g_refcount;
    251     printf("QueryInterface: %d\n", g_refcount);
    252     *resultp = that;
    253     return NS_OK;
     269    if (memcmp(iid, &ivirtualboxCallbackUUID, sizeof(nsID)) == 0)
     270    {
     271        ++g_refcount;
     272        printf("QueryInterface: %d\n", g_refcount);
     273        *resultp = that;
     274        return NS_OK;
     275    }
     276    else
     277    {
     278        printf("vboxCallback QueryInterface didn't find a matching interface\n");
     279        printUUID(iid);
     280        printUUID(&ivirtualboxCallbackUUID);
     281        return NS_NOINTERFACE;
     282    }
    254283}
    255284
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