Index: /trunk/src/VBox/NetworkServices/NAT/proxy.c
===================================================================
--- /trunk/src/VBox/NetworkServices/NAT/proxy.c	(revision 51973)
+++ /trunk/src/VBox/NetworkServices/NAT/proxy.c	(revision 51974)
@@ -201,5 +201,5 @@
                                 (LPSTR)&msg, 0,
                                 NULL);
-        if (nchars <= 0 || msg == NULL) {
+        if (nchars == 0 || msg == NULL) {
             cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, NULL,
                               "Unknown error: %d", error);
@@ -528,6 +528,6 @@
 #else
     DWORD nsent;
+#endif
     int rc;
-#endif
     IOVEC fixiov[8];     /* fixed size (typical case) */
     const size_t fixiovsize = sizeof(fixiov)/sizeof(fixiov[0]);
@@ -573,12 +573,10 @@
 
     nsent = sendmsg(sock, &mh, 0);
+    rc = (nsent >= 0) ? 0 : SOCKET_ERROR;
 #else
     rc = WSASendTo(sock, iov, (DWORD)clen, &nsent, 0,
                    name, (int)namelen, NULL, NULL);
+#endif
     if (rc == SOCKET_ERROR) {
-        nsent = -1;
-    }
-#endif
-    if (nsent < 0) {
         error = SOCKERRNO();
         DPRINTF(("%s: socket %d: sendmsg: %R[sockerr]\n",
Index: /trunk/src/VBox/NetworkServices/NAT/pxping_win.c
===================================================================
--- /trunk/src/VBox/NetworkServices/NAT/pxping_win.c	(revision 51973)
+++ /trunk/src/VBox/NetworkServices/NAT/pxping_win.c	(revision 51974)
@@ -303,5 +303,5 @@
 
     nreplies = IcmpParseReplies(pong->buf, (DWORD)pong->bufsize);
-    if (nreplies <= 0) {
+    if (nreplies == 0) {
         DWORD error = GetLastError();
         if (error == IP_REQ_TIMED_OUT) {
@@ -582,5 +582,5 @@
 
     nreplies = Icmp6ParseReplies(pong->buf, (DWORD)pong->bufsize);
-    if (nreplies <= 0) {
+    if (nreplies == 0) {
         DWORD error = GetLastError();
         if (error == IP_REQ_TIMED_OUT) {
Index: /trunk/src/VBox/NetworkServices/NAT/pxtcp.c
===================================================================
--- /trunk/src/VBox/NetworkServices/NAT/pxtcp.c	(revision 51973)
+++ /trunk/src/VBox/NetworkServices/NAT/pxtcp.c	(revision 51974)
@@ -1583,5 +1583,5 @@
                      0, NULL, NULL);
     if (status == SOCKET_ERROR) {
-        nsent = -SOCKERRNO();
+        return -SOCKERRNO();
     }
 
@@ -1867,5 +1867,5 @@
                      &flags, NULL, NULL);
     if (status == SOCKET_ERROR) {
-        nread = -SOCKERRNO();
+        return -SOCKERRNO();
     }
 
