Index: trunk/src/VBox/Devices/USB/darwin/USBProxyDevice-darwin.cpp
===================================================================
--- trunk/src/VBox/Devices/USB/darwin/USBProxyDevice-darwin.cpp	(revision 50231)
+++ trunk/src/VBox/Devices/USB/darwin/USBProxyDevice-darwin.cpp	(revision 50234)
@@ -1482,10 +1482,10 @@
     {
         Log(("usbProxyDarwinSetConfig: Set configuration -> %#x\n", irc));
-        return false;
+        return RTErrConvertFromDarwin(irc);
     }
 
     usbProxyDarwinReleaseAllInterfaces(pDevOsX);
     usbProxyDarwinSeizeAllInterfaces(pDevOsX, true /* make the best out of it */);
-    return true;
+    return VINF_SUCCESS;
 }
 
@@ -1497,9 +1497,9 @@
  * open/reset/setconfig time.
  *
- * @returns success indicator (always true).
+ * @returns success indicator (always VINF_SUCCESS).
  */
 static DECLCALLBACK(int) usbProxyDarwinClaimInterface(PUSBPROXYDEV pProxyDev, int iIf)
 {
-    return true;
+    return VINF_SUCCESS;
 }
 
@@ -1515,5 +1515,5 @@
 static DECLCALLBACK(int) usbProxyDarwinReleaseInterface(PUSBPROXYDEV pProxyDev, int iIf)
 {
-    return true;
+    return VINF_SUCCESS;
 }
 
@@ -1540,5 +1540,5 @@
             {
                 usbProxyDarwinGetPipeProperties(pDevOsX, pIf);
-                return true;
+                return VINF_SUCCESS;
             }
         }
@@ -1558,5 +1558,5 @@
             irc = (*pDevOsX->ppDevI)->DeviceRequest(pDevOsX->ppDevI, &Req);
             Log(("usbProxyDarwinSetInterface: SET_INTERFACE(%d,%d) -> irc=%#x\n", iIf, iAlt, irc));
-            return true;
+            return VINF_SUCCESS;
         }
     }
@@ -1564,5 +1564,5 @@
     LogFlow(("usbProxyDarwinSetInterface: pProxyDev=%s eiIf=%#x iAlt=%#x - failure - pIf=%p irc=%#x\n",
              pProxyDev->pUsbIns->pszName, iIf, iAlt, pIf, irc));
-    return false;
+    return RTErrConvertFromDarwin(irc);
 }
 
@@ -1571,5 +1571,5 @@
  * Clears the halted endpoint 'EndPt'.
  */
-static DECLCALLBACK(bool) usbProxyDarwinClearHaltedEp(PUSBPROXYDEV pProxyDev, unsigned int EndPt)
+static DECLCALLBACK(int) usbProxyDarwinClearHaltedEp(PUSBPROXYDEV pProxyDev, unsigned int EndPt)
 {
     PUSBPROXYDEVOSX pDevOsX = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVOSX);
@@ -1581,5 +1581,5 @@
      */
     if (EndPt == 0)
-        return true;
+        return VINF_SUCCESS;
 
     /*
@@ -1595,5 +1595,5 @@
         irc = (*pIf->ppIfI)->ClearPipeStallBothEnds(pIf->ppIfI, u8PipeRef);
         if (irc == kIOReturnSuccess)
-            return true;
+            return VINF_SUCCESS;
         AssertMsg(irc == kIOReturnNoDevice || irc == kIOReturnNotResponding, ("irc=#x (control pipe?)\n", irc));
     }
@@ -1601,5 +1601,5 @@
     LogFlow(("usbProxyDarwinClearHaltedEp: pProxyDev=%s EndPt=%#x - failure - pIf=%p irc=%#x\n",
              pProxyDev->pUsbIns->pszName, EndPt, pIf, irc));
-    return false;
+    return RTErrConvertFromDarwin(irc);
 }
 
@@ -1608,7 +1608,6 @@
  * @copydoc USBPROXYBACK::pfnUrbQueue
  */
-static DECLCALLBACK(int) usbProxyDarwinUrbQueue(PVUSBURB pUrb)
-{
-    PUSBPROXYDEV    pProxyDev = PDMINS_2_DATA(pUrb->pUsbIns, PUSBPROXYDEV);
+static DECLCALLBACK(int) usbProxyDarwinUrbQueue(PUSBPROXYDEV pProxyDev, PVUSBURB pUrb)
+{
     PUSBPROXYDEVOSX pDevOsX = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVOSX);
     LogFlow(("%s: usbProxyDarwinUrbQueue: pProxyDev=%s pUrb=%p EndPt=%d cbData=%d\n",
@@ -1629,5 +1628,5 @@
             LogFlow(("%s: usbProxyDarwinUrbQueue: pProxyDev=%s EndPt=%d cbData=%d - can't find interface / pipe!!!\n",
                      pUrb->pszDesc, pProxyDev->pUsbIns->pszName, pUrb->EndPt, pUrb->cbData));
-            return false;
+            return VERR_NOT_FOUND;
         }
 
@@ -1646,5 +1645,5 @@
     PUSBPROXYURBOSX pUrbOsX = usbProxyDarwinUrbAlloc(pDevOsX);
     if (!pUrbOsX)
-        return false;
+        return VERR_NO_MEMORY;
 
     pUrbOsX->u64SubmitTS = RTTimeMilliTS();
@@ -1795,5 +1794,5 @@
     {
         Log(("%s: usbProxyDarwinUrbQueue: success\n", pUrb->pszDesc));
-        return true;
+        return VINF_SUCCESS;
     }
     switch (irc)
@@ -1804,5 +1803,5 @@
             Log(("%s: usbProxyDarwinUrbQueue: pProxyDev=%s EndPt=%d cbData=%d - failed irc=%#x! (stall)\n",
                  pUrb->pszDesc, pProxyDev->pUsbIns->pszName, pUrb->EndPt, pUrb->cbData, irc));
-            return true;
+            return VINF_SUCCESS;
         }
     }
@@ -1810,5 +1809,5 @@
     Log(("%s: usbProxyDarwinUrbQueue: pProxyDev=%s EndPt=%d cbData=%d - failed irc=%#x!\n",
          pUrb->pszDesc, pProxyDev->pUsbIns->pszName, pUrb->EndPt, pUrb->cbData, irc));
-    return false;
+    return RTErrConvertFromDarwin(irc);
 }
 
@@ -1896,9 +1895,7 @@
  *          requests, we should probably be fine...
  */
-static DECLCALLBACK(void) usbProxyDarwinUrbCancel(PVUSBURB pUrb)
-{
-    PUSBPROXYDEV pProxyDev = PDMINS_2_DATA(pUrb->pUsbIns, PUSBPROXYDEV);
+static DECLCALLBACK(int) usbProxyDarwinUrbCancel(PUSBPROXYDEV pProxyDev, PVUSBURB pUrb)
+{
     PUSBPROXYDEVOSX pDevOsX = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVOSX);
-    //PUSBPROXYURBOSX pUrbOsX = (PUSBPROXYURBOSX)pUrb->Dev.pvProxyUrb;
     LogFlow(("%s: usbProxyDarwinUrbCancel: pProxyDev=%s EndPt=%d\n",
              pUrb->pszDesc, pProxyDev->pUsbIns->pszName, pUrb->EndPt));
@@ -1921,7 +1918,14 @@
                  pProxyDev->pUsbIns->pszName, pUrb, pUrb->EndPt));
     }
+
+    int rc = VINF_SUCCESS;
     if (irc != kIOReturnSuccess)
+    {
         Log(("usbProxyDarwinUrbCancel: pProxyDev=%s pUrb=%p EndPt=%d -> %#x!\n",
              pProxyDev->pUsbIns->pszName, pUrb, pUrb->EndPt, irc));
+        rc = RTErrConvertFromDarwin(irc);
+    }
+
+    return rc;
 }
 
