1*c2c66affSColin Finckdiff -pudN e:\wine\dlls\wininet/http.c e:\reactos\dll\win32\wininet/http.c 2*c2c66affSColin Finck--- e:\wine\dlls\wininet/http.c 2016-11-16 17:36:38 +0100 3*c2c66affSColin Finck+++ e:\reactos\dll\win32\wininet/http.c 2016-11-17 00:15:58 +0100 4*c2c66affSColin Finck@@ -118,6 +118,7 @@ static const WCHAR emptyW[] = {0}; 5*c2c66affSColin Finck 6*c2c66affSColin Finck #define COLLECT_TIME 60000 7*c2c66affSColin Finck 8*c2c66affSColin Finck+#undef ARRAYSIZE 9*c2c66affSColin Finck #define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0])) 10*c2c66affSColin Finck 11*c2c66affSColin Finck struct HttpAuthInfo 12*c2c66affSColin Finck@@ -203,7 +204,13 @@ void server_release(server_t *server) 13*c2c66affSColin Finck if(InterlockedDecrement(&server->ref)) 14*c2c66affSColin Finck return; 15*c2c66affSColin Finck 16*c2c66affSColin Finck+#ifdef __REACTOS__ 17*c2c66affSColin Finck+ EnterCriticalSection(&connection_pool_cs); 18*c2c66affSColin Finck+#endif 19*c2c66affSColin Finck list_remove(&server->entry); 20*c2c66affSColin Finck+#ifdef __REACTOS__ 21*c2c66affSColin Finck+ LeaveCriticalSection(&connection_pool_cs); 22*c2c66affSColin Finck+#endif 23*c2c66affSColin Finck 24*c2c66affSColin Finck if(server->cert_chain) 25*c2c66affSColin Finck CertFreeCertificateChain(server->cert_chain); 26*c2c66affSColin Finck@@ -286,7 +293,11 @@ BOOL collect_connections(collect_type_t 27*c2c66affSColin Finck BOOL remaining = FALSE; 28*c2c66affSColin Finck DWORD64 now; 29*c2c66affSColin Finck 30*c2c66affSColin Finck+#ifdef __REACTOS__ 31*c2c66affSColin Finck+ now = GetTickCount(); 32*c2c66affSColin Finck+#else 33*c2c66affSColin Finck now = GetTickCount64(); 34*c2c66affSColin Finck+#endif 35*c2c66affSColin Finck 36*c2c66affSColin Finck LIST_FOR_EACH_ENTRY_SAFE(server, server_safe, &connection_pool, server_t, entry) { 37*c2c66affSColin Finck LIST_FOR_EACH_ENTRY_SAFE(netconn, netconn_safe, &server->conn_pool, netconn_t, pool_entry) { 38*c2c66affSColin Finck@@ -1933,13 +1944,14 @@ static void http_release_netconn(http_re 39*c2c66affSColin Finck if(!is_valid_netconn(req->netconn)) 40*c2c66affSColin Finck return; 41*c2c66affSColin Finck 42*c2c66affSColin Finck+#ifndef __REACTOS__ 43*c2c66affSColin Finck if(reuse && req->netconn->keep_alive) { 44*c2c66affSColin Finck BOOL run_collector; 45*c2c66affSColin Finck 46*c2c66affSColin Finck EnterCriticalSection(&connection_pool_cs); 47*c2c66affSColin Finck 48*c2c66affSColin Finck list_add_head(&req->netconn->server->conn_pool, &req->netconn->pool_entry); 49*c2c66affSColin Finck- req->netconn->keep_until = GetTickCount64() + COLLECT_TIME; 50*c2c66affSColin Finck+ req->netconn->keep_until = (DWORD64)GetTickCount() + COLLECT_TIME; 51*c2c66affSColin Finck req->netconn = NULL; 52*c2c66affSColin Finck 53*c2c66affSColin Finck run_collector = !collector_running; 54*c2c66affSColin Finck@@ -1967,6 +1979,10 @@ static void http_release_netconn(http_re 55*c2c66affSColin Finck } 56*c2c66affSColin Finck return; 57*c2c66affSColin Finck } 58*c2c66affSColin Finck+#else 59*c2c66affSColin Finck+ /* Silence unused function warning */ 60*c2c66affSColin Finck+ (void)collect_connections_proc; 61*c2c66affSColin Finck+#endif 62*c2c66affSColin Finck 63*c2c66affSColin Finck INTERNET_SendCallback(&req->hdr, req->hdr.dwContext, 64*c2c66affSColin Finck INTERNET_STATUS_CLOSING_CONNECTION, 0, 0); 65*c2c66affSColin Finckdiff -pudN e:\wine\dlls\wininet/internet.c e:\reactos\dll\win32\wininet/internet.c 66*c2c66affSColin Finck--- e:\wine\dlls\wininet/internet.c 2016-11-16 17:36:38 +0100 67*c2c66affSColin Finck+++ e:\reactos\dll\win32\wininet/internet.c 2016-08-15 17:12:14 +0100 68*c2c66affSColin Finck@@ -963,6 +963,9 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR l 69*c2c66affSColin Finck { 70*c2c66affSColin Finck appinfo_t *lpwai = NULL; 71*c2c66affSColin Finck 72*c2c66affSColin Finck+#ifdef __REACTOS__ 73*c2c66affSColin Finck+ init_winsock(); 74*c2c66affSColin Finck+#endif 75*c2c66affSColin Finck if (TRACE_ON(wininet)) { 76*c2c66affSColin Finck #define FE(x) { x, #x } 77*c2c66affSColin Finck static const wininet_flag_info access_type[] = { 78*c2c66affSColin Finck 79*c2c66affSColin Finckdiff -pudN e:\wine\dlls\wininet/netconnection.c e:\reactos\dll\win32\wininet/netconnection.c 80*c2c66affSColin Finck--- e:\wine\dlls\wininet/netconnection.c 2016-11-16 17:36:38 +0100 81*c2c66affSColin Finck+++ e:\reactos\dll\win32\wininet/netconnection.c 2016-10-13 11:15:37 +0100 82*c2c66affSColin Finck@@ -259,7 +259,7 @@ static BOOL WINAPI winsock_startup(INIT_ 83*c2c66affSColin Finck WSADATA wsa_data; 84*c2c66affSColin Finck DWORD res; 85*c2c66affSColin Finck 86*c2c66affSColin Finck- res = WSAStartup(MAKEWORD(1,1), &wsa_data); 87*c2c66affSColin Finck+ res = WSAStartup(MAKEWORD(2,2), &wsa_data); 88*c2c66affSColin Finck if(res == ERROR_SUCCESS) 89*c2c66affSColin Finck winsock_loaded = TRUE; 90*c2c66affSColin Finck else 91*c2c66affSColin Finckdiff -pudN e:\wine\dlls\wininet/urlcache.c e:\reactos\dll\win32\wininet/urlcache.c 92*c2c66affSColin Finck--- e:\wine\dlls\wininet/urlcache.c 2016-11-16 17:36:38 +0100 93*c2c66affSColin Finck+++ e:\reactos\dll\win32\wininet/urlcache.c 2016-11-17 00:16:23 +0100 94*c2c66affSColin Finck@@ -179,6 +179,8 @@ typedef struct 95*c2c66affSColin Finck 96*c2c66affSColin Finck /* List of all containers available */ 97*c2c66affSColin Finck static struct list UrlContainers = LIST_INIT(UrlContainers); 98*c2c66affSColin Finck+/* ReactOS r54992 */ 99*c2c66affSColin Finck+BOOL bDefaultContainersAdded = FALSE; 100*c2c66affSColin Finck 101*c2c66affSColin Finck static inline char *heap_strdupWtoUTF8(LPCWSTR str) 102*c2c66affSColin Finck { 103*c2c66affSColin Finck@@ -729,6 +731,8 @@ static void cache_containers_init(void) 104*c2c66affSColin Finck static const WCHAR UrlSuffix[] = {'C','o','n','t','e','n','t','.','I','E','5',0}; 105*c2c66affSColin Finck static const WCHAR HistorySuffix[] = {'H','i','s','t','o','r','y','.','I','E','5',0}; 106*c2c66affSColin Finck static const WCHAR CookieSuffix[] = {0}; 107*c2c66affSColin Finck+ /* ReactOS r50916 */ 108*c2c66affSColin Finck+ static const WCHAR UserProfile[] = {'U','S','E','R','P','R','O','F','I','L','E',0}; 109*c2c66affSColin Finck static const struct 110*c2c66affSColin Finck { 111*c2c66affSColin Finck int nFolder; /* CSIDL_* constant */ 112*c2c66affSColin Finck@@ -743,6 +747,13 @@ static void cache_containers_init(void) 113*c2c66affSColin Finck }; 114*c2c66affSColin Finck DWORD i; 115*c2c66affSColin Finck 116*c2c66affSColin Finck+ /* ReactOS r50916 */ 117*c2c66affSColin Finck+ if (GetEnvironmentVariableW(UserProfile, NULL, 0) == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND) 118*c2c66affSColin Finck+ { 119*c2c66affSColin Finck+ ERR("Environment variable 'USERPROFILE' does not exist!\n"); 120*c2c66affSColin Finck+ return; 121*c2c66affSColin Finck+ } 122*c2c66affSColin Finck+ 123*c2c66affSColin Finck for (i = 0; i < sizeof(DefaultContainerData) / sizeof(DefaultContainerData[0]); i++) 124*c2c66affSColin Finck { 125*c2c66affSColin Finck WCHAR wszCachePath[MAX_PATH]; 126*c2c66affSColin Finck@@ -793,6 +804,10 @@ static void cache_containers_init(void) 127*c2c66affSColin Finck cache_containers_add(DefaultContainerData[i].cache_prefix, wszCachePath, 128*c2c66affSColin Finck DefaultContainerData[i].default_entry_type, wszMutexName); 129*c2c66affSColin Finck } 130*c2c66affSColin Finck+ 131*c2c66affSColin Finck+#ifdef __REACTOS__ 132*c2c66affSColin Finck+ bDefaultContainersAdded = TRUE; 133*c2c66affSColin Finck+#endif 134*c2c66affSColin Finck } 135*c2c66affSColin Finck 136*c2c66affSColin Finck static void cache_containers_free(void) 137*c2c66affSColin Finck@@ -812,6 +827,12 @@ static DWORD cache_containers_find(const 138*c2c66affSColin Finck if(!url) 139*c2c66affSColin Finck return ERROR_INVALID_PARAMETER; 140*c2c66affSColin Finck 141*c2c66affSColin Finck+#ifdef __REACTOS__ 142*c2c66affSColin Finck+ /* ReactOS r54992 */ 143*c2c66affSColin Finck+ if (!bDefaultContainersAdded) 144*c2c66affSColin Finck+ cache_containers_init(); 145*c2c66affSColin Finck+#endif 146*c2c66affSColin Finck+ 147*c2c66affSColin Finck LIST_FOR_EACH_ENTRY(container, &UrlContainers, cache_container, entry) 148*c2c66affSColin Finck { 149*c2c66affSColin Finck int prefix_len = strlen(container->cache_prefix); 150*c2c66affSColin Finck@@ -838,6 +859,12 @@ static BOOL cache_containers_enum(char * 151*c2c66affSColin Finck if (search_pattern && index > 0) 152*c2c66affSColin Finck return FALSE; 153*c2c66affSColin Finck 154*c2c66affSColin Finck+#ifdef __REACTOS__ 155*c2c66affSColin Finck+ /* ReactOS r54992 */ 156*c2c66affSColin Finck+ if (!bDefaultContainersAdded) 157*c2c66affSColin Finck+ cache_containers_init(); 158*c2c66affSColin Finck+#endif 159*c2c66affSColin Finck+ 160*c2c66affSColin Finck LIST_FOR_EACH_ENTRY(container, &UrlContainers, cache_container, entry) 161*c2c66affSColin Finck { 162*c2c66affSColin Finck if (search_pattern) 163*c2c66affSColin Finck@@ -3995,7 +4022,9 @@ BOOL init_urlcache(void) 164*c2c66affSColin Finck return FALSE; 165*c2c66affSColin Finck } 166*c2c66affSColin Finck 167*c2c66affSColin Finck+#ifndef __REACTOS__ 168*c2c66affSColin Finck cache_containers_init(); 169*c2c66affSColin Finck+#endif 170*c2c66affSColin Finck return TRUE; 171*c2c66affSColin Finck } 172*c2c66affSColin Finck 173*c2c66affSColin Finckdiff -pudN e:\wine\dlls\wininet/utility.c e:\reactos\dll\win32\wininet/utility.c 174*c2c66affSColin Finck--- e:\wine\dlls\wininet/utility.c 2016-11-16 17:36:38 +0100 175*c2c66affSColin Finck+++ e:\reactos\dll\win32\wininet/utility.c 2016-08-15 17:12:40 +0100 176*c2c66affSColin Finck@@ -24,6 +24,9 @@ 177*c2c66affSColin Finck 178*c2c66affSColin Finck #include "internet.h" 179*c2c66affSColin Finck 180*c2c66affSColin Finck+// ReactOS 181*c2c66affSColin Finck+#include "inet_ntop.c" 182*c2c66affSColin Finck+ 183*c2c66affSColin Finck #define TIME_STRING_LEN 30 184*c2c66affSColin Finck 185*c2c66affSColin Finck time_t ConvertTimeString(LPCWSTR asctime) 186