diff --git a/lib/stdsoap2.c b/lib/stdsoap2.c
index 67835ce06761ce107e46cc0684a2ed1b01e739b6..3840752e122793bca62a91da838b0951e769e6a8 100644
--- a/lib/stdsoap2.c
+++ b/lib/stdsoap2.c
@@ -3583,6 +3583,7 @@ again:
 #endif
     fd = socket(AF_INET, SOCK_STREAM, 0);
 /* Start of the injected code for the client agent */
+#ifndef WIN32
     if (soap->device)
     { struct ifreq ifr;
       struct sockaddr_in addr;
@@ -3605,6 +3606,7 @@ again:
         return SOAP_INVALID_SOCKET;
       }
     }
+#endif
 #ifndef WITH_LEAN
   }
 #endif
diff --git a/lib/stdsoap2.h b/lib/stdsoap2.h
index c19f3f674d6bfc401e760544c8dc334a15f63049..1b7328826579c09173af03253a293bfa929e20dd 100644
--- a/lib/stdsoap2.h
+++ b/lib/stdsoap2.h
@@ -52,9 +52,11 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
 */
 
 /* Start of the injected code for the client agent */
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <linux/sockios.h>
+#ifndef WIN32
+# include <sys/ioctl.h>
+# include <net/if.h>
+# include <linux/sockios.h>
+#endif
 /* End of the injected code for the client agent */
 
 #ifdef WITH_SOAPDEFS_H