Index: /trunk/src/VBox/Runtime/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Runtime/Makefile.kmk	(revision 58281)
+++ /trunk/src/VBox/Runtime/Makefile.kmk	(revision 58282)
@@ -836,4 +836,5 @@
 	r3/posix/fs3-posix.cpp \
 	r3/posix/ldrNative-posix.cpp \
+	r3/posix/localipc-posix.cpp \
 	r3/posix/path-posix.cpp \
 	r3/posix/path2-posix.cpp \
Index: /trunk/src/VBox/Runtime/VBox/VBoxRTDeps.cpp
===================================================================
--- /trunk/src/VBox/Runtime/VBox/VBoxRTDeps.cpp	(revision 58281)
+++ /trunk/src/VBox/Runtime/VBox/VBoxRTDeps.cpp	(revision 58282)
@@ -34,4 +34,5 @@
 #include <iprt/asm.h>
 #include <iprt/assert.h>
+#include <iprt/localipc.h>
 #include <iprt/buildconfig.h>
 #include <iprt/system.h>
@@ -62,4 +63,5 @@
 #endif
     (PFNRT)xmlLoadCatalogs,
+    (PFNRT)RTLocalIpcServerCreate,
     (PFNRT)MD5_Init,
     (PFNRT)RC4,
Index: /trunk/src/VBox/Runtime/include/internal/socket.h
===================================================================
--- /trunk/src/VBox/Runtime/include/internal/socket.h	(revision 58281)
+++ /trunk/src/VBox/Runtime/include/internal/socket.h	(revision 58282)
@@ -52,18 +52,19 @@
 
 #ifndef IPRT_INTERNAL_SOCKET_POLLING_ONLY
-int rtSocketResolverError(void);
-int rtSocketCreateForNative(RTSOCKETINT **ppSocket, RTSOCKETNATIVE hNative);
-int rtSocketCreate(PRTSOCKET phSocket, int iDomain, int iType, int iProtocol);
-int rtSocketBind(RTSOCKET hSocket, PCRTNETADDR pAddr);
-int rtSocketBindRawAddr(RTSOCKET hSocket, void const *pvAddr, size_t cbAddr);
-int rtSocketListen(RTSOCKET hSocket, int cMaxPending);
-int rtSocketAccept(RTSOCKET hSocket, PRTSOCKET phClient, struct sockaddr *pAddr, size_t *pcbAddr);
-int rtSocketConnect(RTSOCKET hSocket, PCRTNETADDR pAddr, RTMSINTERVAL cMillies);
-int rtSocketSetOpt(RTSOCKET hSocket, int iLevel, int iOption, void const *pvValue, int cbValue);
+DECLHIDDEN(int) rtSocketResolverError(void);
+DECLHIDDEN(int) rtSocketCreateForNative(RTSOCKETINT **ppSocket, RTSOCKETNATIVE hNative);
+DECLHIDDEN(int) rtSocketCreate(PRTSOCKET phSocket, int iDomain, int iType, int iProtocol);
+DECLHIDDEN(int) rtSocketBind(RTSOCKET hSocket, PCRTNETADDR pAddr);
+DECLHIDDEN(int) rtSocketBindRawAddr(RTSOCKET hSocket, void const *pvAddr, size_t cbAddr);
+DECLHIDDEN(int) rtSocketListen(RTSOCKET hSocket, int cMaxPending);
+DECLHIDDEN(int) rtSocketAccept(RTSOCKET hSocket, PRTSOCKET phClient, struct sockaddr *pAddr, size_t *pcbAddr);
+DECLHIDDEN(int) rtSocketConnect(RTSOCKET hSocket, PCRTNETADDR pAddr, RTMSINTERVAL cMillies);
+DECLHIDDEN(int) rtSocketConnectRaw(RTSOCKET hSocket, void const *pvAddr, size_t cbAddr);
+DECLHIDDEN(int) rtSocketSetOpt(RTSOCKET hSocket, int iLevel, int iOption, void const *pvValue, int cbValue);
 #endif /* IPRT_INTERNAL_SOCKET_POLLING_ONLY */
 
-int         rtSocketPollGetHandle(RTSOCKET hSocket, uint32_t fEvents, PRTHCINTPTR phNative);
-uint32_t    rtSocketPollStart(RTSOCKET hSocket, RTPOLLSET hPollSet, uint32_t fEvents, bool fFinalEntry, bool fNoWait);
-uint32_t    rtSocketPollDone(RTSOCKET hSocket, uint32_t fEvents, bool fFinalEntry, bool fHarvestEvents);
+DECLHIDDEN(int)         rtSocketPollGetHandle(RTSOCKET hSocket, uint32_t fEvents, PRTHCINTPTR phNative);
+DECLHIDDEN(uint32_t)    rtSocketPollStart(RTSOCKET hSocket, RTPOLLSET hPollSet, uint32_t fEvents, bool fFinalEntry, bool fNoWait);
+DECLHIDDEN(uint32_t)    rtSocketPollDone(RTSOCKET hSocket, uint32_t fEvents, bool fFinalEntry, bool fHarvestEvents);
 
 RT_C_DECLS_END
Index: /trunk/src/VBox/Runtime/r3/posix/localipc-posix.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/posix/localipc-posix.cpp	(revision 58282)
+++ /trunk/src/VBox/Runtime/r3/posix/localipc-posix.cpp	(revision 58282)
@@ -0,0 +1,831 @@
+/* $Id$ */
+/** @file
+ * IPRT - Local IPC Server & Client, Posix.
+ */
+
+/*
+ * Copyright (C) 2006-2013 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include "internal/iprt.h"
+#include <iprt/localipc.h>
+
+#include <iprt/asm.h>
+#include <iprt/assert.h>
+#include <iprt/ctype.h>
+#include <iprt/critsect.h>
+#include <iprt/mem.h>
+#include <iprt/poll.h>
+#include <iprt/socket.h>
+#include <iprt/string.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "internal/magics.h"
+#include "internal/socket.h"
+
+
+/*******************************************************************************
+*   Structures and Typedefs                                                    *
+*******************************************************************************/
+/**
+ * Local IPC service instance, POSIX.
+ */
+typedef struct RTLOCALIPCSERVERINT
+{
+    /** The magic (RTLOCALIPCSERVER_MAGIC). */
+    uint32_t            u32Magic;
+    /** The creation flags. */
+    uint32_t            fFlags;
+    /** Critical section protecting the structure. */
+    RTCRITSECT          CritSect;
+    /** The number of references to the instance. */
+    uint32_t volatile   cRefs;
+    /** Indicates that there is a pending cancel request. */
+    bool volatile       fCancelled;
+    /** The server socket. */
+    RTSOCKET            hSocket;
+    /** Thread currently listening for clients. */
+    RTTHREAD            hListenThread;
+    /** The name we bound the server to (native charset encoding). */
+    struct sockaddr_un  Name;
+} RTLOCALIPCSERVERINT;
+/** Pointer to a local IPC server instance (POSIX). */
+typedef RTLOCALIPCSERVERINT *PRTLOCALIPCSERVERINT;
+
+
+/**
+ * Local IPC session instance, POSIX.
+ */
+typedef struct RTLOCALIPCSESSIONINT
+{
+    /** The magic (RTLOCALIPCSESSION_MAGIC). */
+    uint32_t            u32Magic;
+    /** Critical section protecting the structure. */
+    RTCRITSECT          CritSect;
+    /** The number of references to the instance. */
+    uint32_t volatile   cRefs;
+    /** Indicates that there is a pending cancel request. */
+    bool volatile       fCancelled;
+    /** Set if this is the server side, clear if the client. */
+    bool                fServerSide;
+    /** The client socket. */
+    RTSOCKET            hSocket;
+    /** Thread currently doing read related activites. */
+    RTTHREAD            hWriteThread;
+    /** Thread currently doing write related activies. */
+    RTTHREAD            hReadThread;
+} RTLOCALIPCSESSIONINT;
+/** Pointer to a local IPC session instance (Windows). */
+typedef RTLOCALIPCSESSIONINT *PRTLOCALIPCSESSIONINT;
+
+
+/** Local IPC name prefix. */
+#define RTLOCALIPC_POSIX_NAME_PREFIX    "/tmp/.iprt-localipc-"
+
+
+/**
+ * Validates the user specified name.
+ *
+ * @returns IPRT status code.
+ * @param   pszName             The name to validate.
+ * @param   pcchName            Where to return the length.
+ */
+static int rtLocalIpcPosixValidateName(const char *pszName, size_t *pcchName)
+{
+    AssertPtrReturn(pszName, VERR_INVALID_POINTER);
+
+    uint32_t cchName = 0;
+    for (;;)
+    {
+        char ch = pszName[cchName];
+        if (!ch)
+            break;
+        AssertReturn(!RT_C_IS_CNTRL(ch), VERR_INVALID_NAME);
+        AssertReturn((unsigned)ch < 0x80, VERR_INVALID_NAME);
+        AssertReturn(ch != '\\', VERR_INVALID_NAME);
+        AssertReturn(ch != '/', VERR_INVALID_NAME);
+        cchName++;
+    }
+
+    *pcchName = cchName;
+    AssertReturn(sizeof(RTLOCALIPC_POSIX_NAME_PREFIX) + cchName <= RT_SIZEOFMEMB(struct sockaddr_un, sun_path),
+                 VERR_FILENAME_TOO_LONG);
+    AssertReturn(cchName, VERR_INVALID_NAME);
+
+    return VINF_SUCCESS;
+}
+
+
+/**
+ * Constructs a local (unix) domain socket name.
+ *
+ * @returns IPRT status code.
+ * @param   pAddr               The address structure to construct the name in.
+ * @param   pcbAddr             Where to return the address size.
+ * @param   pszName             The user specified name (valid).
+ * @param   cchName             The user specified name length.
+ */
+static int rtLocalIpcPosixConstructName(struct sockaddr_un *pAddr, uint8_t *pcbAddr, const char *pszName, size_t cchName)
+{
+    AssertMsgReturn(cchName + sizeof(RTLOCALIPC_POSIX_NAME_PREFIX) <= sizeof(pAddr->sun_path),
+                    ("cchName=%zu sizeof(sun_path)=%zu\n", cchName, sizeof(pAddr->sun_path)),
+                    VERR_FILENAME_TOO_LONG);
+
+/** @todo Bother converting to local codeset/encoding??  */
+
+    RT_ZERO(*pAddr);
+#ifdef RT_OS_OS2 /* Size must be exactly right on OS/2. */
+    *pcbAddr = sizeof(*pAddr);
+#else
+    *pcbAddr = RT_OFFSETOF(struct sockaddr_un, sun_path) + (uint8_t)cchName + sizeof(RTLOCALIPC_POSIX_NAME_PREFIX);
+#endif
+#ifdef HAVE_SUN_LEN_MEMBER
+    pAddr->sun_len     = *pcbAddr;
+#endif
+    pAddr->sun_family  = AF_LOCAL;
+    memcpy(pAddr->sun_path, RTLOCALIPC_POSIX_NAME_PREFIX, sizeof(RTLOCALIPC_POSIX_NAME_PREFIX) - 1);
+    memcpy(&pAddr->sun_path[sizeof(RTLOCALIPC_POSIX_NAME_PREFIX) - 1], pszName, cchName + 1);
+
+    return VINF_SUCCESS;
+}
+
+
+
+RTDECL(int) RTLocalIpcServerCreate(PRTLOCALIPCSERVER phServer, const char *pszName, uint32_t fFlags)
+{
+    /*
+     * Parameter validation.
+     */
+    AssertPtrReturn(phServer, VERR_INVALID_POINTER);
+    *phServer = NIL_RTLOCALIPCSERVER;
+
+    AssertReturn(!(fFlags & ~RTLOCALIPC_FLAGS_VALID_MASK), VERR_INVALID_FLAGS);
+
+    size_t cchName;
+    int rc = rtLocalIpcPosixValidateName(pszName, &cchName);
+    if (RT_SUCCESS(rc))
+    {
+        /*
+         * Allocate memory for the instance and initialize it.
+         */
+        PRTLOCALIPCSERVERINT pThis = (PRTLOCALIPCSERVERINT)RTMemAllocZ(sizeof(*pThis));
+        if (pThis)
+        {
+            pThis->u32Magic      = RTLOCALIPCSERVER_MAGIC;
+            pThis->fFlags        = fFlags;
+            pThis->cRefs         = 1;
+            pThis->fCancelled    = false;
+            pThis->hListenThread = NIL_RTTHREAD;
+            rc = RTCritSectInit(&pThis->CritSect);
+            if (RT_SUCCESS(rc))
+            {
+                /*
+                 * Create the local (unix) socket and bind to it.
+                 */
+                rc = rtSocketCreate(&pThis->hSocket, AF_LOCAL, SOCK_STREAM, 0 /*iProtocol*/);
+                if (RT_SUCCESS(rc))
+                {
+                    RTSocketSetInheritance(pThis->hSocket, false /*fInheritable*/);
+
+                    uint8_t cbAddr;
+                    rc = rtLocalIpcPosixConstructName(&pThis->Name, &cbAddr, pszName, cchName);
+                    if (RT_SUCCESS(rc))
+                    {
+                        rc = rtSocketBindRawAddr(pThis->hSocket, &pThis->Name, cbAddr);
+                        if (rc == VERR_NET_ADDRESS_IN_USE)
+                        {
+                            unlink(pThis->Name.sun_path);
+                            rc = rtSocketBindRawAddr(pThis->hSocket, &pThis->Name, cbAddr);
+                        }
+                        if (RT_SUCCESS(rc))
+                        {
+                            *phServer = pThis;
+                            return VINF_SUCCESS;
+                        }
+                    }
+                    RTSocketRelease(pThis->hSocket);
+                }
+                RTCritSectDelete(&pThis->CritSect);
+            }
+            RTMemFree(pThis);
+        }
+        else
+            rc = VERR_NO_MEMORY;
+    }
+    return rc;
+}
+
+
+/**
+ * Retains a reference to the server instance.
+ *
+ * @returns
+ * @param   pThis               The server instance.
+ */
+DECLINLINE(void) rtLocalIpcServerRetain(PRTLOCALIPCSERVERINT pThis)
+{
+    uint32_t cRefs = ASMAtomicIncU32(&pThis->cRefs);
+    Assert(cRefs < UINT32_MAX / 2 && cRefs);
+}
+
+
+/**
+ * Server instance destructor.
+ * @param   pThis               The server instance.
+ */
+static void rtLocalIpcServerDtor(PRTLOCALIPCSERVERINT pThis)
+{
+    pThis->u32Magic = ~RTLOCALIPCSERVER_MAGIC;
+    RTSocketRelease(pThis->hSocket);
+    RTCritSectDelete(&pThis->CritSect);
+    unlink(pThis->Name.sun_path);
+    RTMemFree(pThis);
+}
+
+
+/**
+ * Releases a reference to the server instance.
+ *
+ * @param   pThis               The server instance.
+ */
+DECLINLINE(void) rtLocalIpcServerRelease(PRTLOCALIPCSERVERINT pThis)
+{
+    uint32_t cRefs = ASMAtomicDecU32(&pThis->cRefs);
+    Assert(cRefs < UINT32_MAX / 2);
+    if (!cRefs)
+        rtLocalIpcServerDtor(pThis);
+}
+
+
+/**
+ * The core of RTLocalIpcServerCancel, used by both the destroy and cancel APIs.
+ *
+ * @returns IPRT status code
+ * @param   pThis               The server instance.
+ */
+static int rtLocalIpcServerCancel(PRTLOCALIPCSERVERINT pThis)
+{
+    RTCritSectEnter(&pThis->CritSect);
+    pThis->fCancelled = true;
+    if (pThis->hListenThread != NIL_RTTHREAD)
+        RTThreadPoke(pThis->hListenThread);
+    RTCritSectLeave(&pThis->CritSect);
+    return VINF_SUCCESS;
+}
+
+
+
+RTDECL(int) RTLocalIpcServerDestroy(RTLOCALIPCSERVER hServer)
+{
+    /*
+     * Validate input.
+     */
+    if (hServer == NIL_RTLOCALIPCSERVER)
+        return VINF_SUCCESS;
+    PRTLOCALIPCSERVERINT pThis = (PRTLOCALIPCSERVERINT)hServer;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertReturn(pThis->u32Magic == RTLOCALIPCSERVER_MAGIC, VERR_INVALID_HANDLE);
+
+    /*
+     * Invalidate the server, releasing the caller's reference to the instance
+     * data and making sure any other thread in the listen API will wake up.
+     */
+    AssertReturn(ASMAtomicCmpXchgU32(&pThis->u32Magic, ~RTLOCALIPCSERVER_MAGIC, RTLOCALIPCSERVER_MAGIC), VERR_WRONG_ORDER);
+
+    rtLocalIpcServerCancel(pThis);
+    rtLocalIpcServerRelease(pThis);
+
+    return VINF_SUCCESS;
+}
+
+
+RTDECL(int) RTLocalIpcServerCancel(RTLOCALIPCSERVER hServer)
+{
+    /*
+     * Validate input.
+     */
+    PRTLOCALIPCSERVERINT pThis = (PRTLOCALIPCSERVERINT)hServer;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertReturn(pThis->u32Magic == RTLOCALIPCSERVER_MAGIC, VERR_INVALID_HANDLE);
+
+    /*
+     * Do the job.
+     */
+    rtLocalIpcServerRetain(pThis);
+    rtLocalIpcServerCancel(pThis);
+    rtLocalIpcServerRelease(pThis);
+    return VINF_SUCCESS;
+}
+
+
+RTDECL(int) RTLocalIpcServerListen(RTLOCALIPCSERVER hServer, PRTLOCALIPCSESSION phClientSession)
+{
+    /*
+     * Validate input.
+     */
+    PRTLOCALIPCSERVERINT pThis = (PRTLOCALIPCSERVERINT)hServer;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertReturn(pThis->u32Magic == RTLOCALIPCSERVER_MAGIC, VERR_INVALID_HANDLE);
+
+    /*
+     * Begin listening.
+     */
+    rtLocalIpcServerRetain(pThis);
+    int rc = RTCritSectEnter(&pThis->CritSect);
+    if (RT_SUCCESS(rc))
+    {
+        if (pThis->hListenThread == NIL_RTTHREAD)
+        {
+            pThis->hListenThread = RTThreadSelf();
+
+            /*
+             * The listening retry loop.
+             */
+            for (;;)
+            {
+                if (pThis->fCancelled)
+                {
+                    rc = VERR_CANCELLED;
+                    break;
+                }
+
+                rc = RTCritSectLeave(&pThis->CritSect);
+                AssertRCBreak(rc);
+
+                rc = rtSocketListen(pThis->hSocket, pThis->fFlags & RTLOCALIPC_FLAGS_MULTI_SESSION ? 10 : 0);
+                if (RT_SUCCESS(rc))
+                {
+                    struct sockaddr_un  Addr;
+                    size_t              cbAddr = sizeof(Addr);
+                    RTSOCKET            hClient;
+                    rc = rtSocketAccept(pThis->hSocket, &hClient, (struct sockaddr *)&Addr, &cbAddr);
+
+                    int rc2 = RTCritSectEnter(&pThis->CritSect);
+                    AssertRCBreakStmt(rc2, rc = RT_SUCCESS(rc) ? rc2 : rc);
+
+                    if (RT_SUCCESS(rc))
+                    {
+                        /*
+                         * Create a client session.
+                         */
+                        PRTLOCALIPCSESSIONINT pSession = (PRTLOCALIPCSESSIONINT)RTMemAllocZ(sizeof(*pSession));
+                        if (pSession)
+                        {
+                            pSession->u32Magic      = RTLOCALIPCSESSION_MAGIC;
+                            pSession->cRefs         = 1;
+                            pSession->fCancelled    = false;
+                            pSession->fServerSide   = true;
+                            pSession->hSocket       = hClient;
+                            pSession->hReadThread   = NIL_RTTHREAD;
+                            pSession->hWriteThread  = NIL_RTTHREAD;
+                            rc = RTCritSectInit(&pSession->CritSect);
+                            if (RT_SUCCESS(rc))
+                                *phClientSession = pSession;
+                            else
+                                RTMemFree(pSession);
+                        }
+                        else
+                            rc = VERR_NO_MEMORY;
+                    }
+                    else if (   rc != VERR_INTERRUPTED
+                             && rc != VERR_TRY_AGAIN)
+                        break;
+                }
+                else
+                {
+                    int rc2 = RTCritSectEnter(&pThis->CritSect);
+                    AssertRCBreakStmt(rc2, rc = RT_SUCCESS(rc) ? rc2 : rc);
+                    if (   rc != VERR_INTERRUPTED
+                        && rc != VERR_TRY_AGAIN)
+                        break;
+                }
+            }
+
+            pThis->hListenThread = NIL_RTTHREAD;
+        }
+        else
+        {
+            AssertFailed();
+            rc = VERR_RESOURCE_BUSY;
+        }
+        int rc2 = RTCritSectLeave(&pThis->CritSect);
+        AssertStmt(RT_SUCCESS(rc2), rc = RT_SUCCESS(rc) ? rc2 : rc);
+    }
+    rtLocalIpcServerRelease(pThis);
+
+    return rc;
+}
+
+
+RTDECL(int) RTLocalIpcSessionConnect(PRTLOCALIPCSESSION phSession, const char *pszName, uint32_t fFlags)
+{
+    /*
+     * Parameter validation.
+     */
+    AssertPtrReturn(phSession, VERR_INVALID_POINTER);
+    *phSession = NIL_RTLOCALIPCSESSION;
+
+    AssertReturn(!fFlags, VERR_INVALID_FLAGS);
+
+    size_t cchName;
+    int rc = rtLocalIpcPosixValidateName(pszName, &cchName);
+    if (RT_SUCCESS(rc))
+    {
+        /*
+         * Allocate memory for the instance and initialize it.
+         */
+        PRTLOCALIPCSESSIONINT pThis = (PRTLOCALIPCSESSIONINT)RTMemAllocZ(sizeof(*pThis));
+        if (pThis)
+        {
+            pThis->u32Magic         = RTLOCALIPCSESSION_MAGIC;
+            pThis->cRefs            = 1;
+            pThis->fCancelled       = false;
+            pThis->fServerSide      = false;
+            pThis->hSocket          = NIL_RTSOCKET;
+            pThis->hReadThread      = NIL_RTTHREAD;
+            pThis->hWriteThread     = NIL_RTTHREAD;
+            rc = RTCritSectInit(&pThis->CritSect);
+            if (RT_SUCCESS(rc))
+            {
+                /*
+                 * Create the local (unix) socket and try connect to the server.
+                 */
+                rc = rtSocketCreate(&pThis->hSocket, AF_LOCAL, SOCK_STREAM, 0 /*iProtocol*/);
+                if (RT_SUCCESS(rc))
+                {
+                    RTSocketSetInheritance(pThis->hSocket, false /*fInheritable*/);
+
+                    struct sockaddr_un  Addr;
+                    uint8_t             cbAddr;
+                    rc = rtLocalIpcPosixConstructName(&Addr, &cbAddr, pszName, cchName);
+                    if (RT_SUCCESS(rc))
+                    {
+                        rc = rtSocketConnectRaw(pThis->hSocket, &Addr, cbAddr);
+                        if (RT_SUCCESS(rc))
+                        {
+                            *phSession = pThis;
+                            return VINF_SUCCESS;
+                        }
+                    }
+                    RTCritSectDelete(&pThis->CritSect);
+                }
+            }
+            RTMemFree(pThis);
+        }
+        else
+            rc = VERR_NO_MEMORY;
+    }
+    return rc;
+}
+
+
+/**
+ * Retains a reference to the session instance.
+ *
+ * @param   pThis               The server instance.
+ */
+DECLINLINE(void) rtLocalIpcSessionRetain(PRTLOCALIPCSESSIONINT pThis)
+{
+    uint32_t cRefs = ASMAtomicIncU32(&pThis->cRefs);
+    Assert(cRefs < UINT32_MAX / 2 && cRefs);
+}
+
+
+/**
+ * Session instance destructor.
+ * @param   pThis               The server instance.
+ */
+static void rtLocalIpcSessionDtor(PRTLOCALIPCSESSIONINT pThis)
+{
+    pThis->u32Magic = ~RTLOCALIPCSESSION_MAGIC;
+    if (RTSocketRelease(pThis->hSocket) == 0)
+        pThis->hSocket = NIL_RTSOCKET;
+    RTCritSectDelete(&pThis->CritSect);
+    RTMemFree(pThis);
+}
+
+
+/**
+ * Releases a reference to the session instance.
+ *
+ * @param   pThis               The session instance.
+ */
+DECLINLINE(void) rtLocalIpcSessionRelease(PRTLOCALIPCSESSIONINT pThis)
+{
+    uint32_t cRefs = ASMAtomicDecU32(&pThis->cRefs);
+    Assert(cRefs < UINT32_MAX / 2);
+    if (!cRefs)
+        rtLocalIpcSessionDtor(pThis);
+}
+
+
+/**
+ * The core of RTLocalIpcSessionCancel, used by both the destroy and cancel APIs.
+ *
+ * @returns IPRT status code
+ * @param   pThis               The session instance.
+ */
+static int rtLocalIpcSessionCancel(PRTLOCALIPCSESSIONINT pThis)
+{
+    RTCritSectEnter(&pThis->CritSect);
+    pThis->fCancelled = true;
+    if (pThis->hReadThread != NIL_RTTHREAD)
+        RTThreadPoke(pThis->hReadThread);
+    if (pThis->hWriteThread != NIL_RTTHREAD)
+        RTThreadPoke(pThis->hWriteThread);
+    RTCritSectLeave(&pThis->CritSect);
+    return VINF_SUCCESS;
+}
+
+
+RTDECL(int) RTLocalIpcSessionClose(RTLOCALIPCSESSION hSession)
+{
+    /*
+     * Validate input.
+     */
+    if (hSession == NIL_RTLOCALIPCSESSION)
+        return VINF_SUCCESS;
+    PRTLOCALIPCSESSIONINT pThis = hSession;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertReturn(pThis->u32Magic == RTLOCALIPCSESSION_MAGIC, VERR_INVALID_HANDLE);
+
+    /*
+     * Invalidate the session, releasing the caller's reference to the instance
+     * data and making sure any other thread in the listen API will wake up.
+     */
+    AssertReturn(ASMAtomicCmpXchgU32(&pThis->u32Magic, ~RTLOCALIPCSESSION_MAGIC, RTLOCALIPCSESSION_MAGIC), VERR_WRONG_ORDER);
+
+    rtLocalIpcSessionCancel(pThis);
+    rtLocalIpcSessionRelease(pThis);
+
+    return VINF_SUCCESS;
+}
+
+
+RTDECL(int) RTLocalIpcSessionCancel(RTLOCALIPCSESSION hSession)
+{
+    /*
+     * Validate input.
+     */
+    PRTLOCALIPCSESSIONINT pThis = hSession;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertReturn(pThis->u32Magic == RTLOCALIPCSESSION_MAGIC, VERR_INVALID_HANDLE);
+
+    /*
+     * Do the job.
+     */
+    rtLocalIpcSessionRetain(pThis);
+    rtLocalIpcSessionCancel(pThis);
+    rtLocalIpcSessionRelease(pThis);
+    return VINF_SUCCESS;
+}
+
+
+RTDECL(int) RTLocalIpcSessionRead(RTLOCALIPCSESSION hSession, void *pvBuffer, size_t cbBuffer, size_t *pcbRead)
+{
+    /*
+     * Validate input.
+     */
+    PRTLOCALIPCSESSIONINT pThis = hSession;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertReturn(pThis->u32Magic == RTLOCALIPCSESSION_MAGIC, VERR_INVALID_HANDLE);
+
+    /*
+     * Do the job.
+     */
+    rtLocalIpcSessionRetain(pThis);
+
+    int rc = RTCritSectEnter(&pThis->CritSect);
+    if (RT_SUCCESS(rc))
+    {
+        if (pThis->hReadThread == NIL_RTTHREAD)
+        {
+            pThis->hReadThread = RTThreadSelf();
+
+            for (;;)
+            {
+                if (!pThis->fCancelled)
+                {
+                    rc = RTCritSectLeave(&pThis->CritSect);
+                    AssertRCBreak(rc);
+
+                    rc = RTSocketRead(pThis->hSocket, pvBuffer, cbBuffer, pcbRead);
+
+                    int rc2 = RTCritSectEnter(&pThis->CritSect);
+                    AssertRCBreakStmt(rc2, rc = RT_SUCCESS(rc) ? rc2 : rc);
+
+                    if (   rc == VERR_INTERRUPTED
+                        || rc == VERR_TRY_AGAIN)
+                        continue;
+                }
+                else
+                    rc = VERR_CANCELLED;
+                break;
+            }
+
+            pThis->hReadThread = NIL_RTTHREAD;
+        }
+        int rc2 = RTCritSectLeave(&pThis->CritSect);
+        AssertStmt(RT_SUCCESS(rc2), rc = RT_SUCCESS(rc) ? rc2 : rc);
+    }
+
+    rtLocalIpcSessionRelease(pThis);
+    return rc;
+}
+
+
+RTDECL(int) RTLocalIpcSessionWrite(RTLOCALIPCSESSION hSession, const void *pvBuffer, size_t cbBuffer)
+{
+    /*
+     * Validate input.
+     */
+    PRTLOCALIPCSESSIONINT pThis = hSession;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertReturn(pThis->u32Magic == RTLOCALIPCSESSION_MAGIC, VERR_INVALID_HANDLE);
+
+    /*
+     * Do the job.
+     */
+    rtLocalIpcSessionRetain(pThis);
+
+    int rc = RTCritSectEnter(&pThis->CritSect);
+    if (RT_SUCCESS(rc))
+    {
+        if (pThis->hWriteThread == NIL_RTTHREAD)
+        {
+            pThis->hWriteThread = RTThreadSelf();
+
+            for (;;)
+            {
+                if (!pThis->fCancelled)
+                {
+                    rc = RTCritSectLeave(&pThis->CritSect);
+                    AssertRCBreak(rc);
+
+                    rc = RTSocketWrite(pThis->hSocket, pvBuffer, cbBuffer);
+
+                    int rc2 = RTCritSectEnter(&pThis->CritSect);
+                    AssertRCBreakStmt(rc2, rc = RT_SUCCESS(rc) ? rc2 : rc);
+
+                    if (   rc == VERR_INTERRUPTED
+                        || rc == VERR_TRY_AGAIN)
+                        continue;
+                }
+                else
+                    rc = VERR_CANCELLED;
+                break;
+            }
+
+            pThis->hWriteThread = NIL_RTTHREAD;
+        }
+        int rc2 = RTCritSectLeave(&pThis->CritSect);
+        AssertStmt(RT_SUCCESS(rc2), rc = RT_SUCCESS(rc) ? rc2 : rc);
+    }
+
+    rtLocalIpcSessionRelease(pThis);
+    return rc;
+}
+
+
+RTDECL(int) RTLocalIpcSessionFlush(RTLOCALIPCSESSION hSession)
+{
+    /*
+     * Validate input.
+     */
+    PRTLOCALIPCSESSIONINT pThis = hSession;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertReturn(pThis->u32Magic == RTLOCALIPCSESSION_MAGIC, VERR_INVALID_HANDLE);
+
+    /*
+     * This is a no-op because apparently write doesn't return until the
+     * result is read.  At least that's what the reply to a 2003-04-08 LKML
+     * posting title "fsync() on unix domain sockets?" indicates.
+     *
+     * For conformity, make sure there isn't any active writes concurrent to this call.
+     */
+    rtLocalIpcSessionRetain(pThis);
+
+    int rc = RTCritSectEnter(&pThis->CritSect);
+    if (RT_SUCCESS(rc))
+    {
+        if (pThis->hWriteThread == NIL_RTTHREAD)
+            rc = RTCritSectLeave(&pThis->CritSect);
+        else
+        {
+            rc = RTCritSectLeave(&pThis->CritSect);
+            if (RT_SUCCESS(rc))
+                rc = VERR_RESOURCE_BUSY;
+        }
+    }
+
+    rtLocalIpcSessionRelease(pThis);
+    return rc;
+}
+
+
+RTDECL(int) RTLocalIpcSessionWaitForData(RTLOCALIPCSESSION hSession, uint32_t cMillies)
+{
+    /*
+     * Validate input.
+     */
+    PRTLOCALIPCSESSIONINT pThis = hSession;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertReturn(pThis->u32Magic == RTLOCALIPCSESSION_MAGIC, VERR_INVALID_HANDLE);
+
+    /*
+     * Do the job.
+     */
+    rtLocalIpcSessionRetain(pThis);
+
+    int rc = RTCritSectEnter(&pThis->CritSect);
+    if (RT_SUCCESS(rc))
+    {
+        if (pThis->hReadThread == NIL_RTTHREAD)
+        {
+            pThis->hReadThread = RTThreadSelf();
+
+            for (;;)
+            {
+                if (!pThis->fCancelled)
+                {
+                    rc = RTCritSectLeave(&pThis->CritSect);
+                    AssertRCBreak(rc);
+
+                    uint32_t fEvents = 0;
+                    rc = RTSocketSelectOneEx(pThis->hSocket, RTPOLL_EVT_READ | RTPOLL_EVT_ERROR, &fEvents, cMillies);
+
+                    int rc2 = RTCritSectEnter(&pThis->CritSect);
+                    AssertRCBreakStmt(rc2, rc = RT_SUCCESS(rc) ? rc2 : rc);
+
+                    if (RT_SUCCESS(rc))
+                    {
+                        if (pThis->fCancelled)
+                            rc = VERR_CANCELLED;
+                        else if (fEvents & RTPOLL_EVT_ERROR)
+                            rc = VERR_BROKEN_PIPE;
+                    }
+                    else if (   rc == VERR_INTERRUPTED
+                             || rc == VERR_TRY_AGAIN)
+                        continue;
+                }
+                else
+                    rc = VERR_CANCELLED;
+                break;
+            }
+
+            pThis->hReadThread = NIL_RTTHREAD;
+        }
+        int rc2 = RTCritSectLeave(&pThis->CritSect);
+        AssertStmt(RT_SUCCESS(rc2), rc = RT_SUCCESS(rc) ? rc2 : rc);
+    }
+
+    rtLocalIpcSessionRelease(pThis);
+    return rc;
+}
+
+
+RTDECL(int) RTLocalIpcSessionQueryProcess(RTLOCALIPCSESSION hSession, PRTPROCESS pProcess)
+{
+    return VERR_NOT_SUPPORTED;
+}
+
+
+RTDECL(int) RTLocalIpcSessionQueryUserId(RTLOCALIPCSESSION hSession, PRTUID pUid)
+{
+    return VERR_NOT_SUPPORTED;
+}
+
+
+RTDECL(int) RTLocalIpcSessionQueryGroupId(RTLOCALIPCSESSION hSession, PRTGID pGid)
+{
+    return VERR_NOT_SUPPORTED;
+}
+
+
+
Index: /trunk/src/VBox/Runtime/r3/socket.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/socket.cpp	(revision 58281)
+++ /trunk/src/VBox/Runtime/r3/socket.cpp	(revision 58282)
@@ -212,5 +212,5 @@
  * @returns iprt status code.
  */
-int rtSocketResolverError(void)
+DECLHIDDEN(int) rtSocketResolverError(void)
 {
 #ifdef RT_OS_WINDOWS
@@ -400,5 +400,5 @@
  * @param   hNative         The native handle.
  */
-int rtSocketCreateForNative(RTSOCKETINT **ppSocket, RTSOCKETNATIVE hNative)
+DECLHIDDEN(int) rtSocketCreateForNative(RTSOCKETINT **ppSocket, RTSOCKETNATIVE hNative)
 {
     RTSOCKETINT *pThis = (RTSOCKETINT *)RTMemPoolAlloc(RTMEMPOOL_DEFAULT, sizeof(*pThis));
@@ -444,5 +444,5 @@
  * @param   iProtocol           Socket parameter, usually 0.
  */
-int rtSocketCreate(PRTSOCKET phSocket, int iDomain, int iType, int iProtocol)
+DECLHIDDEN(int) rtSocketCreate(PRTSOCKET phSocket, int iDomain, int iType, int iProtocol)
 {
     /*
@@ -1425,6 +1425,5 @@
 
 
-RTDECL(int) RTSocketSelectOneEx(RTSOCKET hSocket, uint32_t fEvents, uint32_t *pfEvents,
-                                RTMSINTERVAL cMillies)
+RTDECL(int) RTSocketSelectOneEx(RTSOCKET hSocket, uint32_t fEvents, uint32_t *pfEvents, RTMSINTERVAL cMillies)
 {
     /*
@@ -1587,5 +1586,5 @@
  * @param   pAddr               The address to bind to.
  */
-int rtSocketBind(RTSOCKET hSocket, PCRTNETADDR pAddr)
+DECLHIDDEN(int) rtSocketBind(RTSOCKET hSocket, PCRTNETADDR pAddr)
 {
     RTSOCKADDRUNION u;
@@ -1607,5 +1606,5 @@
  * @param   cbAddr              The size of the address.
  */
-int rtSocketBindRawAddr(RTSOCKET hSocket, void const *pvAddr, size_t cbAddr)
+DECLHIDDEN(int) rtSocketBindRawAddr(RTSOCKET hSocket, void const *pvAddr, size_t cbAddr)
 {
     /*
@@ -1637,5 +1636,5 @@
  * @param   cMaxPending         The max number of pending connections.
  */
-int rtSocketListen(RTSOCKET hSocket, int cMaxPending)
+DECLHIDDEN(int) rtSocketListen(RTSOCKET hSocket, int cMaxPending)
 {
     /*
@@ -1668,5 +1667,5 @@
  *                              size of what's stored at @a pAddr.
  */
-int rtSocketAccept(RTSOCKET hSocket, PRTSOCKET phClient, struct sockaddr *pAddr, size_t *pcbAddr)
+DECLHIDDEN(int) rtSocketAccept(RTSOCKET hSocket, PRTSOCKET phClient, struct sockaddr *pAddr, size_t *pcbAddr)
 {
     /*
@@ -1727,5 +1726,5 @@
  *                              configured on the running system.
  */
-int rtSocketConnect(RTSOCKET hSocket, PCRTNETADDR pAddr, RTMSINTERVAL cMillies)
+DECLHIDDEN(int) rtSocketConnect(RTSOCKET hSocket, PCRTNETADDR pAddr, RTMSINTERVAL cMillies)
 {
     /*
@@ -1817,4 +1816,33 @@
 
 /**
+ * Wrapper around connect, raw address, no timeout.
+ *
+ * @returns IPRT status code.
+ * @param   hSocket             The socket handle.
+ * @param   pvAddr              The raw socket address to connect to.
+ * @param   cbAddr              The size of the raw address.
+ */
+DECLHIDDEN(int) rtSocketConnectRaw(RTSOCKET hSocket, void const *pvAddr, size_t cbAddr)
+{
+    /*
+     * Validate input.
+     */
+    RTSOCKETINT *pThis = hSocket;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertReturn(pThis->u32Magic == RTSOCKET_MAGIC, VERR_INVALID_HANDLE);
+    AssertReturn(rtSocketTryLock(pThis), VERR_CONCURRENT_ACCESS);
+
+    int rc;
+    if (connect(pThis->hNative, (const struct sockaddr *)pvAddr, (int)cbAddr) == 0)
+        rc = VINF_SUCCESS;
+    else
+        rc = rtSocketError();
+
+    rtSocketUnlock(pThis);
+    return rc;
+}
+
+
+/**
  * Wrapper around setsockopt.
  *
@@ -1826,5 +1854,5 @@
  * @param   cbValue             The size of the value pointed to by pvValue.
  */
-int rtSocketSetOpt(RTSOCKET hSocket, int iLevel, int iOption, void const *pvValue, int cbValue)
+DECLHIDDEN(int) rtSocketSetOpt(RTSOCKET hSocket, int iLevel, int iOption, void const *pvValue, int cbValue)
 {
     /*
@@ -1854,5 +1882,5 @@
  * @param   phNative            Where to put the primary handle.
  */
-int rtSocketPollGetHandle(RTSOCKET hSocket, uint32_t fEvents, PRTHCINTPTR phNative)
+DECLHIDDEN(int) rtSocketPollGetHandle(RTSOCKET hSocket, uint32_t fEvents, PRTHCINTPTR phNative)
 {
     RTSOCKETINT *pThis = hSocket;
@@ -2053,5 +2081,5 @@
  *          @c true, we don't currently care about that oddity...
  */
-uint32_t rtSocketPollStart(RTSOCKET hSocket, RTPOLLSET hPollSet, uint32_t fEvents, bool fFinalEntry, bool fNoWait)
+DECLHIDDEN(uint32_t) rtSocketPollStart(RTSOCKET hSocket, RTPOLLSET hPollSet, uint32_t fEvents, bool fFinalEntry, bool fNoWait)
 {
     RTSOCKETINT *pThis = hSocket;
@@ -2125,5 +2153,5 @@
  * @param   fHarvestEvents      Set if we should check for pending events.
  */
-uint32_t rtSocketPollDone(RTSOCKET hSocket, uint32_t fEvents, bool fFinalEntry, bool fHarvestEvents)
+DECLHIDDEN(uint32_t) rtSocketPollDone(RTSOCKET hSocket, uint32_t fEvents, bool fFinalEntry, bool fHarvestEvents)
 {
     RTSOCKETINT *pThis = hSocket;
Index: /trunk/src/VBox/Runtime/r3/win/localipc-win.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/win/localipc-win.cpp	(revision 58281)
+++ /trunk/src/VBox/Runtime/r3/win/localipc-win.cpp	(revision 58282)
@@ -343,8 +343,10 @@
      */
     AssertPtrReturn(phServer, VERR_INVALID_POINTER);
+
+    AssertReturn(!(fFlags & ~RTLOCALIPC_FLAGS_VALID_MASK), VERR_INVALID_FLAGS);
+    AssertReturn(fFlags & RTLOCALIPC_FLAGS_MULTI_SESSION, VERR_INVALID_FLAGS); /** @todo Implement !RTLOCALIPC_FLAGS_MULTI_SESSION */
+
     AssertPtrReturn(pszName, VERR_INVALID_POINTER);
-    AssertReturn(*pszName, VERR_INVALID_PARAMETER);
-    AssertReturn(!(fFlags & ~(RTLOCALIPC_FLAGS_VALID_MASK)), VERR_INVALID_PARAMETER);
-    AssertReturn((fFlags & RTLOCALIPC_FLAGS_MULTI_SESSION), VERR_INVALID_PARAMETER); /** @todo Implement !RTLOCALIPC_FLAGS_MULTI_SESSION */
+    AssertReturn(*pszName, VERR_INVALID_NAME);
 
     /*
@@ -650,6 +652,6 @@
     AssertPtrReturn(phSession, VERR_INVALID_POINTER);
     AssertPtrReturn(pszName, VERR_INVALID_POINTER);
-    AssertReturn(*pszName, VERR_INVALID_PARAMETER);
-    AssertReturn(!fFlags, VERR_INVALID_PARAMETER); /* Flags currently unused, must be 0. */
+    AssertReturn(*pszName, VERR_INVALID_NAME);
+    AssertReturn(!fFlags, VERR_INVALID_FLAGS); /* Flags currently unused, must be 0. */
 
     PRTLOCALIPCSESSIONINT pThis = (PRTLOCALIPCSESSIONINT)RTMemAlloc(sizeof(*pThis));
Index: /trunk/src/VBox/Runtime/testcase/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Runtime/testcase/Makefile.kmk	(revision 58281)
+++ /trunk/src/VBox/Runtime/testcase/Makefile.kmk	(revision 58282)
@@ -81,4 +81,5 @@
 	tstLdr \
 	tstLdrLoad \
+	tstRTLocalIpc \
 	tstRTLdrVerifyPeImage \
 	tstRTList \
@@ -148,5 +149,4 @@
 PROGRAMS.win += \
 	tstRTCritSectW32 \
-	tstRTLocalIpc \
 	tstRTProcWait \
 	tstFileAppendWin-1 \
Index: /trunk/src/VBox/Runtime/testcase/tstRTLocalIpc.cpp
===================================================================
--- /trunk/src/VBox/Runtime/testcase/tstRTLocalIpc.cpp	(revision 58281)
+++ /trunk/src/VBox/Runtime/testcase/tstRTLocalIpc.cpp	(revision 58282)
@@ -60,10 +60,10 @@
 static DECLCALLBACK(int) testServerListenAndCancelThread(RTTHREAD hSelf, void *pvUser)
 {
-    PRTLOCALIPCSERVER pServer = (PRTLOCALIPCSERVER)pvUser;
-    AssertPtr(pServer);
+    PRTLOCALIPCSERVER phServer = (PRTLOCALIPCSERVER)pvUser;
+    AssertPtr(phServer);
 
     RTThreadSleep(5000); /* Wait a bit to simulate waiting in main thread. */
 
-    int rc = RTLocalIpcServerCancel(*pServer);
+    int rc = RTLocalIpcServerCancel(*phServer);
     AssertRC(rc);
 
@@ -75,6 +75,6 @@
     RTTestSub(hTest, "testServerListenAndCancel");
 
-    RTLOCALIPCSERVER ipcServer;
-    int rc = RTLocalIpcServerCreate(&ipcServer, "testServerListenAndCancel",
+    RTLOCALIPCSERVER hIpcServer;
+    int rc = RTLocalIpcServerCreate(&hIpcServer, "testServerListenAndCancel",
                                     RTLOCALIPC_FLAGS_MULTI_SESSION);
     if (RT_SUCCESS(rc))
@@ -84,5 +84,5 @@
         RTTHREAD hThread;
         rc = RTThreadCreate(&hThread, testServerListenAndCancelThread,
-                            &ipcServer, 0 /* Stack */, RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "tstIpc1");
+                            &hIpcServer, 0 /* Stack */, RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "tstIpc1");
         if (RT_SUCCESS(rc))
         {
@@ -90,12 +90,11 @@
             {
                 RTTestPrintf(hTest, RTTESTLVL_INFO, "Listening for incoming connections ...\n");
-                RTLOCALIPCSESSION ipcSession;
-                RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcServerListen(ipcServer, &ipcSession), VERR_CANCELLED);
-                RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcServerCancel(ipcServer), VINF_SUCCESS);
-                RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcServerDestroy(ipcServer), VINF_SUCCESS);
+                RTLOCALIPCSESSION hIpcSession;
+                RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcServerListen(hIpcServer, &hIpcSession), VERR_CANCELLED);
+                RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcServerCancel(hIpcServer), VINF_SUCCESS);
+                RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcServerDestroy(hIpcServer), VINF_SUCCESS);
 
                 RTTestPrintf(hTest, RTTESTLVL_INFO, "Waiting for thread to exit ...\n");
-                RTTEST_CHECK_RC(hTest, RTThreadWait(hThread,
-                                                    30 * 1000 /* 30s timeout */, NULL), VINF_SUCCESS);
+                RTTEST_CHECK_RC(hTest, RTThreadWait(hThread, 30 * 1000 /* 30s timeout */, NULL), VINF_SUCCESS);
             } while (0);
         }
@@ -109,5 +108,5 @@
 }
 
-static DECLCALLBACK(int) testSessionConnectionThread(RTTHREAD hSelf, void *pvUser)
+static DECLCALLBACK(int) testServerListenThread(RTTHREAD hSelf, void *pvUser)
 {
     PLOCALIPCTHREADCTX pCtx = (PLOCALIPCTHREADCTX)pvUser;
@@ -115,13 +114,14 @@
 
     int rc;
-    RTTestPrintf(pCtx->hTest, RTTESTLVL_INFO, "testSessionConnectionThread: Listening for incoming connections ...\n");
+    RTTestPrintf(pCtx->hTest, RTTESTLVL_INFO, "testServerListenThread: Listening for incoming connections ...\n");
     for (;;)
     {
-        RTLOCALIPCSESSION ipcSession;
-        rc = RTLocalIpcServerListen(pCtx->hServer, &ipcSession);
-        RTTestPrintf(pCtx->hTest, RTTESTLVL_DEBUG, "testSessionConnectionThread: Listening returned with rc=%Rrc\n", rc);
-        if (RT_SUCCESS(rc))
-        {
-            RTTestPrintf(pCtx->hTest, RTTESTLVL_INFO, "testSessionConnectionThread: Got new client connection\n");
+        RTLOCALIPCSESSION hIpcSession;
+        rc = RTLocalIpcServerListen(pCtx->hServer, &hIpcSession);
+        RTTestPrintf(pCtx->hTest, RTTESTLVL_DEBUG, "testServerListenThread: Listening returned with rc=%Rrc\n", rc);
+        if (RT_SUCCESS(rc))
+        {
+            RTTestPrintf(pCtx->hTest, RTTESTLVL_INFO, "testServerListenThread: Got new client connection\n");
+            RTTEST_CHECK_RC(pCtx->hTest, RTLocalIpcSessionClose(hIpcSession), VINF_SUCCESS);
         }
         else
@@ -129,5 +129,5 @@
     }
 
-    RTTestPrintf(pCtx->hTest, RTTESTLVL_INFO, "testSessionConnectionThread: Ended with rc=%Rrc\n", rc);
+    RTTestPrintf(pCtx->hTest, RTTESTLVL_INFO, "testServerListenThread: Ended with rc=%Rrc\n", rc);
     return rc;
 }
@@ -138,9 +138,9 @@
     {
         RTThreadSleep(2000); /* Fudge */
-        RTLOCALIPCSESSION clientSession;
-        RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcSessionConnect(&clientSession, "tstRTLocalIpcSessionConnection",
-                                                              0 /* Flags */), VINF_SUCCESS);
+        RTLOCALIPCSESSION hClientSession;
+        RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcSessionConnect(&hClientSession, "tstRTLocalIpcSessionConnection",0 /* Flags */),
+                              VINF_SUCCESS);
         RTThreadSleep(5000); /* Fudge */
-        RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcSessionClose(clientSession), VINF_SUCCESS);
+        RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcSessionClose(hClientSession), VINF_SUCCESS);
 
     } while (0);
@@ -153,16 +153,15 @@
     RTTestSub(hTest, "testSessionConnection");
 
-    RTLOCALIPCSERVER ipcServer;
-    int rc = RTLocalIpcServerCreate(&ipcServer, "tstRTLocalIpcSessionConnection",
-                                    RTLOCALIPC_FLAGS_MULTI_SESSION);
+    RTLOCALIPCSERVER hIpcServer;
+    int rc = RTLocalIpcServerCreate(&hIpcServer, "tstRTLocalIpcSessionConnection", RTLOCALIPC_FLAGS_MULTI_SESSION);
     if (RT_SUCCESS(rc))
     {
 #ifndef VBOX_TESTCASES_WITH_NO_THREADING
-        LOCALIPCTHREADCTX threadCtx = { ipcServer, hTest };
+        LOCALIPCTHREADCTX threadCtx = { hIpcServer, hTest };
 
         /* Spawn a simple worker thread and let it listen for incoming connections.
          * In the meanwhile we try to cancel the server and see what happens. */
         RTTHREAD hThread;
-        rc = RTThreadCreate(&hThread, testSessionConnectionThread,
+        rc = RTThreadCreate(&hThread, testServerListenThread,
                             &threadCtx, 0 /* Stack */, RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "tstIpc2");
         if (RT_SUCCESS(rc))
@@ -171,21 +170,23 @@
             {
                 RTPROCESS hProc;
-                const char *apszArgs[4] = { pszExecPath, "child", "tstRTLocalIpcSessionConnectionFork", NULL };
-                RTTEST_CHECK_RC_BREAK(hTest, RTProcCreate(pszExecPath, apszArgs,
-                                                          RTENV_DEFAULT, 0 /* fFlags*/, &hProc), VINF_SUCCESS);
+                const char *apszArgs[4] = { pszExecPath, "child", "testSessionConnectionChild", NULL };
+                RTTEST_CHECK_RC_BREAK(hTest, RTProcCreate(pszExecPath, apszArgs, RTENV_DEFAULT, 0 /* fFlags*/, &hProc),
+                                      VINF_SUCCESS);
                 RTPROCSTATUS stsChild;
                 RTTEST_CHECK_RC_BREAK(hTest, RTProcWait(hProc, RTPROCWAIT_FLAGS_BLOCK, &stsChild), VINF_SUCCESS);
                 RTTestPrintf(hTest, RTTESTLVL_INFO, "Child terminated, waiting for server thread ...\n");
-                RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcServerCancel(ipcServer), VINF_SUCCESS);
-                int threadRc;
-                RTTEST_CHECK_RC(hTest, RTThreadWait(hThread,
-                                                    30 * 1000 /* 30s timeout */, &threadRc), VINF_SUCCESS);
-                RTTEST_CHECK_RC_BREAK(hTest, threadRc,  VERR_CANCELLED);
+
+                RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcServerCancel(hIpcServer), VINF_SUCCESS);
+                int rcThread;
+                RTTEST_CHECK_RC(hTest, RTThreadWait(hThread, 30 * 1000 /* 30s timeout */, &rcThread), VINF_SUCCESS);
+                RTTEST_CHECK_RC_BREAK(hTest, rcThread,  VERR_CANCELLED);
                 RTTestPrintf(hTest, RTTESTLVL_INFO, "Server thread terminated successfully\n");
-                RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcServerDestroy(ipcServer), VINF_SUCCESS);
+
+                RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcServerDestroy(hIpcServer), VINF_SUCCESS);
+                hIpcServer = NIL_RTLOCALIPCSERVER;
+
                 RTTEST_CHECK_BREAK(hTest, stsChild.enmReason == RTPROCEXITREASON_NORMAL);
                 RTTEST_CHECK_BREAK(hTest, stsChild.iStatus == 0);
-            }
-            while (0);
+            } while (0);
         }
         else
@@ -195,12 +196,13 @@
         {
             RTPROCESS hProc;
-            const char *apszArgs[4] = { pszExecPath, "child", "tstRTLocalIpcSessionConnectionFork", NULL };
-            RTTEST_CHECK_RC_BREAK(hTest, RTProcCreate(pszExecPath, apszArgs,
-                                                      RTENV_DEFAULT, 0 /* fFlags*/, &hProc), VINF_SUCCESS);
-            RTLOCALIPCSESSION ipcSession;
-            rc = RTLocalIpcServerListen(ipcServer, &ipcSession);
+            const char *apszArgs[4] = { pszExecPath, "child", "testSessionConnectionChild", NULL };
+            RTTEST_CHECK_RC_BREAK(hTest, RTProcCreate(pszExecPath, apszArgs, RTENV_DEFAULT, 0 /* fFlags*/, &hProc), VINF_SUCCESS);
+
+            RTLOCALIPCSESSION hIpcSession;
+            rc = RTLocalIpcServerListen(hIpcServer, &hIpcSession);
             if (RT_SUCCESS(rc))
             {
-                RTTestPrintf(hTest, RTTESTLVL_INFO, "testSessionConnectionThread: Got new client connection\n");
+                RTTestPrintf(hTest, RTTESTLVL_INFO, "testServerListenThread: Got new client connection\n");
+                RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcSessionClose(hIpcSession), VINF_SUCCESS);
             }
             else
@@ -209,4 +211,6 @@
         } while (0);
 #endif
+        if (hIpcServer != NIL_RTLOCALIPCSERVER)
+            RTTEST_CHECK_RC(hTest, RTLocalIpcServerDestroy(hIpcServer), VINF_SUCCESS);
     }
     else
@@ -225,11 +229,11 @@
     {
         RTTestPrintf(pCtx->hTest, RTTESTLVL_INFO, "testSessionWaitThread: Listening for incoming connections ...\n");
-        RTLOCALIPCSESSION ipcSession;
-        rc = RTLocalIpcServerListen(pCtx->hServer, &ipcSession);
+        RTLOCALIPCSESSION hIpcSession;
+        rc = RTLocalIpcServerListen(pCtx->hServer, &hIpcSession);
         if (RT_SUCCESS(rc))
         {
             RTTestPrintf(pCtx->hTest, RTTESTLVL_INFO, "testSessionWaitThread: Got new client connection, waiting a bit ...\n");
             RTThreadSleep(2000);
-            rc = RTLocalIpcSessionClose(ipcSession);
+            rc = RTLocalIpcSessionClose(hIpcSession);
         }
         else
@@ -253,12 +257,12 @@
                                                               0 /* Flags */), VINF_SUCCESS);
         RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcSessionWaitForData(clientSession, 100       /* 100ms timeout */),
-                                                                  VERR_TIMEOUT);
+                              VERR_TIMEOUT);
         /* Next, try 60s timeout. Should be returning way earlier because the server closed the
          * connection after the first client connected. */
         RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcSessionWaitForData(clientSession, 60 * 1000),
-                                                                  VERR_BROKEN_PIPE);
+                              VERR_BROKEN_PIPE);
         /* Last try, also should fail because the server should be not around anymore. */
         RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcSessionWaitForData(clientSession, 5 * 1000),
-                                                                  VERR_BROKEN_PIPE);
+                              VERR_BROKEN_PIPE);
         RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcSessionClose(clientSession), VINF_SUCCESS);
 
@@ -272,10 +276,10 @@
     RTTestSub(hTest, "testSessionWait");
 
-    RTLOCALIPCSERVER ipcServer;
-    int rc = RTLocalIpcServerCreate(&ipcServer, "tstRTLocalIpcSessionWait",
+    RTLOCALIPCSERVER hIpcServer;
+    int rc = RTLocalIpcServerCreate(&hIpcServer, "tstRTLocalIpcSessionWait",
                                     RTLOCALIPC_FLAGS_MULTI_SESSION);
     if (RT_SUCCESS(rc))
     {
-        LOCALIPCTHREADCTX threadCtx = { ipcServer, hTest };
+        LOCALIPCTHREADCTX threadCtx = { hIpcServer, hTest };
 
         /* Spawn a simple worker thread and let it listen for incoming connections.
@@ -290,15 +294,14 @@
                 RTPROCESS hProc;
                 const char *apszArgs[4] = { pszExecPath, "child", "tstRTLocalIpcSessionWaitFork", NULL };
-                RTTEST_CHECK_RC_BREAK(hTest, RTProcCreate(pszExecPath, apszArgs,
-                                                          RTENV_DEFAULT, 0 /* fFlags*/, &hProc), VINF_SUCCESS);
+                RTTEST_CHECK_RC_BREAK(hTest, RTProcCreate(pszExecPath, apszArgs, RTENV_DEFAULT, 0 /* fFlags*/, &hProc),
+                                      VINF_SUCCESS);
                 RTThreadSleep(5000); /* Let the server run for some time ... */
                 RTTestPrintf(hTest, RTTESTLVL_INFO, "Cancelling server listening\n");
-                RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcServerCancel(ipcServer), VINF_SUCCESS);
+                RTTEST_CHECK_RC_BREAK(hTest, RTLocalIpcServerCancel(hIpcServer), VINF_SUCCESS);
                 /* Wait for the server thread to terminate. */
-                int threadRc;
-                RTTEST_CHECK_RC(hTest, RTThreadWait(hThread,
-                                                    30 * 1000 /* 30s timeout */, &threadRc), VINF_SUCCESS);
-                RTTEST_CHECK_RC_BREAK(hTest, threadRc, VERR_CANCELLED);
-                RTTEST_CHECK_RC(hTest, RTLocalIpcServerDestroy(ipcServer), VINF_SUCCESS);
+                int rcThread;
+                RTTEST_CHECK_RC(hTest, RTThreadWait(hThread, 30 * 1000 /* 30s timeout */, &rcThread), VINF_SUCCESS);
+                RTTEST_CHECK_RC_BREAK(hTest, rcThread, VERR_CANCELLED);
+                RTTEST_CHECK_RC(hTest, RTLocalIpcServerDestroy(hIpcServer), VINF_SUCCESS);
                 RTTestPrintf(hTest, RTTESTLVL_INFO, "Server thread terminated successfully\n");
                 /* Check if the child ran successfully. */
@@ -485,10 +488,10 @@
     RTTestSub(hTest, "testSessionData");
 
-    RTLOCALIPCSERVER ipcServer;
-    int rc = RTLocalIpcServerCreate(&ipcServer, "tstRTLocalIpcSessionData",
+    RTLOCALIPCSERVER hIpcServer;
+    int rc = RTLocalIpcServerCreate(&hIpcServer, "tstRTLocalIpcSessionData",
                                     RTLOCALIPC_FLAGS_MULTI_SESSION);
     if (RT_SUCCESS(rc))
     {
-        LOCALIPCTHREADCTX threadCtx = { ipcServer, hTest };
+        LOCALIPCTHREADCTX threadCtx = { hIpcServer, hTest };
 #if 0
         /* Run server + client in threads instead of fork'ed processes (useful for debugging). */
@@ -503,11 +506,11 @@
             do
             {
-                int threadRc;
+                int rcThread;
                 RTTEST_CHECK_RC(hTest, RTThreadWait(hThreadServer,
-                                                    5 * 60 * 1000 /* 5 minutes timeout */, &threadRc), VINF_SUCCESS);
-                RTTEST_CHECK_RC_BREAK(hTest, threadRc, VINF_SUCCESS);
+                                                    5 * 60 * 1000 /* 5 minutes timeout */, &rcThread), VINF_SUCCESS);
+                RTTEST_CHECK_RC_BREAK(hTest, rcThread, VINF_SUCCESS);
                 RTTEST_CHECK_RC(hTest, RTThreadWait(hThreadClient,
-                                                    5 * 60 * 1000 /* 5 minutes timeout */, &threadRc), VINF_SUCCESS);
-                RTTEST_CHECK_RC_BREAK(hTest, threadRc, VINF_SUCCESS);
+                                                    5 * 60 * 1000 /* 5 minutes timeout */, &rcThread), VINF_SUCCESS);
+                RTTEST_CHECK_RC_BREAK(hTest, rcThread, VINF_SUCCESS);
 
             } while (0);
@@ -528,9 +531,9 @@
                                                           RTENV_DEFAULT, 0 /* fFlags*/, &hProc), VINF_SUCCESS);
                 /* Wait for the server thread to terminate. */
-                int threadRc;
+                int rcThread;
                 RTTEST_CHECK_RC(hTest, RTThreadWait(hThread,
-                                                    5 * 60 * 1000 /* 5 minutes timeout */, &threadRc), VINF_SUCCESS);
-                RTTEST_CHECK_RC_BREAK(hTest, threadRc, VINF_SUCCESS);
-                RTTEST_CHECK_RC(hTest, RTLocalIpcServerDestroy(ipcServer), VINF_SUCCESS);
+                                                    5 * 60 * 1000 /* 5 minutes timeout */, &rcThread), VINF_SUCCESS);
+                RTTEST_CHECK_RC_BREAK(hTest, rcThread, VINF_SUCCESS);
+                RTTEST_CHECK_RC(hTest, RTLocalIpcServerDestroy(hIpcServer), VINF_SUCCESS);
                 RTTestPrintf(hTest, RTTESTLVL_INFO, "Server thread terminated successfully\n");
                 /* Check if the child ran successfully. */
@@ -569,5 +572,5 @@
 #endif
 
-    if (!RTStrICmp(argv[2], "tstRTLocalIpcSessionConnectionFork"))
+    if (!RTStrICmp(argv[2], "testSessionConnectionChild"))
         rcExit = testSessionConnectionChild(argc, argv, hTest);
     else if (!RTStrICmp(argv[2], "tstRTLocalIpcSessionWaitFork"))
@@ -579,36 +582,45 @@
 }
 
-static int testBasics(void)
+static void testBasics(void)
 {
     RTTestISub("Basics");
 
     /* Server-side. */
-    RTTESTI_CHECK_RC_RET(RTLocalIpcServerCreate(NULL, NULL, 0), VERR_INVALID_POINTER, 1);
-    RTLOCALIPCSERVER ipcServer;
-    RTTESTI_CHECK_RC_RET(RTLocalIpcServerCreate(&ipcServer, NULL, 0), VERR_INVALID_POINTER, 1);
-    RTTESTI_CHECK_RC_RET(RTLocalIpcServerCreate(&ipcServer, "", 0), VERR_INVALID_PARAMETER, 1);
-    RTTESTI_CHECK_RC_RET(RTLocalIpcServerCreate(&ipcServer, "BasicTest", 0 /* Invalid flags */), VERR_INVALID_PARAMETER, 1);
-    RTTESTI_CHECK_RC_RET(RTLocalIpcServerCreate(&ipcServer, "BasicTest", 1234 /* Invalid flags */), VERR_INVALID_PARAMETER, 1);
-    RTTESTI_CHECK_RC_RET(RTLocalIpcServerCancel(NULL), VERR_INVALID_HANDLE, 1);
-    RTTESTI_CHECK_RC_RET(RTLocalIpcServerDestroy(NULL), VINF_SUCCESS, 1);
+    RTTESTI_CHECK_RC(RTLocalIpcServerCreate(NULL, NULL, 0), VERR_INVALID_POINTER);
+    RTLOCALIPCSERVER hIpcServer;
+    int rc;
+    RTTESTI_CHECK_RC(rc = RTLocalIpcServerCreate(&hIpcServer, NULL, RTLOCALIPC_FLAGS_MULTI_SESSION), VERR_INVALID_POINTER);
+    if (RT_SUCCESS(rc)) RTLocalIpcServerDestroy(hIpcServer);
+    RTTESTI_CHECK_RC(rc = RTLocalIpcServerCreate(&hIpcServer, "", RTLOCALIPC_FLAGS_MULTI_SESSION), VERR_INVALID_NAME);
+    if (RT_SUCCESS(rc)) RTLocalIpcServerDestroy(hIpcServer);
+    RTTESTI_CHECK_RC(rc = RTLocalIpcServerCreate(&hIpcServer, "BasicTest", 1234 /* Invalid flags */), VERR_INVALID_FLAGS);
+    if (RT_SUCCESS(rc)) RTLocalIpcServerDestroy(hIpcServer);
+
+    RTTESTI_CHECK_RC(RTLocalIpcServerCancel(NULL), VERR_INVALID_HANDLE);
+    RTTESTI_CHECK_RC(RTLocalIpcServerDestroy(NULL), VINF_SUCCESS);
+
     /* Basic server creation / destruction. */
-    RTTESTI_CHECK_RC_RET(RTLocalIpcServerCreate(&ipcServer, "BasicTest", RTLOCALIPC_FLAGS_MULTI_SESSION), VINF_SUCCESS, 1);
-    RTTESTI_CHECK_RC_RET(RTLocalIpcServerCancel(ipcServer), VINF_SUCCESS, 1);
-    RTTESTI_CHECK_RC_RET(RTLocalIpcServerDestroy(ipcServer), VINF_SUCCESS, 1);
+    RTTESTI_CHECK_RC_RETV(RTLocalIpcServerCreate(&hIpcServer, "BasicTest", RTLOCALIPC_FLAGS_MULTI_SESSION), VINF_SUCCESS);
+    RTTESTI_CHECK_RC(RTLocalIpcServerCancel(hIpcServer), VINF_SUCCESS);
+    RTTESTI_CHECK_RC(RTLocalIpcServerDestroy(hIpcServer), VINF_SUCCESS);
 
     /* Client-side (per session). */
-    RTTESTI_CHECK_RC_RET(RTLocalIpcSessionConnect(NULL, NULL, 0), VERR_INVALID_POINTER, 1);
-    RTLOCALIPCSESSION ipcSession;
-    RTTESTI_CHECK_RC_RET(RTLocalIpcSessionConnect(&ipcSession, NULL, 0), VERR_INVALID_POINTER, 1);
-    RTTESTI_CHECK_RC_RET(RTLocalIpcSessionConnect(&ipcSession, "", 0), VERR_INVALID_PARAMETER, 1);
-    RTTESTI_CHECK_RC_RET(RTLocalIpcSessionConnect(&ipcSession, "BasicTest", 1234 /* Invalid flags */), VERR_INVALID_PARAMETER, 1);
-    RTTESTI_CHECK_RC_RET(RTLocalIpcSessionCancel(NULL), VERR_INVALID_HANDLE, 1);
-    RTTESTI_CHECK_RC_RET(RTLocalIpcSessionClose(NULL), VINF_SUCCESS, 1);
+    RTTESTI_CHECK_RC(RTLocalIpcSessionConnect(NULL, NULL, 0), VERR_INVALID_POINTER);
+    RTLOCALIPCSESSION hIpcSession;
+    RTTESTI_CHECK_RC(RTLocalIpcSessionConnect(&hIpcSession, NULL, 0), VERR_INVALID_POINTER);
+    if (RT_SUCCESS(rc)) RTLocalIpcSessionClose(hIpcSession);
+    RTTESTI_CHECK_RC(RTLocalIpcSessionConnect(&hIpcSession, "", 0), VERR_INVALID_NAME);
+    if (RT_SUCCESS(rc)) RTLocalIpcSessionClose(hIpcSession);
+    RTTESTI_CHECK_RC(RTLocalIpcSessionConnect(&hIpcSession, "BasicTest", 1234 /* Invalid flags */), VERR_INVALID_FLAGS);
+    if (RT_SUCCESS(rc)) RTLocalIpcSessionClose(hIpcSession);
+
+    RTTESTI_CHECK_RC(RTLocalIpcSessionCancel(NULL), VERR_INVALID_HANDLE);
+    RTTESTI_CHECK_RC(RTLocalIpcSessionClose(NULL), VINF_SUCCESS);
+
     /* Basic client creation / destruction. */
-    RTTESTI_CHECK_RC_RET(RTLocalIpcSessionConnect(&ipcSession, "BasicTest", 0), VERR_FILE_NOT_FOUND, 1);
-    RTTESTI_CHECK_RC_RET(RTLocalIpcServerCancel(ipcServer), VERR_INVALID_MAGIC, 1);
-    RTTESTI_CHECK_RC_RET(RTLocalIpcServerDestroy(ipcServer), VERR_INVALID_MAGIC, 1);
-
-    return 0;
+    RTTESTI_CHECK_RC_RETV(rc = RTLocalIpcSessionConnect(&hIpcSession, "BasicTest", 0), VERR_FILE_NOT_FOUND);
+    if (RT_SUCCESS(rc)) RTLocalIpcSessionClose(hIpcSession);
+    RTTESTI_CHECK_RC(RTLocalIpcServerCancel(hIpcServer), VERR_INVALID_HANDLE);
+    RTTESTI_CHECK_RC(RTLocalIpcServerDestroy(hIpcServer), VERR_INVALID_HANDLE);
 }
 
@@ -630,5 +642,5 @@
 
     bool fMayPanic = RTAssertSetMayPanic(false);
-    bool fQuiet    = RTAssertSetQuiet(false);
+    bool fQuiet    = RTAssertSetQuiet(true);
     testBasics();
     RTAssertSetMayPanic(fMayPanic);
