Author: tfaber
Date: Wed Jun 20 12:24:12 2012
New Revision: 56758
URL:
http://svn.reactos.org/svn/reactos?rev=56758&view=rev
Log:
[WININET][PSDK]
- Better mark ROS-specific changes
- Make wininet_ros.diff sensible
- Update wininet.h
See issue #7117 for more details.
Modified:
trunk/reactos/dll/win32/wininet/http.c
trunk/reactos/dll/win32/wininet/internet.c
trunk/reactos/dll/win32/wininet/internet.h
trunk/reactos/dll/win32/wininet/netconnection.c
trunk/reactos/dll/win32/wininet/urlcache.c
trunk/reactos/dll/win32/wininet/wininet_ros.diff
trunk/reactos/include/psdk/wininet.h
Modified: trunk/reactos/dll/win32/wininet/http.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/http.c?r…
==============================================================================
--- trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] Wed Jun 20 12:24:12 2012
@@ -71,6 +71,7 @@
#include "wine/exception.h"
#include "wine/unicode.h"
+// ReactOS
#include "inet_ntop.c"
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
Modified: trunk/reactos/dll/win32/wininet/internet.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
==============================================================================
--- trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] Wed Jun 20 12:24:12 2012
@@ -291,6 +291,10 @@
if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES)
return FALSE;
+
+#ifndef __REACTOS__
+ URLCacheContainers_CreateDefaults();
+#endif
WININET_hModule = hinstDLL;
@@ -3595,6 +3599,7 @@
LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen)
{
+ // ReactOS: use select instead of poll
fd_set infd;
struct timeval tv;
BOOL bSuccess = FALSE;
Modified: trunk/reactos/dll/win32/wininet/internet.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
==============================================================================
--- trunk/reactos/dll/win32/wininet/internet.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wininet/internet.h [iso-8859-1] Wed Jun 20 12:24:12 2012
@@ -528,7 +528,11 @@
LPCVOID NETCON_GetCert(netconn_t *connection) DECLSPEC_HIDDEN;
int NETCON_GetCipherStrength(netconn_t*) DECLSPEC_HIDDEN;
DWORD NETCON_set_timeout(netconn_t *connection, BOOL send, int value) DECLSPEC_HIDDEN;
+#ifndef __REACTOS__
+int sock_get_error(int) DECLSPEC_HIDDEN;
+#else
#define sock_get_error(x) WSAGetLastError()
+#endif
extern void URLCacheContainers_CreateDefaults(void) DECLSPEC_HIDDEN;
extern void URLCacheContainers_DeleteAll(void) DECLSPEC_HIDDEN;
Modified: trunk/reactos/dll/win32/wininet/netconnection.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/netconne…
==============================================================================
--- trunk/reactos/dll/win32/wininet/netconnection.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wininet/netconnection.c [iso-8859-1] Wed Jun 20 12:24:12 2012
@@ -587,7 +587,7 @@
#endif
}
-#if 0
+#ifndef __REACTOS__
/* translate a unix error code into a winsock one */
int sock_get_error( int err )
{
Modified: trunk/reactos/dll/win32/wininet/urlcache.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/urlcache…
==============================================================================
--- trunk/reactos/dll/win32/wininet/urlcache.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wininet/urlcache.c [iso-8859-1] Wed Jun 20 12:24:12 2012
@@ -182,6 +182,7 @@
/* List of all containers available */
static struct list UrlContainers = LIST_INIT(UrlContainers);
+// ReactOS r54992
BOOL bDefaultContainersAdded = FALSE;
static DWORD URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_ENTRY
*pPrevHash, HASH_CACHEFILE_ENTRY **ppHash);
@@ -519,6 +520,7 @@
static const WCHAR HistoryPrefix[] =
{'V','i','s','i','t','e','d',':',0};
static const WCHAR CookieSuffix[] = {0};
static const WCHAR CookiePrefix[] =
{'C','o','o','k','i','e',':',0};
+ // ReactOS r50916
static const WCHAR UserProfile[] =
{'U','S','E','R','P','R','O','F','I','L','E',0};
static const struct
{
@@ -533,6 +535,7 @@
};
DWORD i;
+ // ReactOS r50916
if (GetEnvironmentVariableW(UserProfile, NULL, 0) == 0 && GetLastError() ==
ERROR_ENVVAR_NOT_FOUND)
{
TRACE("Environment variable 'USERPROFILE' does not exist!\n");
@@ -592,6 +595,7 @@
if(!lpwszUrl)
return ERROR_INVALID_PARAMETER;
+ // ReactOS r54992
if (!bDefaultContainersAdded)
URLCacheContainers_CreateDefaults();
@@ -633,6 +637,7 @@
if (lpwszSearchPattern && dwIndex > 0)
return FALSE;
+ // ReactOS r54992
if (!bDefaultContainersAdded)
URLCacheContainers_CreateDefaults();
@@ -1539,6 +1544,7 @@
return FALSE;
}
+ // ReactOS r54992
if (!bDefaultContainersAdded)
URLCacheContainers_CreateDefaults();
Modified: trunk/reactos/dll/win32/wininet/wininet_ros.diff
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/wininet_…
==============================================================================
--- trunk/reactos/dll/win32/wininet/wininet_ros.diff [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wininet/wininet_ros.diff [iso-8859-1] Wed Jun 20 12:24:12
2012
@@ -1,59 +1,53 @@
---- wine-1.3.4/dlls/wininet/internet.h 2010-10-01 14:46:44.000000000 -0400
-+++ dll/win32/wininet/internet.h 2010-10-09 15:34:13.000000000 -0400
-@@ -462,7 +462,7 @@
- LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection);
- int NETCON_GetCipherStrength(WININET_NETCONNECTION *connection);
- DWORD NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value);
--int sock_get_error(int);
+--- wine-1.3.21/dlls/wininet/internet.h 2012-06-20 13:23:07 +0200
++++ dll/win32/wininet/internet.h 2012-06-20 13:58:16 +0200
+@@ -528,7 +528,11 @@ BOOL NETCON_is_alive(netconn_t*) DECLSPE
+ LPCVOID NETCON_GetCert(netconn_t *connection) DECLSPEC_HIDDEN;
+ int NETCON_GetCipherStrength(netconn_t*) DECLSPEC_HIDDEN;
+ DWORD NETCON_set_timeout(netconn_t *connection, BOOL send, int value) DECLSPEC_HIDDEN;
++#ifndef __REACTOS__
+ int sock_get_error(int) DECLSPEC_HIDDEN;
++#else
+#define sock_get_error(x) WSAGetLastError()
-
- extern void URLCacheContainers_CreateDefaults(void);
- extern void URLCacheContainers_DeleteAll(void);
---- wine-1.3.4/dlls/wininet/http.c 2010-10-01 14:46:44.000000000 -0400
-+++ dll/win32/wininet/http.c 2010-10-09 15:28:29.000000000 -0400
-@@ -69,6 +69,8 @@
- #include "wine/exception.h"
- #include "wine/unicode.h"
-
-+#include "inet_ntop.c"
-+
- WINE_DEFAULT_DEBUG_CHANNEL(wininet);
-
- static const WCHAR g_szHttp1_0[] =
{'H','T','T','P','/','1','.','0',0};
---- wine-1.3.4/dlls/wininet/netconnection.c 2010-10-01 14:46:44.000000000 -0400
-+++ dll/win32/wininet/netconnection.c 2010-10-09 15:33:53.000000000 -0400
-@@ -547,6 +547,7 @@
- return TRUE;
++#endif
+
+ extern void URLCacheContainers_CreateDefaults(void) DECLSPEC_HIDDEN;
+ extern void URLCacheContainers_DeleteAll(void) DECLSPEC_HIDDEN;
+--- wine-1.3.21/dlls/wininet/netconnection.c 2012-06-20 13:23:07 +0200
++++ dll/win32/wininet/netconnection.c 2012-06-20 13:40:10 +0200
+@@ -587,6 +587,7 @@ void NETCON_unload(void)
+ #endif
}
-+#if 0
++#ifndef __REACTOS__
/* translate a unix error code into a winsock one */
int sock_get_error( int err )
{
-@@ -613,6 +614,7 @@
+@@ -653,6 +654,7 @@ int sock_get_error( int err )
#endif
return err;
}
+#endif
/******************************************************************************
- * NETCON_create
---- wine-1.3.4/dlls/wininet/internet.c 2010-10-01 14:46:44.000000000 -0400
-+++ dll/win32/wininet/internet.c 2010-10-09 15:33:04.000000000 -0400
-@@ -292,8 +292,6 @@
+ * NETCON_secure_connect
+--- wine-1.3.21/dlls/wininet/internet.c 2012-06-20 13:23:07 +0200
++++ dll/win32/wininet/internet.c 2012-06-20 13:39:47 +0200
+@@ -292,7 +292,9 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL,
if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES)
return FALSE;
-- URLCacheContainers_CreateDefaults();
--
++#ifndef __REACTOS__
+ URLCacheContainers_CreateDefaults();
++#endif
+
WININET_hModule = hinstDLL;
- case DLL_THREAD_ATTACH:
-@@ -3569,19 +3567,22 @@
+@@ -3597,19 +3599,23 @@ LPSTR INTERNET_GetResponseBuffer(void)
LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen)
{
- struct pollfd pfd;
++ // ReactOS: use select instead of poll
+ fd_set infd;
+ struct timeval tv;
BOOL bSuccess = FALSE;
@@ -78,28 +72,31 @@
{
Index: dll/win32/wininet/urlcache.c
===================================================================
---- dll/win32/wininet/urlcache.c (revision 50814)
-+++ dll/win32/wininet/urlcache.c (working copy)
-@@ -182,6 +182,7 @@
+--- wine-1.3.21/dlls/wininet/urlcache.c 2012-06-20 13:23:07 +0200
++++ dll/win32/wininet/urlcache.c 2012-06-20 13:41:43 +0200
+@@ -182,6 +182,8 @@ typedef struct _URLCACHECONTAINER
/* List of all containers available */
static struct list UrlContainers = LIST_INIT(UrlContainers);
++// ReactOS r54992
+BOOL bDefaultContainersAdded = FALSE;
static DWORD URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_ENTRY
*pPrevHash, HASH_CACHEFILE_ENTRY **ppHash);
-@@ -527,6 +528,7 @@
+@@ -518,6 +520,8 @@ void URLCacheContainers_CreateDefaults(v
static const WCHAR HistoryPrefix[] =
{'V','i','s','i','t','e','d',':',0};
static const WCHAR CookieSuffix[] = {0};
static const WCHAR CookiePrefix[] =
{'C','o','o','k','i','e',':',0};
++ // ReactOS r50916
+ static const WCHAR UserProfile[] =
{'U','S','E','R','P','R','O','F','I','L','E',0};
static const struct
{
int nFolder; /* CSIDL_* constant */
-@@ -540,6 +542,12 @@
+@@ -531,6 +535,13 @@ void URLCacheContainers_CreateDefaults(v
};
DWORD i;
++ // ReactOS r50916
+ if (GetEnvironmentVariableW(UserProfile, NULL, 0) == 0 && GetLastError() ==
ERROR_ENVVAR_NOT_FOUND)
+ {
+ TRACE("Environment variable 'USERPROFILE' does not
exist!\n");
@@ -109,30 +106,33 @@
for (i = 0; i < sizeof(DefaultContainerData) / sizeof(DefaultContainerData[0]);
i++)
{
WCHAR wszCachePath[MAX_PATH];
-@@ -584,6 +592,9 @@
+@@ -584,6 +595,10 @@ static DWORD URLCacheContainers_FindCont
if(!lpwszUrl)
return ERROR_INVALID_PARAMETER;
++ // ReactOS r54992
+ if (!bDefaultContainersAdded)
+ URLCacheContainers_CreateDefaults();
+
LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
{
int prefix_len = strlenW(pContainer->cache_prefix);
-@@ -622,6 +633,9 @@
+@@ -622,6 +637,10 @@ static BOOL URLCacheContainers_Enum(LPCW
if (lpwszSearchPattern && dwIndex > 0)
return FALSE;
++ // ReactOS r54992
+ if (!bDefaultContainersAdded)
+ URLCacheContainers_CreateDefaults();
+
LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
{
if (lpwszSearchPattern)
-@@ -1525,6 +1539,9 @@
+@@ -1525,6 +1544,10 @@ BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR l
return FALSE;
}
++ // ReactOS r54992
+ if (!bDefaultContainersAdded)
+ URLCacheContainers_CreateDefaults();
+
@@ -141,15 +141,26 @@
/* The URL cache has prefix L"" (unlike Cookies and History) */
Index: dll/win32/wininet/http.c
===================================================================
---- dll/win32/wininet/http.c (revision 54234)
-+++ dll/win32/wininet/http.c (working copy)
-@@ -245,8 +245,17 @@
+--- wine-1.3.21/dlls/wininet/http.c 2012-06-20 13:37:39 +0200
++++ dll/win32/wininet/http.c 2012-06-20 13:52:44 +0200
+@@ -71,6 +71,9 @@
+ #include "wine/exception.h"
+ #include "wine/unicode.h"
+
++// ReactOS
++#include "inet_ntop.c"
++
+ WINE_DEFAULT_DEBUG_CHANNEL(wininet);
+
+ static const WCHAR g_szHttp1_0[] =
{'H','T','T','P','/','1','.','0',0};
+@@ -243,8 +246,17 @@ void server_release(server_t *server)
if(InterlockedDecrement(&server->ref))
return;
+#ifndef __REACTOS__
if(!server->ref)
- server->keep_until = (DWORD64)GetTickCount() + COLLECT_TIME;
+- server->keep_until = GetTickCount64() + COLLECT_TIME;
++ server->keep_until = (DWORD64)GetTickCount() + COLLECT_TIME;
+#else
+ EnterCriticalSection(&connection_pool_cs);
+ list_remove(&server->entry);
@@ -161,7 +172,16 @@
}
static server_t *get_server(const WCHAR *name, INTERNET_PORT port)
-@@ -1861,6 +1870,7 @@
+@@ -290,7 +302,7 @@ BOOL collect_connections(BOOL collect_al
+ BOOL remaining = FALSE;
+ DWORD64 now;
+
+- now = GetTickCount64();
++ now = GetTickCount();
+
+ LIST_FOR_EACH_ENTRY_SAFE(server, server_safe, &connection_pool, server_t, entry)
{
+ LIST_FOR_EACH_ENTRY_SAFE(netconn, netconn_safe, &server->conn_pool,
netconn_t, pool_entry) {
+@@ -1859,13 +1871,14 @@ static void http_release_netconn(http_re
if(!req->netconn)
return;
@@ -169,7 +189,15 @@
if(reuse && req->netconn->keep_alive) {
BOOL run_collector;
-@@ -1893,6 +1903,7 @@
+ EnterCriticalSection(&connection_pool_cs);
+
+ list_add_head(&req->netconn->server->conn_pool,
&req->netconn->pool_entry);
+- req->netconn->keep_until = GetTickCount64() + COLLECT_TIME;
++ req->netconn->keep_until = (DWORD64)GetTickCount() + COLLECT_TIME;
+ req->netconn = NULL;
+
+ run_collector = !collector_running;
+@@ -1893,6 +1906,7 @@ static void http_release_netconn(http_re
}
return;
}
Modified: trunk/reactos/include/psdk/wininet.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wininet.h?rev…
==============================================================================
--- trunk/reactos/include/psdk/wininet.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/wininet.h [iso-8859-1] Wed Jun 20 12:24:12 2012
@@ -687,7 +687,7 @@
#define INTERNET_STATE_IDLE 0x00000100
#define INTERNET_STATE_BUSY 0x00000200
-#define INTERNET_INVALID_STATUS_CALLBACK ((INTERNET_STATUS_CALLBACK)(-1L))
+#define INTERNET_INVALID_STATUS_CALLBACK ((INTERNET_STATUS_CALLBACK)(-1))
#define FTP_TRANSFER_TYPE_UNKNOWN 0x00000000
#define FTP_TRANSFER_TYPE_ASCII 0x00000001
@@ -1496,6 +1496,7 @@
#define EDITED_CACHE_ENTRY 0x00000008
#define COOKIE_CACHE_ENTRY 0x00100000
#define URLHISTORY_CACHE_ENTRY 0x00200000
+#define DELETED_CACHE_ENTRY 0x00400000
#define TRACK_OFFLINE_CACHE_ENTRY 0x00000010
#define TRACK_ONLINE_CACHE_ENTRY 0x00000020
#define SPARSE_CACHE_ENTRY 0x00010000