New wininet vendor import
Modified: trunk/reactos/include/wine/shlwapi.h
Modified: trunk/reactos/include/wine/winnetwk.h
Added: trunk/reactos/lib/wininet/
Deleted: trunk/reactos/lib/wininet/Makefile.in
Modified: trunk/reactos/lib/wininet/http.c
Modified: trunk/reactos/lib/wininet/internet.c
Modified: trunk/reactos/lib/wininet/netconnection.c
Modified: trunk/reactos/lib/wininet/utility.c
Added: trunk/reactos/lib/wininet/wininet.xml
Modified: trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/w32api/include/wininet.h

Modified: trunk/reactos/include/wine/shlwapi.h
--- trunk/reactos/include/wine/shlwapi.h	2006-01-15 22:22:02 UTC (rev 20908)
+++ trunk/reactos/include/wine/shlwapi.h	2006-01-15 22:25:16 UTC (rev 20909)
@@ -13,6 +13,7 @@
 #define __WINE_SHLWAPI_H
 
 #define URL_FILE_USE_PATHURL 0x00010000
+#define URL_BROWSER_MODE     URL_DONT_ESCAPE_EXTRA_INFO
 
 HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR,DWORD,DWORD,BOOL,struct IStream*,struct IStream**);
 

Modified: trunk/reactos/include/wine/winnetwk.h
--- trunk/reactos/include/wine/winnetwk.h	2006-01-15 22:22:02 UTC (rev 20908)
+++ trunk/reactos/include/wine/winnetwk.h	2006-01-15 22:25:16 UTC (rev 20909)
@@ -24,6 +24,8 @@
 } PASSWORD_CACHE_ENTRY;
 
 typedef BOOL (CALLBACK *ENUMPASSWORDPROC)(PASSWORD_CACHE_ENTRY *, DWORD);
+DWORD WINAPI WNetCachePassword( LPSTR, WORD, LPSTR, WORD, BYTE, WORD );
 UINT WINAPI WNetEnumCachedPasswords( LPSTR, WORD, BYTE, ENUMPASSWORDPROC, DWORD);
+DWORD WINAPI WNetGetCachedPassword( LPSTR, WORD, LPSTR, LPWORD, BYTE );
 
 #endif /* __WINE_WINNETWK_H */

Copied: trunk/reactos/lib/wininet (from rev 20908, vendor/wine/dlls/wininet/current)
Property changes on: trunk/reactos/lib/wininet ___________________________________________________________________ Name: svn:ignore   + GNUmakefile
Deleted: trunk/reactos/lib/wininet/Makefile.in
--- vendor/wine/dlls/wininet/current/Makefile.in	2006-01-15 22:22:02 UTC (rev 20908)
+++ trunk/reactos/lib/wininet/Makefile.in	2006-01-15 22:25:16 UTC (rev 20909)
@@ -1,31 +0,0 @@
-EXTRADEFS = -D_WINX32_
-TOPSRCDIR = @top_srcdir@
-TOPOBJDIR = ../..
-SRCDIR    = @srcdir@
-VPATH     = @srcdir@
-MODULE    = wininet.dll
-IMPORTLIB = libwininet.$(IMPLIBEXT)
-IMPORTS   = mpr shlwapi shell32 user32 advapi32 kernel32 ntdll
-EXTRALIBS = $(LIBUNICODE) @SOCKETLIBS@
-
-C_SRCS = \
-	cookie.c \
-	dialogs.c \
-	ftp.c \
-	gopher.c \
-	http.c \
-	internet.c \
-	netconnection.c \
-	urlcache.c \
-	utility.c \
-	wininet_main.c
-
-RC_SRCS = \
-	rsrc.rc \
-	version.rc
-
-SUBDIRS = tests
-
-@MAKE_DLL_RULES@
-
-### Dependencies:

Modified: trunk/reactos/lib/wininet/http.c
--- vendor/wine/dlls/wininet/current/http.c	2006-01-15 22:22:02 UTC (rev 20908)
+++ trunk/reactos/lib/wininet/http.c	2006-01-15 22:25:16 UTC (rev 20909)
@@ -2524,7 +2524,11 @@
     /*
      * HACK peek at the buffer
      */
+#if 0
+    /* This is Wine code, we don't support MSG_PEEK yet so we have to do it
+       a bit different */
     NETCON_recv(&lpwhr->netConnection, buffer, buflen, MSG_PEEK, &rc);
+#endif
 
     /*
      * We should first receive 'HTTP/1.x nnn OK' where nnn is the status code.
@@ -2533,6 +2537,9 @@
     memset(buffer, 0, MAX_REPLY_LEN);
     if (!NETCON_getNextLine(&lpwhr->netConnection, bufferA, &buflen))
         goto lend;
+#if 1
+    rc = buflen;
+#endif
     MultiByteToWideChar( CP_ACP, 0, bufferA, buflen, buffer, MAX_REPLY_LEN );
 
     /* regenerate raw headers */
@@ -2579,6 +2586,9 @@
         {
             LPWSTR * pFieldAndValue;
 
+#if 1
+            rc += buflen;
+#endif
             TRACE("got line %s, now interpreting\n", debugstr_a(bufferA));
             MultiByteToWideChar( CP_ACP, 0, bufferA, buflen, buffer, MAX_REPLY_LEN );
 

Modified: trunk/reactos/lib/wininet/internet.c
--- vendor/wine/dlls/wininet/current/internet.c	2006-01-15 22:22:02 UTC (rev 20908)
+++ trunk/reactos/lib/wininet/internet.c	2006-01-15 22:25:16 UTC (rev 20909)
@@ -259,15 +259,23 @@
 
 BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 {
+    WSADATA wsaData;
+
     TRACE("%p,%lx,%p\n", hinstDLL, fdwReason, lpvReserved);
 
     switch (fdwReason) {
         case DLL_PROCESS_ATTACH:
 
+            if (0 != WSAStartup(MAKEWORD(1, 1), &wsaData)) {
+                return FALSE;
+            }
+
             g_dwTlsErrIndex = TlsAlloc();
 
-	    if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES)
+	    if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES) {
+                WSACleanup();
 		return FALSE;
+            }
 
 	    hQuitEvent = CreateEventW(0, TRUE, FALSE, NULL);
 	    hWorkEvent = CreateEventW(0, FALSE, FALSE, NULL);
@@ -314,6 +322,7 @@
 	    CloseHandle(hQuitEvent);
 	    CloseHandle(hWorkEvent);
 	    DeleteCriticalSection(&csQueue);
+            WSACleanup();
             break;
     }
 
@@ -2687,10 +2696,10 @@
   /*
    * Build our ping command
    */
-  len = WideCharToMultiByte(CP_UNIXCP, 0, hostW, -1, NULL, 0, NULL, NULL);
+  len = WideCharToMultiByte(CP_THREAD_ACP, 0, hostW, -1, NULL, 0, NULL, NULL);
   command = HeapAlloc( GetProcessHeap(), 0, strlen(ping)+len+strlen(redirect) );
   strcpy(command,ping);
-  WideCharToMultiByte(CP_UNIXCP, 0, hostW, -1, command+strlen(ping), len, NULL, NULL);
+  WideCharToMultiByte(CP_THREAD_ACP, 0, hostW, -1, command+strlen(ping), len, NULL, NULL);
   strcat(command,redirect);
 
   TRACE("Ping command is : %s\n",command);

Modified: trunk/reactos/lib/wininet/netconnection.c
--- vendor/wine/dlls/wininet/current/netconnection.c	2006-01-15 22:22:02 UTC (rev 20908)
+++ trunk/reactos/lib/wininet/netconnection.c	2006-01-15 22:25:16 UTC (rev 20909)
@@ -199,70 +199,6 @@
         return TRUE;
 }
 
-/* translate a unix error code into a winsock one */
-static int sock_get_error( int err )
-{
-    switch (err)
-    {
-        case EINTR:             return WSAEINTR;
-        case EBADF:             return WSAEBADF;
-        case EPERM:
-        case EACCES:            return WSAEACCES;
-        case EFAULT:            return WSAEFAULT;
-        case EINVAL:            return WSAEINVAL;
-        case EMFILE:            return WSAEMFILE;
-        case EWOULDBLOCK:       return WSAEWOULDBLOCK;
-        case EINPROGRESS:       return WSAEINPROGRESS;
-        case EALREADY:          return WSAEALREADY;
-        case ENOTSOCK:          return WSAENOTSOCK;
-        case EDESTADDRREQ:      return WSAEDESTADDRREQ;
-        case EMSGSIZE:          return WSAEMSGSIZE;
-        case EPROTOTYPE:        return WSAEPROTOTYPE;
-        case ENOPROTOOPT:       return WSAENOPROTOOPT;
-        case EPROTONOSUPPORT:   return WSAEPROTONOSUPPORT;
-        case ESOCKTNOSUPPORT:   return WSAESOCKTNOSUPPORT;
-        case EOPNOTSUPP:        return WSAEOPNOTSUPP;
-        case EPFNOSUPPORT:      return WSAEPFNOSUPPORT;
-        case EAFNOSUPPORT:      return WSAEAFNOSUPPORT;
-        case EADDRINUSE:        return WSAEADDRINUSE;
-        case EADDRNOTAVAIL:     return WSAEADDRNOTAVAIL;
-        case ENETDOWN:          return WSAENETDOWN;
-        case ENETUNREACH:       return WSAENETUNREACH;
-        case ENETRESET:         return WSAENETRESET;
-        case ECONNABORTED:      return WSAECONNABORTED;
-        case EPIPE:
-        case ECONNRESET:        return WSAECONNRESET;
-        case ENOBUFS:           return WSAENOBUFS;
-        case EISCONN:           return WSAEISCONN;
-        case ENOTCONN:          return WSAENOTCONN;
-        case ESHUTDOWN:         return WSAESHUTDOWN;
-        case ETOOMANYREFS:      return WSAETOOMANYREFS;
-        case ETIMEDOUT:         return WSAETIMEDOUT;
-        case ECONNREFUSED:      return WSAECONNREFUSED;
-        case ELOOP:             return WSAELOOP;
-        case ENAMETOOLONG:      return WSAENAMETOOLONG;
-        case EHOSTDOWN:         return WSAEHOSTDOWN;
-        case EHOSTUNREACH:      return WSAEHOSTUNREACH;
-        case ENOTEMPTY:         return WSAENOTEMPTY;
-#ifdef EPROCLIM
-        case EPROCLIM:          return WSAEPROCLIM;
-#endif
-#ifdef EUSERS
-        case EUSERS:            return WSAEUSERS;
-#endif
-#ifdef EDQUOT
-        case EDQUOT:            return WSAEDQUOT;
-#endif
-#ifdef ESTALE
-        case ESTALE:            return WSAESTALE;
-#endif
-#ifdef EREMOTE
-        case EREMOTE:           return WSAEREMOTE;
-#endif
-    default: errno=err; perror("sock_set_error"); return WSAEFAULT;
-    }
-}
-
 /******************************************************************************
  * NETCON_create
  * Basically calls 'socket()'
@@ -276,9 +212,9 @@
 #endif
 
     connection->socketFD = socket(domain, type, protocol);
-    if (connection->socketFD == -1)
+    if (INVALID_SOCKET == connection->socketFD)
     {
-        INTERNET_SetLastError(sock_get_error(errno));
+        INTERNET_SetLastError(WSAGetLastError());
         return FALSE;
     }
     return TRUE;
@@ -312,9 +248,9 @@
     result = closesocket(connection->socketFD);
     connection->socketFD = -1;
 
-    if (result == -1)
+    if (0 != result)
     {
-        INTERNET_SetLastError(sock_get_error(errno));
+        INTERNET_SetLastError(WSAGetLastError());
         return FALSE;
     }
     return TRUE;
@@ -390,14 +326,14 @@
          * the moment */
     }
 
-    len = WideCharToMultiByte(CP_UNIXCP, 0, hostname, -1, NULL, 0, NULL, NULL);
+    len = WideCharToMultiByte(CP_THREAD_ACP, 0, hostname, -1, NULL, 0, NULL, NULL);
     hostname_unix = HeapAlloc(GetProcessHeap(), 0, len);
     if (!hostname_unix)
     {
         INTERNET_SetLastError(ERROR_NOT_ENOUGH_MEMORY);
         goto fail;
     }
-    WideCharToMultiByte(CP_UNIXCP, 0, hostname, -1, hostname_unix, len, NULL, NULL);
+    WideCharToMultiByte(CP_THREAD_ACP, 0, hostname, -1, hostname_unix, len, NULL, NULL);
 
     if (!check_hostname(cert, hostname_unix))
     {
@@ -433,10 +369,10 @@
     if (!NETCON_connected(connection)) return FALSE;
 
     result = connect(connection->socketFD, serv_addr, addrlen);
-    if (result == -1)
+    if (SOCKET_ERROR == result)
     {
         WARN("Unable to connect to host (%s)\n", strerror(errno));
-        INTERNET_SetLastError(sock_get_error(errno));
+        INTERNET_SetLastError(WSAGetLastError());
 
         closesocket(connection->socketFD);
         connection->socketFD = -1;
@@ -458,9 +394,9 @@
     if (!connection->useSSL)
     {
 	*sent = send(connection->socketFD, msg, len, flags);
-	if (*sent == -1)
+	if (SOCKET_ERROR == *sent)
 	{
-	    INTERNET_SetLastError(sock_get_error(errno));
+	    INTERNET_SetLastError(WSAGetLastError());
 	    return FALSE;
 	}
         return TRUE;
@@ -492,9 +428,9 @@
     if (!connection->useSSL)
     {
 	*recvd = recv(connection->socketFD, buf, len, flags);
-	if (*recvd == -1)
+	if (SOCKET_ERROR == *recvd)
 	{
-	    INTERNET_SetLastError(sock_get_error(errno));
+	    INTERNET_SetLastError(WSAGetLastError());
 	    return FALSE;
 	}
         return TRUE;
@@ -572,6 +508,7 @@
 	fd_set infd;
 	BOOL bSuccess = FALSE;
 	DWORD nRecv = 0;
+        int r;
 
 	FD_ZERO(&infd);
 	FD_SET(connection->socketFD, &infd);
@@ -582,9 +519,10 @@
 	{
 	    if (select(connection->socketFD+1,&infd,NULL,NULL,&tv) > 0)
 	    {
-		if (recv(connection->socketFD, &lpszBuffer[nRecv], 1, 0) <= 0)
+		r = recv(connection->socketFD, &lpszBuffer[nRecv], 1, 0);
+		if (0 == r || SOCKET_ERROR == r)
 		{
-		    INTERNET_SetLastError(sock_get_error(errno));
+		    INTERNET_SetLastError(WSAGetLastError());
 		    goto lend;
 		}
 

Modified: trunk/reactos/lib/wininet/utility.c
--- vendor/wine/dlls/wininet/current/utility.c	2006-01-15 22:22:02 UTC (rev 20908)
+++ trunk/reactos/lib/wininet/utility.c	2006-01-15 22:25:16 UTC (rev 20909)
@@ -147,9 +147,9 @@
     else
         len = strlenW(lpszServerName);
 
-    sz = WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, NULL, 0, NULL, NULL );
+    sz = WideCharToMultiByte( CP_THREAD_ACP, 0, lpszServerName, len, NULL, 0, NULL, NULL );
     name = HeapAlloc(GetProcessHeap(), 0, sz+1);
-    WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, name, sz, NULL, NULL );
+    WideCharToMultiByte( CP_THREAD_ACP, 0, lpszServerName, len, name, sz, NULL, NULL );
     name[sz] = 0;
     phe = gethostbyname(name);
     HeapFree( GetProcessHeap(), 0, name );

Added: trunk/reactos/lib/wininet/wininet.xml
--- vendor/wine/dlls/wininet/current/wininet.xml	2006-01-15 22:22:02 UTC (rev 20908)
+++ trunk/reactos/lib/wininet/wininet.xml	2006-01-15 22:25:16 UTC (rev 20909)
@@ -0,0 +1,33 @@
+<module name="wininet" type="win32dll" baseaddress="${BASEADDRESS_WININET}" installbase="system32" installname="wininet.dll" allowwarnings="true">
+	<autoregister infsection="OleControlDlls" type="DllInstall" />
+	<importlibrary definition="wininet.spec.def" />
+	<include base="wininet">.</include>
+	<include base="ReactOS">include/wine</include>
+	<define name="__REACTOS__" />
+	<define name="__USE_W32API" />
+	<define name="_WIN32_IE">0x600</define>
+	<define name="_WIN32_WINNT">0x501</define>
+	<define name="WINVER">0x501</define>
+	<library>wine</library>
+	<library>ntdll</library>
+	<library>kernel32</library>
+	<library>user32</library>
+	<library>advapi32</library>
+	<library>shell32</library>
+	<library>shlwapi</library>
+	<library>mpr</library>
+	<library>ws2_32</library>
+	<file>cookie.c</file>
+	<file>dialogs.c</file>
+	<file>ftp.c</file>
+	<file>gopher.c</file>
+	<file>http.c</file>
+	<file>internet.c</file>
+	<file>netconnection.c</file>
+	<file>urlcache.c</file>
+	<file>utility.c</file>
+	<file>wininet_main.c</file>
+	<file>rsrc.rc</file>
+	<file>version.rc</file>
+	<file>wininet.spec</file>
+</module>
Property changes on: trunk/reactos/lib/wininet/wininet.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/reactos/media/doc/README.WINE
--- trunk/reactos/media/doc/README.WINE	2006-01-15 22:22:02 UTC (rev 20908)
+++ trunk/reactos/media/doc/README.WINE	2006-01-15 22:25:16 UTC (rev 20909)
@@ -78,7 +78,7 @@
 reactos/lib/urlmon		# Synced to Wine-0_9_5
 reactos/lib/uxtheme		# Synced to Wine-0_9_5
 reactos/lib/version		# Out of sync
-reactos/lib/wininet		# Out of sync
+reactos/lib/wininet		# Synced to Wine-0_9_5
 reactos/lib/wintrust		# Synced to Wine-0_9_5
 reactos/lib/winmm		# Forked at Wine-20050628
 reactos/lib/winmm/midimap       # Forked at Wine-20050628

Modified: trunk/reactos/w32api/include/wininet.h
--- trunk/reactos/w32api/include/wininet.h	2006-01-15 22:22:02 UTC (rev 20908)
+++ trunk/reactos/w32api/include/wininet.h	2006-01-15 22:25:16 UTC (rev 20909)
@@ -474,11 +474,42 @@
 #define INTERNET_OPTION_HTTP_VERSION            59
 #define INTERNET_OPTION_RESET_URLCACHE_SESSION  60
 #define INTERNET_OPTION_ERROR_MASK              62
+#define INTERNET_OPTION_FROM_CACHE_TIMEOUT      63
+#define INTERNET_OPTION_BYPASS_EDITED_ENTRY     64
+#define INTERNET_OPTION_DIAGNOSTIC_SOCKET_INFO  67
 #define INTERNET_OPTION_CODEPAGE                68
+#define INTERNET_OPTION_CACHE_TIMESTAMPS        69
+#define INTERNET_OPTION_DISABLE_AUTODIAL        70
+#define INTERNET_OPTION_MAX_CONNS_PER_SERVER    73
+#define INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER 74
+#define INTERNET_OPTION_PER_CONNECTION_OPTION   75
+#define INTERNET_OPTION_DIGEST_AUTH_UNLOAD      76
+#define INTERNET_OPTION_IGNORE_OFFLINE          77
+#define INTERNET_OPTION_IDENTITY                78
+#define INTERNET_OPTION_REMOVE_IDENTITY         79
+#define INTERNET_OPTION_ALTER_IDENTITY          80
+#define INTERNET_OPTION_SUPPRESS_BEHAVIOR       81
+#define INTERNET_OPTION_AUTODIAL_MODE           82
+#define INTERNET_OPTION_AUTODIAL_CONNECTION     83
+#define INTERNET_OPTION_CLIENT_CERT_CONTEXT     84
+#define INTERNET_OPTION_AUTH_FLAGS              85
 #define INTERNET_OPTION_COOKIES_3RD_PARTY       86
+#define INTERNET_OPTION_COOKIES_3RD_PARTY       86
+#define INTERNET_OPTION_DISABLE_PASSPORT_AUTH   87
+#define INTERNET_OPTION_SEND_UTF8_SERVERNAME_TO_PROXY 88
+#define INTERNET_OPTION_EXEMPT_CONNECTION_LIMIT 89
+#define INTERNET_OPTION_ENABLE_PASSPORT_AUTH    90
+
+#define INTERNET_OPTION_HIBERNATE_INACTIVE_WORKER_THREADS 91
+#define INTERNET_OPTION_ACTIVATE_WORKER_THREADS           92
+#define INTERNET_OPTION_RESTORE_WORKER_THREAD_DEFAULTS    93
+#define INTERNET_OPTION_SOCKET_SEND_BUFFER_LENGTH         94
+
 #define INTERNET_OPTION_PROXY_SETTINGS_CHANGED  95
+#define INTERNET_OPTION_DATAFILE_EXT            96
+
 #define INTERNET_FIRST_OPTION                   INTERNET_OPTION_CALLBACK
-#define INTERNET_LAST_OPTION                    INTERNET_OPTION_PROXY_SETTINGS_CHANGED
+#define INTERNET_LAST_OPTION                    INTERNET_OPTION_DATAFILE_EXT
 
 #define INTERNET_PRIORITY_FOREGROUND            1000
 #define INTERNET_HANDLE_TYPE_INTERNET           1