VirtualBox

Ignore:
Timestamp:
Feb 20, 2008 11:54:09 AM (17 years ago)
Author:
vboxsync
Message:

XPCOM/IPC: Made IPC_AddName()/IPC_RemoveName(), IPC_DefineTarget() to return a failure when the name/target is already defined or when a non-existent name/target is requested for removal.

Location:
trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcIDList.h

    r1 r7029  
    8686    }
    8787
    88     void FindAndDelete(const nsID &id)
     88    PRBool FindAndDelete(const nsID &id)
    8989    {
    9090        ipcIDNode *node = FindNodeBefore(mHead, id);
    91         if (node)
     91        if (node) {
    9292            DeleteAfter(node);
    93         else
     93            return PR_TRUE;
     94        }
     95        else if (!IsEmpty()) {
    9496            DeleteFirst();
     97            return PR_TRUE;
     98        }
     99
     100        return PR_FALSE;
    95101    }
    96102
  • trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcStringList.h

    r1 r7029  
    9292    }
    9393
    94     void FindAndDelete(const char *str)
     94    PRBool FindAndDelete(const char *str)
    9595    {
    9696        ipcStringNode *node = FindNodeBefore(mHead, str);
    97         if (node)
     97        if (node) {
    9898            DeleteAfter(node);
    99         else
     99            return PR_TRUE;
     100        }
     101        else if (!IsEmpty()) {
    100102            DeleteFirst();
     103            return PR_TRUE;
     104        }
     105
     106        return PR_FALSE;
    101107    }
    102108
  • trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcm.h

    r1 r7029  
    129129
    130130//
    131 // return IPCM message request index. 
     131// return IPCM message request index.
    132132//
    133133static inline PRUint32
     
    258258// This request message has as its payload a null-terminated ASCII character
    259259// string indicating the client name to query.
    260 // 
     260//
    261261
    262262// ACKNOWLEDGEMENTS
     
    272272// codes):
    273273//
    274 #define IPCM_OK               0  // success: generic
    275 #define IPCM_ERROR_GENERIC   -1  // failure: generic
    276 #define IPCM_ERROR_NO_CLIENT -2  // failure: client does not exist
     274#define IPCM_OK                      0  // success: generic
     275#define IPCM_ERROR_GENERIC          -1  // failure: generic
     276#define IPCM_ERROR_NO_CLIENT        -2  // failure: client does not exist
     277#define IPCM_ERROR_INVALID_ARG      -3  // failure: invalid request argument
     278#define IPCM_ERROR_NO_SUCH_DATA     -4  // failure: requested data does not exist
     279#define IPCM_ERROR_ALREADY_EXISTS   -5  // failure: data to set already exists
    277280
    278281//
     
    310313// This message is sent by the daemon to a client on behalf of another client.
    311314// The recipient is expected to unpack the contained message and process it.
    312 // 
     315//
    313316// The payload of this message matches the payload of IPCM_MSG_REQ_FORWARD,
    314317// with the exception that the clientID field is set to the clientID of the
     
    323326//       adds no additional member variables.  |operator new| should be used
    324327//       to allocate one of the IPCM helper classes, e.g.:
    325 //         
     328//
    326329//          ipcMessage *msg = new ipcmMessageClientHello("foo");
    327330//
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