Index: trunk/src/VBox/Runtime/r3/win/pipe-win.cpp
===================================================================
--- trunk/src/VBox/Runtime/r3/win/pipe-win.cpp	(revision 27510)
+++ trunk/src/VBox/Runtime/r3/win/pipe-win.cpp	(revision 27511)
@@ -78,6 +78,6 @@
     /** Set if we've promised that the handle is writable. */
     bool                fPromisedWritable;
-    /** The number of users of the current mode. */
-    uint32_t            cModeUsers;
+    /** Usage counter. */
+    uint32_t            cUsers;
     /** The overlapped I/O structure we use. */
     OVERLAPPED          Overlapped;
@@ -91,6 +91,4 @@
      *  We can only have one poller at the time (lazy bird). */
     RTPOLLSET           hPollSet;
-    /** The number of references to the handle in hPollSet. */
-    uint32_t            cPolls;
     /** Critical section protecting the above members.
      * (Taking the lazy/simple approach.) */
@@ -289,6 +287,6 @@
                             //pThisW->fPromisedWritable= false;
                             //pThisR->fPromisedWritable= false;
-                            //pThisR->cModeUsers      = 0;
-                            //pThisW->cModeUsers      = 0;
+                            //pThisR->cUsers          = 0;
+                            //pThisW->cUsers          = 0;
                             //pThisR->pbBounceBuf     = NULL;
                             //pThisW->pbBounceBuf     = NULL;
@@ -299,6 +297,4 @@
                             pThisR->hPollSet        = NIL_RTPOLLSET;
                             pThisW->hPollSet        = NIL_RTPOLLSET;
-                            //pThisW->cPolls          = 0;
-                            //pThisR->cPolls          = 0;
 
                             *phPipeRead  = pThisR;
@@ -410,5 +406,5 @@
     AssertReturn(ASMAtomicCmpXchgU32(&pThis->u32Magic, ~RTPIPE_MAGIC, RTPIPE_MAGIC), VERR_INVALID_HANDLE);
     RTCritSectEnter(&pThis->CritSect);
-    Assert(pThis->cModeUsers == 0);
+    Assert(pThis->cUsers == 0);
 
     if (!pThis->fRead && pThis->fIOPending)
@@ -456,7 +452,7 @@
     {
         /* No concurrent readers, sorry. */
-        if (pThis->cModeUsers == 0)
-        {
-            pThis->cModeUsers++;
+        if (pThis->cUsers == 0)
+        {
+            pThis->cUsers++;
 
             /*
@@ -503,5 +499,5 @@
                 pThis->fBrokenPipe = true;
 
-            pThis->cModeUsers--;
+            pThis->cUsers--;
         }
         else
@@ -525,7 +521,7 @@
     {
         /* No concurrent readers, sorry. */
-        if (pThis->cModeUsers == 0)
-        {
-            pThis->cModeUsers++;
+        if (pThis->cUsers == 0)
+        {
+            pThis->cUsers++;
 
             size_t cbTotalRead = 0;
@@ -580,5 +576,5 @@
             }
 
-            pThis->cModeUsers--;
+            pThis->cUsers--;
         }
         else
@@ -603,7 +599,7 @@
     {
         /* No concurrent readers, sorry. */
-        if (pThis->cModeUsers == 0)
-        {
-            pThis->cModeUsers++;
+        if (pThis->cUsers == 0)
+        {
+            pThis->cUsers++;
 
             /* If I/O is pending, check if it has completed. */
@@ -687,5 +683,5 @@
                 pThis->fBrokenPipe = true;
 
-            pThis->cModeUsers--;
+            pThis->cUsers--;
         }
         else
@@ -710,7 +706,7 @@
     {
         /* No concurrent readers, sorry. */
-        if (pThis->cModeUsers == 0)
-        {
-            pThis->cModeUsers++;
+        if (pThis->cUsers == 0)
+        {
+            pThis->cUsers++;
 
             /*
@@ -736,5 +732,5 @@
                 /*
                  * Try write everything.
-                 * No bounce buffering, cModeUsers protects us.
+                 * No bounce buffering, cUsers protects us.
                  */
                 size_t cbTotalWritten = 0;
@@ -787,5 +783,5 @@
                 pThis->fBrokenPipe = true;
 
-            pThis->cModeUsers--;
+            pThis->cUsers--;
         }
         else
@@ -886,5 +882,5 @@
                     break;
                 }
-                AssertBreakStmt(pThis->cModeUsers == 0, rc = VERR_INTERNAL_ERROR_5);
+                AssertBreakStmt(pThis->cUsers == 0, rc = VERR_INTERNAL_ERROR_5);
                 rc = ResetEvent(pThis->Overlapped.hEvent); Assert(rc == TRUE);
                 DWORD cbRead = 0;
@@ -897,5 +893,5 @@
                 else if (GetLastError() == ERROR_IO_PENDING)
                 {
-                    pThis->cModeUsers++;
+                    pThis->cUsers++;
                     pThis->fIOPending = true;
                     pThis->fZeroByteRead = true;
@@ -997,5 +993,5 @@
             if (pThis->fZeroByteRead)
             {
-                pThis->cModeUsers--;
+                pThis->cUsers--;
                 pThis->fIOPending = false;
                 if (rc != VINF_SUCCESS)
@@ -1144,8 +1140,6 @@
     /* Check that this is the only current use of this pipe. */
     uint32_t fRetEvents;
-    if (   (   pThis->cPolls == 0
-            && pThis->cModeUsers == 0)
-        || pThis->hPollSet == hPollSet
-       )
+    if (   pThis->cUsers   == 0
+        || pThis->hPollSet == hPollSet)
     {
         /* Check what the current events are. */
@@ -1183,6 +1177,5 @@
             if (!fRetEvents)
             {
-                pThis->cPolls++;
-                pThis->cModeUsers++;
+                pThis->cUsers++;
                 pThis->hPollSet = hPollSet;
             }
@@ -1224,6 +1217,5 @@
     AssertRCReturn(rc, 0);
 
-    Assert(pThis->cPolls > 0);
-    Assert(pThis->cModeUsers > 0);
+    Assert(pThis->cUsers > 0);
 
 
@@ -1246,8 +1238,7 @@
 
     /* update counters. */
-    pThis->cPolls--;
-    if (!pThis->cPolls)
+    pThis->cUsers--;
+    if (!pThis->cUsers)
         pThis->hPollSet = NIL_RTPOLLSET;
-    pThis->cModeUsers--;
 
     RTCritSectLeave(&pThis->CritSect);
