Index: /trunk/include/VBox/HostServices/Service.h
===================================================================
--- /trunk/include/VBox/HostServices/Service.h	(revision 85317)
+++ /trunk/include/VBox/HostServices/Service.h	(revision 85318)
@@ -30,6 +30,4 @@
 #endif
 
-#include <memory>  /* for auto_ptr */
-
 #include <VBox/log.h>
 #include <VBox/hgcmsvc.h>
@@ -39,4 +37,6 @@
 #include <iprt/cpp/utils.h>
 
+#include <new>
+
 
 namespace HGCM
@@ -50,5 +50,5 @@
     /** HGCM helper functions. */
     PVBOXHGCMSVCHELPERS pHelpers;
-    /*
+    /**
      * Callback function supplied by the host for notification of updates
      * to properties.
@@ -65,34 +65,23 @@
 {
 public:
-
     Message(void);
-
     Message(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM aParms[]);
-
     virtual ~Message(void);
 
-    uint32_t GetParamCount(void) const;
-
-    int GetData(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM aParms[]) const;
-
-    int GetParmU32(uint32_t uParm, uint32_t *pu32Info) const;
-
-    int GetParmU64(uint32_t uParm, uint64_t *pu64Info) const;
-
-    int GetParmPtr(uint32_t uParm, void **ppvAddr, uint32_t *pcbSize) const;
-
-    uint32_t GetType(void) const;
-
-public:
-
-    static int CopyParms(PVBOXHGCMSVCPARM paParmsDst, uint32_t cParmsDst,
-                         PVBOXHGCMSVCPARM paParmsSrc, uint32_t cParmsSrc,
-                         bool fDeepCopy);
-
-protected:
-
-    int initData(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM aParms[]);
-
-    void reset();
+    uint32_t    GetParamCount(void) const RT_NOEXCEPT;
+    int         GetData(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM aParms[]) const RT_NOEXCEPT;
+    int         GetParmU32(uint32_t uParm, uint32_t *pu32Info) const RT_NOEXCEPT;
+    int         GetParmU64(uint32_t uParm, uint64_t *pu64Info) const RT_NOEXCEPT;
+    int         GetParmPtr(uint32_t uParm, void **ppvAddr, uint32_t *pcbSize) const RT_NOEXCEPT;
+    uint32_t    GetType(void) const RT_NOEXCEPT;
+
+public:
+    static int  CopyParms(PVBOXHGCMSVCPARM paParmsDst, uint32_t cParmsDst,
+                          PVBOXHGCMSVCPARM paParmsSrc, uint32_t cParmsSrc,
+                          bool fDeepCopy) RT_NOEXCEPT;
+
+protected:
+    int         initData(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM aParms[]) RT_NOEXCEPT;
+    void        reset() RT_NOEXCEPT;
 
 protected:
@@ -112,50 +101,34 @@
 {
 public:
-
-    Client(uint32_t uClientID);
-
+    Client(uint32_t idClient);
     virtual ~Client(void);
 
 public:
-
-    int Complete(VBOXHGCMCALLHANDLE hHandle, int rcOp = VINF_SUCCESS);
-
-    int CompleteDeferred(int rcOp = VINF_SUCCESS);
-
-    uint32_t GetClientID(void) const;
-
-    VBOXHGCMCALLHANDLE GetHandle(void) const;
-
-    uint32_t GetMsgType(void) const;
-
-    uint32_t GetMsgParamCount(void) const;
-
-    uint32_t GetProtocolVer(void) const;
-
-    bool IsDeferred(void) const;
-
-    void SetDeferred(VBOXHGCMCALLHANDLE hHandle, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
-
-    void SetProtocolVer(uint32_t uVersion);
-
-    void SetSvcContext(const VBOXHGCMSVCTX &SvcCtx);
-
-public:
-
-    int SetDeferredMsgInfo(uint32_t uMsg, uint32_t cParms);
-
-    int SetDeferredMsgInfo(const Message *pMessage);
-
-protected:
-
-    int completeInternal(VBOXHGCMCALLHANDLE hHandle, int rcOp);
-
-    void reset(void);
-
-protected:
-
+    int         Complete(VBOXHGCMCALLHANDLE hHandle, int rcOp = VINF_SUCCESS) RT_NOEXCEPT;
+    int         CompleteDeferred(int rcOp = VINF_SUCCESS) RT_NOEXCEPT;
+    uint32_t    GetClientID(void) const RT_NOEXCEPT;
+    VBOXHGCMCALLHANDLE GetHandle(void) const RT_NOEXCEPT;
+    uint32_t    GetMsgType(void) const RT_NOEXCEPT;
+    uint32_t    GetMsgParamCount(void) const RT_NOEXCEPT;
+    uint32_t    GetProtocolVer(void) const RT_NOEXCEPT;
+    bool        IsDeferred(void) const RT_NOEXCEPT;
+    void        SetDeferred(VBOXHGCMCALLHANDLE hHandle, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) RT_NOEXCEPT;
+    void        SetProtocolVer(uint32_t uVersion) RT_NOEXCEPT;
+    void        SetSvcContext(const VBOXHGCMSVCTX &SvcCtx) RT_NOEXCEPT;
+
+public:
+    int         SetDeferredMsgInfo(uint32_t uMsg, uint32_t cParms) RT_NOEXCEPT;
+    int         SetDeferredMsgInfo(const Message *pMessage) RT_NOEXCEPT;
+
+protected:
+    int         completeInternal(VBOXHGCMCALLHANDLE hHandle, int rcOp) RT_NOEXCEPT;
+    void        reset(void) RT_NOEXCEPT;
+
+protected:
     /** The client's HGCM client ID. */
-    uint32_t           m_uClientID;
-    /** Optional protocol version the client uses. Set to 0 by default. */
+    uint32_t           m_idClient;
+    /** Optional protocol version the client uses. Set to 0 by default.
+     * @todo r=bird: This does not belong here.  Whether a service has a "protocol
+     * version" isn't given and I've argued that it's an inflexible bad idea. */
     uint32_t           m_uProtocolVer;
     /** The HGCM service context this client is bound to. */
@@ -172,5 +145,6 @@
         /** The client's HGCM call handle. Needed for completing a deferred call. */
         VBOXHGCMCALLHANDLE hHandle;
-        /** Message type (function number) to use when completing the deferred call. */
+        /** Message type (function number) to use when completing the deferred call.
+         * @todo r=bird: uType or uMsg? Make up your mind (Message::m_uMsg).  */
         uint32_t           uType;
         /** Parameter count to use when completing the deferred call. */
@@ -204,25 +178,14 @@
             else
             {
-                RT_GCC_NO_WARN_DEPRECATED_BEGIN
-                std::auto_ptr<AbstractService> apService;
-                /* No exceptions may propagate outside. */
-                try
-                {
-                    apService = std::auto_ptr<AbstractService>(new T(pTable->pHelpers));
-                } catch (int rcThrown)
-                {
-                    rc = rcThrown;
-                } catch (...)
-                {
-                    rc = VERR_UNRESOLVED_ERROR;
-                }
-                RT_GCC_NO_WARN_DEPRECATED_END
+                AbstractService *pService = NULL;
+                /* No exceptions may propagate outside (callbacks like this one are nothrow/noexcept). */
+                try { pService = new T(pTable->pHelpers); }
+                catch (std::bad_alloc &) { rc = VERR_NO_MEMORY; }
+                catch (...)              { rc = VERR_UNEXPECTED_EXCEPTION; }
                 if (RT_SUCCESS(rc))
                 {
-                    /*
-                     * We don't need an additional client data area on the host,
-                     * because we're a class which can have members for that :-).
-                     */
-                    pTable->cbClient = 0;
+                    /* We don't need an additional client data area on the host,
+                       because we're a class which can have members for that :-). */
+                    pTable->cbClient              = 0;
 
                     /* These functions are mandatory */
@@ -238,9 +201,9 @@
 
                     /* Let the service itself initialize. */
-                    rc = apService->init(pTable);
-
-                    /* Only on success stop the auto release of the auto_ptr. */
+                    rc = pService->init(pTable);
                     if (RT_SUCCESS(rc))
-                        pTable->pvService = apService.release();
+                        pTable->pvService = pService;
+                    else
+                        delete pService;
                 }
             }
@@ -258,10 +221,13 @@
         m_SvcCtx.pHelpers = pHelpers;
     }
-    virtual int  init(VBOXHGCMSVCFNTABLE *ptable) { RT_NOREF1(ptable); return VINF_SUCCESS; }
-    virtual int  uninit() { return VINF_SUCCESS; }
-    virtual int  clientConnect(uint32_t u32ClientID, void *pvClient) = 0;
-    virtual int  clientDisconnect(uint32_t u32ClientID, void *pvClient) = 0;
-    virtual void guestCall(VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID, void *pvClient, uint32_t eFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) = 0;
-    virtual int  hostCall(uint32_t eFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
+    virtual int  init(VBOXHGCMSVCFNTABLE *ptable) RT_NOEXCEPT
+    { RT_NOREF1(ptable); return VINF_SUCCESS; }
+    virtual int  uninit()  RT_NOEXCEPT
+    { return VINF_SUCCESS; }
+    virtual int  clientConnect(uint32_t idClient, void *pvClient) RT_NOEXCEPT = 0;
+    virtual int  clientDisconnect(uint32_t idClient, void *pvClient) RT_NOEXCEPT = 0;
+    virtual void guestCall(VBOXHGCMCALLHANDLE callHandle, uint32_t idClient, void *pvClient, uint32_t eFunction,
+                           uint32_t cParms, VBOXHGCMSVCPARM paParms[]) RT_NOEXCEPT = 0;
+    virtual int  hostCall(uint32_t eFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) RT_NOEXCEPT
     { RT_NOREF3(eFunction, cParms, paParms); return VINF_SUCCESS; }
 
@@ -291,5 +257,5 @@
      */
     static DECLCALLBACK(int) svcConnect(void *pvService,
-                                        uint32_t u32ClientID,
+                                        uint32_t idClient,
                                         void *pvClient,
                                         uint32_t fRequestor,
@@ -298,7 +264,7 @@
         RT_NOREF(fRequestor, fRestoring);
         AssertLogRelReturn(VALID_PTR(pvService), VERR_INVALID_PARAMETER);
-        LogFlowFunc(("pvService=%p, u32ClientID=%u, pvClient=%p\n", pvService, u32ClientID, pvClient));
-        SELF *pSelf = reinterpret_cast<SELF *>(pvService);
-        int rc = pSelf->clientConnect(u32ClientID, pvClient);
+        LogFlowFunc(("pvService=%p, idClient=%u, pvClient=%p\n", pvService, idClient, pvClient));
+        SELF *pSelf = reinterpret_cast<SELF *>(pvService);
+        int rc = pSelf->clientConnect(idClient, pvClient);
         LogFlowFunc(("rc=%Rrc\n", rc));
         return rc;
@@ -310,11 +276,11 @@
      */
     static DECLCALLBACK(int) svcDisconnect(void *pvService,
-                                           uint32_t u32ClientID,
+                                           uint32_t idClient,
                                            void *pvClient)
     {
         AssertLogRelReturn(VALID_PTR(pvService), VERR_INVALID_PARAMETER);
-        LogFlowFunc(("pvService=%p, u32ClientID=%u, pvClient=%p\n", pvService, u32ClientID, pvClient));
-        SELF *pSelf = reinterpret_cast<SELF *>(pvService);
-        int rc = pSelf->clientDisconnect(u32ClientID, pvClient);
+        LogFlowFunc(("pvService=%p, idClient=%u, pvClient=%p\n", pvService, idClient, pvClient));
+        SELF *pSelf = reinterpret_cast<SELF *>(pvService);
+        int rc = pSelf->clientDisconnect(idClient, pvClient);
         LogFlowFunc(("rc=%Rrc\n", rc));
         return rc;
@@ -325,7 +291,7 @@
      * Wraps to the call member function
      */
-    static DECLCALLBACK(void) svcCall(void * pvService,
+    static DECLCALLBACK(void) svcCall(void *pvService,
                                       VBOXHGCMCALLHANDLE callHandle,
-                                      uint32_t u32ClientID,
+                                      uint32_t idClient,
                                       void *pvClient,
                                       uint32_t u32Function,
@@ -335,7 +301,8 @@
     {
         AssertLogRelReturnVoid(VALID_PTR(pvService));
-        LogFlowFunc(("pvService=%p, callHandle=%p, u32ClientID=%u, pvClient=%p, u32Function=%u, cParms=%u, paParms=%p\n", pvService, callHandle, u32ClientID, pvClient, u32Function, cParms, paParms));
-        SELF *pSelf = reinterpret_cast<SELF *>(pvService);
-        pSelf->guestCall(callHandle, u32ClientID, pvClient, u32Function, cParms, paParms);
+        LogFlowFunc(("pvService=%p, callHandle=%p, idClient=%u, pvClient=%p, u32Function=%u, cParms=%u, paParms=%p\n",
+                     pvService, callHandle, idClient, pvClient, u32Function, cParms, paParms));
+        SELF *pSelf = reinterpret_cast<SELF *>(pvService);
+        pSelf->guestCall(callHandle, idClient, pvClient, u32Function, cParms, paParms);
         LogFlowFunc(("returning\n"));
         RT_NOREF_PV(tsArrival);
Index: /trunk/src/VBox/HostServices/DragAndDrop/VBoxDragAndDropSvc.cpp
===================================================================
--- /trunk/src/VBox/HostServices/DragAndDrop/VBoxDragAndDropSvc.cpp	(revision 85317)
+++ /trunk/src/VBox/HostServices/DragAndDrop/VBoxDragAndDropSvc.cpp	(revision 85318)
@@ -50,7 +50,6 @@
 {
 public:
-
-    DragAndDropClient(uint32_t uClientID)
-        : HGCM::Client(uClientID)
+    DragAndDropClient(uint32_t idClient)
+        : HGCM::Client(idClient)
     {
         RT_ZERO(m_SvcCtx);
@@ -63,6 +62,5 @@
 
 public:
-
-    void disconnect(void);
+    void disconnect(void) RT_NOEXCEPT;
 };
 
@@ -79,27 +77,27 @@
 {
 public:
-
     explicit DragAndDropService(PVBOXHGCMSVCHELPERS pHelpers)
         : HGCM::AbstractService<DragAndDropService>(pHelpers)
-        , m_pManager(NULL) {}
+        , m_pManager(NULL)
+        , m_u32Mode(VBOX_DRAG_AND_DROP_MODE_OFF)
+    {}
 
 protected:
-
-    int  init(VBOXHGCMSVCFNTABLE *pTable);
-    int  uninit(void);
-    int  clientConnect(uint32_t u32ClientID, void *pvClient);
-    int  clientDisconnect(uint32_t u32ClientID, void *pvClient);
-    void guestCall(VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID, void *pvClient, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
-    int  hostCall(uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
-
-    int modeSet(uint32_t u32Mode);
-    inline uint32_t modeGet(void) const { return m_u32Mode; };
-
-protected:
+    int  init(VBOXHGCMSVCFNTABLE *pTable) RT_NOEXCEPT RT_OVERRIDE;
+    int  uninit(void) RT_NOEXCEPT RT_OVERRIDE;
+    int  clientConnect(uint32_t idClient, void *pvClient) RT_NOEXCEPT RT_OVERRIDE;
+    int  clientDisconnect(uint32_t idClient, void *pvClient) RT_NOEXCEPT RT_OVERRIDE;
+    void guestCall(VBOXHGCMCALLHANDLE callHandle, uint32_t idClient, void *pvClient, uint32_t u32Function,
+                   uint32_t cParms, VBOXHGCMSVCPARM paParms[]) RT_NOEXCEPT RT_OVERRIDE;
+    int  hostCall(uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) RT_NOEXCEPT RT_OVERRIDE;
+
+private:
+    int  modeSet(uint32_t u32Mode) RT_NOEXCEPT;
+    inline uint32_t modeGet(void) const RT_NOEXCEPT
+    { return m_u32Mode; };
 
     static DECLCALLBACK(int) progressCallback(uint32_t uStatus, uint32_t uPercentage, int rc, void *pvUser);
 
-protected:
-
+private:
     /** Pointer to our DnD manager instance. */
     DnDManager                        *m_pManager;
@@ -112,5 +110,5 @@
      *  to process new commands. The key is the (unique) client ID. */
     DnDClientQueue                     m_clientQueue;
-    /** Current drag and drop mode. */
+    /** Current drag and drop mode, VBOX_DRAG_AND_DROP_MODE_XXX. */
     uint32_t                           m_u32Mode;
 };
@@ -123,11 +121,11 @@
 /**
  * Called when the HGCM client disconnected on the guest side.
+ *
  * This function takes care of the client's data cleanup and also lets the host
  * know that the client has been disconnected.
- *
  */
-void DragAndDropClient::disconnect(void)
+void DragAndDropClient::disconnect(void) RT_NOEXCEPT
 {
-    LogFlowThisFunc(("uClient=%RU32\n", m_uClientID));
+    LogFlowThisFunc(("uClient=%RU32\n", m_idClient));
 
     if (IsDeferred())
@@ -146,5 +144,5 @@
         int rc2 = m_SvcCtx.pfnHostCallback(m_SvcCtx.pvHostData, GUEST_DND_DISCONNECT, &data, sizeof(data));
         if (RT_FAILURE(rc2))
-            LogFlowFunc(("Warning: Unable to notify host about client %RU32 disconnect, rc=%Rrc\n", m_uClientID, rc2));
+            LogFlowFunc(("Warning: Unable to notify host about client %RU32 disconnect, rc=%Rrc\n", m_idClient, rc2));
         /* Not fatal. */
     }
@@ -156,5 +154,5 @@
 *********************************************************************************************************************************/
 
-int DragAndDropService::init(VBOXHGCMSVCFNTABLE *pTable)
+int DragAndDropService::init(VBOXHGCMSVCFNTABLE *pTable) RT_NOEXCEPT
 {
     /* Register functions. */
@@ -174,5 +172,5 @@
         m_pManager = new DnDManager(&DragAndDropService::progressCallback, this);
     }
-    catch(std::bad_alloc &)
+    catch (std::bad_alloc &)
     {
         rc = VERR_NO_MEMORY;
@@ -183,5 +181,5 @@
 }
 
-int DragAndDropService::uninit(void)
+int DragAndDropService::uninit(void) RT_NOEXCEPT
 {
     LogFlowFuncEnter();
@@ -205,5 +203,5 @@
 }
 
-int DragAndDropService::clientConnect(uint32_t u32ClientID, void *pvClient)
+int DragAndDropService::clientConnect(uint32_t idClient, void *pvClient) RT_NOEXCEPT
 {
     RT_NOREF1(pvClient);
@@ -214,53 +212,53 @@
     }
 
-    int rc = VINF_SUCCESS;
 
     /*
      * Add client to our client map.
      */
-    if (m_clientMap.find(u32ClientID) != m_clientMap.end())
-        rc = VERR_ALREADY_EXISTS;
-
-    if (RT_SUCCESS(rc))
-    {
-        try
-        {
-            DragAndDropClient *pClient = new DragAndDropClient(u32ClientID);
-            pClient->SetSvcContext(m_SvcCtx);
-            m_clientMap[u32ClientID] = pClient;
-        }
-        catch(std::bad_alloc &)
-        {
-            rc = VERR_NO_MEMORY;
-        }
-
-        if (RT_SUCCESS(rc))
-        {
-            /*
-             * Reset the message queue as soon as a new clients connect
-             * to ensure that every client has the same state.
-             */
-            if (m_pManager)
-                m_pManager->Reset();
-        }
-    }
-
-    LogFlowFunc(("Client %RU32 connected, rc=%Rrc\n", u32ClientID, rc));
-    return rc;
+    if (m_clientMap.find(idClient) != m_clientMap.end())
+    {
+        LogFunc(("Client %RU32 is already connected!\n", idClient));
+        return VERR_ALREADY_EXISTS;
+    }
+
+    try
+    {
+        DragAndDropClient *pClient = new DragAndDropClient(idClient);
+        pClient->SetSvcContext(m_SvcCtx);
+        m_clientMap[idClient] = pClient;
+    }
+    catch (std::bad_alloc &)
+    {
+        LogFunc(("Client %RU32 - VERR_NO_MEMORY!\n", idClient));
+        return VERR_NO_MEMORY;
+    }
+
+    /*
+     * Reset the message queue as soon as a new clients connect
+     * to ensure that every client has the same state.
+     */
+    if (m_pManager)
+        m_pManager->Reset();
+
+    LogFlowFunc(("Client %RU32 connected (VINF_SUCCESS)\n", idClient));
+    return VINF_SUCCESS;
 }
 
-int DragAndDropService::clientDisconnect(uint32_t u32ClientID, void *pvClient)
+int DragAndDropService::clientDisconnect(uint32_t idClient, void *pvClient) RT_NOEXCEPT
 {
     RT_NOREF1(pvClient);
 
     /* Client not found? Bail out early. */
-    DnDClientMap::iterator itClient =  m_clientMap.find(u32ClientID);
+    DnDClientMap::iterator itClient =  m_clientMap.find(idClient);
     if (itClient == m_clientMap.end())
+    {
+        LogFunc(("Client %RU32 not found!\n", idClient));
         return VERR_NOT_FOUND;
+    }
 
     /*
      * Remove from waiters queue.
      */
-    m_clientQueue.remove(u32ClientID);
+    m_clientQueue.remove(idClient);
 
     /*
@@ -272,9 +270,9 @@
     m_clientMap.erase(itClient);
 
-    LogFlowFunc(("Client %RU32 disconnected\n", u32ClientID));
+    LogFlowFunc(("Client %RU32 disconnected\n", idClient));
     return VINF_SUCCESS;
 }
 
-int DragAndDropService::modeSet(uint32_t u32Mode)
+int DragAndDropService::modeSet(uint32_t u32Mode) RT_NOEXCEPT
 {
 #ifndef VBOX_WITH_DRAG_AND_DROP_GH
@@ -304,11 +302,10 @@
 }
 
-void DragAndDropService::guestCall(VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID,
+void DragAndDropService::guestCall(VBOXHGCMCALLHANDLE callHandle, uint32_t idClient,
                                    void *pvClient, uint32_t u32Function,
-                                   uint32_t cParms, VBOXHGCMSVCPARM paParms[])
+                                   uint32_t cParms, VBOXHGCMSVCPARM paParms[]) RT_NOEXCEPT
 {
     RT_NOREF1(pvClient);
-    LogFlowFunc(("u32ClientID=%RU32, u32Function=%RU32, cParms=%RU32\n",
-                 u32ClientID, u32Function, cParms));
+    LogFlowFunc(("idClient=%RU32, u32Function=%RU32, cParms=%RU32\n", idClient, u32Function, cParms));
 
     /* Check if we've the right mode set. */
@@ -319,7 +316,5 @@
         {
             if (modeGet() != VBOX_DRAG_AND_DROP_MODE_OFF)
-            {
                 rc = VINF_SUCCESS;
-            }
             else
             {
@@ -341,4 +336,5 @@
             break;
         }
+
         case GUEST_DND_HG_ACK_OP:
         case GUEST_DND_HG_REQ_DATA:
@@ -347,9 +343,7 @@
             if (   modeGet() == VBOX_DRAG_AND_DROP_MODE_BIDIRECTIONAL
                 || modeGet() == VBOX_DRAG_AND_DROP_MODE_HOST_TO_GUEST)
-            {
                 rc = VINF_SUCCESS;
-            }
             else
-                LogFlowFunc(("Host -> Guest DnD mode disabled, ignoring request\n"));
+                LogFlowFunc(("Host -> Guest DnD mode disabled, failing request\n"));
             break;
         }
@@ -366,10 +360,8 @@
             if (   modeGet() == VBOX_DRAG_AND_DROP_MODE_BIDIRECTIONAL
                 || modeGet() == VBOX_DRAG_AND_DROP_MODE_GUEST_TO_HOST)
-            {
                 rc = VINF_SUCCESS;
-            }
             else
 #endif
-                LogFlowFunc(("Guest -> Host DnD mode disabled, ignoring request\n"));
+                LogFlowFunc(("Guest -> Host DnD mode disabled, failing request\n"));
             break;
         }
@@ -397,5 +389,5 @@
     DragAndDropClient *pClient = NULL;
 
-    DnDClientMap::iterator itClient =  m_clientMap.find(u32ClientID);
+    DnDClientMap::iterator itClient =  m_clientMap.find(idClient);
     if (itClient != m_clientMap.end())
     {
@@ -405,5 +397,5 @@
     else
     {
-        LogFunc(("Client %RU32 was not found\n", u32ClientID));
+        LogFunc(("Client %RU32 was not found\n", idClient));
         rc = VERR_NOT_FOUND;
     }
@@ -412,9 +404,9 @@
  * Will set rc to VERR_INVALID_PARAMETER otherwise. See #9777. */
 #define VERIFY_BUFFER_SIZE_UINT32(a_ParmUInt32, a_SizeExpected) \
-{ \
+do { \
     uint32_t cbTemp = 0; \
     rc = HGCMSvcGetU32(&a_ParmUInt32, &cbTemp); \
     ASSERT_GUEST_STMT(RT_SUCCESS(rc) && cbTemp == a_SizeExpected, rc = VERR_INVALID_PARAMETER); \
-}
+} while (0)
 
     if (rc == VINF_SUCCESS) /* Note: rc might be VINF_HGCM_ASYNC_EXECUTE! */
@@ -990,5 +982,5 @@
             AssertPtr(pClient);
             pClient->SetDeferred(callHandle, u32Function, cParms, paParms);
-            m_clientQueue.push_back(u32ClientID);
+            m_clientQueue.push_back(idClient);
         }
         catch (std::bad_alloc &)
@@ -1010,5 +1002,5 @@
 
 int DragAndDropService::hostCall(uint32_t u32Function,
-                                 uint32_t cParms, VBOXHGCMSVCPARM paParms[])
+                                 uint32_t cParms, VBOXHGCMSVCPARM paParms[]) RT_NOEXCEPT
 {
     LogFlowFunc(("u32Function=%RU32, cParms=%RU32, cClients=%zu, cQueue=%zu\n",
@@ -1016,83 +1008,82 @@
 
     int rc;
-
-    do
-    {
-        bool fSendToGuest = false; /* Whether to send the message down to the guest side or not. */
-
-        switch (u32Function)
+    bool fSendToGuest = false; /* Whether to send the message down to the guest side or not. */
+
+    switch (u32Function)
+    {
+        case HOST_DND_SET_MODE:
         {
-            case HOST_DND_SET_MODE:
-            {
-                if (cParms != 1)
-                    rc = VERR_INVALID_PARAMETER;
-                else if (paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT)
-                    rc = VERR_INVALID_PARAMETER;
-                else
-                    rc = modeSet(paParms[0].u.uint32);
-                break;
-            }
-
-            case HOST_DND_CANCEL:
-            {
-                LogFlowFunc(("Cancelling all waiting clients ...\n"));
-
-                /* Reset the message queue as the host cancelled the whole operation. */
-                m_pManager->Reset();
-
-                rc = m_pManager->AddMsg(u32Function, cParms, paParms, true /* fAppend */);
-                if (RT_FAILURE(rc))
-                {
-                    AssertMsgFailed(("Adding new message of type=%RU32 failed with rc=%Rrc\n", u32Function, rc));
-                    break;
-                }
-
-                /*
-                 * Wake up all deferred clients and tell them to process
-                 * the cancelling message next.
-                 */
-                DnDClientQueue::iterator itQueue = m_clientQueue.begin();
-                while (itQueue != m_clientQueue.end())
-                {
-                    DnDClientMap::iterator itClient = m_clientMap.find(*itQueue);
-                    Assert(itClient != m_clientMap.end());
-
-                    DragAndDropClient *pClient = itClient->second;
-                    AssertPtr(pClient);
-
-                    int rc2 = pClient->SetDeferredMsgInfo(HOST_DND_CANCEL,
-                                                          /* Protocol v3+ also contains the context ID. */
-                                                          pClient->GetProtocolVer() >= 3 ? 1 : 0);
-                    pClient->CompleteDeferred(rc2);
-
-                    m_clientQueue.erase(itQueue);
-                    itQueue = m_clientQueue.begin();
-                }
-
-                Assert(m_clientQueue.empty());
-
-                /* Tell the host that everything went well. */
-                rc = VINF_SUCCESS;
-                break;
-            }
-
-            case HOST_DND_HG_EVT_ENTER:
-            {
-                /* Reset the message queue as a new DnD operation just began. */
-                m_pManager->Reset();
-
-                fSendToGuest = true;
-                rc = VINF_SUCCESS;
-                break;
-            }
-
-            default:
-            {
-                fSendToGuest = true;
-                rc = VINF_SUCCESS;
-                break;
-            }
+            if (cParms != 1)
+                rc = VERR_INVALID_PARAMETER;
+            else if (paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT)
+                rc = VERR_INVALID_PARAMETER;
+            else
+                rc = modeSet(paParms[0].u.uint32);
+            break;
         }
 
+        case HOST_DND_CANCEL:
+        {
+            LogFlowFunc(("Cancelling all waiting clients ...\n"));
+
+            /* Reset the message queue as the host cancelled the whole operation. */
+            m_pManager->Reset();
+
+            rc = m_pManager->AddMsg(u32Function, cParms, paParms, true /* fAppend */);
+            if (RT_FAILURE(rc))
+            {
+                AssertMsgFailed(("Adding new message of type=%RU32 failed with rc=%Rrc\n", u32Function, rc));
+                break;
+            }
+
+            /*
+             * Wake up all deferred clients and tell them to process
+             * the cancelling message next.
+             */
+            DnDClientQueue::iterator itQueue = m_clientQueue.begin();
+            while (itQueue != m_clientQueue.end())
+            {
+                DnDClientMap::iterator itClient = m_clientMap.find(*itQueue);
+                Assert(itClient != m_clientMap.end());
+
+                DragAndDropClient *pClient = itClient->second;
+                AssertPtr(pClient);
+
+                int rc2 = pClient->SetDeferredMsgInfo(HOST_DND_CANCEL,
+                                                      /* Protocol v3+ also contains the context ID. */
+                                                      pClient->GetProtocolVer() >= 3 ? 1 : 0);
+                pClient->CompleteDeferred(rc2);
+
+                m_clientQueue.erase(itQueue);
+                itQueue = m_clientQueue.begin();
+            }
+
+            Assert(m_clientQueue.empty());
+
+            /* Tell the host that everything went well. */
+            rc = VINF_SUCCESS;
+            break;
+        }
+
+        case HOST_DND_HG_EVT_ENTER:
+        {
+            /* Reset the message queue as a new DnD operation just began. */
+            m_pManager->Reset();
+
+            fSendToGuest = true;
+            rc = VINF_SUCCESS;
+            break;
+        }
+
+        default:
+        {
+            fSendToGuest = true;
+            rc = VINF_SUCCESS;
+            break;
+        }
+    }
+
+    do /* goto avoidance break-loop. */
+    {
         if (fSendToGuest)
         {
Index: /trunk/src/VBox/HostServices/common/client.cpp
===================================================================
--- /trunk/src/VBox/HostServices/common/client.cpp	(revision 85317)
+++ /trunk/src/VBox/HostServices/common/client.cpp	(revision 85318)
@@ -27,6 +27,6 @@
 using namespace HGCM;
 
-Client::Client(uint32_t uClientID)
-    : m_uClientID(uClientID)
+Client::Client(uint32_t idClient)
+    : m_idClient(idClient)
     , m_uProtocolVer(0)
     , m_fDeferred(false)
@@ -49,7 +49,7 @@
  * @param   rcOp                Return code to return to the guest side.
  */
-int Client::completeInternal(VBOXHGCMCALLHANDLE hHandle, int rcOp)
-{
-    LogFlowThisFunc(("uClientID=%RU32\n", m_uClientID));
+int Client::completeInternal(VBOXHGCMCALLHANDLE hHandle, int rcOp) RT_NOEXCEPT
+{
+    LogFlowThisFunc(("idClient=%RU32\n", m_idClient));
 
     if (   m_SvcCtx.pHelpers
@@ -68,5 +68,5 @@
  * Resets the client's internal state.
  */
-void Client::reset(void)
+void Client::reset(void) RT_NOEXCEPT
 {
    m_fDeferred = false;
@@ -83,5 +83,5 @@
  * @param   rcOp                Return code to return to the guest side.
  */
-int Client::Complete(VBOXHGCMCALLHANDLE hHandle, int rcOp /* = VINF_SUCCESS */)
+int Client::Complete(VBOXHGCMCALLHANDLE hHandle, int rcOp /* = VINF_SUCCESS */) RT_NOEXCEPT
 {
     return completeInternal(hHandle, rcOp);
@@ -95,5 +95,5 @@
  * @param   rcOp                Return code to return to the guest side.
  */
-int Client::CompleteDeferred(int rcOp)
+int Client::CompleteDeferred(int rcOp) RT_NOEXCEPT
 {
     if (m_fDeferred)
@@ -108,5 +108,5 @@
     }
 
-    AssertMsg(m_fDeferred, ("Client %RU32 is not in deferred mode\n", m_uClientID));
+    AssertMsg(m_fDeferred, ("Client %RU32 is not in deferred mode\n", m_idClient));
     return VERR_INVALID_STATE;
 }
@@ -117,5 +117,5 @@
  * @returns HGCM handle.
  */
-VBOXHGCMCALLHANDLE Client::GetHandle(void) const
+VBOXHGCMCALLHANDLE Client::GetHandle(void) const RT_NOEXCEPT
 {
     return m_Deferred.hHandle;
@@ -127,10 +127,10 @@
  * @returns HGCM handle.
  */
-uint32_t Client::GetMsgType(void) const
+uint32_t Client::GetMsgType(void) const RT_NOEXCEPT
 {
     return m_Deferred.uType;
 }
 
-uint32_t Client::GetMsgParamCount(void) const
+uint32_t Client::GetMsgParamCount(void) const RT_NOEXCEPT
 {
     return m_Deferred.cParms;
@@ -142,7 +142,7 @@
  * @returns The client's (HGCM) ID.
  */
-uint32_t Client::GetClientID(void) const
-{
-    return m_uClientID;
+uint32_t Client::GetClientID(void) const RT_NOEXCEPT
+{
+    return m_idClient;
 }
 
@@ -152,5 +152,5 @@
  * @returns Protocol version, or 0 if not set.
  */
-uint32_t Client::GetProtocolVer(void) const
+uint32_t Client::GetProtocolVer(void) const RT_NOEXCEPT
 {
     return m_uProtocolVer;
@@ -162,5 +162,5 @@
  * @returns \c True if in deferred mode, \c False if not.
  */
-bool Client::IsDeferred(void) const
+bool Client::IsDeferred(void) const RT_NOEXCEPT
 {
     return m_fDeferred;
@@ -171,7 +171,7 @@
  * until CompleteDeferred() has been called.
  */
-void Client::SetDeferred(VBOXHGCMCALLHANDLE hHandle, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
-{
-    LogFlowThisFunc(("uClient=%RU32\n", m_uClientID));
+void Client::SetDeferred(VBOXHGCMCALLHANDLE hHandle, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) RT_NOEXCEPT
+{
+    LogFlowThisFunc(("uClient=%RU32\n", m_idClient));
 
 #ifndef DEBUG_bird /** r=bird: This bugger triggers in the DnD service when restoring saved state.  Not tested?  */
@@ -192,5 +192,5 @@
  * @param   uVersion            Version number to set.
  */
-void Client::SetProtocolVer(uint32_t uVersion)
+void Client::SetProtocolVer(uint32_t uVersion) RT_NOEXCEPT
 {
     m_uProtocolVer = uVersion;
@@ -202,5 +202,5 @@
  * @param   SvcCtx              Service context to set.
  */
-void Client::SetSvcContext(const VBOXHGCMSVCTX &SvcCtx)
+void Client::SetSvcContext(const VBOXHGCMSVCTX &SvcCtx) RT_NOEXCEPT
 {
     m_SvcCtx = SvcCtx;
@@ -216,5 +216,5 @@
  * @param   cParms              Number of parameters the message needs.
  */
-int Client::SetDeferredMsgInfo(uint32_t uMsg, uint32_t cParms)
+int Client::SetDeferredMsgInfo(uint32_t uMsg, uint32_t cParms) RT_NOEXCEPT
 {
     if (m_fDeferred)
@@ -243,5 +243,5 @@
  * @param   pMessage            Message to get message type and required parameters from.
  */
-int Client::SetDeferredMsgInfo(const Message *pMessage)
+int Client::SetDeferredMsgInfo(const Message *pMessage) RT_NOEXCEPT
 {
     AssertPtrReturn(pMessage, VERR_INVALID_POINTER);
Index: /trunk/src/VBox/HostServices/common/message.cpp
===================================================================
--- /trunk/src/VBox/HostServices/common/message.cpp	(revision 85317)
+++ /trunk/src/VBox/HostServices/common/message.cpp	(revision 85318)
@@ -23,5 +23,7 @@
     : m_uMsg(0)
     , m_cParms(0)
-    , m_paParms(NULL) { }
+    , m_paParms(NULL)
+{
+}
 
 Message::Message(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM aParms[])
@@ -41,5 +43,5 @@
  * Resets the message by free'ing all allocated parameters and resetting the rest.
  */
-void Message::reset(void)
+void Message::reset(void) RT_NOEXCEPT
 {
     if (m_paParms)
@@ -67,5 +69,5 @@
  * @returns Parameter count.
  */
-uint32_t Message::GetParamCount(void) const
+uint32_t Message::GetParamCount(void) const RT_NOEXCEPT
 {
     return m_cParms;
@@ -80,5 +82,5 @@
  * @param   aParms          Where to store the HGCM parameter data.
  */
-int Message::GetData(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM aParms[]) const
+int Message::GetData(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM aParms[]) const RT_NOEXCEPT
 {
     if (m_uMsg != uMsg)
@@ -103,5 +105,5 @@
  * @param   pu32Info        Where to store the parameter value.
  */
-int Message::GetParmU32(uint32_t uParm, uint32_t *pu32Info) const
+int Message::GetParmU32(uint32_t uParm, uint32_t *pu32Info) const RT_NOEXCEPT
 {
     AssertPtrNullReturn(pu32Info, VERR_INVALID_PARAMETER);
@@ -121,5 +123,5 @@
  * @param   pu64Info        Where to store the parameter value.
  */
-int Message::GetParmU64(uint32_t uParm, uint64_t *pu64Info) const
+int Message::GetParmU64(uint32_t uParm, uint64_t *pu64Info) const RT_NOEXCEPT
 {
     AssertPtrNullReturn(pu64Info, VERR_INVALID_PARAMETER);
@@ -142,5 +144,5 @@
  * @remarks Does not copy (store) the actual content of the pointer (deep copy).
  */
-int Message::GetParmPtr(uint32_t uParm, void **ppvAddr, uint32_t *pcbSize) const
+int Message::GetParmPtr(uint32_t uParm, void **ppvAddr, uint32_t *pcbSize) const RT_NOEXCEPT
 {
     AssertPtrNullReturn(ppvAddr, VERR_INVALID_PARAMETER);
@@ -160,5 +162,5 @@
  * @returns Message type.
  */
-uint32_t Message::GetType(void) const
+uint32_t Message::GetType(void) const RT_NOEXCEPT
 {
     return m_uMsg;
@@ -180,5 +182,5 @@
 int Message::CopyParms(PVBOXHGCMSVCPARM paParmsDst, uint32_t cParmsDst,
                        PVBOXHGCMSVCPARM paParmsSrc, uint32_t cParmsSrc,
-                       bool fDeepCopy)
+                       bool fDeepCopy) RT_NOEXCEPT
 {
     AssertPtrReturn(paParmsSrc, VERR_INVALID_POINTER);
@@ -188,5 +190,4 @@
         return VERR_BUFFER_OVERFLOW;
 
-    int rc = VINF_SUCCESS;
     for (uint32_t i = 0; i < cParmsSrc; i++)
     {
@@ -215,8 +216,5 @@
                         paParmsDst[i].u.pointer.addr = RTMemAlloc(paParmsDst[i].u.pointer.size);
                         if (!paParmsDst[i].u.pointer.addr)
-                        {
-                            rc = VERR_NO_MEMORY;
-                            break;
-                        }
+                            return VERR_NO_MEMORY;
                     }
                 }
@@ -225,8 +223,5 @@
                     /* No, but we have to check if there is enough room. */
                     if (paParmsDst[i].u.pointer.size < paParmsSrc[i].u.pointer.size)
-                    {
-                        rc = VERR_BUFFER_OVERFLOW;
-                        break;
-                    }
+                        return VERR_BUFFER_OVERFLOW;
                 }
 
@@ -235,11 +230,9 @@
                     if (   paParmsDst[i].u.pointer.addr
                         && paParmsDst[i].u.pointer.size)
-                    {
                         memcpy(paParmsDst[i].u.pointer.addr,
                                paParmsSrc[i].u.pointer.addr,
                                RT_MIN(paParmsDst[i].u.pointer.size, paParmsSrc[i].u.pointer.size));
-                    }
                     else
-                        rc = VERR_INVALID_POINTER;
+                        return VERR_INVALID_POINTER;
                 }
                 break;
@@ -248,12 +241,9 @@
             {
                 AssertMsgFailed(("Unknown HGCM type %u\n", paParmsSrc[i].type));
-                rc = VERR_INVALID_PARAMETER;
-                break;
+                return VERR_INVALID_PARAMETER;
             }
         }
-        if (RT_FAILURE(rc))
-            break;
-    }
-    return rc;
+    }
+    return VINF_SUCCESS;
 }
 
@@ -266,6 +256,8 @@
  * @param   aParms          Array of parameters to set.
  */
-int Message::initData(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM aParms[])
-{
+int Message::initData(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM aParms[]) RT_NOEXCEPT
+{
+    /** @todo r=bird: There is a define for the max number of HGCM parameters,
+     *        it's way smaller than 256, something like 61 IIRC. */
     AssertReturn(cParms < 256, VERR_INVALID_PARAMETER);
     AssertPtrNullReturn(aParms, VERR_INVALID_PARAMETER);
