winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2011
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
945 discussions
Start a n
N
ew thread
Piotr Caban : msvcrt: Improved _getmaxstdio and _setmaxstdio implementation .
by Alexandre Julliard
19 May '11
19 May '11
Module: wine Branch: master Commit: 2ca229dec17cef0233c66556e8eccf17ab37390d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2ca229dec17cef0233c66556e…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu May 19 15:31:33 2011 +0200 msvcrt: Improved _getmaxstdio and _setmaxstdio implementation. --- dlls/msvcrt/file.c | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index bf98579..07c31ba 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -3766,20 +3766,19 @@ int CDECL MSVCRT_wprintf_s(const MSVCRT_wchar_t *format, ...) */ int CDECL _getmaxstdio(void) { - FIXME("stub, always returns 512\n"); - return 512; + return MSVCRT_max_streams; } /********************************************************************* - * _setmaxstdio_ (MSVCRT.@) + * _setmaxstdio (MSVCRT.@) */ int CDECL _setmaxstdio(int newmax) { - int res; - if( newmax > 2048) - res = -1; - else - res = newmax; - FIXME("stub: setting new maximum for number of simultaneously open files not implemented,returning %d\n",res); - return res; + TRACE("%d\n", newmax); + + if(newmax<_IOB_ENTRIES || newmax>MSVCRT_MAX_FILES || newmax<MSVCRT_stream_idx) + return -1; + + MSVCRT_max_streams = newmax; + return MSVCRT_max_streams; }
1
0
0
0
Piotr Caban : msvcrt: Allocate FILE tables dynamically.
by Alexandre Julliard
19 May '11
19 May '11
Module: wine Branch: master Commit: 19c4c37a1d16ce8790bbbfcda3c19eb753dba199 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=19c4c37a1d16ce8790bbbfcda…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu May 19 15:31:22 2011 +0200 msvcrt: Allocate FILE tables dynamically. --- dlls/msvcrt/file.c | 106 +++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 76 insertions(+), 30 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 1098138..bf98579 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -41,6 +41,7 @@ #include "winbase.h" #include "winternl.h" #include "msvcrt.h" +#include "mtdll.h" #include "wine/unicode.h" @@ -90,13 +91,17 @@ ioinfo * MSVCRT___pioinfo[MSVCRT_MAX_FILES/MSVCRT_FD_BLOCK_SIZE] = { 0 }; */ ioinfo MSVCRT___badioinfo = { INVALID_HANDLE_VALUE, WX_TEXT }; -MSVCRT_FILE MSVCRT__iob[3] = { { 0 } }; - static int MSVCRT_fdstart = 3; /* first unallocated fd */ static int MSVCRT_fdend = 3; /* highest allocated fd */ -static MSVCRT_FILE* MSVCRT_fstreams[2048]; -static int MSVCRT_stream_idx; +typedef struct { + MSVCRT_FILE file; + CRITICAL_SECTION crit; +} file_crit; + +MSVCRT_FILE MSVCRT__iob[_IOB_ENTRIES] = { { 0 } }; +static file_crit* MSVCRT_fstream[MSVCRT_MAX_FILES/MSVCRT_FD_BLOCK_SIZE]; +static int MSVCRT_max_streams = 512, MSVCRT_stream_idx; /* INTERNAL: process umask */ static int MSVCRT_umask = 0; @@ -179,6 +184,32 @@ static inline ioinfo* msvcrt_get_ioinfo(int fd) return ret + (fd%MSVCRT_FD_BLOCK_SIZE); } +static inline MSVCRT_FILE* msvcrt_get_file(int i) +{ + file_crit *ret; + + if(i >= MSVCRT_max_streams) + return NULL; + + if(i < _IOB_ENTRIES) + return &MSVCRT__iob[i]; + + ret = MSVCRT_fstream[i/MSVCRT_FD_BLOCK_SIZE]; + if(!ret) { + MSVCRT_fstream[i/MSVCRT_FD_BLOCK_SIZE] = MSVCRT_calloc(MSVCRT_FD_BLOCK_SIZE, sizeof(file_crit)); + if(!MSVCRT_fstream[i/MSVCRT_FD_BLOCK_SIZE]) { + ERR("out of memory"); + *MSVCRT__errno() = MSVCRT_ENOMEM; + return NULL; + } + + ret = MSVCRT_fstream[i/MSVCRT_FD_BLOCK_SIZE] + (i%MSVCRT_FD_BLOCK_SIZE); + } else + ret += i%MSVCRT_FD_BLOCK_SIZE; + + return &ret->file; +} + static inline BOOL msvcrt_is_valid_fd(int fd) { return fd >= 0 && fd < MSVCRT_fdend && (msvcrt_get_ioinfo(fd)->wxflag & WX_OPEN); @@ -316,20 +347,21 @@ static int msvcrt_alloc_fd(HANDLE hand, int flag) static MSVCRT_FILE* msvcrt_alloc_fp(void) { unsigned int i; + MSVCRT_FILE *file; - for (i = 3; i < sizeof(MSVCRT_fstreams) / sizeof(MSVCRT_fstreams[0]); i++) + for (i = 3; i < MSVCRT_max_streams; i++) { - if (!MSVCRT_fstreams[i] || MSVCRT_fstreams[i]->_flag == 0) + file = msvcrt_get_file(i); + if (!file) + return NULL; + + if (file->_flag == 0) { - if (!MSVCRT_fstreams[i]) - { - if (!(MSVCRT_fstreams[i] = MSVCRT_calloc(sizeof(MSVCRT_FILE),1))) - return NULL; - if (i == MSVCRT_stream_idx) MSVCRT_stream_idx++; - } - return MSVCRT_fstreams[i]; + if (i == MSVCRT_stream_idx) MSVCRT_stream_idx++; + return file; } } + return NULL; } @@ -471,7 +503,6 @@ void msvcrt_init_io(void) for (i = 0; i < 3; i++) { /* FILE structs for stdin/out/err are static and never deleted */ - MSVCRT_fstreams[i] = &MSVCRT__iob[i]; MSVCRT__iob[i]._file = i; MSVCRT__iob[i]._tmpfname = NULL; MSVCRT__iob[i]._flag = (i == 0) ? MSVCRT__IOREAD : MSVCRT__IOWRT; @@ -715,22 +746,20 @@ int CDECL MSVCRT_fflush(MSVCRT_FILE* file); int CDECL _flushall(void) { int i, num_flushed = 0; + MSVCRT_FILE *file; LOCK_FILES(); - for (i = 3; i < MSVCRT_stream_idx; i++) - if (MSVCRT_fstreams[i] && MSVCRT_fstreams[i]->_flag) + for (i = 3; i < MSVCRT_stream_idx; i++) { + file = msvcrt_get_file(i); + + if (file->_flag) { -#if 0 - /* FIXME: flush, do not commit */ - if (_commit(i) == -1) - if (MSVCRT_fstreams[i]) - MSVCRT_fstreams[i]->_flag |= MSVCRT__IOERR; -#endif - if(MSVCRT_fstreams[i]->_flag & MSVCRT__IOWRT) { - MSVCRT_fflush(MSVCRT_fstreams[i]); + if(file->_flag & MSVCRT__IOWRT) { + MSVCRT_fflush(file); num_flushed++; } } + } UNLOCK_FILES(); TRACE(":flushed (%d) handles\n",num_flushed); @@ -913,12 +942,15 @@ int CDECL _eof(int fd) int CDECL MSVCRT__fcloseall(void) { int num_closed = 0, i; + MSVCRT_FILE *file; LOCK_FILES(); - for (i = 3; i < MSVCRT_stream_idx; i++) - if (MSVCRT_fstreams[i] && MSVCRT_fstreams[i]->_flag && - !MSVCRT_fclose(MSVCRT_fstreams[i])) + for (i = 3; i < MSVCRT_stream_idx; i++) { + file = msvcrt_get_file(i); + + if (file->_flag && !MSVCRT_fclose(file)) num_closed++; + } UNLOCK_FILES(); TRACE(":closed (%d) handles\n",num_closed); @@ -942,6 +974,9 @@ void msvcrt_free_io(void) for(i=0; i<sizeof(MSVCRT___pioinfo)/sizeof(MSVCRT___pioinfo[0]); i++) MSVCRT_free(MSVCRT___pioinfo[i]); + for(i=0; i<sizeof(MSVCRT_fstream)/sizeof(MSVCRT_fstream[0]); i++) + MSVCRT_free(MSVCRT_fstream[i]); + MSVCRT_file_cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&MSVCRT_file_cs); } @@ -1927,14 +1962,18 @@ int CDECL _open_osfhandle(MSVCRT_intptr_t handle, int oflags) int CDECL _rmtmp(void) { int num_removed = 0, i; + MSVCRT_FILE *file; LOCK_FILES(); - for (i = 3; i < MSVCRT_stream_idx; i++) - if (MSVCRT_fstreams[i] && MSVCRT_fstreams[i]->_tmpfname) + for (i = 3; i < MSVCRT_stream_idx; i++) { + file = msvcrt_get_file(i); + + if (file->_tmpfname) { - MSVCRT_fclose(MSVCRT_fstreams[i]); + MSVCRT_fclose(file); num_removed++; } + } UNLOCK_FILES(); if (num_removed) @@ -2517,6 +2556,13 @@ int CDECL MSVCRT_fclose(MSVCRT_FILE* file) file->_flag = 0; + if(file == msvcrt_get_file(MSVCRT_stream_idx-1)) { + while(MSVCRT_stream_idx>3 && !file->_flag) { + MSVCRT_stream_idx--; + file = msvcrt_get_file(MSVCRT_stream_idx-1); + } + } + return ((r == -1) || (flag & MSVCRT__IOERR) ? MSVCRT_EOF : 0); }
1
0
0
0
Piotr Caban : msvcrt: Allocate ioinfo tables dynamically.
by Alexandre Julliard
19 May '11
19 May '11
Module: wine Branch: master Commit: 2679186d19031b900c8bae53ca13a3eebaf0799d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2679186d19031b900c8bae53c…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu May 19 15:31:12 2011 +0200 msvcrt: Allocate ioinfo tables dynamically. --- dlls/msvcr100/msvcr100.spec | 4 +- dlls/msvcr80/msvcr80.spec | 4 +- dlls/msvcr90/msvcr90.spec | 4 +- dlls/msvcrt/file.c | 303 ++++++++++++++++++++++++------------------- 4 files changed, 176 insertions(+), 139 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=2679186d19031b900c8ba…
1
0
0
0
Jacek Caban : wininet: Use set_cookie directly in HTTP_ProcessCookies.
by Alexandre Julliard
19 May '11
19 May '11
Module: wine Branch: master Commit: 2e2ed52cfb0dad4cf7742ff2b82ac2597678f9af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2e2ed52cfb0dad4cf7742ff2b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu May 19 16:11:45 2011 +0200 wininet: Use set_cookie directly in HTTP_ProcessCookies. --- dlls/wininet/cookie.c | 2 +- dlls/wininet/http.c | 43 ++++++++++++++++++++++++++----------------- dlls/wininet/internet.h | 1 + 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/dlls/wininet/cookie.c b/dlls/wininet/cookie.c index d3c6232..77e22ac 100644 --- a/dlls/wininet/cookie.c +++ b/dlls/wininet/cookie.c @@ -414,7 +414,7 @@ BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName, return r; } -static BOOL set_cookie(LPCWSTR domain, LPCWSTR path, LPCWSTR cookie_name, LPCWSTR cookie_data) +BOOL set_cookie(LPCWSTR domain, LPCWSTR path, LPCWSTR cookie_name, LPCWSTR cookie_data) { cookie_domain *thisCookieDomain = NULL; cookie *thisCookie; diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 53bbde2..883e574 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -720,26 +720,35 @@ static void HTTP_ProcessCookies( http_request_t *request ) int numCookies = 0; LPHTTPHEADERW setCookieHeader; - while((HeaderIndex = HTTP_GetCustomHeaderIndex(request, szSet_Cookie, numCookies, FALSE)) != -1) + if(request->hdr.dwFlags & INTERNET_FLAG_NO_COOKIES) + return; + + while((HeaderIndex = HTTP_GetCustomHeaderIndex(request, szSet_Cookie, numCookies++, FALSE)) != -1) { + HTTPHEADERW *host; + const WCHAR *data; + WCHAR *name; + setCookieHeader = &request->custHeaders[HeaderIndex]; - if (!(request->hdr.dwFlags & INTERNET_FLAG_NO_COOKIES) && setCookieHeader->lpszValue) - { - int len; - static const WCHAR szFmt[] = { 'h','t','t','p',':','/','/','%','s','%','s',0}; - LPWSTR buf_url; - LPHTTPHEADERW Host; + if (!setCookieHeader->lpszValue) + continue; - Host = HTTP_GetHeader(request, hostW); - len = lstrlenW(Host->lpszValue) + 9 + lstrlenW(request->path); - buf_url = heap_alloc(len*sizeof(WCHAR)); - sprintfW(buf_url, szFmt, Host->lpszValue, request->path); - InternetSetCookieW(buf_url, NULL, setCookieHeader->lpszValue); + host = HTTP_GetHeader(request, hostW); + if(!host) + continue; - HeapFree(GetProcessHeap(), 0, buf_url); - } - numCookies++; + data = strchrW(setCookieHeader->lpszValue, '='); + if(!data) + continue; + + name = heap_strndupW(setCookieHeader->lpszValue, data-setCookieHeader->lpszValue); + if(!name) + continue; + + data++; + set_cookie(host->lpszValue, request->path, name, data); + heap_free(name); } } diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index f94942a..aedb265 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -498,6 +498,7 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort, struct sockaddr *psa, socklen_t *sa_len) DECLSPEC_HIDDEN; BOOL get_cookie(const WCHAR*,const WCHAR*,WCHAR*,DWORD*) DECLSPEC_HIDDEN; +BOOL set_cookie(const WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN; void INTERNET_SetLastError(DWORD dwError) DECLSPEC_HIDDEN; DWORD INTERNET_GetLastError(void) DECLSPEC_HIDDEN;
1
0
0
0
Jacek Caban : wininet: Use get_cookie directly in HTTP_InsertCookies.
by Alexandre Julliard
19 May '11
19 May '11
Module: wine Branch: master Commit: dce9181c91032b1ef3441fb53e73ae7d69e7b1f7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dce9181c91032b1ef3441fb53…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu May 19 16:11:30 2011 +0200 wininet: Use get_cookie directly in HTTP_InsertCookies. --- dlls/wininet/cookie.c | 2 +- dlls/wininet/http.c | 42 ++++++++++++++++++++---------------------- dlls/wininet/internet.h | 2 ++ 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/dlls/wininet/cookie.c b/dlls/wininet/cookie.c index 683776b..d3c6232 100644 --- a/dlls/wininet/cookie.c +++ b/dlls/wininet/cookie.c @@ -260,7 +260,7 @@ static void COOKIE_deleteDomain(cookie_domain *deadDomain) HeapFree(GetProcessHeap(), 0, deadDomain); } -static BOOL get_cookie(const WCHAR *host, const WCHAR *path, WCHAR *cookie_data, DWORD *size) +BOOL get_cookie(const WCHAR *host, const WCHAR *path, WCHAR *cookie_data, DWORD *size) { unsigned cnt = 0, len, domain_count = 0, cookie_count = 0; cookie_domain *domain; diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index c6542a8..53bbde2 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -3957,32 +3957,30 @@ static DWORD HTTP_SecureProxyConnect(http_request_t *request) static void HTTP_InsertCookies(http_request_t *request) { - static const WCHAR szUrlForm[] = {'h','t','t','p',':','/','/','%','s','%','s',0}; - LPWSTR lpszCookies, lpszUrl = NULL; - DWORD nCookieSize, size; - LPHTTPHEADERW Host = HTTP_GetHeader(request, hostW); + DWORD cookie_size, size, cnt = 0; + HTTPHEADERW *host; + WCHAR *cookies; - size = (strlenW(Host->lpszValue) + strlenW(szUrlForm) + strlenW(request->path)) * sizeof(WCHAR); - if (!(lpszUrl = heap_alloc(size))) return; - sprintfW( lpszUrl, szUrlForm, Host->lpszValue, request->path); + static const WCHAR cookieW[] = {'C','o','o','k','i','e',':',' ',0}; - if (InternetGetCookieW(lpszUrl, NULL, NULL, &nCookieSize)) - { - int cnt = 0; - static const WCHAR szCookie[] = {'C','o','o','k','i','e',':',' ',0}; + host = HTTP_GetHeader(request, hostW); + if(!host) + return; - size = sizeof(szCookie) + nCookieSize * sizeof(WCHAR) + sizeof(szCrLf); - if ((lpszCookies = heap_alloc(size))) - { - cnt += sprintfW(lpszCookies, szCookie); - InternetGetCookieW(lpszUrl, NULL, lpszCookies + cnt, &nCookieSize); - strcatW(lpszCookies, szCrLf); + if(!get_cookie(host->lpszValue, request->path, NULL, &cookie_size)) + return; - HTTP_HttpAddRequestHeadersW(request, lpszCookies, strlenW(lpszCookies), HTTP_ADDREQ_FLAG_REPLACE); - HeapFree(GetProcessHeap(), 0, lpszCookies); - } - } - HeapFree(GetProcessHeap(), 0, lpszUrl); + size = sizeof(cookieW) + cookie_size * sizeof(WCHAR) + sizeof(szCrLf); + if(!(cookies = heap_alloc(size))) + return; + + cnt += sprintfW(cookies, cookieW); + get_cookie(host->lpszValue, request->path, cookies+cnt, &cookie_size); + strcatW(cookies, szCrLf); + + HTTP_HttpAddRequestHeadersW(request, cookies, strlenW(cookies), HTTP_ADDREQ_FLAG_REPLACE); + + heap_free(cookies); } static WORD HTTP_ParseDay(LPCWSTR day) diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index c83e617..f94942a 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -497,6 +497,8 @@ DWORD HTTP_Connect(appinfo_t*,LPCWSTR, BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort, struct sockaddr *psa, socklen_t *sa_len) DECLSPEC_HIDDEN; +BOOL get_cookie(const WCHAR*,const WCHAR*,WCHAR*,DWORD*) DECLSPEC_HIDDEN; + void INTERNET_SetLastError(DWORD dwError) DECLSPEC_HIDDEN; DWORD INTERNET_GetLastError(void) DECLSPEC_HIDDEN; DWORD INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest) DECLSPEC_HIDDEN;
1
0
0
0
Jacek Caban : wininet: Moved getting cookie from known host to separated function.
by Alexandre Julliard
19 May '11
19 May '11
Module: wine Branch: master Commit: 9a741bf3d72498bce5726856ff3f8d5ac9d95420 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9a741bf3d72498bce5726856f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu May 19 16:11:10 2011 +0200 wininet: Moved getting cookie from known host to separated function. --- dlls/wininet/cookie.c | 160 ++++++++++++++++++++++++------------------------- 1 files changed, 78 insertions(+), 82 deletions(-) diff --git a/dlls/wininet/cookie.c b/dlls/wininet/cookie.c index 8a50ef7..683776b 100644 --- a/dlls/wininet/cookie.c +++ b/dlls/wininet/cookie.c @@ -260,114 +260,110 @@ static void COOKIE_deleteDomain(cookie_domain *deadDomain) HeapFree(GetProcessHeap(), 0, deadDomain); } -/*********************************************************************** - * InternetGetCookieW (WININET.@) - * - * Retrieve cookie from the specified url - * - * It should be noted that on windows the lpszCookieName parameter is "not implemented". - * So it won't be implemented here. - * - * RETURNS - * TRUE on success - * FALSE on failure - * - */ -BOOL WINAPI InternetGetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName, - LPWSTR lpCookieData, LPDWORD lpdwSize) +static BOOL get_cookie(const WCHAR *host, const WCHAR *path, WCHAR *cookie_data, DWORD *size) { - BOOL ret; - struct list * cursor; - unsigned int cnt = 0, domain_count = 0, cookie_count = 0; - WCHAR hostName[2048], path[2048]; + unsigned cnt = 0, len, domain_count = 0, cookie_count = 0; + cookie_domain *domain; FILETIME tm; - TRACE("(%s, %s, %p, %p)\n", debugstr_w(lpszUrl),debugstr_w(lpszCookieName), - lpCookieData, lpdwSize); + GetSystemTimeAsFileTime(&tm); - if (!lpszUrl) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } + LIST_FOR_EACH_ENTRY(domain, &domain_list, cookie_domain, entry) { + struct list *cursor, *cursor2; - hostName[0] = 0; - ret = COOKIE_crackUrlSimple(lpszUrl, hostName, sizeof(hostName)/sizeof(hostName[0]), path, sizeof(path)/sizeof(path[0])); - if (!ret || !hostName[0]) return FALSE; - - GetSystemTimeAsFileTime(&tm); + if(!COOKIE_matchDomain(host, path, domain, TRUE)) + continue; - LIST_FOR_EACH(cursor, &domain_list) - { - cookie_domain *cookiesDomain = LIST_ENTRY(cursor, cookie_domain, entry); - if (COOKIE_matchDomain(hostName, path, cookiesDomain, TRUE)) - { - struct list * cursor, * cursor2; - domain_count++; - TRACE("found domain %p\n", cookiesDomain); + domain_count++; + TRACE("found domain %p\n", domain); - LIST_FOR_EACH_SAFE(cursor, cursor2, &cookiesDomain->cookie_list) + LIST_FOR_EACH_SAFE(cursor, cursor2, &domain->cookie_list) { + cookie *cookie_iter = LIST_ENTRY(cursor, cookie, entry); + + /* check for expiry */ + if((cookie_iter->expiry.dwLowDateTime != 0 || cookie_iter->expiry.dwHighDateTime != 0) + && CompareFileTime(&tm, &cookie_iter->expiry) > 0) { - cookie *thisCookie = LIST_ENTRY(cursor, cookie, entry); - /* check for expiry */ - if ((thisCookie->expiry.dwLowDateTime != 0 || thisCookie->expiry.dwHighDateTime != 0) && CompareFileTime(&tm,&thisCookie->expiry) > 0) - { - TRACE("Found expired cookie. deleting\n"); - COOKIE_deleteCookie(thisCookie, FALSE); - continue; - } + TRACE("Found expired cookie. deleting\n"); + COOKIE_deleteCookie(cookie_iter, FALSE); + continue; + } - if (lpCookieData == NULL) /* return the size of the buffer required to lpdwSize */ - { - unsigned int len; - - if (cookie_count) cnt += 2; /* '; ' */ - cnt += strlenW(thisCookie->lpCookieName); - if ((len = strlenW(thisCookie->lpCookieData))) - { - cnt += 1; /* = */ - cnt += len; - } + if(!cookie_data) { /* return the size of the buffer required to lpdwSize */ + if (cookie_count) + cnt += 2; /* '; ' */ + cnt += strlenW(cookie_iter->lpCookieName); + if ((len = strlenW(cookie_iter->lpCookieData))) { + cnt += 1; /* = */ + cnt += len; } - else - { - static const WCHAR szsc[] = { ';',' ',0 }; - static const WCHAR szname[] = { '%','s',0 }; - static const WCHAR szdata[] = { '=','%','s',0 }; + }else { + static const WCHAR szsc[] = { ';',' ',0 }; + static const WCHAR szname[] = { '%','s',0 }; + static const WCHAR szdata[] = { '=','%','s',0 }; - if (cookie_count) cnt += snprintfW(lpCookieData + cnt, *lpdwSize - cnt, szsc); - cnt += snprintfW(lpCookieData + cnt, *lpdwSize - cnt, szname, thisCookie->lpCookieName); + if (cookie_count) cnt += snprintfW(cookie_data + cnt, *size - cnt, szsc); + cnt += snprintfW(cookie_data + cnt, *size - cnt, szname, cookie_iter->lpCookieName); - if (thisCookie->lpCookieData[0]) - cnt += snprintfW(lpCookieData + cnt, *lpdwSize - cnt, szdata, thisCookie->lpCookieData); + if (cookie_iter->lpCookieData[0]) + cnt += snprintfW(cookie_data + cnt, *size - cnt, szdata, cookie_iter->lpCookieData); - TRACE("Cookie: %s\n", debugstr_w(lpCookieData)); - } - cookie_count++; + TRACE("Cookie: %s\n", debugstr_w(cookie_data)); } + cookie_count++; } } - if (!domain_count) - { - TRACE("no cookies found for %s\n", debugstr_w(hostName)); + if (!domain_count) { + TRACE("no cookies found for %s\n", debugstr_w(host)); SetLastError(ERROR_NO_MORE_ITEMS); return FALSE; } - if (lpCookieData == NULL) - { - *lpdwSize = (cnt + 1) * sizeof(WCHAR); - TRACE("returning %u\n", *lpdwSize); + if(!cookie_data) { + *size = (cnt + 1) * sizeof(WCHAR); + TRACE("returning %u\n", *size); return TRUE; } - *lpdwSize = cnt + 1; + *size = cnt + 1; + + TRACE("Returning %u (from %u domains): %s\n", cnt, domain_count, debugstr_w(cookie_data)); + return cnt != 0; +} + +/*********************************************************************** + * InternetGetCookieW (WININET.@) + * + * Retrieve cookie from the specified url + * + * It should be noted that on windows the lpszCookieName parameter is "not implemented". + * So it won't be implemented here. + * + * RETURNS + * TRUE on success + * FALSE on failure + * + */ +BOOL WINAPI InternetGetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName, + LPWSTR lpCookieData, LPDWORD lpdwSize) +{ + WCHAR host[INTERNET_MAX_HOST_NAME_LENGTH], path[INTERNET_MAX_PATH_LENGTH]; + BOOL ret; + + TRACE("(%s, %s, %p, %p)\n", debugstr_w(lpszUrl),debugstr_w(lpszCookieName), lpCookieData, lpdwSize); + + if (!lpszUrl) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } - TRACE("Returning %u (from %u domains): %s\n", cnt, domain_count, - debugstr_w(lpCookieData)); + host[0] = 0; + ret = COOKIE_crackUrlSimple(lpszUrl, host, sizeof(host)/sizeof(host[0]), path, sizeof(path)/sizeof(path[0])); + if (!ret || !host[0]) return FALSE; - return (cnt ? TRUE : FALSE); + return get_cookie(host, path, lpCookieData, lpdwSize); }
1
0
0
0
Andrew Nguyen : include: Revise the Winsock include in windows. h to match the Windows SDK.
by Alexandre Julliard
19 May '11
19 May '11
Module: wine Branch: master Commit: aca2385d6c79dd0499bd8ffbee2dbc9370208a36 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aca2385d6c79dd0499bd8ffbe…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Thu May 19 07:10:09 2011 -0500 include: Revise the Winsock include in windows.h to match the Windows SDK. --- dlls/ws2_32/tests/sock.c | 1 + include/windows.h | 2 +- programs/ipconfig/ipconfig.c | 1 + 3 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index c032c11..ac0a7d0 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -22,6 +22,7 @@ #include <ntstatus.h> #define WIN32_NO_STATUS +#include <winsock2.h> #include <windows.h> #include <ws2tcpip.h> #include <mswsock.h> diff --git a/include/windows.h b/include/windows.h index af83f83..7cd8a83 100644 --- a/include/windows.h +++ b/include/windows.h @@ -63,7 +63,7 @@ /* #include <winperf.h> */ #ifndef WINE_NOWINSOCK -#include <winsock2.h> +#include <winsock.h> #endif /* WINE_NOWINSOCK */ #ifndef NOCRYPT diff --git a/programs/ipconfig/ipconfig.c b/programs/ipconfig/ipconfig.c index 50f7e6c..14974ae 100644 --- a/programs/ipconfig/ipconfig.c +++ b/programs/ipconfig/ipconfig.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <winsock2.h> #include <windows.h> #include <iphlpapi.h> #include <wine/unicode.h>
1
0
0
0
Francois Gouget : user32: Use macros for the resource IDs instead of numeric literals.
by Alexandre Julliard
19 May '11
19 May '11
Module: wine Branch: master Commit: e82c57372b827861b01163c572a870689d5876ec URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e82c57372b827861b01163c57…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed May 18 17:52:08 2011 +0200 user32: Use macros for the resource IDs instead of numeric literals. --- dlls/user32/msgbox.c | 4 ++- dlls/user32/resources.h | 2 + dlls/user32/resources/user32_Bg.rc | 24 +++++++++--------- dlls/user32/resources/user32_Ca.rc | 24 +++++++++--------- dlls/user32/resources/user32_Cs.rc | 24 +++++++++--------- dlls/user32/resources/user32_Da.rc | 24 +++++++++--------- dlls/user32/resources/user32_De.rc | 24 +++++++++--------- dlls/user32/resources/user32_En.rc | 24 +++++++++--------- dlls/user32/resources/user32_Eo.rc | 24 +++++++++--------- dlls/user32/resources/user32_Es.rc | 24 +++++++++--------- dlls/user32/resources/user32_Fi.rc | 24 +++++++++--------- dlls/user32/resources/user32_Fr.rc | 24 +++++++++--------- dlls/user32/resources/user32_He.rc | 24 +++++++++--------- dlls/user32/resources/user32_Hu.rc | 24 +++++++++--------- dlls/user32/resources/user32_It.rc | 24 +++++++++--------- dlls/user32/resources/user32_Ja.rc | 24 +++++++++--------- dlls/user32/resources/user32_Ko.rc | 22 ++++++++-------- dlls/user32/resources/user32_Lt.rc | 24 +++++++++--------- dlls/user32/resources/user32_Nl.rc | 24 +++++++++--------- dlls/user32/resources/user32_No.rc | 24 +++++++++--------- dlls/user32/resources/user32_Pl.rc | 24 +++++++++--------- dlls/user32/resources/user32_Pt.rc | 24 +++++++++--------- dlls/user32/resources/user32_Ro.rc | 24 +++++++++--------- dlls/user32/resources/user32_Ru.rc | 24 +++++++++--------- dlls/user32/resources/user32_Si.rc | 24 +++++++++--------- dlls/user32/resources/user32_Sk.rc | 24 +++++++++--------- dlls/user32/resources/user32_Sr.rc | 48 ++++++++++++++++++------------------ dlls/user32/resources/user32_Sv.rc | 24 +++++++++--------- dlls/user32/resources/user32_Tr.rc | 24 +++++++++--------- dlls/user32/resources/user32_Uk.rc | 24 +++++++++--------- dlls/user32/resources/user32_Wa.rc | 24 +++++++++--------- dlls/user32/resources/user32_Zh.rc | 48 ++++++++++++++++++------------------ 32 files changed, 388 insertions(+), 384 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=e82c57372b827861b0116…
1
0
0
0
Francois Gouget : taskmgr: Remove unused button labels.
by Alexandre Julliard
19 May '11
19 May '11
Module: wine Branch: master Commit: cfae31f2c40bc38ff01159229fdaae097723043b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cfae31f2c40bc38ff01159229…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed May 18 17:51:27 2011 +0200 taskmgr: Remove unused button labels. --- programs/taskmgr/Da.rc | 8 ++++---- programs/taskmgr/De.rc | 8 ++++---- programs/taskmgr/En.rc | 6 +++--- programs/taskmgr/Fr.rc | 8 ++++---- programs/taskmgr/He.rc | 8 ++++---- programs/taskmgr/It.rc | 8 ++++---- programs/taskmgr/Ja.rc | 8 ++++---- programs/taskmgr/Ko.rc | 8 ++++---- programs/taskmgr/Lt.rc | 8 ++++---- programs/taskmgr/Nl.rc | 8 ++++---- programs/taskmgr/No.rc | 8 ++++---- programs/taskmgr/Pl.rc | 6 +++--- programs/taskmgr/Pt.rc | 8 ++++---- programs/taskmgr/Ro.rc | 8 ++++---- programs/taskmgr/Ru.rc | 8 ++++---- programs/taskmgr/Si.rc | 8 ++++---- programs/taskmgr/Sv.rc | 8 ++++---- programs/taskmgr/Tr.rc | 8 ++++---- programs/taskmgr/Uk.rc | 8 ++++---- programs/taskmgr/Zh.rc | 8 ++++---- 20 files changed, 78 insertions(+), 78 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=cfae31f2c40bc38ff0115…
1
0
0
0
Francois Gouget : progman: Fix ellipsis usage in the menu and button labels .
by Alexandre Julliard
19 May '11
19 May '11
Module: wine Branch: master Commit: 6073425ca79793a857fa9c5930e7629537c11793 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6073425ca79793a857fa9c593…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed May 18 17:49:50 2011 +0200 progman: Fix ellipsis usage in the menu and button labels. Also renamed the 'Attributes' menu item to 'Properties' as it seems more standard and appropriate. --- po/ar.po | 10 ++++++---- po/bg.po | 10 ++++++---- po/ca.po | 4 ++-- po/cs.po | 8 +++++--- po/da.po | 8 +++++--- po/de.po | 6 ++++-- po/el.po | 7 ++++--- po/en.po | 8 ++++---- po/en_US.po | 8 ++++---- po/eo.po | 10 ++++++---- po/es.po | 8 +++++--- po/fa.po | 10 ++++++---- po/fi.po | 10 ++++++---- po/fr.po | 8 +++++--- po/he.po | 8 +++++--- po/hi.po | 7 ++++--- po/hu.po | 6 ++++-- po/it.po | 8 +++++--- po/ja.po | 8 +++++--- po/ko.po | 8 +++++--- po/lt.po | 8 +++++--- po/ml.po | 7 ++++--- po/nb_NO.po | 8 +++++--- po/nl.po | 6 ++++-- po/or.po | 7 ++++--- po/pa.po | 7 ++++--- po/pl.po | 6 ++++-- po/pt_BR.po | 8 +++++--- po/pt_PT.po | 8 +++++--- po/rm.po | 7 ++++--- po/ro.po | 8 +++++--- po/ru.po | 8 +++++--- po/sk.po | 12 +++++++++--- po/sl.po | 8 +++++--- po/sr_RS(a)cyrillic.po | 10 ++++++---- po/sr_RS(a)latin.po | 10 ++++++---- po/sv.po | 8 +++++--- po/te.po | 7 ++++--- po/th.po | 7 ++++--- po/tr.po | 8 +++++--- po/uk.po | 8 +++++--- po/wa.po | 10 ++++++---- po/wine.pot | 4 ++-- po/zh_CN.po | 8 +++++--- po/zh_TW.po | 8 +++++--- programs/progman/progman.rc | 4 ++-- 46 files changed, 219 insertions(+), 141 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=6073425ca79793a857fa9…
1
0
0
0
← Newer
1
...
37
38
39
40
41
42
43
...
95
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Results per page:
10
25
50
100
200