Index: /trunk/src/VBox/RDP/client/vrdp/rdpusb.c
===================================================================
--- /trunk/src/VBox/RDP/client/vrdp/rdpusb.c	(revision 54779)
+++ /trunk/src/VBox/RDP/client/vrdp/rdpusb.c	(revision 54780)
@@ -98,4 +98,7 @@
 #pragma pack ()
 
+/**
+ * @returns VBox status code.
+ */
 static inline int op_usbproxy_back_open(PUSBPROXYDEV p, const char *pszAddress)
 {
@@ -108,4 +111,7 @@
 }
 
+/**
+ * @returns VBox status code.
+ */
 static inline int op_usbproxy_back_reset(PUSBPROXYDEV pDev)
 {
@@ -113,4 +119,7 @@
 }
 
+/**
+ * @returns VBox status code.
+ */
 static inline int op_usbproxy_back_set_config(PUSBPROXYDEV pDev, int cfg)
 {
@@ -118,4 +127,7 @@
 }
 
+/**
+ * @returns VBox status code.
+ */
 static inline int op_usbproxy_back_claim_interface(PUSBPROXYDEV pDev, int ifnum)
 {
@@ -123,4 +135,7 @@
 }
 
+/**
+ * @returns VBox status code.
+ */
 static inline int op_usbproxy_back_release_interface(PUSBPROXYDEV pDev, int ifnum)
 {
@@ -128,4 +143,7 @@
 }
 
+/**
+ * @returns VBox status code.
+ */
 static inline int op_usbproxy_back_interface_setting(PUSBPROXYDEV pDev, int ifnum, int setting)
 {
@@ -133,4 +151,7 @@
 }
 
+/**
+ * @returns VBox status code.
+ */
 static inline int op_usbproxy_back_queue_urb(PUSBPROXYDEV pDev, PVUSBURB pUrb)
 {
@@ -143,9 +164,15 @@
 }
 
-static inline bool op_usbproxy_back_clear_halted_ep(PUSBPROXYDEV pDev, unsigned EndPoint)
+/**
+ * @returns VBox status code.
+ */
+static inline int op_usbproxy_back_clear_halted_ep(PUSBPROXYDEV pDev, unsigned EndPoint)
 {
     return g_USBProxyDeviceHost.pfnClearHaltedEndpoint (pDev, EndPoint);
 }
 
+/**
+ * @returns VBox status code.
+ */
 static inline int op_usbproxy_back_cancel_urb(PUSBPROXYDEV pDev, PVUSBURB pUrb)
 {
@@ -471,4 +498,6 @@
 			}
 
+			memset (proxy, 0, sizeof (USBPROXYDEV));
+
 			proxy->pvInstanceDataR3 = xmalloc(g_USBProxyDeviceHost.cbBackend);
 			if (!proxy->pvInstanceDataR3)
@@ -477,6 +506,4 @@
 				return;
 			}
-
-			memset (proxy, 0, sizeof (USBPROXYDEV));
 
 			proxy->Dev.pszName = "Remote device";
@@ -551,5 +578,4 @@
 
 			rc = op_usbproxy_back_reset(proxy);
-
 			if (rc != VINF_SUCCESS)
 			{
@@ -574,6 +600,5 @@
 
 			rc = op_usbproxy_back_set_config(proxy, cfg);
-
-			if (!rc)
+			if (RT_FAILURE(rc))
 			{
 				rdpusb_send_reply (code, vrdp_usb_status (rc, &proxy->Dev), devid);
@@ -595,8 +620,8 @@
 
 	        	in_uint8(s, ifnum);
+				in_uint8(s, ifnum);
 
 			rc = op_usbproxy_back_claim_interface(proxy, ifnum);
-
-			if (!rc)
+			if (RT_FAILURE(rc))
 			{
 				rdpusb_send_reply (code, vrdp_usb_status (rc, &proxy->Dev), devid);
@@ -620,6 +645,5 @@
 
 			rc = op_usbproxy_back_release_interface(proxy, ifnum);
-
-			if (!rc)
+			if (RT_FAILURE(rc))
 			{
 				rdpusb_send_reply (code, vrdp_usb_status (rc, &proxy->Dev), devid);
@@ -645,6 +669,5 @@
 
 			rc = op_usbproxy_back_interface_setting(proxy, ifnum, setting);
-
-			if (!rc)
+			if (RT_FAILURE(rc))
 			{
 				rdpusb_send_reply (code, vrdp_usb_status (rc, &proxy->Dev), devid);
@@ -703,5 +726,5 @@
 			/* No reply required. */
 
-			if (rc)
+			if (RT_SUCCESS(rc))
 			{
 				if (proxy->pUrbs)
@@ -740,6 +763,5 @@
 
 			rc = op_usbproxy_back_clear_halted_ep(proxy, ep);
-
-			if (!rc)
+			if (RT_FAILURE(rc))
 			{
 				rdpusb_send_reply (code, vrdp_usb_status (rc, &proxy->Dev), devid);
