summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/curl/interface.c2
-rw-r--r--ext/curl/streams.c2
-rw-r--r--ext/fbsql/php_fbsql.c2
-rw-r--r--ext/ftp/ftp.c2
-rw-r--r--ext/hyperwave/hg_comm.c2
-rw-r--r--ext/hyperwave/hw.c2
-rw-r--r--ext/imap/php_imap.c2
-rw-r--r--ext/ldap/ldap.c2
-rw-r--r--ext/mcal/php_mcal.c2
-rw-r--r--ext/mysql/php_mysql.c2
-rw-r--r--ext/odbc/php_odbc.c2
-rw-r--r--ext/rpc/com/com_wrapper.c6
-rw-r--r--ext/snmp/snmp.c2
-rw-r--r--ext/standard/dns.c2
-rw-r--r--ext/standard/file.c162
-rw-r--r--ext/standard/fsock.c2
-rw-r--r--ext/standard/ftp_fopen_wrapper.c4
-rw-r--r--ext/standard/http_fopen_wrapper.c4
-rw-r--r--ext/standard/pack.c2
-rw-r--r--ext/zlib/zlib.c2
-rw-r--r--main/fopen_wrappers.c4
-rw-r--r--main/mergesort.c2
-rw-r--r--main/network.c2
-rw-r--r--main/php.h4
-rw-r--r--main/php_open_temporary_file.c2
-rwxr-xr-xmain/streams.c18
-rwxr-xr-xrun-tests.php16
-rw-r--r--win32/php4dllts.dsp8
-rw-r--r--win32/sendmail.c2
-rw-r--r--win32/time.h2
30 files changed, 225 insertions, 43 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 2b5c48a61e..3286543f51 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -30,7 +30,7 @@
#include <string.h>
#ifdef PHP_WIN32
-#include <winsock.h>
+#include <winsock2.h>
#include <sys/types.h>
#endif
diff --git a/ext/curl/streams.c b/ext/curl/streams.c
index 58695bd50a..ed57749318 100644
--- a/ext/curl/streams.c
+++ b/ext/curl/streams.c
@@ -36,7 +36,7 @@
#include <string.h>
#ifdef PHP_WIN32
-#include <winsock.h>
+#include <winsock2.h>
#include <sys/types.h>
#endif
diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c
index df19e70a9d..0b278f2d02 100644
--- a/ext/fbsql/php_fbsql.c
+++ b/ext/fbsql/php_fbsql.c
@@ -43,7 +43,7 @@
#include "ext/standard/php_string.h"
#ifdef PHP_WIN32
-#include <winsock.h>
+#include <winsock2.h>
#else
#include <php_config.h>
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index 1ebce4e470..233c832508 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -33,7 +33,7 @@
#include <string.h>
#include <time.h>
#ifdef PHP_WIN32
-#include <winsock.h>
+#include <winsock2.h>
#elif defined(NETWARE)
#ifdef USE_WINSOCK /* Modified to use Winsock (NOVSOCK2.H), atleast for now */
#include <novsock2.h>
diff --git a/ext/hyperwave/hg_comm.c b/ext/hyperwave/hg_comm.c
index 856b1c1bfa..5aaae3dcfd 100644
--- a/ext/hyperwave/hg_comm.c
+++ b/ext/hyperwave/hg_comm.c
@@ -31,7 +31,7 @@
#include <string.h>
#include <sys/types.h>
#ifdef PHP_WIN32
-# include <winsock.h>
+# include <winsock2.h>
# define EWOULDBLOCK WSAEWOULDBLOCK
# define ETIMEDOUT WSAETIMEDOUT
# define bcopy memcpy
diff --git a/ext/hyperwave/hw.c b/ext/hyperwave/hw.c
index 4975b9586f..8859e13952 100644
--- a/ext/hyperwave/hw.c
+++ b/ext/hyperwave/hw.c
@@ -34,7 +34,7 @@
#include "SAPI.h"
#ifdef PHP_WIN32
-#include <winsock.h>
+#include <winsock2.h>
#endif
#if HYPERWAVE
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index e43f513f98..77c9aceb2a 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -50,7 +50,7 @@
#include <signal.h>
#ifdef PHP_WIN32
-#include <winsock.h>
+#include <winsock2.h>
#include <stdlib.h>
#include "win32/sendmail.h"
MAILSTREAM DEFAULTPROTO;
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 96adc911d3..a4dbca40bc 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -46,7 +46,7 @@
#ifdef PHP_WIN32
#include <string.h>
#if HAVE_NSLDAP
-#include <winsock.h>
+#include <winsock2.h>
#endif
#define strdup _strdup
#undef WINDOWS
diff --git a/ext/mcal/php_mcal.c b/ext/mcal/php_mcal.c
index 6ecd3a5419..3ef97c5683 100644
--- a/ext/mcal/php_mcal.c
+++ b/ext/mcal/php_mcal.c
@@ -42,7 +42,7 @@
#include "ext/standard/info.h"
#include "ext/standard/basic_functions.h"
#ifdef PHP_WIN32
-#include "winsock.h"
+#include "winsock2.h"
#endif
static void cal_close_it(zend_rsrc_list_entry *rsrc TSRMLS_DC);
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index ef46b204a0..6a493ba3a1 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -37,7 +37,7 @@
#if HAVE_MYSQL
#ifdef PHP_WIN32
-# include <winsock.h>
+# include <winsock2.h>
# define signal(a, b) NULL
#elif defined(NETWARE)
# include <sys/socket.h>
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 5583a4dfcb..ba473e8911 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -44,7 +44,7 @@
#include "php_ini.h"
#ifdef PHP_WIN32
-#include <winsock.h>
+#include <winsock2.h>
#define ODBC_TYPE "Win32"
#define PHP_ODBC_TYPE ODBC_TYPE
diff --git a/ext/rpc/com/com_wrapper.c b/ext/rpc/com/com_wrapper.c
index 1c27c4d774..04e9a74f08 100644
--- a/ext/rpc/com/com_wrapper.c
+++ b/ext/rpc/com/com_wrapper.c
@@ -56,13 +56,13 @@
#define _WIN32_DCOM
+#include "php.h"
+#include "php_ini.h"
+
#include <iostream.h>
#include <math.h>
#include <ocidl.h>
-#include "php.h"
-#include "php_ini.h"
-
#include "../rpc.h"
#include "../php_rpc.h"
#include "../handler.h"
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 6f95b28772..ad76753633 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -33,7 +33,7 @@
#include <sys/types.h>
#ifdef PHP_WIN32
-#include <winsock.h>
+#include <winsock2.h>
#include <errno.h>
#include <process.h>
#include "win32/time.h"
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 32641382fa..916ff4637d 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -44,7 +44,7 @@
#include "resolv.h"
#endif
#endif /* HAVE_LIBBIND */
-#include <winsock.h>
+#include <winsock2.h>
#else /* This holds good for NetWare too, both for Winsock and Berkeley sockets */
#include <netinet/in.h>
#if HAVE_ARPA_INET_H
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 25d1257330..d5024cc396 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -44,7 +44,7 @@
#include <fcntl.h>
#ifdef PHP_WIN32
#include <windows.h>
-#include <winsock.h>
+#include <winsock2.h>
#define O_RDONLY _O_RDONLY
#include "win32/param.h"
#include "win32/winutil.h"
@@ -821,6 +821,160 @@ static int stream_array_emulate_read_fd_set(zval *stream_array TSRMLS_DC)
}
/* }}} */
+#ifdef PHP_WIN32
+/* Win32 select() will only work with sockets, so we roll our own implementation that will
+ * get the OS file handle from regular fd's and sockets and then use WaitForMultipleObjects().
+ * This implementation is not as feature-full as posix select, but it works for our purposes
+ */
+static int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tv)
+{
+ HANDLE *handles;
+ DWORD ms, waitret;
+ DWORD ms_total;
+ int i, f, s, fd_count = 0, sock_count = 0;
+ int retval;
+ fd_set ard, awr, aex; /* active fd sets */
+ long sock_events;
+
+ for (i = 0; i < max_fd; i++) {
+ if (FD_ISSET(i, rfds) || FD_ISSET(i, wfds) || FD_ISSET(i, efds)) {
+ if (_get_osfhandle(i) == 0xffffffff) {
+ /* it is a socket */
+ sock_count++;
+ } else {
+ fd_count++;
+ }
+ }
+ }
+
+ if (fd_count + sock_count == 0) {
+ return 0;
+ }
+
+ handles = (HANDLE*)emalloc((fd_count + sock_count) * sizeof(HANDLE));
+
+ /* populate the events and handles arrays */
+ f = 0;
+ s = 0;
+ for (i = 0; i < max_fd; i++) {
+ if (FD_ISSET(i, rfds) || FD_ISSET(i, wfds) || FD_ISSET(i, efds)) {
+ long h = _get_osfhandle(i);
+ if (h == 0xFFFFFFFF) {
+ HANDLE evt;
+ long evt_flags = 0;
+
+ if (FD_ISSET(i, rfds)) {
+ evt_flags |= FD_READ|FD_CONNECT|FD_ACCEPT|FD_CLOSE;
+ }
+ if (FD_ISSET(i, wfds)) {
+ evt_flags |= FD_WRITE;
+ }
+ if (FD_ISSET(i, efds)) {
+ evt_flags |= FD_OOB;
+ }
+
+ evt = WSACreateEvent();
+ WSAEventSelect(i, evt, evt_flags);
+
+ handles[fd_count + s] = evt;
+ s++;
+ } else {
+ handles[f++] = (HANDLE)h;
+ }
+ }
+ }
+
+ /* calculate how long we need to wait in milliseconds */
+ if (tv == NULL) {
+ ms_total = INFINITE;
+ } else {
+ ms_total = tv->tv_sec * 1000;
+ ms_total += tv->tv_usec / 1000;
+ }
+
+ waitret = MsgWaitForMultipleObjects(fd_count + sock_count, handles, FALSE, ms_total, QS_ALLEVENTS);
+
+ if (waitret == WAIT_TIMEOUT) {
+ retval = 0;
+ } else if (waitret == 0xFFFFFFFF) {
+ retval = -1;
+ } else {
+
+ FD_ZERO(&ard);
+ FD_ZERO(&awr);
+ FD_ZERO(&aex);
+
+ f = 0;
+ retval = 0;
+ for (i = 0; i < max_fd; i++) {
+ if (FD_ISSET(i, rfds) || FD_ISSET(i, wfds) || FD_ISSET(i, efds)) {
+ if (f >= fd_count) {
+ /* socket event */
+ HANDLE evt = handles[f];
+
+ if (WAIT_OBJECT_0 == WaitForSingleObject(evt, 0)) {
+ /* check for various signal states */
+ if (FD_ISSET(i, rfds)) {
+ WSAEventSelect(i, evt, FD_READ|FD_CONNECT|FD_ACCEPT|FD_CLOSE);
+ if (WAIT_OBJECT_0 == WaitForSingleObject(evt, 0)) {
+ FD_SET(i, &ard);
+ }
+ }
+ if (FD_ISSET(i, wfds)) {
+ WSAEventSelect(i, evt, FD_WRITE);
+ if (WAIT_OBJECT_0 == WaitForSingleObject(evt, 0)) {
+ FD_SET(i, &awr);
+ }
+ }
+ if (FD_ISSET(i, efds)) {
+ WSAEventSelect(i, evt, FD_OOB);
+ if (WAIT_OBJECT_0 == WaitForSingleObject(evt, 0)) {
+ FD_SET(i, &aex);
+ }
+ }
+ retval++;
+ }
+
+ WSACloseEvent(evt);
+
+ } else {
+ if (WAIT_OBJECT_0 == WaitForSingleObject(handles[f], 0)) {
+ if (FD_ISSET(i, rfds)) {
+ FD_SET(i, &ard);
+ }
+ if (FD_ISSET(i, wfds)) {
+ FD_SET(i, &awr);
+ }
+ if (FD_ISSET(i, efds)) {
+ FD_SET(i, &aex);
+ }
+ retval++;
+ }
+
+ }
+ f++;
+ }
+ }
+
+ if (rfds) {
+ *rfds = ard;
+ }
+ if (wfds) {
+ *wfds = awr;
+ }
+ if (efds) {
+ *efds = aex;
+ }
+ }
+
+ efree(handles);
+
+ return retval;
+}
+#else
+#define php_select(m, r, w, e, t) select(m, r, w, e, t)
+#endif
+
/* {{{ proto int stream_select(array &read_streams, array &write_streams, array &except_streams, int tv_sec[, int tv_usec])
Runs the select() system call on the sets of streams with a timeout specified by tv_sec and tv_usec */
PHP_FUNCTION(stream_select)
@@ -867,11 +1021,11 @@ PHP_FUNCTION(stream_select)
}
}
- retval = select(max_fd+1, &rfds, &wfds, &efds, tv_p);
+ retval = php_select(max_fd+1, &rfds, &wfds, &efds, tv_p);
if (retval == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to select [%d]: %s",
- errno, strerror(errno));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to select [%d]: %s (max_fd=%d)",
+ errno, strerror(errno), max_fd);
RETURN_FALSE;
}
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c
index d1f37a46dc..bbe6d7debb 100644
--- a/ext/standard/fsock.c
+++ b/ext/standard/fsock.c
@@ -46,7 +46,7 @@
#include <sys/socket.h>
#endif
#ifdef PHP_WIN32
-#include <winsock.h>
+#include <winsock2.h>
#elif defined(NETWARE)
#ifdef NEW_LIBC
#ifdef USE_WINSOCK
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index c68ff5fcf3..a603b464b3 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -32,7 +32,7 @@
#ifdef PHP_WIN32
#include <windows.h>
-#include <winsock.h>
+#include <winsock2.h>
#define O_RDONLY _O_RDONLY
#include "win32/param.h"
#elif defined(NETWARE)
@@ -55,7 +55,7 @@
#endif
#ifdef PHP_WIN32
-#include <winsock.h>
+#include <winsock2.h>
#elif defined(NETWARE) && defined(USE_WINSOCK)
/*#include <ws2nlm.h>*/
#include <novsock2.h>
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 55f9ef26c0..d12c61b5f5 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -36,7 +36,7 @@
#ifdef PHP_WIN32
#include <windows.h>
-#include <winsock.h>
+#include <winsock2.h>
#define O_RDONLY _O_RDONLY
#include "win32/param.h"
#elif defined(NETWARE)
@@ -59,7 +59,7 @@
#endif
#ifdef PHP_WIN32
-#include <winsock.h>
+#include <winsock2.h>
#elif defined(NETWARE) && defined(USE_WINSOCK)
/*#include <ws2nlm.h>*/
#include <novsock2.h>
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index 0002aaeb37..755665d636 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -27,7 +27,7 @@
#include <fcntl.h>
#ifdef PHP_WIN32
#include <windows.h>
-#include <winsock.h>
+#include <winsock2.h>
#define O_RDONLY _O_RDONLY
#include "win32/param.h"
#elif defined(NETWARE)
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 3a2c13e2d8..b04ca107eb 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -36,7 +36,7 @@
#include <fcntl.h>
#ifdef PHP_WIN32
#include <windows.h>
-#include <winsock.h>
+#include <winsock2.h>
#define O_RDONLY _O_RDONLY
#include "win32/param.h"
#else
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index c6781c8ce8..eb91436b3b 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -33,7 +33,7 @@
#ifdef PHP_WIN32
#include <windows.h>
-#include <winsock.h>
+#include <winsock2.h>
#define O_RDONLY _O_RDONLY
#include "win32/param.h"
#elif defined(NETWARE)
@@ -74,7 +74,7 @@
#endif
#ifdef PHP_WIN32
-#include <winsock.h>
+#include <winsock2.h>
#elif defined(NETWARE) && defined(USE_WINSOCK)
/*#include <ws2nlm.h>*/
#include <novsock2.h>
diff --git a/main/mergesort.c b/main/mergesort.c
index 7ee4ee00ef..34da44cf2f 100644
--- a/main/mergesort.c
+++ b/main/mergesort.c
@@ -61,7 +61,7 @@ static char sccsid[] = "@(#)merge.c 8.2 (Berkeley) 2/14/94";
#include "php.h"
#ifdef PHP_WIN32
-#include <winsock.h> /* Includes definition for u_char */
+#include <winsock2.h> /* Includes definition for u_char */
#endif
#if defined(NETWARE) && !defined(NEW_LIBC)
diff --git a/main/network.c b/main/network.c
index 51b46b8f18..50428a8116 100644
--- a/main/network.c
+++ b/main/network.c
@@ -26,7 +26,7 @@
#ifdef PHP_WIN32
#include <windows.h>
-#include <winsock.h>
+#include <winsock2.h>
#define O_RDONLY _O_RDONLY
#include "win32/param.h"
#elif defined(NETWARE)
diff --git a/main/php.h b/main/php.h
index 6cd191453a..d6c220b3e1 100644
--- a/main/php.h
+++ b/main/php.h
@@ -22,6 +22,10 @@
#ifndef PHP_H
#define PHP_H
+#ifdef PHP_WIN32
+#include <winsock2.h>
+#endif
+
#ifdef HAVE_DMALLOC
#include <dmalloc.h>
#endif
diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c
index eff0393eb1..f24ee66e31 100644
--- a/main/php_open_temporary_file.c
+++ b/main/php_open_temporary_file.c
@@ -27,7 +27,7 @@
#ifdef PHP_WIN32
#include <windows.h>
-#include <winsock.h>
+#include <winsock2.h>
#define O_RDONLY _O_RDONLY
#include "win32/param.h"
#include "win32/winutil.h"
diff --git a/main/streams.c b/main/streams.c
index 67e961540b..d746e35996 100755
--- a/main/streams.c
+++ b/main/streams.c
@@ -1332,6 +1332,15 @@ PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode STREAMS_DC
struct stat sb;
self->is_pipe = (fstat(self->fd, &sb) == 0 && S_ISFIFO(sb.st_mode)) ? 1 : 0;
}
+#elif defined(PHP_WIN32)
+ {
+ long handle = _get_osfhandle(self->fd);
+ DWORD in_buf_size, out_buf_size;
+
+ if (handle != 0xFFFFFFFF) {
+ self->is_pipe = GetNamedPipeInfo((HANDLE)handle, NULL, &out_buf_size, &in_buf_size, NULL);
+ }
+ }
#endif
stream = php_stream_alloc_rel(&php_stream_stdio_ops, self, 0, mode);
@@ -1365,6 +1374,15 @@ PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STRE
struct stat sb;
self->is_pipe = (fstat(self->fd, &sb) == 0 && S_ISFIFO(sb.st_mode)) ? 1 : 0;
}
+#elif defined(PHP_WIN32)
+ {
+ long handle = _get_osfhandle(self->fd);
+ DWORD in_buf_size, out_buf_size;
+
+ if (handle != 0xFFFFFFFF) {
+ self->is_pipe = GetNamedPipeInfo((HANDLE)handle, NULL, &out_buf_size, &in_buf_size, NULL);
+ }
+ }
#endif
stream = php_stream_alloc_rel(&php_stream_stdio_ops, self, 0, mode);
diff --git a/run-tests.php b/run-tests.php
index cb68f32653..f393b5fedd 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -520,26 +520,32 @@ function system_with_timeout($commandline)
{
$data = "";
- $proc = proc_open($commandline, array(1 => array('pipe', 'w')), $pipes);
+ $proc = proc_open($commandline, array(
+ 0 => array('pipe', 'r'),
+ 1 => array('pipe', 'w'),
+ 2 => array('pipe', 'w')
+ ), $pipes);
if (!$proc)
return false;
+ fclose($pipes[0]);
+
while (true) {
/* hide errors from interrupted syscalls */
$r = $pipes;
$w = null;
$e = null;
- $n = stream_select($r, $w, $e, 60);
+ $n = @stream_select($r, $w, $e, 60);
if ($n == 0) {
/* timed out */
$data .= "\n ** ERROR: process timed out **\n";
proc_terminate($proc);
return $data;
- } else if ($n) {
- $line = fgets($pipes[1]);
- if ($line === false) {
+ } else if ($n > 0) {
+ $line = fread($pipes[1], 8192);
+ if (strlen($line) == 0) {
/* EOF */
break;
}
diff --git a/win32/php4dllts.dsp b/win32/php4dllts.dsp
index afd2c74bfb..5cec39f174 100644
--- a/win32/php4dllts.dsp
+++ b/win32/php4dllts.dsp
@@ -55,7 +55,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib Urlmon.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /out:"..\Debug_TS\php4ts_debug.dll" /pdbtype:sept /libpath:"..\TSRM\Debug_TS" /libpath:"..\Zend\Debug_TS" /libpath:"..\..\bindlib_w32\Debug" /libpath:"..\ext\mysql\libmysql\Debug_TS" /libpath:"Debug_TS" /libpath:"..\..\zlib\Debug"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib Urlmon.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /out:"..\Debug_TS\php4ts_debug.dll" /pdbtype:sept /libpath:"..\TSRM\Debug_TS" /libpath:"..\Zend\Debug_TS" /libpath:"..\..\bindlib_w32\Debug" /libpath:"..\ext\mysql\libmysql\Debug_TS" /libpath:"Debug_TS" /libpath:"..\..\zlib\Debug"
!ELSEIF "$(CFG)" == "php4dllts - Win32 Release_TS"
@@ -81,7 +81,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib Urlmon.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TS\php4ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\ext\mysql\libmysql\Release_TS" /libpath:"Release_TS" /libpath:"..\..\zlib\Release"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib Urlmon.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TS\php4ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\ext\mysql\libmysql\Release_TS" /libpath:"Release_TS" /libpath:"..\..\zlib\Release"
!ELSEIF "$(CFG)" == "php4dllts - Win32 Release_TS_inline"
@@ -108,7 +108,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"Release_TS/php4ts.dll" /libpath:"TSRM\Release_TS" /libpath:"Zend\Release_TS" /libpath:"..\bindlib_w32\Release"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib Urlmon.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TS_inline\php4ts.dll" /libpath:"..\TSRM\Release_TS_inline" /libpath:"..\Zend\Release_TS_inline" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\ext\mysql\libmysql\Release_TS_inline" /libpath:"Release_TS_Inline" /libpath:"..\..\zlib\Release"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib Urlmon.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TS_inline\php4ts.dll" /libpath:"..\TSRM\Release_TS_inline" /libpath:"..\Zend\Release_TS_inline" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\ext\mysql\libmysql\Release_TS_inline" /libpath:"Release_TS_Inline" /libpath:"..\..\zlib\Release"
!ELSEIF "$(CFG)" == "php4dllts - Win32 Release_TSDbg"
@@ -135,7 +135,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"..\Release_TS\php4ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\ext\mysql\libmysql\Release_TS" /libpath:"Release_TS"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib Urlmon.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TSDbg\php4ts.dll" /libpath:"..\TSRM\Release_TSDbg" /libpath:"..\Zend\Release_TSDbg" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\ext\mysql\libmysql\Release_TSDbg" /libpath:"Release_TSDbg"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib Urlmon.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TSDbg\php4ts.dll" /libpath:"..\TSRM\Release_TSDbg" /libpath:"..\Zend\Release_TSDbg" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\ext\mysql\libmysql\Release_TSDbg" /libpath:"Release_TSDbg"
!ENDIF
diff --git a/win32/sendmail.c b/win32/sendmail.c
index 97a1af9a14..82f8efab5d 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -23,7 +23,7 @@
#include <stdio.h>
#include <stdlib.h>
#ifndef NETWARE
-#include <winsock.h>
+#include <winsock2.h>
#else /* NETWARE */
#include <netware\sendmail_nw.h>
#endif /* NETWARE */
diff --git a/win32/time.h b/win32/time.h
index f0514ebe59..4d6c8a2bc2 100644
--- a/win32/time.h
+++ b/win32/time.h
@@ -13,7 +13,7 @@
#define TIME_H
/* Include stuff ************************************************************ */
-#include <winsock.h>
+#include <winsock2.h>
#include <time.h>
#include <php.h>