Index: /trunk/include/iprt/mangling.h
===================================================================
--- /trunk/include/iprt/mangling.h	(revision 57642)
+++ /trunk/include/iprt/mangling.h	(revision 57643)
@@ -1105,4 +1105,5 @@
 # define RTPipeFlush                                    RT_MANGLER(RTPipeFlush)
 # define RTPipeFromNative                               RT_MANGLER(RTPipeFromNative)
+# define RTPipeQueryInfo                                RT_MANGLER(RTPipeQueryInfo)
 # define RTPipeQueryReadable                            RT_MANGLER(RTPipeQueryReadable)
 # define RTPipeRead                                     RT_MANGLER(RTPipeRead)
@@ -1935,4 +1936,5 @@
 # define RTVfsIoStrmFlush                               RT_MANGLER(RTVfsIoStrmFlush)
 # define RTVfsIoStrmFromRTFile                          RT_MANGLER(RTVfsIoStrmFromRTFile)
+# define RTVfsIoStrmFromRTPipe                          RT_MANGLER(RTVfsIoStrmFromRTPipe)
 # define RTVfsIoStrmFromStdHandle                       RT_MANGLER(RTVfsIoStrmFromStdHandle)
 # define RTVfsIoStrmIsAtEnd                             RT_MANGLER(RTVfsIoStrmIsAtEnd)
Index: /trunk/include/iprt/pipe.h
===================================================================
--- /trunk/include/iprt/pipe.h	(revision 57642)
+++ /trunk/include/iprt/pipe.h	(revision 57643)
@@ -29,4 +29,5 @@
 #include <iprt/cdefs.h>
 #include <iprt/types.h>
+#include <iprt/fs.h>
 
 RT_C_DECLS_BEGIN
@@ -219,4 +220,29 @@
 RTDECL(int) RTPipeQueryReadable(RTPIPE hPipe, size_t *pcbReadable);
 
+/**
+ * Query information about a pipe (mainly a VFS I/O stream formality).
+ *
+ * The only thing we guarentee to be returned is RTFSOBJINFO::Attr.fMode being
+ * set to FIFO and will reflect the read/write end in the RTFS_DOS_READONLY,
+ * RTFS_UNIX_IRUSR and RTFS_UNIX_IWUSR bits.
+ *
+ * Some implementations sometimes provide the pipe buffer size via
+ * RTFSOBJINFO::cbAllocated.
+ *
+ * Some implementations sometimes provide the available read data or available
+ * write space via RTFSOBJINFO::cbObject.
+ *
+ * Some implementations sometimes provide valid device and/or inode numbers.
+ *
+ * @returns iprt status code.
+ *
+ * @param   hPipe       The IPRT read pipe handle.
+ * @param   pObjInfo    Object information structure to be filled on successful
+ *                      return.
+ * @param   enmAddAttr  Which set of additional attributes to request.  Use
+ *                      RTFSOBJATTRADD_NOTHING if this doesn't matter.
+ */
+RTDECL(int) RTPipeQueryInfo(RTPIPE hPipe, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr);
+
 /** @} */
 
Index: /trunk/include/iprt/vfs.h
===================================================================
--- /trunk/include/iprt/vfs.h	(revision 57642)
+++ /trunk/include/iprt/vfs.h	(revision 57643)
@@ -440,5 +440,5 @@
 
 /**
- * Create a VFS I/O stream handle from a standard IPRT file handle (RTFILE).
+ * Creates a VFS I/O stream handle from a standard IPRT file handle (RTFILE).
  *
  * @returns IPRT status code.
@@ -451,4 +451,15 @@
  */
 RTDECL(int)         RTVfsIoStrmFromRTFile(RTFILE hFile, uint64_t fOpen, bool fLeaveOpen, PRTVFSIOSTREAM phVfsIos);
+
+/**
+ * Creates a VFS I/O stream handle from a standard IPRT pipe handle (RTPIPE).
+ *
+ * @returns IPRT status code.
+ * @param   hPipe           The standard IPRT pipe handle.
+ * @param   fLeaveOpen      Whether to leave the handle open when the VFS file
+ *                          is released, or to close it (@c false).
+ * @param   phVfsIos        Where to return the VFS I/O stream handle.
+ */
+RTDECL(int)         RTVfsIoStrmFromRTPipe(RTPIPE hPipe, bool fLeaveOpen, PRTVFSIOSTREAM phVfsIos);
 
 /**
Index: /trunk/src/VBox/Runtime/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Runtime/Makefile.kmk	(revision 57642)
+++ /trunk/src/VBox/Runtime/Makefile.kmk	(revision 57643)
@@ -572,4 +572,5 @@
 	common/vfs/vfsmisc.cpp \
 	common/vfs/vfsstdfile.cpp \
+	common/vfs/vfsstdpipe.cpp \
 	common/zip/tar.cpp \
 	common/zip/tarcmd.cpp \
Index: /trunk/src/VBox/Runtime/common/vfs/vfsmisc.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/vfs/vfsmisc.cpp	(revision 57642)
+++ /trunk/src/VBox/Runtime/common/vfs/vfsmisc.cpp	(revision 57643)
@@ -71,6 +71,5 @@
 
             case RTHANDLETYPE_PIPE:
-                /** @todo  */
-                rc = VERR_NOT_IMPLEMENTED;
+                rc = RTVfsIoStrmFromRTPipe(h.u.hPipe, fLeaveOpen, phVfsIos);
                 break;
 
Index: /trunk/src/VBox/Runtime/common/vfs/vfsstdpipe.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/vfs/vfsstdpipe.cpp	(revision 57643)
+++ /trunk/src/VBox/Runtime/common/vfs/vfsstdpipe.cpp	(revision 57643)
@@ -0,0 +1,317 @@
+/* $Id$ */
+/** @file
+ * IPRT - Virtual File System, Standard Pipe I/O stream Implementation.
+ */
+
+/*
+ * Copyright (C) 2010-2015 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 <iprt/vfs.h>
+#include <iprt/vfslowlevel.h>
+
+#include <iprt/assert.h>
+#include <iprt/err.h>
+#include <iprt/file.h>
+#include <iprt/pipe.h>
+#include <iprt/poll.h>
+
+
+/*********************************************************************************************************************************
+*   Structures and Typedefs                                                                                                      *
+*********************************************************************************************************************************/
+/**
+ * Private data of a standard pipe.
+ */
+typedef struct RTVFSSTDPIPE
+{
+    /** The pipe handle. */
+    RTPIPE          hPipe;
+    /** Whether to leave the handle open when the VFS handle is closed. */
+    bool            fLeaveOpen;
+    /** Set if primarily read, clear if write. */
+    bool            fReadPipe;
+    /** Fake stream position. */
+    uint64_t        offFakePos;
+} RTVFSSTDPIPE;
+/** Pointer to the private data of a standard pipe. */
+typedef RTVFSSTDPIPE *PRTVFSSTDPIPE;
+
+
+/**
+ * @interface_method_impl{RTVFSOBJOPS,pfnClose}
+ */
+static DECLCALLBACK(int) rtVfsStdPipe_Close(void *pvThis)
+{
+    PRTVFSSTDPIPE pThis = (PRTVFSSTDPIPE)pvThis;
+
+    int rc;
+    if (!pThis->fLeaveOpen)
+        rc = RTPipeClose(pThis->hPipe);
+    else
+        rc = VINF_SUCCESS;
+    pThis->hPipe = NIL_RTPIPE;
+
+    return rc;
+}
+
+
+/**
+ * @interface_method_impl{RTVFSOBJOPS,pfnQueryInfo}
+ */
+static DECLCALLBACK(int) rtVfsStdPipe_QueryInfo(void *pvThis, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
+{
+    PRTVFSSTDPIPE pThis = (PRTVFSSTDPIPE)pvThis;
+    return RTPipeQueryInfo(pThis->hPipe, pObjInfo, enmAddAttr);
+}
+
+
+/**
+ * @interface_method_impl{RTVFSIOSTREAMOPS,pfnRead}
+ */
+static DECLCALLBACK(int) rtVfsStdPipe_Read(void *pvThis, RTFOFF off, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbRead)
+{
+    PRTVFSSTDPIPE pThis = (PRTVFSSTDPIPE)pvThis;
+    int           rc;
+    AssertReturn(off < 0 || pThis->offFakePos == off, VERR_SEEK_ON_DEVICE);
+
+    NOREF(fBlocking);
+    if (pSgBuf->cSegs == 1)
+    {
+        if (fBlocking)
+            rc = RTPipeReadBlocking(pThis->hPipe, pSgBuf->paSegs[0].pvSeg, pSgBuf->paSegs[0].cbSeg, pcbRead);
+        else
+            rc = RTPipeRead(        pThis->hPipe, pSgBuf->paSegs[0].pvSeg, pSgBuf->paSegs[0].cbSeg, pcbRead);
+        if (RT_SUCCESS(rc))
+            pThis->offFakePos += pcbRead ? *pcbRead : pSgBuf->paSegs[0].cbSeg;
+    }
+    else
+    {
+        size_t  cbSeg      = 0;
+        size_t  cbRead     = 0;
+        size_t  cbReadSeg  = 0;
+        size_t *pcbReadSeg = pcbRead ? &cbReadSeg : NULL;
+        rc = VINF_SUCCESS;
+
+        for (uint32_t iSeg = 0; iSeg < pSgBuf->cSegs; iSeg++)
+        {
+            void *pvSeg = pSgBuf->paSegs[iSeg].pvSeg;
+            cbSeg       = pSgBuf->paSegs[iSeg].cbSeg;
+
+            cbReadSeg = cbSeg;
+            if (fBlocking)
+                rc = RTPipeReadBlocking(pThis->hPipe, pvSeg, cbSeg, pcbReadSeg);
+            else
+                rc = RTPipeRead(        pThis->hPipe, pvSeg, cbSeg, pcbReadSeg);
+            if (RT_FAILURE(rc))
+                break;
+            pThis->offFakePos += pcbRead ? cbReadSeg : cbSeg;
+            cbRead += cbReadSeg;
+            if (rc != VINF_SUCCESS)
+                break;
+            AssertBreakStmt(!pcbRead || cbReadSeg == cbSeg, rc = VINF_TRY_AGAIN);
+        }
+
+        if (pcbRead)
+            *pcbRead = cbRead;
+    }
+
+    return rc;
+}
+
+
+/**
+ * @interface_method_impl{RTVFSIOSTREAMOPS,pfnWrite}
+ */
+static DECLCALLBACK(int) rtVfsStdPipe_Write(void *pvThis, RTFOFF off, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbWritten)
+{
+    PRTVFSSTDPIPE pThis = (PRTVFSSTDPIPE)pvThis;
+    int           rc;
+    AssertReturn(off < 0 || pThis->offFakePos == off, VERR_SEEK_ON_DEVICE);
+
+    if (pSgBuf->cSegs == 1)
+    {
+        if (fBlocking)
+            rc = RTPipeWriteBlocking(pThis->hPipe, pSgBuf->paSegs[0].pvSeg, pSgBuf->paSegs[0].cbSeg, pcbWritten);
+        else
+            rc = RTPipeWrite(        pThis->hPipe, pSgBuf->paSegs[0].pvSeg, pSgBuf->paSegs[0].cbSeg, pcbWritten);
+        if (RT_SUCCESS(rc))
+            pThis->offFakePos += pcbWritten ? *pcbWritten : pSgBuf->paSegs[0].cbSeg;
+    }
+    else
+    {
+        size_t  cbWritten     = 0;
+        size_t  cbWrittenSeg;
+        size_t *pcbWrittenSeg = pcbWritten ? &cbWrittenSeg : NULL;
+        rc = VINF_SUCCESS;
+
+        for (uint32_t iSeg = 0; iSeg < pSgBuf->cSegs; iSeg++)
+        {
+            void   *pvSeg  = pSgBuf->paSegs[iSeg].pvSeg;
+            size_t  cbSeg  = pSgBuf->paSegs[iSeg].cbSeg;
+
+            cbWrittenSeg = 0;
+            if (fBlocking)
+                rc = RTPipeWriteBlocking(pThis->hPipe, pvSeg, cbSeg, pcbWrittenSeg);
+            else
+                rc = RTPipeWrite(        pThis->hPipe, pvSeg, cbSeg, pcbWrittenSeg);
+            if (RT_FAILURE(rc))
+                break;
+            pThis->offFakePos += pcbWritten ? cbWrittenSeg : cbSeg;
+            if (pcbWritten)
+            {
+                cbWritten += cbWrittenSeg;
+                if (rc != VINF_SUCCESS)
+                    break;
+                AssertStmt(cbWrittenSeg == cbSeg, rc = VINF_TRY_AGAIN);
+            }
+            else
+                AssertBreak(rc == VINF_SUCCESS);
+        }
+
+        if (pcbWritten)
+            *pcbWritten = cbWritten;
+    }
+
+    return rc;
+}
+
+
+/**
+ * @interface_method_impl{RTVFSIOSTREAMOPS,pfnFlush}
+ */
+static DECLCALLBACK(int) rtVfsStdPipe_Flush(void *pvThis)
+{
+    PRTVFSSTDPIPE pThis = (PRTVFSSTDPIPE)pvThis;
+    return RTPipeFlush(pThis->hPipe);
+}
+
+
+/**
+ * @interface_method_impl{RTVFSIOSTREAMOPS,pfnPollOne}
+ */
+static DECLCALLBACK(int) rtVfsStdPipe_PollOne(void *pvThis, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,
+                                              uint32_t *pfRetEvents)
+{
+    PRTVFSSTDPIPE pThis = (PRTVFSSTDPIPE)pvThis;
+    uint32_t const fPossibleEvt = pThis->fReadPipe ? RTPOLL_EVT_READ : RTPOLL_EVT_WRITE;
+
+    int rc = RTPipeSelectOne(pThis->hPipe, cMillies);
+    if (RT_SUCCESS(rc))
+    {
+        if (fEvents & fPossibleEvt)
+            *pfRetEvents = fPossibleEvt;
+        else
+            rc = RTVfsUtilDummyPollOne(fEvents, cMillies, fIntr, pfRetEvents);
+    }
+    else if (   rc != VERR_TIMEOUT
+             && rc != VERR_INTERRUPTED
+             && rc != VERR_TRY_AGAIN /* paranoia */)
+    {
+        *pfRetEvents = RTPOLL_EVT_ERROR;
+        rc = VINF_SUCCESS;
+    }
+
+    return rc;
+}
+
+
+/**
+ * @interface_method_impl{RTVFSIOSTREAMOPS,pfnTell}
+ */
+static DECLCALLBACK(int) rtVfsStdPipe_Tell(void *pvThis, PRTFOFF poffActual)
+{
+    PRTVFSSTDPIPE pThis = (PRTVFSSTDPIPE)pvThis;
+    *poffActual = pThis->offFakePos;
+    return VINF_SUCCESS;
+}
+
+
+/**
+ * Standard pipe operations.
+ */
+DECL_HIDDEN_CONST(const RTVFSIOSTREAMOPS) g_rtVfsStdPipeOps =
+{
+    { /* Obj */
+        RTVFSOBJOPS_VERSION,
+        RTVFSOBJTYPE_IO_STREAM,
+        "StdFile",
+        rtVfsStdPipe_Close,
+        rtVfsStdPipe_QueryInfo,
+        RTVFSOBJOPS_VERSION
+    },
+    RTVFSIOSTREAMOPS_VERSION,
+    0,
+    rtVfsStdPipe_Read,
+    rtVfsStdPipe_Write,
+    rtVfsStdPipe_Flush,
+    rtVfsStdPipe_PollOne,
+    rtVfsStdPipe_Tell,
+    NULL /*rtVfsStdPipe_Skip*/,
+    NULL /*ZeroFill*/,
+    RTVFSIOSTREAMOPS_VERSION,
+};
+
+
+/**
+ * Internal worker for RTVfsIosFromRTPipe and later some create API.
+ *
+ * @returns IRPT status code.
+ * @param   hPipe               The IPRT file handle.
+ * @param   fOpen               The RTFILE_O_XXX flags.
+ * @param   fLeaveOpen          Whether to leave it open or close it.
+ * @param   phVfsFile           Where to return the handle.
+ */
+static int rtVfsFileFromRTPipe(RTPIPE hPipe, uint64_t fOpen, bool fLeaveOpen, PRTVFSIOSTREAM phVfsIos)
+{
+    PRTVFSSTDPIPE   pThis;
+    RTVFSIOSTREAM   hVfsIos;
+    int rc = RTVfsNewIoStream(&g_rtVfsStdPipeOps, sizeof(RTVFSSTDPIPE), fOpen, NIL_RTVFS, NIL_RTVFSLOCK,
+                              &hVfsIos, (void **)&pThis);
+    if (RT_FAILURE(rc))
+        return rc;
+
+    pThis->hPipe        = hPipe;
+    pThis->fLeaveOpen   = fLeaveOpen;
+    *phVfsIos = hVfsIos;
+    return VINF_SUCCESS;
+}
+
+
+RTDECL(int) RTVfsIoStrmFromRTPipe(RTPIPE hPipe, bool fLeaveOpen, PRTVFSIOSTREAM phVfsIos)
+{
+    /*
+     * Check the handle validity and read/write mode, then create a stream for it.
+     */
+    RTFSOBJINFO ObjInfo;
+    int rc = RTPipeQueryInfo(hPipe, &ObjInfo, RTFSOBJATTRADD_NOTHING);
+    if (RT_SUCCESS(rc))
+        rc = rtVfsFileFromRTPipe(hPipe,
+                                 ObjInfo.Attr.fMode & RTFS_DOS_READONLY ? RTFILE_O_READ : RTFILE_O_WRITE,
+                                 fLeaveOpen, phVfsIos);
+    return rc;
+}
+
+/** @todo Create pipe API? */
+
Index: /trunk/src/VBox/Runtime/include/internal/pipe.h
===================================================================
--- /trunk/src/VBox/Runtime/include/internal/pipe.h	(revision 57642)
+++ /trunk/src/VBox/Runtime/include/internal/pipe.h	(revision 57643)
@@ -82,4 +82,41 @@
 uint32_t    rtPipePollDone(RTPIPE hPipe, uint32_t fEvents, bool fFinalEntry, bool fHarvestEvents);
 
+
+/**
+ * Fakes basic query info data for RTPipeQueryInfo.
+ *
+ * @param   pObjInfo            The output structure.
+ * @param   enmAddAttr          The extra attribute.
+ * @param   fReadPipe           Set if read pipe, clear if write pipe.
+ */
+DECLINLINE(void) rtPipeFakeQueryInfo(PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr, bool fReadPipe)
+{
+    RT_ZERO(*pObjInfo);
+    if (fReadPipe)
+        pObjInfo->Attr.fMode     = RTFS_TYPE_FIFO | RTFS_UNIX_IRUSR | RTFS_DOS_READONLY;
+    else
+        pObjInfo->Attr.fMode     = RTFS_TYPE_FIFO | RTFS_UNIX_IWUSR;
+    pObjInfo->Attr.enmAdditional = enmAddAttr;
+    switch (enmAddAttr)
+    {
+        case RTFSOBJATTRADD_UNIX:
+            pObjInfo->Attr.u.Unix.cHardlinks = 1;
+            break;
+        case RTFSOBJATTRADD_UNIX_OWNER:
+            pObjInfo->Attr.u.UnixOwner.uid = NIL_RTUID;
+            break;
+        case RTFSOBJATTRADD_UNIX_GROUP:
+            pObjInfo->Attr.u.UnixGroup.gid = NIL_RTGID;
+            break;
+        case RTFSOBJATTRADD_EASIZE:
+            break;
+        case RTFSOBJATTRADD_32BIT_SIZE_HACK:
+            /* shut up gcc. */
+            break;
+        /* no default, want warnings. */
+    }
+}
+
+
 RT_C_DECLS_END
 
Index: /trunk/src/VBox/Runtime/r3/os2/pipe-os2.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/os2/pipe-os2.cpp	(revision 57642)
+++ /trunk/src/VBox/Runtime/r3/os2/pipe-os2.cpp	(revision 57643)
@@ -879,4 +879,33 @@
 
 
+RTDECL(int) RTPipeQueryInfo(RTPIPE hPipe, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
+{
+    RTPIPEINTERNAL *pThis = hPipe;
+    AssertPtrReturn(pThis, 0);
+    AssertReturn(pThis->u32Magic == RTPIPE_MAGIC, 0);
+
+    int rc = RTCritSectEnter(&pThis->CritSect);
+    AssertRCReturn(rc, 0);
+
+    rtPipeFakeQueryInfo(pObjInfo, enmAddAttr, pThis->fRead);
+
+    if (pThis->fRead)
+    {
+        ULONG       cbActual = 0;
+        ULONG       ulState  = 0;
+        AVAILDATA   Avail    = { 0, 0 };
+        APIRET orc = DosPeekNPipe(pThis->hPipe, NULL, 0, &cbActual, &Avail, &ulState);
+        if (orc == NO_ERROR && (Avail.cbpipe > 0 || ulState == NP_STATE_CONNECTED))
+            pObjInfo->cbObject = Avail.cbpipe;
+    }
+    else
+        pObjInfo->cbObject = rtPipeOs2GetSpace(pThis)
+    pObjInfo->cbAllocated = RTPIPE_OS2_SIZE; /** @todo this isn't necessarily true if we didn't create it... but, whatever */
+
+    RTCritSectLeave(&pThis->CritSect);
+    return VINF_SUCCESS;
+}
+
+
 int rtPipePollGetHandle(RTPIPE hPipe, uint32_t fEvents, PRTHCINTPTR phNative)
 {
Index: /trunk/src/VBox/Runtime/r3/posix/pipe-posix.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/posix/pipe-posix.cpp	(revision 57642)
+++ /trunk/src/VBox/Runtime/r3/posix/pipe-posix.cpp	(revision 57643)
@@ -672,4 +672,49 @@
 
 
+RTDECL(int) RTPipeQueryInfo(RTPIPE hPipe, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
+{
+    RTPIPEINTERNAL *pThis = hPipe;
+    AssertPtrReturn(pThis, 0);
+    AssertReturn(pThis->u32Magic == RTPIPE_MAGIC, 0);
+
+    rtPipeFakeQueryInfo(pObjInfo, enmAddAttr, pThis->fRead);
+
+    if (pThis->fRead)
+    {
+        int cb = 0;
+        int rc = ioctl(pThis->fd, FIONREAD, &cb);
+        if (rc >= 0)
+            pObjInfo->cbObject = cb;
+    }
+#ifdef FIONSPACE
+    else
+    {
+        int cb = 0;
+        int rc = ioctl(pThis->fd, FIONSPACE, &cb);
+        if (rc >= 0)
+            pObjInfo->cbObject = cb;
+    }
+#endif
+
+    /** @todo Check this out on linux, solaris and darwin... (Currently going by a
+     *        FreeBSD manpage.) */
+    struct stat St;
+    if (fstat(pThis->fd, &St))
+    {
+        pObjInfo->cbAllocated = St.st_blksize;
+        if (   enmAddAttr == RTFSOBJATTRADD_NOTHING
+            || enmAddAttr == RTFSOBJATTRADD_UNIX)
+        {
+            pObjInfo->Attr.enmAdditional = RTFSOBJATTRADD_UNIX;
+            pObjInfo->Attr.u.Unix.INodeId       = St.st_ino;
+            pObjInfo->Attr.u.Unix.INodeIdDevice = St.st_dev;
+        }
+    }
+    /** @todo error handling?  */
+
+    return VINF_SUCCESS;
+}
+
+
 int rtPipePollGetHandle(RTPIPE hPipe, uint32_t fEvents, PRTHCINTPTR phNative)
 {
Index: /trunk/src/VBox/Runtime/r3/win/pipe-win.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/win/pipe-win.cpp	(revision 57642)
+++ /trunk/src/VBox/Runtime/r3/win/pipe-win.cpp	(revision 57643)
@@ -149,5 +149,5 @@
  * @param   pInfo               The info structure.
  */
-static bool rtPipeQueryInfo(RTPIPEINTERNAL *pThis, FILE_PIPE_LOCAL_INFORMATION *pInfo)
+static bool rtPipeQueryNtInfo(RTPIPEINTERNAL *pThis, FILE_PIPE_LOCAL_INFORMATION *pInfo)
 {
     IO_STATUS_BLOCK Ios;
@@ -459,5 +459,5 @@
 
     /*
-     * Looks kind of OK, create a handle so we can try rtPipeQueryInfo on it
+     * Looks kind of OK, create a handle so we can try rtPipeQueryNtInfo on it
      * and see if we need to duplicate it to make that call work.
      */
@@ -487,5 +487,5 @@
             HANDLE  hNative2 = INVALID_HANDLE_VALUE;
             FILE_PIPE_LOCAL_INFORMATION Info;
-            if (rtPipeQueryInfo(pThis, &Info))
+            if (rtPipeQueryNtInfo(pThis, &Info))
                 rc = VINF_SUCCESS;
             else
@@ -498,5 +498,5 @@
                 {
                     pThis->hPipe = hNative2;
-                    if (rtPipeQueryInfo(pThis, &Info))
+                    if (rtPipeQueryNtInfo(pThis, &Info))
                         rc = VINF_SUCCESS;
                     else
@@ -538,4 +538,5 @@
                      * Ok, we're good!
                      */
+/** @todo This is bogus for standard handles! */
                     if (hNative2 != INVALID_HANDLE_VALUE)
                         CloseHandle(hNative);
@@ -746,5 +747,5 @@
                 if (   !pThis->fPromisedWritable
                     && cbToWrite > 0
-                    && rtPipeQueryInfo(pThis, &Info))
+                    && rtPipeQueryNtInfo(pThis, &Info))
                 {
                     if (Info.NamedPipeState == FILE_PIPE_CLOSING_STATE)
@@ -1051,5 +1052,5 @@
             {
                 FILE_PIPE_LOCAL_INFORMATION Info;
-                if (rtPipeQueryInfo(pThis, &Info))
+                if (rtPipeQueryNtInfo(pThis, &Info))
                 {
                     /* Check for broken pipe. */
@@ -1172,4 +1173,27 @@
 
 
+RTDECL(int) RTPipeQueryInfo(RTPIPE hPipe, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
+{
+    RTPIPEINTERNAL *pThis = hPipe;
+    AssertPtrReturn(pThis, 0);
+    AssertReturn(pThis->u32Magic == RTPIPE_MAGIC, 0);
+
+    int rc = RTCritSectEnter(&pThis->CritSect);
+    AssertRCReturn(rc, 0);
+
+    rtPipeFakeQueryInfo(pObjInfo, enmAddAttr, pThis->fRead);
+
+    FILE_PIPE_LOCAL_INFORMATION Info;
+    if (rtPipeQueryNtInfo(pThis, &Info))
+    {
+        pObjInfo->cbAllocated = pThis->fRead ? Info.InboundQuota : Info.OutboundQuota;
+        pObjInfo->cbObject    = pThis->fRead ? Info.ReadDataAvailable : Info.WriteQuotaAvailable;
+    }
+
+    RTCritSectLeave(&pThis->CritSect);
+    return VINF_SUCCESS;
+}
+
+
 int rtPipePollGetHandle(RTPIPE hPipe, uint32_t fEvents, PRTHCINTPTR phNative)
 {
@@ -1232,5 +1256,5 @@
         {
             FILE_PIPE_LOCAL_INFORMATION Info;
-            if (rtPipeQueryInfo(pThis, &Info))
+            if (rtPipeQueryNtInfo(pThis, &Info))
             {
                 /* Check for broken pipe. */
