Index: trunk/src/VBox/HostServices/GuestProperties/service.cpp
===================================================================
--- trunk/src/VBox/HostServices/GuestProperties/service.cpp	(revision 62798)
+++ trunk/src/VBox/HostServices/GuestProperties/service.cpp	(revision 62799)
@@ -410,4 +410,6 @@
     static DECLCALLBACK(int) threadNotifyHost(RTTHREAD self, void *pvUser);
 #endif
+
+    DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(Service);
 };
 
@@ -472,5 +474,5 @@
 int Service::validateValue(const char *pszValue, uint32_t cbValue)
 {
-    LogFlowFunc(("cbValue=%d\n", cbValue));
+    LogFlowFunc(("cbValue=%d\n", cbValue)); RT_NOREF1(pszValue);
 
     int rc = VINF_SUCCESS;
@@ -512,54 +514,55 @@
         rc = VERR_INVALID_PARAMETER;
     /** @todo validate the array sizes... */
-
-    for (unsigned i = 0; RT_SUCCESS(rc) && papszNames[i] != NULL; ++i)
-    {
-        if (   !RT_VALID_PTR(papszNames[i])
-            || !RT_VALID_PTR(papszValues[i])
-            || !RT_VALID_PTR(papszFlags[i])
-            )
-            rc = VERR_INVALID_POINTER;
-        else
-        {
-            uint32_t fFlagsIgn;
-            rc = validateFlags(papszFlags[i], &fFlagsIgn);
-        }
-    }
-
-    if (RT_SUCCESS(rc))
-    {
-        /*
-         * Add the properties.  No way to roll back here.
-         */
-        for (unsigned i = 0; papszNames[i] != NULL; ++i)
-        {
-            uint32_t fFlags;
-            rc = validateFlags(papszFlags[i], &fFlags);
-            AssertRCBreak(rc);
-
-            Property *pProp = getPropertyInternal(papszNames[i]);
-            if (pProp)
-            {
-                /* Update existing property. */
-                pProp->mValue     = papszValues[i];
-                pProp->mTimestamp = pau64Timestamps[i];
-                pProp->mFlags     = fFlags;
-            }
+    else
+    {
+        for (unsigned i = 0; RT_SUCCESS(rc) && papszNames[i] != NULL; ++i)
+        {
+            if (   !RT_VALID_PTR(papszNames[i])
+                || !RT_VALID_PTR(papszValues[i])
+                || !RT_VALID_PTR(papszFlags[i])
+                )
+                rc = VERR_INVALID_POINTER;
             else
             {
-                /* Create a new property */
-                pProp = new Property(papszNames[i], papszValues[i], pau64Timestamps[i], fFlags);
-                if (!pProp)
+                uint32_t fFlagsIgn;
+                rc = validateFlags(papszFlags[i], &fFlagsIgn);
+            }
+        }
+        if (RT_SUCCESS(rc))
+        {
+            /*
+             * Add the properties.  No way to roll back here.
+             */
+            for (unsigned i = 0; papszNames[i] != NULL; ++i)
+            {
+                uint32_t fFlags;
+                rc = validateFlags(papszFlags[i], &fFlags);
+                AssertRCBreak(rc);
+
+                Property *pProp = getPropertyInternal(papszNames[i]);
+                if (pProp)
                 {
-                    rc = VERR_NO_MEMORY;
-                    break;
+                    /* Update existing property. */
+                    pProp->mValue     = papszValues[i];
+                    pProp->mTimestamp = pau64Timestamps[i];
+                    pProp->mFlags     = fFlags;
                 }
-                if (RTStrSpaceInsert(&mhProperties, &pProp->mStrCore))
-                    mcProperties++;
                 else
                 {
-                    delete pProp;
-                    rc = VERR_INTERNAL_ERROR_3;
-                    AssertFailedBreak();
+                    /* Create a new property */
+                    pProp = new Property(papszNames[i], papszValues[i], pau64Timestamps[i], fFlags);
+                    if (!pProp)
+                    {
+                        rc = VERR_NO_MEMORY;
+                        break;
+                    }
+                    if (RTStrSpaceInsert(&mhProperties, &pProp->mStrCore))
+                        mcProperties++;
+                    else
+                    {
+                        delete pProp;
+                        rc = VERR_INTERNAL_ERROR_3;
+                        AssertFailedBreak();
+                    }
                 }
             }
@@ -586,6 +589,7 @@
     int         rc;
     const char *pcszName = NULL;        /* shut up gcc */
-    char       *pchBuf;
-    uint32_t    cbName, cbBuf;
+    char       *pchBuf = NULL;          /* shut up MSC */
+    uint32_t    cbName;
+    uint32_t    cbBuf = 0;              /* shut up MSC */
 
     /*
@@ -1022,15 +1026,16 @@
             buffer += '\0';
             u64Timestamp = prop.mTimestamp;
-        }
-    }
-    /* Write out the data. */
-    if (RT_SUCCESS(rc))
-    {
-        paParms[1].setUInt64(u64Timestamp);
-        paParms[3].setUInt32((uint32_t)buffer.size());
-        if (buffer.size() <= cbBuf)
-            buffer.copy(pchBuf, cbBuf);
-        else
-            rc = VERR_BUFFER_OVERFLOW;
+
+            /* Write out the data. */
+            if (RT_SUCCESS(rc))
+            {
+                paParms[1].setUInt64(u64Timestamp);
+                paParms[3].setUInt32((uint32_t)buffer.size());
+                if (buffer.size() <= cbBuf)
+                    buffer.copy(pchBuf, cbBuf);
+                else
+                    rc = VERR_BUFFER_OVERFLOW;
+            }
+        }
     }
     return rc;
@@ -1061,5 +1066,5 @@
      */
     LogFlowThisFunc(("\n"));
-    if (   (cParms != 4)  /* Hardcoded value as the next lines depend on it. */
+    if (   cParms != 4  /* Hardcoded value as the next lines depend on it. */
         || RT_FAILURE(paParms[0].getString(&pszPatterns, &cchPatterns))  /* patterns */
         || RT_FAILURE(paParms[1].getUInt64(&u64Timestamp))  /* timestamp */
@@ -1067,55 +1072,56 @@
        )
         rc = VERR_INVALID_PARAMETER;
-
-    if (RT_SUCCESS(rc))
+    else
+    {
         LogFlow(("pszPatterns=%s, u64Timestamp=%llu\n", pszPatterns, u64Timestamp));
 
-    /*
-     * If no timestamp was supplied or no notification was found in the queue
-     * of old notifications, enqueue the request in the waiting queue.
-     */
-    Property prop;
-    if (RT_SUCCESS(rc) && u64Timestamp != 0)
-        rc = getOldNotification(pszPatterns, u64Timestamp, &prop);
-    if (RT_SUCCESS(rc))
-    {
-        if (prop.isNull())
-        {
+        /*
+         * If no timestamp was supplied or no notification was found in the queue
+         * of old notifications, enqueue the request in the waiting queue.
+         */
+        Property prop;
+        if (RT_SUCCESS(rc) && u64Timestamp != 0)
+            rc = getOldNotification(pszPatterns, u64Timestamp, &prop);
+        if (RT_SUCCESS(rc))
+        {
+            if (prop.isNull())
+            {
+                /*
+                 * Check if the client already had the same request.
+                 * Complete the old request with an error in this case.
+                 * Protection against clients, which cancel and resubmits requests.
+                 */
+                CallList::iterator it = mGuestWaiters.begin();
+                while (it != mGuestWaiters.end())
+                {
+                    const char *pszPatternsExisting;
+                    uint32_t cchPatternsExisting;
+                    int rc3 = it->mParms[0].getString(&pszPatternsExisting, &cchPatternsExisting);
+
+                    if (   RT_SUCCESS(rc3)
+                        && u32ClientId == it->u32ClientId
+                        && RTStrCmp(pszPatterns, pszPatternsExisting) == 0)
+                    {
+                        /* Complete the old request. */
+                        mpHelpers->pfnCallComplete(it->mHandle, VERR_INTERRUPTED);
+                        it = mGuestWaiters.erase(it);
+                    }
+                    else
+                        ++it;
+                }
+
+                mGuestWaiters.push_back(GuestCall(u32ClientId, callHandle, GET_NOTIFICATION,
+                                                  cParms, paParms, rc));
+                rc = VINF_HGCM_ASYNC_EXECUTE;
+            }
             /*
-             * Check if the client already had the same request.
-             * Complete the old request with an error in this case.
-             * Protection against clients, which cancel and resubmits requests.
+             * Otherwise reply at once with the enqueued notification we found.
              */
-            CallList::iterator it = mGuestWaiters.begin();
-            while (it != mGuestWaiters.end())
+            else
             {
-                const char *pszPatternsExisting;
-                uint32_t cchPatternsExisting;
-                int rc3 = it->mParms[0].getString(&pszPatternsExisting, &cchPatternsExisting);
-
-                if (   RT_SUCCESS(rc3)
-                    && u32ClientId == it->u32ClientId
-                    && RTStrCmp(pszPatterns, pszPatternsExisting) == 0)
-                {
-                    /* Complete the old request. */
-                    mpHelpers->pfnCallComplete(it->mHandle, VERR_INTERRUPTED);
-                    it = mGuestWaiters.erase(it);
-                }
-                else
-                    ++it;
+                int rc2 = getNotificationWriteOut(cParms, paParms, prop);
+                if (RT_FAILURE(rc2))
+                    rc = rc2;
             }
-
-            mGuestWaiters.push_back(GuestCall(u32ClientId, callHandle, GET_NOTIFICATION,
-                                              cParms, paParms, rc));
-            rc = VINF_HGCM_ASYNC_EXECUTE;
-        }
-        /*
-         * Otherwise reply at once with the enqueued notification we found.
-         */
-        else
-        {
-            int rc2 = getNotificationWriteOut(cParms, paParms, prop);
-            if (RT_FAILURE(rc2))
-                rc = rc2;
         }
     }
@@ -1425,4 +1431,5 @@
 void Service::dbgInfo(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs)
 {
+    RT_NOREF1(pszArgs);
     SELF *pSelf = reinterpret_cast<SELF *>(pvUser);
     pSelf->dbgInfoShow(pHlp);
@@ -1519,6 +1526,7 @@
 #ifdef ASYNC_HOST_NOTIFY
 /* static */
-DECLCALLBACK(int) Service::threadNotifyHost(RTTHREAD self, void *pvUser)
-{
+DECLCALLBACK(int) Service::threadNotifyHost(RTTHREAD hThreadSelf, void *pvUser)
+{
+    RT_NOREF1(hThreadSelf);
     Service *pThis = (Service *)pvUser;
     int rc = VINF_SUCCESS;
