mirror of
https://github.com/reactos/reactos.git
synced 2025-06-05 17:30:32 +00:00
[WININET][PSDK]
- Better mark ROS-specific changes - Make wininet_ros.diff sensible - Update wininet.h See issue #7117 for more details. svn path=/trunk/; revision=56758
This commit is contained in:
parent
f0c893c3f6
commit
cbe36a0d88
7 changed files with 95 additions and 50 deletions
|
@ -71,6 +71,7 @@
|
|||
#include "wine/exception.h"
|
||||
#include "wine/unicode.h"
|
||||
|
||||
// ReactOS
|
||||
#include "inet_ntop.c"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
|
||||
|
|
|
@ -292,6 +292,10 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES)
|
||||
return FALSE;
|
||||
|
||||
#ifndef __REACTOS__
|
||||
URLCacheContainers_CreateDefaults();
|
||||
#endif
|
||||
|
||||
WININET_hModule = hinstDLL;
|
||||
|
||||
case DLL_THREAD_ATTACH:
|
||||
|
@ -3595,6 +3599,7 @@ LPSTR INTERNET_GetResponseBuffer(void)
|
|||
|
||||
LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen)
|
||||
{
|
||||
// ReactOS: use select instead of poll
|
||||
fd_set infd;
|
||||
struct timeval tv;
|
||||
BOOL bSuccess = FALSE;
|
||||
|
|
|
@ -528,7 +528,11 @@ BOOL NETCON_is_alive(netconn_t*) DECLSPEC_HIDDEN;
|
|||
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;
|
||||
|
|
|
@ -587,7 +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 )
|
||||
{
|
||||
|
|
|
@ -182,6 +182,7 @@ 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);
|
||||
|
@ -519,6 +520,7 @@ void URLCacheContainers_CreateDefaults(void)
|
|||
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 @@ void URLCacheContainers_CreateDefaults(void)
|
|||
};
|
||||
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 @@ static DWORD URLCacheContainers_FindContainerW(LPCWSTR lpwszUrl, URLCACHECONTAIN
|
|||
if(!lpwszUrl)
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
// ReactOS r54992
|
||||
if (!bDefaultContainersAdded)
|
||||
URLCacheContainers_CreateDefaults();
|
||||
|
||||
|
@ -633,6 +637,7 @@ static BOOL URLCacheContainers_Enum(LPCWSTR lpwszSearchPattern, DWORD dwIndex, U
|
|||
if (lpwszSearchPattern && dwIndex > 0)
|
||||
return FALSE;
|
||||
|
||||
// ReactOS r54992
|
||||
if (!bDefaultContainersAdded)
|
||||
URLCacheContainers_CreateDefaults();
|
||||
|
||||
|
@ -1539,6 +1544,7 @@ BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR lpszCachePath, DWORD dwSize, DWORD dwSize
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
// ReactOS r54992
|
||||
if (!bDefaultContainersAdded)
|
||||
URLCacheContainers_CreateDefaults();
|
||||
|
||||
|
|
|
@ -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()
|
||||
+#endif
|
||||
|
||||
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;
|
||||
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 @@ Index: dll/win32/wininet/urlcache.c
|
|||
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 @@ Index: dll/win32/wininet/urlcache.c
|
|||
/* 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 @@ Index: dll/win32/wininet/http.c
|
|||
}
|
||||
|
||||
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 @@ Index: dll/win32/wininet/http.c
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -687,7 +687,7 @@ INTERNETAPI INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackW(HINTERNET
|
|||
#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 @@ INTERNETAPI DWORD WINAPI PrivacyGetZonePreferenceW(DWORD,DWORD,LPDWORD,LPWSTR,LP
|
|||
#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
|
||||
|
|
Loading…
Reference in a new issue