Index: trunk/src/VBox/HostServices/GuestProperties/service.cpp
===================================================================
--- trunk/src/VBox/HostServices/GuestProperties/service.cpp	(revision 75432)
+++ trunk/src/VBox/HostServices/GuestProperties/service.cpp	(revision 75498)
@@ -394,7 +394,5 @@
     }
 
-#ifdef ASYNC_HOST_NOTIFY
     int initialize();
-#endif
 
 private:
@@ -422,5 +420,4 @@
     int hostCall(uint32_t eFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
     int uninit();
-    void dbgInfoShow(PCDBGFINFOHLP pHlp);
     static DECLCALLBACK(void) dbgInfo(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs);
 
@@ -1439,6 +1436,6 @@
 static DECLCALLBACK(int) dbgInfoCallback(PRTSTRSPACECORE pStr, void *pvUser)
 {
-    Property *pProp = (Property *)pStr;
-    PCDBGFINFOHLP pHlp = ((ENUMDBGINFO*)pvUser)->pHlp;
+    Property     *pProp = (Property *)pStr;
+    PCDBGFINFOHLP pHlp  = ((ENUMDBGINFO *)pvUser)->pHlp;
 
     char szFlags[GUEST_PROP_MAX_FLAGS_LEN];
@@ -1447,6 +1444,5 @@
         RTStrPrintf(szFlags, sizeof(szFlags), "???");
 
-    pHlp->pfnPrintf(pHlp, "%s: '%s', %RU64",
-                    pProp->mName.c_str(), pProp->mValue.c_str(), pProp->mTimestamp);
+    pHlp->pfnPrintf(pHlp, "%s: '%s', %RU64", pProp->mName.c_str(), pProp->mValue.c_str(), pProp->mTimestamp);
     if (strlen(szFlags))
         pHlp->pfnPrintf(pHlp, " (%s)", szFlags);
@@ -1455,9 +1451,4 @@
 }
 
-void Service::dbgInfoShow(PCDBGFINFOHLP pHlp)
-{
-    ENUMDBGINFO EnumData = { pHlp };
-    RTStrSpaceEnumerate(&mhProperties, dbgInfoCallback, &EnumData);
-}
 
 /**
@@ -1468,9 +1459,11 @@
  * @param   pszArgs     Arguments, ignored.
  */
-void Service::dbgInfo(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs)
+DECLCALLBACK(void) Service::dbgInfo(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs)
 {
     RT_NOREF1(pszArgs);
     SELF *pSelf = reinterpret_cast<SELF *>(pvUser);
-    pSelf->dbgInfoShow(pHlp);
+
+    ENUMDBGINFO EnumData = { pHlp };
+    RTStrSpaceEnumerate(&pSelf->mhProperties, dbgInfoCallback, &EnumData);
 }
 
@@ -1542,11 +1535,4 @@
                 break;
 
-            case GUEST_PROP_FN_HOST_GET_DBGF_INFO:
-                if (cParms != 2)
-                    return VERR_INVALID_PARAMETER;
-                paParms[0].u.pointer.addr = (void*)(uintptr_t)dbgInfo;
-                paParms[1].u.pointer.addr = (void*)this;
-                break;
-
             default:
                 rc = VERR_NOT_SUPPORTED;
@@ -1564,4 +1550,5 @@
 
 #ifdef ASYNC_HOST_NOTIFY
+
 /* static */
 DECLCALLBACK(int) Service::threadNotifyHost(RTTHREAD hThreadSelf, void *pvUser)
@@ -1596,6 +1583,9 @@
 }
 
+#endif /* ASYNC_HOST_NOTIFY */
+
 int Service::initialize()
 {
+#ifdef ASYNC_HOST_NOTIFY
     /* The host notification thread and queue. */
     int rc = RTReqQueueCreate(&mhReqQNotifyHost);
@@ -1619,8 +1609,16 @@
         }
     }
+#else  /* !ASYNC_HOST_NOTIFY */
+    int rc = VINF_SUCCESS;
+#endif /* !ASYNC_HOST_NOTIFY */
+
+    /* Finally debug stuff (ignore failures): */
+    if (RT_SUCCESS(rc))
+        HGCMSvcHlpInfoRegister(mpHelpers, "guestprops", "Display the guest properties", Service::dbgInfo, this);
 
     return rc;
 }
 
+#ifdef ASYNC_HOST_NOTIFY
 /**
  * @callback_method_impl{FNRTSTRSPACECALLBACK, Destroys Property.}
@@ -1638,4 +1636,7 @@
 int Service::uninit()
 {
+    if (mpHelpers)
+        HGCMSvcHlpInfoDeregister(mpHelpers, "guestprops");
+
 #ifdef ASYNC_HOST_NOTIFY
     if (mhReqQNotifyHost != NIL_RTREQQUEUE)
@@ -1656,5 +1657,4 @@
     }
 #endif
-
     return VINF_SUCCESS;
 }
@@ -1667,5 +1667,5 @@
  * @copydoc VBOXHGCMSVCLOAD
  */
-extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad (VBOXHGCMSVCFNTABLE *ptable)
+extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad(VBOXHGCMSVCFNTABLE *ptable)
 {
     int rc = VERR_IPE_UNINITIALIZED_STATUS;
@@ -1713,9 +1713,7 @@
                 ptable->pfnLoadState          = NULL;  /* construction done before restoring suffices */
                 ptable->pfnRegisterExtension  = Service::svcRegisterExtension;
+                ptable->pvService             = pService;
 
                 /* Service specific initialization. */
-                ptable->pvService = pService;
-
-#ifdef ASYNC_HOST_NOTIFY
                 rc = pService->initialize();
                 if (RT_FAILURE(rc))
@@ -1724,5 +1722,4 @@
                     pService = NULL;
                 }
-#endif
             }
             else
Index: trunk/src/VBox/HostServices/SharedClipboard/VBoxClipboard-win.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedClipboard/VBoxClipboard-win.cpp	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedClipboard/VBoxClipboard-win.cpp	(revision 75498)
@@ -1,4 +1,5 @@
+/* $Id$ */
 /** @file
- * Shared Clipboard: Win32 host.
+ * Shared Clipboard Service - Win32 host.
  */
 
@@ -15,4 +16,9 @@
  */
 
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define LOG_GROUP LOG_GROUP_SHARED_CLIPBOARD
 #include <iprt/win/windows.h>
 
Index: trunk/src/VBox/HostServices/SharedClipboard/VBoxClipboard.h
===================================================================
--- trunk/src/VBox/HostServices/SharedClipboard/VBoxClipboard.h	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedClipboard/VBoxClipboard.h	(revision 75498)
@@ -1,5 +1,5 @@
+/* $Id$ */
 /** @file
- *
- * Shared Clipboard
+ * Shared Clipboard Service - Internal Header.
  */
 
@@ -16,8 +16,7 @@
  */
 
-#ifndef __VBOXCLIPBOARD__H
-#define __VBOXCLIPBOARD__H
+#ifndef ___VBOXCLIPBOARD_H
+#define ___VBOXCLIPBOARD_H
 
-#define LOG_GROUP LOG_GROUP_SHARED_CLIPBOARD
 #include <VBox/hgcmsvc.h>
 #include <VBox/log.h>
@@ -98,3 +97,4 @@
 #endif
 
-#endif /* __VBOXCLIPBOARD__H */
+#endif /* !___VBOXCLIPBOARD_H */
+
Index: trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboard.rc
===================================================================
--- trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboard.rc	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboard.rc	(revision 75498)
@@ -1,5 +1,5 @@
 /* $Id$ */
 /** @file
- * VBoxSharedClipboard - Resource file containing version info and icon.
+ * Shared Clipboard Service - Resource file containing version info and icon.
  */
 
Index: trunk/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.cpp	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.cpp	(revision 75498)
@@ -1,5 +1,5 @@
 /* $Id$ */
 /** @file
- * Shared Clipboard: Mac OS X host implementation.
+ * Shared Clipboard Service - Mac OS X host implementation.
  */
 
@@ -18,5 +18,8 @@
  */
 
-#define LOG_GROUP LOG_GROUP_HGCM
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define LOG_GROUP LOG_GROUP_SHARED_CLIPBOARD
 #include <Carbon/Carbon.h>
 
@@ -29,6 +32,11 @@
 #include "VBox/GuestHost/clipboard-helper.h"
 
+
+/*********************************************************************************************************************************
+*   Defined Constants And Macros                                                                                                 *
+*********************************************************************************************************************************/
 /* For debugging */
 //#define SHOW_CLIPBOARD_CONTENT
+
 
 /**
Index: trunk/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.h
===================================================================
--- trunk/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.h	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.h	(revision 75498)
@@ -1,5 +1,5 @@
 /* $Id$ */
 /** @file
- * Shared Clipboard: Mac OS X host implementation.
+ * Shared Clipboard Service - Mac OS X host implementation.
  */
 
@@ -21,10 +21,10 @@
 typedef struct OpaquePasteboardRef *PasteboardRef;
 
-int initPasteboard (PasteboardRef *pPasteboardRef);
-void destroyPasteboard (PasteboardRef *pPasteboardRef);
+int initPasteboard(PasteboardRef *pPasteboardRef);
+void destroyPasteboard(PasteboardRef *pPasteboardRef);
 
-int queryNewPasteboardFormats (PasteboardRef pPasteboard, uint32_t *pfFormats, bool *pfChanged);
-int readFromPasteboard (PasteboardRef pPasteboard, uint32_t fFormat, void *pv, uint32_t cb, uint32_t *pcbActual);
-int writeToPasteboard (PasteboardRef pPasteboard, void *pv, uint32_t cb, uint32_t fFormat);
+int queryNewPasteboardFormats(PasteboardRef pPasteboard, uint32_t *pfFormats, bool *pfChanged);
+int readFromPasteboard(PasteboardRef pPasteboard, uint32_t fFormat, void *pv, uint32_t cb, uint32_t *pcbActual);
+int writeToPasteboard(PasteboardRef pPasteboard, void *pv, uint32_t cb, uint32_t fFormat);
 
 #endif
Index: trunk/src/VBox/HostServices/SharedClipboard/darwin.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedClipboard/darwin.cpp	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedClipboard/darwin.cpp	(revision 75498)
@@ -1,5 +1,5 @@
 /* $Id$ */
 /** @file
- * Shared Clipboard: Mac OS X host.
+ * Shared Clipboard Service - Mac OS X host.
  */
 
@@ -16,4 +16,9 @@
  */
 
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define LOG_GROUP LOG_GROUP_SHARED_CLIPBOARD
 #include <VBox/HostServices/VBoxClipboardSvc.h>
 
@@ -25,4 +30,8 @@
 #include "darwin-pasteboard.h"
 
+
+/*********************************************************************************************************************************
+*   Structures and Typedefs                                                                                                      *
+*********************************************************************************************************************************/
 /** Global clipboard context information */
 struct _VBOXCLIPBOARDCONTEXT
@@ -38,4 +47,8 @@
 };
 
+
+/*********************************************************************************************************************************
+*   Global Variables                                                                                                             *
+*********************************************************************************************************************************/
 /** Only one client is supported. There seems to be no need for more clients. */
 static VBOXCLIPBOARDCONTEXT g_ctx;
Index: trunk/src/VBox/HostServices/SharedClipboard/service.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedClipboard/service.cpp	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedClipboard/service.cpp	(revision 75498)
@@ -1,5 +1,5 @@
 /* $Id$ */
 /** @file
- * Shared Clipboard: Host service entry points.
+ * Shared Clipboard Service - Host service entry points.
  */
 
@@ -70,4 +70,8 @@
  */
 
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define LOG_GROUP LOG_GROUP_SHARED_CLIPBOARD
 #include <VBox/HostServices/VBoxClipboardSvc.h>
 #include <VBox/HostServices/VBoxClipboardExt.h>
@@ -81,42 +85,8 @@
 #include "VBoxClipboard.h"
 
-static void VBoxHGCMParmUInt32Set (VBOXHGCMSVCPARM *pParm, uint32_t u32)
-{
-    pParm->type = VBOX_HGCM_SVC_PARM_32BIT;
-    pParm->u.uint32 = u32;
-}
-
-static int VBoxHGCMParmUInt32Get (VBOXHGCMSVCPARM *pParm, uint32_t *pu32)
-{
-    if (pParm->type == VBOX_HGCM_SVC_PARM_32BIT)
-    {
-        *pu32 = pParm->u.uint32;
-        return VINF_SUCCESS;
-    }
-
-    return VERR_INVALID_PARAMETER;
-}
-
-#if 0
-static void VBoxHGCMParmPtrSet (VBOXHGCMSVCPARM *pParm, void *pv, uint32_t cb)
-{
-    pParm->type             = VBOX_HGCM_SVC_PARM_PTR;
-    pParm->u.pointer.size   = cb;
-    pParm->u.pointer.addr   = pv;
-}
-#endif
-
-static int VBoxHGCMParmPtrGet (VBOXHGCMSVCPARM *pParm, void **ppv, uint32_t *pcb)
-{
-    if (pParm->type == VBOX_HGCM_SVC_PARM_PTR)
-    {
-        *ppv = pParm->u.pointer.addr;
-        *pcb = pParm->u.pointer.size;
-        return VINF_SUCCESS;
-    }
-
-    return VERR_INVALID_PARAMETER;
-}
-
+
+/*********************************************************************************************************************************
+*   Global Variables                                                                                                             *
+*********************************************************************************************************************************/
 static PVBOXHGCMSVCHELPERS g_pHelpers;
 
@@ -136,4 +106,44 @@
 /** Is the clipboard running in headless mode? */
 static bool g_fHeadless = false;
+
+
+static void VBoxHGCMParmUInt32Set (VBOXHGCMSVCPARM *pParm, uint32_t u32)
+{
+    pParm->type = VBOX_HGCM_SVC_PARM_32BIT;
+    pParm->u.uint32 = u32;
+}
+
+static int VBoxHGCMParmUInt32Get (VBOXHGCMSVCPARM *pParm, uint32_t *pu32)
+{
+    if (pParm->type == VBOX_HGCM_SVC_PARM_32BIT)
+    {
+        *pu32 = pParm->u.uint32;
+        return VINF_SUCCESS;
+    }
+
+    return VERR_INVALID_PARAMETER;
+}
+
+#if 0
+static void VBoxHGCMParmPtrSet (VBOXHGCMSVCPARM *pParm, void *pv, uint32_t cb)
+{
+    pParm->type             = VBOX_HGCM_SVC_PARM_PTR;
+    pParm->u.pointer.size   = cb;
+    pParm->u.pointer.addr   = pv;
+}
+#endif
+
+static int VBoxHGCMParmPtrGet (VBOXHGCMSVCPARM *pParm, void **ppv, uint32_t *pcb)
+{
+    if (pParm->type == VBOX_HGCM_SVC_PARM_PTR)
+    {
+        *ppv = pParm->u.pointer.addr;
+        *pcb = pParm->u.pointer.size;
+        return VINF_SUCCESS;
+    }
+
+    return VERR_INVALID_PARAMETER;
+}
+
 
 static uint32_t vboxSvcClipboardMode (void)
Index: trunk/src/VBox/HostServices/SharedClipboard/x11-clipboard.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedClipboard/x11-clipboard.cpp	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedClipboard/x11-clipboard.cpp	(revision 75498)
@@ -1,6 +1,5 @@
+/* $Id$ */
 /** @file
- *
- * Shared Clipboard:
- * Linux host.
+ * Shared Clipboard Service - Linux host.
  */
 
@@ -17,8 +16,9 @@
  */
 
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
 #define LOG_GROUP LOG_GROUP_SHARED_CLIPBOARD
-
-#include <string.h>
-
 #include <iprt/assert.h>
 #include <iprt/critsect.h>
@@ -26,4 +26,5 @@
 #include <iprt/mem.h>
 #include <iprt/semaphore.h>
+#include <iprt/string.h>
 
 #include <VBox/GuestHost/SharedClipboard.h>
Index: trunk/src/VBox/HostServices/SharedClipboard/x11-stub.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedClipboard/x11-stub.cpp	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedClipboard/x11-stub.cpp	(revision 75498)
@@ -1,6 +1,5 @@
+/* $Id$*/
 /** @file
- *
- * Shared Clipboard:
- * Linux host, a stub version with no functionality for use on headless hosts.
+ * Shared Clipboard Service - Linux host, a stub version with no functionality for use on headless hosts.
  */
 
@@ -17,4 +16,9 @@
  */
 
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define LOG_GROUP LOG_GROUP_SHARED_CLIPBOARD
 #include <VBox/HostServices/VBoxClipboardSvc.h>
 
@@ -32,4 +36,6 @@
 
 #include "VBoxClipboard.h"
+
+
 
 /** Initialise the host side of the shared clipboard - called by the hgcm layer. */
@@ -129,2 +135,3 @@
     LogFlowFunc(("called, returning.\n"));
 }
+
Index: trunk/src/VBox/HostServices/SharedFolders/mappings.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedFolders/mappings.cpp	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedFolders/mappings.cpp	(revision 75498)
@@ -1,4 +1,5 @@
+/* $Id$ */
 /** @file
- * Shared Folders: Mappings support.
+ * Shared Folders Service - Mappings support.
  */
 
@@ -15,4 +16,9 @@
  */
 
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define LOG_GROUP LOG_GROUP_SHARED_FOLDERS
 #ifdef UNITTEST
 # include "testcase/tstSharedFolderService.h"
@@ -31,4 +37,8 @@
 #endif
 
+
+/*********************************************************************************************************************************
+*   Global Variables                                                                                                             *
+*********************************************************************************************************************************/
 extern PVBOXHGCMSVCHELPERS g_pHelpers; /* service.cpp */
 
Index: trunk/src/VBox/HostServices/SharedFolders/service.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedFolders/service.cpp	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedFolders/service.cpp	(revision 75498)
@@ -16,6 +16,9 @@
  */
 
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define LOG_GROUP LOG_GROUP_SHARED_FOLDERS
 #include <VBox/shflsvc.h>
-
 
 #include "shfl.h"
@@ -30,7 +33,70 @@
 #include <VBox/vmm/pdmifs.h>
 
+
+/*********************************************************************************************************************************
+*   Defined Constants And Macros                                                                                                 *
+*********************************************************************************************************************************/
 #define SHFL_SAVED_STATE_VERSION_FOLDERNAME_UTF16       2
 #define SHFL_SAVED_STATE_VERSION_PRE_AUTO_MOUNT_POINT   3
 #define SHFL_SAVED_STATE_VERSION                        4
+
+
+/*********************************************************************************************************************************
+*   Global Variables                                                                                                             *
+*********************************************************************************************************************************/
+PVBOXHGCMSVCHELPERS g_pHelpers;
+static PPDMLED      g_pStatusLed = NULL;
+
+/** @name Shared folder statistics.
+ * @{ */
+static STAMPROFILE g_StatQueryMappings;
+static STAMPROFILE g_StatQueryMappingsFail;
+static STAMPROFILE g_StatQueryMapName;
+static STAMPROFILE g_StatCreate;
+static STAMPROFILE g_StatCreateFail;
+static STAMPROFILE g_StatLookup;
+static STAMPROFILE g_StatLookupFail;
+static STAMPROFILE g_StatClose;
+static STAMPROFILE g_StatCloseFail;
+static STAMPROFILE g_StatRead;
+static STAMPROFILE g_StatReadFail;
+static STAMPROFILE g_StatWrite;
+static STAMPROFILE g_StatWriteFail;
+static STAMPROFILE g_StatLock;
+static STAMPROFILE g_StatLockFail;
+static STAMPROFILE g_StatList;
+static STAMPROFILE g_StatListFail;
+static STAMPROFILE g_StatReadLink;
+static STAMPROFILE g_StatReadLinkFail;
+static STAMPROFILE g_StatMapFolderOld;
+static STAMPROFILE g_StatMapFolder;
+static STAMPROFILE g_StatMapFolderFail;
+static STAMPROFILE g_StatUnmapFolder;
+static STAMPROFILE g_StatUnmapFolderFail;
+static STAMPROFILE g_StatInformationFail;
+static STAMPROFILE g_StatInformationSetFile;
+static STAMPROFILE g_StatInformationSetFileFail;
+static STAMPROFILE g_StatInformationSetSize;
+static STAMPROFILE g_StatInformationSetSizeFail;
+static STAMPROFILE g_StatInformationGetFile;
+static STAMPROFILE g_StatInformationGetFileFail;
+static STAMPROFILE g_StatInformationGetVolume;
+static STAMPROFILE g_StatInformationGetVolumeFail;
+static STAMPROFILE g_StatRemove;
+static STAMPROFILE g_StatRemoveFail;
+static STAMPROFILE g_StatRename;
+static STAMPROFILE g_StatRenameFail;
+static STAMPROFILE g_StatFlush;
+static STAMPROFILE g_StatFlushFail;
+static STAMPROFILE g_StatSetUtf8;
+static STAMPROFILE g_StatSymlink;
+static STAMPROFILE g_StatSymlinkFail;
+static STAMPROFILE g_StatSetSymlinks;
+static STAMPROFILE g_StatQueryMapInfo;
+static STAMPROFILE g_StatWaitForMappingsChanges;
+static STAMPROFILE g_StatWaitForMappingsChangesFail;
+static STAMPROFILE g_StatCancelMappingsChangesWait;
+static STAMPROFILE g_StatUnknown;
+/** @} */
 
 
@@ -73,6 +139,4 @@
 
 
-PVBOXHGCMSVCHELPERS g_pHelpers;
-static PPDMLED      pStatusLed = NULL;
 
 static DECLCALLBACK(int) svcUnload (void *)
@@ -83,4 +147,6 @@
     vbsfFreeHandleTable();
 
+    if (g_pHelpers)
+        HGCMSvcHlpStamDeregister(g_pHelpers, "/HGCM/VBoxSharedFolders/*");
     return rc;
 }
@@ -336,6 +402,8 @@
 {
     RT_NOREF1(u32ClientID);
-    int rc = VINF_SUCCESS;
-
+#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
+    uint64_t tsStart;
+    STAM_GET_TS(tsStart);
+#endif
     Log(("SharedFolders host service: svcCall: u32ClientID = %u, fn = %u, cParms = %u, pparms = %p\n", u32ClientID, u32Function, cParms, paParms));
 
@@ -352,8 +420,12 @@
 #endif
 
+    int rc = VINF_SUCCESS;
+    PSTAMPROFILE pStat, pStatFail;
     switch (u32Function)
     {
         case SHFL_FN_QUERY_MAPPINGS:
         {
+            pStat     = &g_StatQueryMappings;
+            pStatFail = &g_StatQueryMappingsFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_QUERY_MAPPINGS\n"));
 
@@ -415,4 +487,5 @@
         case SHFL_FN_QUERY_MAP_NAME:
         {
+            pStatFail = pStat = &g_StatQueryMapName;
             Log(("SharedFolders host service: svcCall: SHFL_FN_QUERY_MAP_NAME\n"));
 
@@ -456,4 +529,6 @@
         case SHFL_FN_CREATE:
         {
+            pStat     = &g_StatCreate;
+            pStatFail = &g_StatCreateFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_CREATE\n"));
 
@@ -491,4 +566,10 @@
                 else
                 {
+                    if (pParms->CreateFlags & SHFL_CF_LOOKUP)
+                    {
+                        pStat     = &g_StatLookup;
+                        pStatFail = &g_StatLookupFail;
+                    }
+
                     /* Execute the function. */
                     rc = vbsfCreate (pClient, root, pPath, cbPath, pParms);
@@ -506,4 +587,6 @@
         case SHFL_FN_CLOSE:
         {
+            pStat     = &g_StatClose;
+            pStatFail = &g_StatCloseFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_CLOSE\n"));
 
@@ -554,4 +637,6 @@
         /** Read object content. */
         case SHFL_FN_READ:
+            pStat     = &g_StatRead;
+            pStatFail = &g_StatReadFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_READ\n"));
 
@@ -596,13 +681,13 @@
                 {
                     /* Execute the function. */
-                    if (pStatusLed)
-                    {
-                        Assert(pStatusLed->u32Magic == PDMLED_MAGIC);
-                        pStatusLed->Asserted.s.fReading = pStatusLed->Actual.s.fReading = 1;
+                    if (g_pStatusLed)
+                    {
+                        Assert(g_pStatusLed->u32Magic == PDMLED_MAGIC);
+                        g_pStatusLed->Asserted.s.fReading = g_pStatusLed->Actual.s.fReading = 1;
                     }
 
                     rc = vbsfRead (pClient, root, Handle, offset, &count, pBuffer);
-                    if (pStatusLed)
-                        pStatusLed->Actual.s.fReading = 0;
+                    if (g_pStatusLed)
+                        g_pStatusLed->Actual.s.fReading = 0;
 
                     if (RT_SUCCESS(rc))
@@ -621,4 +706,6 @@
         /** Write new object content. */
         case SHFL_FN_WRITE:
+            pStat     = &g_StatWrite;
+            pStatFail = &g_StatWriteFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_WRITE\n"));
 
@@ -663,13 +750,13 @@
                 {
                     /* Execute the function. */
-                    if (pStatusLed)
-                    {
-                        Assert(pStatusLed->u32Magic == PDMLED_MAGIC);
-                        pStatusLed->Asserted.s.fWriting = pStatusLed->Actual.s.fWriting = 1;
+                    if (g_pStatusLed)
+                    {
+                        Assert(g_pStatusLed->u32Magic == PDMLED_MAGIC);
+                        g_pStatusLed->Asserted.s.fWriting = g_pStatusLed->Actual.s.fWriting = 1;
                     }
 
                     rc = vbsfWrite (pClient, root, Handle, offset, &count, pBuffer);
-                    if (pStatusLed)
-                        pStatusLed->Actual.s.fWriting = 0;
+                    if (g_pStatusLed)
+                        g_pStatusLed->Actual.s.fWriting = 0;
 
                     if (RT_SUCCESS(rc))
@@ -688,4 +775,6 @@
         /** Lock/unlock a range in the object. */
         case SHFL_FN_LOCK:
+            pStat     = &g_StatLock;
+            pStatFail = &g_StatLockFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_LOCK\n"));
 
@@ -775,4 +864,6 @@
         case SHFL_FN_LIST:
         {
+            pStat     = &g_StatList;
+            pStatFail = &g_StatListFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_LIST\n"));
 
@@ -817,8 +908,8 @@
                 else
                 {
-                    if (pStatusLed)
-                    {
-                        Assert(pStatusLed->u32Magic == PDMLED_MAGIC);
-                        pStatusLed->Asserted.s.fReading = pStatusLed->Actual.s.fReading = 1;
+                    if (g_pStatusLed)
+                    {
+                        Assert(g_pStatusLed->u32Magic == PDMLED_MAGIC);
+                        g_pStatusLed->Asserted.s.fReading = g_pStatusLed->Actual.s.fReading = 1;
                     }
 
@@ -826,6 +917,6 @@
                     rc = vbsfDirList (pClient, root, Handle, pPath, flags, &length, pBuffer, &resumePoint, &cFiles);
 
-                    if (pStatusLed)
-                        pStatusLed->Actual.s.fReading = 0;
+                    if (g_pStatusLed)
+                        g_pStatusLed->Actual.s.fReading = 0;
 
                     if (rc == VERR_NO_MORE_FILES && cFiles != 0)
@@ -853,4 +944,6 @@
         case SHFL_FN_READLINK:
         {
+            pStat     = &g_StatReadLink;
+            pStatFail = &g_StatReadLinkFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_READLINK\n"));
 
@@ -901,4 +994,5 @@
         case SHFL_FN_MAP_FOLDER_OLD:
         {
+            pStatFail = pStat = &g_StatMapFolderOld;
             Log(("SharedFolders host service: svcCall: SHFL_FN_MAP_FOLDER_OLD\n"));
 
@@ -944,4 +1038,6 @@
         case SHFL_FN_MAP_FOLDER:
         {
+            pStat     = &g_StatMapFolder;
+            pStatFail = &g_StatMapFolderFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_MAP_FOLDER\n"));
             if (BIT_FLAG(pClient->fu32Flags, SHFL_CF_UTF8))
@@ -1014,4 +1110,6 @@
         case SHFL_FN_UNMAP_FOLDER:
         {
+            pStat     = &g_StatUnmapFolder;
+            pStatFail = &g_StatUnmapFolderFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_UNMAP_FOLDER\n"));
             Log(("SharedFolders host service: request to unmap folder handle %u\n",
@@ -1049,4 +1147,5 @@
         case SHFL_FN_INFORMATION:
         {
+            pStatFail = pStat = &g_StatInformationFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_INFORMATION\n"));
 
@@ -1084,7 +1183,33 @@
                     /* Execute the function. */
                     if (flags & SHFL_INFO_SET)
+                    {
                         rc = vbsfSetFSInfo (pClient, root, Handle, flags, &length, pBuffer);
+
+                        if (flags & SHFL_INFO_FILE)
+                        {
+                            pStat     = &g_StatInformationSetFile;
+                            pStatFail = &g_StatInformationSetFileFail;
+                        }
+                        else if (flags & SHFL_INFO_SIZE)
+                        {
+                            pStat     = &g_StatInformationSetSize;
+                            pStatFail = &g_StatInformationSetSizeFail;
+                        }
+                    }
                     else /* SHFL_INFO_GET */
+                    {
                         rc = vbsfQueryFSInfo (pClient, root, Handle, flags, &length, pBuffer);
+
+                        if (flags & SHFL_INFO_FILE)
+                        {
+                            pStat     = &g_StatInformationGetFile;
+                            pStatFail = &g_StatInformationGetFileFail;
+                        }
+                        else if (flags & SHFL_INFO_VOLUME)
+                        {
+                            pStat     = &g_StatInformationGetVolume;
+                            pStatFail = &g_StatInformationGetVolumeFail;
+                        }
+                    }
 
                     if (RT_SUCCESS(rc))
@@ -1105,4 +1230,6 @@
         case SHFL_FN_REMOVE:
         {
+            pStat     = &g_StatRemove;
+            pStatFail = &g_StatRemoveFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_REMOVE\n"));
 
@@ -1148,4 +1275,6 @@
         case SHFL_FN_RENAME:
         {
+            pStat     = &g_StatRename;
+            pStatFail = &g_StatRenameFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_RENAME\n"));
 
@@ -1194,4 +1323,6 @@
         case SHFL_FN_FLUSH:
         {
+            pStat     = &g_StatFlush;
+            pStatFail = &g_StatFlushFail;
             Log(("SharedFolders host service: svcCall: SHFL_FN_FLUSH\n"));
 
@@ -1241,4 +1372,6 @@
         case SHFL_FN_SET_UTF8:
         {
+            pStatFail = pStat = &g_StatSetUtf8;
+
             pClient->fu32Flags |= SHFL_CF_UTF8;
             rc = VINF_SUCCESS;
@@ -1248,5 +1381,8 @@
         case SHFL_FN_SYMLINK:
         {
+            pStat     = &g_StatSymlink;
+            pStatFail = &g_StatSymlinkFail;
             Log(("SharedFolders host service: svnCall: SHFL_FN_SYMLINK\n"));
+
             /* Verify parameter count and types. */
             if (cParms != SHFL_CPARMS_SYMLINK)
@@ -1295,4 +1431,6 @@
         case SHFL_FN_SET_SYMLINKS:
         {
+            pStatFail = pStat = &g_StatSetSymlinks;
+
             pClient->fu32Flags |= SHFL_CF_SYMLINKS;
             rc = VINF_SUCCESS;
@@ -1302,4 +1440,5 @@
         case SHFL_FN_QUERY_MAP_INFO:
         {
+            pStatFail = pStat = &g_StatQueryMapInfo;
             Log(("SharedFolders host service: svnCall: SHFL_FN_QUERY_MAP_INFO\n"));
 
@@ -1326,5 +1465,7 @@
         case SHFL_FN_WAIT_FOR_MAPPINGS_CHANGES:
         {
-            Log(("SharedFolders host service: svnCall: SHFL_FN_WAIT_FOR_CHANGES\n"));
+            pStat = &g_StatWaitForMappingsChanges;
+            pStatFail = &g_StatWaitForMappingsChangesFail;
+            Log(("SharedFolders host service: svnCall: SHFL_FN_WAIT_FOR_MAPPINGS_CHANGES\n"));
 
             /* Validate input: */
@@ -1341,4 +1482,5 @@
         case SHFL_FN_CANCEL_MAPPINGS_CHANGES_WAITS:
         {
+            pStatFail = pStat = &g_StatCancelMappingsChangesWait;
             Log(("SharedFolders host service: svnCall: SHFL_FN_CANCEL_WAIT_FOR_CHANGES\n"));
 
@@ -1354,4 +1496,5 @@
         default:
         {
+            pStatFail = pStat = &g_StatUnknown;
             rc = VERR_NOT_IMPLEMENTED;
             break;
@@ -1369,4 +1512,15 @@
         g_pHelpers->pfnCallComplete (callHandle, rc);
     }
+
+#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
+    /* Statistics: */
+    uint64_t cTicks;
+    STAM_GET_TS(cTicks);
+    cTicks -= tsStart;
+    if (RT_SUCCESS(rc))
+        STAM_REL_PROFILE_ADD_PERIOD(pStat, cTicks);
+    else
+        STAM_REL_PROFILE_ADD_PERIOD(pStatFail, cTicks);
+#endif
 
     LogFlow(("\n"));        /* Add a new line to differentiate between calls more easily. */
@@ -1538,5 +1692,5 @@
             {
                 /* Execute the function. */
-                pStatusLed = pLed;
+                g_pStatusLed = pLed;
                 rc = VINF_SUCCESS;
             }
@@ -1598,4 +1752,57 @@
 
         vbsfMappingInit();
+
+        /* Finally, register statistics if everything went well: */
+        if (RT_SUCCESS(rc))
+        {
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatQueryMappings,             STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_QUERY_MAPPINGS successes",          "/HGCM/VBoxSharedFolders/FnQueryMappings");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatQueryMappingsFail,         STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_QUERY_MAPPINGS failures",           "/HGCM/VBoxSharedFolders/FnQueryMappingsFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatQueryMapName,              STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_QUERY_MAP_NAME",                    "/HGCM/VBoxSharedFolders/FnQueryMapName");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatCreate,                    STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_CREATE/CREATE successes",           "/HGCM/VBoxSharedFolders/FnCreate");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatCreateFail,                STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_CREATE/CREATE failures",            "/HGCM/VBoxSharedFolders/FnCreateFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatLookup,                    STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_CREATE/LOOKUP successes",           "/HGCM/VBoxSharedFolders/FnLookup");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatLookupFail,                STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_CREATE/LOOKUP failures",            "/HGCM/VBoxSharedFolders/FnLookupFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatClose,                     STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_CLOSE successes",                   "/HGCM/VBoxSharedFolders/FnClose");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatCloseFail,                 STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_CLOSE failures",                    "/HGCM/VBoxSharedFolders/FnCloseFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatRead,                      STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_READ successes",                    "/HGCM/VBoxSharedFolders/FnRead");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatReadFail,                  STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_READ failures",                     "/HGCM/VBoxSharedFolders/FnReadFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatWrite,                     STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_WRITE successes",                   "/HGCM/VBoxSharedFolders/FnWrite");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatWriteFail,                 STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_WRITE failures",                    "/HGCM/VBoxSharedFolders/FnWriteFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatLock,                      STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_LOCK successes",                    "/HGCM/VBoxSharedFolders/FnLock");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatLockFail,                  STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_LOCK failures",                     "/HGCM/VBoxSharedFolders/FnLockFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatList,                      STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_LIST successes",                    "/HGCM/VBoxSharedFolders/FnList");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatListFail,                  STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_LIST failures",                     "/HGCM/VBoxSharedFolders/FnListFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatReadLink,                  STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_READLINK successes",                "/HGCM/VBoxSharedFolders/FnReadLink");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatReadLinkFail,              STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_READLINK failures",                 "/HGCM/VBoxSharedFolders/FnReadLinkFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatMapFolderOld,              STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_MAP_FOLDER_OLD",                    "/HGCM/VBoxSharedFolders/FnMapFolderOld");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatMapFolder,                 STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_MAP_FOLDER successes",              "/HGCM/VBoxSharedFolders/FnMapFolder");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatMapFolderFail,             STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_MAP_FOLDER failures",               "/HGCM/VBoxSharedFolders/FnMapFolderFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatUnmapFolder,               STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_UNMAP_FOLDER successes",            "/HGCM/VBoxSharedFolders/FnUnmapFolder");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatUnmapFolderFail,           STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_UNMAP_FOLDER failures",             "/HGCM/VBoxSharedFolders/FnUnmapFolderFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatInformationFail,           STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_INFORMATION early failures",        "/HGCM/VBoxSharedFolders/FnInformationFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatInformationSetFile,        STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_INFORMATION/SET/FILE successes",    "/HGCM/VBoxSharedFolders/FnInformationSetFile");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatInformationSetFileFail,    STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_INFORMATION/SET/FILE failures",     "/HGCM/VBoxSharedFolders/FnInformationSetFileFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatInformationSetSize,        STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_INFORMATION/SET/SIZE successes",    "/HGCM/VBoxSharedFolders/FnInformationSetSize");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatInformationSetSizeFail,    STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_INFORMATION/SET/SIZE failures",     "/HGCM/VBoxSharedFolders/FnInformationSetSizeFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatInformationGetFile,        STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_INFORMATION/GET/FILE successes",    "/HGCM/VBoxSharedFolders/FnInformationGetFile");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatInformationGetFileFail,    STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_INFORMATION/GET/FILE failures",     "/HGCM/VBoxSharedFolders/FnInformationGetFileFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatInformationGetVolume,      STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_INFORMATION/GET/VOLUME successes",  "/HGCM/VBoxSharedFolders/FnInformationGetVolume");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatInformationGetVolumeFail,  STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_INFORMATION/GET/VOLUME failures",   "/HGCM/VBoxSharedFolders/FnInformationGetVolumeFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatRemove,                    STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_REMOVE successes",                  "/HGCM/VBoxSharedFolders/FnRemove");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatRemoveFail,                STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_REMOVE failures",                   "/HGCM/VBoxSharedFolders/FnRemoveFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatRename,                    STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_RENAME successes",                  "/HGCM/VBoxSharedFolders/FnRename");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatRenameFail,                STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_RENAME failures",                   "/HGCM/VBoxSharedFolders/FnRenameFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatFlush,                     STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_FLUSH successes",                   "/HGCM/VBoxSharedFolders/FnFlush");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatFlushFail,                 STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_FLUSH failures",                    "/HGCM/VBoxSharedFolders/FnFlushFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatSetUtf8,                   STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_SET_UTF8",                          "/HGCM/VBoxSharedFolders/FnSetUtf8");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatSymlink,                   STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_SYMLINK successes",                 "/HGCM/VBoxSharedFolders/FnSymlink");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatSymlinkFail,               STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_SYMLINK failures",                  "/HGCM/VBoxSharedFolders/FnSymlinkFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatSetSymlinks,               STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_SET_SYMLINKS",                      "/HGCM/VBoxSharedFolders/FnSetSymlink");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatQueryMapInfo,              STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_QUERY_MAP_INFO",                    "/HGCM/VBoxSharedFolders/FnQueryMapInfo");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatWaitForMappingsChanges,    STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_WAIT_FOR_MAPPINGS_CHANGES successes", "/HGCM/VBoxSharedFolders/FnWaitForMappingsChanges");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatWaitForMappingsChangesFail,STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_WAIT_FOR_MAPPINGS_CHANGES failures","/HGCM/VBoxSharedFolders/FnWaitForMappingsChangesFail");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatCancelMappingsChangesWait, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_CANCEL_MAPPINGS_CHANGES_WAITS",     "/HGCM/VBoxSharedFolders/FnCancelMappingsChangesWaits");
+             HGCMSvcHlpStamRegister(g_pHelpers, &g_StatUnknown,                   STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "SHFL_FN_???",                               "/HGCM/VBoxSharedFolders/FnUnknown");
+        }
     }
 
Index: trunk/src/VBox/HostServices/SharedFolders/shfl.h
===================================================================
--- trunk/src/VBox/HostServices/SharedFolders/shfl.h	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedFolders/shfl.h	(revision 75498)
@@ -21,5 +21,4 @@
 #include <VBox/hgcmsvc.h>
 
-#define LOG_GROUP LOG_GROUP_SHARED_FOLDERS
 #include <VBox/log.h>
 
Index: trunk/src/VBox/HostServices/SharedFolders/shflhandle.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedFolders/shflhandle.cpp	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedFolders/shflhandle.cpp	(revision 75498)
@@ -1,6 +1,5 @@
+/* $Id$ */
 /** @file
- *
- * Shared Folders:
- * Handles helper functions.
+ * Shared Folders Service - Handles helper functions.
  */
 
@@ -17,4 +16,9 @@
  */
 
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define LOG_GROUP LOG_GROUP_SHARED_FOLDERS
 #include "shflhandle.h"
 #include <iprt/alloc.h>
@@ -23,8 +27,10 @@
 
 
-/*
+/*********************************************************************************************************************************
+*   Structures and Typedefs                                                                                                      *
+*********************************************************************************************************************************/
+/**
  * Very basic and primitive handle management. Should be sufficient for our needs.
  * Handle allocation can be rather slow, but at least lookup is fast.
- *
  */
 typedef struct
@@ -35,7 +41,12 @@
 } SHFLINTHANDLE, *PSHFLINTHANDLE;
 
+
+/*********************************************************************************************************************************
+*   Global Variables                                                                                                             *
+*********************************************************************************************************************************/
 static SHFLINTHANDLE *g_pHandles = NULL;
 static int32_t        gLastHandleIndex = 0;
 static RTCRITSECT     gLock;
+
 
 int vbsfInitHandleTable()
@@ -213,2 +224,3 @@
         AssertFailed();
 }
+
Index: trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp	(revision 75498)
@@ -16,4 +16,8 @@
  */
 
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define LOG_GROUP LOG_GROUP_SHARED_FOLDERS
 #ifdef UNITTEST
 # include "testcase/tstSharedFolderService.h"
@@ -44,5 +48,10 @@
 #endif
 
+
+/*********************************************************************************************************************************
+*   Defined Constants And Macros                                                                                                 *
+*********************************************************************************************************************************/
 #define SHFL_RT_LINK(pClient) ((pClient)->fu32Flags & SHFL_CF_SYMLINKS ? RTPATH_F_ON_LINK : RTPATH_F_FOLLOW_LINK)
+
 
 /**
Index: trunk/src/VBox/HostServices/SharedFolders/vbsfpath.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedFolders/vbsfpath.cpp	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedFolders/vbsfpath.cpp	(revision 75498)
@@ -1,5 +1,5 @@
 /* $Id$ */
 /** @file
- * Shared Folders - guest/host path convertion and verification.
+ * Shared Folders Service - guest/host path convertion and verification.
  */
 
@@ -16,4 +16,8 @@
  */
 
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define LOG_GROUP LOG_GROUP_SHARED_FOLDERS
 #ifdef UNITTEST
 # include "testcase/tstSharedFolderService.h"
@@ -44,5 +48,10 @@
 #endif
 
+
+/*********************************************************************************************************************************
+*   Defined Constants And Macros                                                                                                 *
+*********************************************************************************************************************************/
 #define SHFL_RT_LINK(pClient) ((pClient)->fu32Flags & SHFL_CF_SYMLINKS ? RTPATH_F_ON_LINK : RTPATH_F_FOLLOW_LINK)
+
 
 /**
@@ -689,2 +698,3 @@
     RTMemFree(pszHostPath);
 }
+
Index: trunk/src/VBox/HostServices/SharedFolders/vbsfpathabs.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedFolders/vbsfpathabs.cpp	(revision 75432)
+++ trunk/src/VBox/HostServices/SharedFolders/vbsfpathabs.cpp	(revision 75498)
@@ -1,5 +1,5 @@
 /* $Id$ */
 /** @file
- * Shared Folders - guest/host path convertion and verification.
+ * Shared Folders Service - guest/host path convertion and verification.
  */
 
@@ -16,6 +16,11 @@
  */
 
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define LOG_GROUP LOG_GROUP_SHARED_FOLDERS
 #include <iprt/path.h>
 #include <iprt/string.h>
+
 
 #if defined(RT_OS_WINDOWS)
