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
March 2006
----- 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
4 participants
581 discussions
Start a n
N
ew thread
Alexandre Julliard : dbt.h: Added DBTF_ flags.
by Alexandre Julliard
09 Mar '06
09 Mar '06
Module: wine Branch: refs/heads/master Commit: 18345170fd888ef54902bd8f80595bec3dc12f0c URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=18345170fd888ef54902bd8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Mar 9 22:48:49 2006 +0100 dbt.h: Added DBTF_ flags. --- include/dbt.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/include/dbt.h b/include/dbt.h index 115a85b..9860707 100644 --- a/include/dbt.h +++ b/include/dbt.h @@ -78,6 +78,9 @@ typedef struct _DEV_BROADCAST_VOLUME WORD dbcv_flags; } DEV_BROADCAST_VOLUME, *PDEV_BROADCAST_VOLUME; +#define DBTF_MEDIA 0x0001 +#define DBTF_NET 0x0002 + typedef struct _DEV_BROADCAST_PORT_A { DWORD dbcp_size;
1
0
0
0
Alexandre Julliard : user: Support packing/ unpacking the WM_DEVICECHANGE message.
by Alexandre Julliard
09 Mar '06
09 Mar '06
Module: wine Branch: refs/heads/master Commit: a32b3e86ec3c6b83804d896ed1cc3438cd9dc482 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=a32b3e86ec3c6b83804d896…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Mar 9 22:48:37 2006 +0100 user: Support packing/unpacking the WM_DEVICECHANGE message. --- dlls/user/message.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/user/message.c b/dlls/user/message.c index 8dc0b3c..8fe2ee7 100644 --- a/dlls/user/message.c +++ b/dlls/user/message.c @@ -32,6 +32,7 @@ #include "winuser.h" #include "winerror.h" #include "winnls.h" +#include "dbt.h" #include "dde.h" #include "wine/unicode.h" #include "wine/server.h" @@ -603,6 +604,12 @@ static size_t pack_message( HWND hwnd, U case WM_MDIGETACTIVE: if (lparam) return sizeof(BOOL); return 0; + case WM_DEVICECHANGE: + { + DEV_BROADCAST_HDR *header = (DEV_BROADCAST_HDR *)lparam; + push_data( data, header, header->dbch_size ); + return 0; + } case WM_WINE_SETWINDOWPOS: push_data( data, (WINDOWPOS *)lparam, sizeof(WINDOWPOS) ); return 0; @@ -646,7 +653,6 @@ static size_t pack_message( HWND hwnd, U case WM_DRAGLOOP: case WM_DRAGSELECT: case WM_DRAGMOVE: - case WM_DEVICECHANGE: FIXME( "msg %x (%s) not supported yet\n", message, SPY_GetMsgName(message, hwnd) ); data->count = -1; return 0; @@ -864,6 +870,9 @@ static BOOL unpack_message( HWND hwnd, U if (!*lparam) return TRUE; if (!get_buffer_space( buffer, sizeof(BOOL) )) return FALSE; break; + case WM_DEVICECHANGE: + minsize = sizeof(DEV_BROADCAST_HDR); + break; case WM_WINE_KEYBOARD_LL_HOOK: minsize = sizeof(KBDLLHOOKSTRUCT); break; @@ -904,7 +913,6 @@ static BOOL unpack_message( HWND hwnd, U case WM_DRAGLOOP: case WM_DRAGSELECT: case WM_DRAGMOVE: - case WM_DEVICECHANGE: FIXME( "msg %x (%s) not supported yet\n", message, SPY_GetMsgName(message, hwnd) ); return FALSE;
1
0
0
0
Robert Shearman : wininet: Fix InternetGetCookie with no matching cookies.
by Alexandre Julliard
09 Mar '06
09 Mar '06
Module: wine Branch: refs/heads/master Commit: 1b8f7f06058b534e471be0df1763766c8185bf8b URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=1b8f7f06058b534e471be0d…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Thu Mar 9 15:20:24 2006 +0000 wininet: Fix InternetGetCookie with no matching cookies. Return FALSE and an error of ERROR_NO_MORE_ITEMS from InternetGetCookie when there are no cookies for the specified domain. This fixes a bug in sending a blank cookie to HTTP servers. --- dlls/wininet/cookie.c | 11 ++++++++--- dlls/wininet/tests/internet.c | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/dlls/wininet/cookie.c b/dlls/wininet/cookie.c index 80bd8ea..043de1b 100644 --- a/dlls/wininet/cookie.c +++ b/dlls/wininet/cookie.c @@ -301,6 +301,14 @@ BOOL WINAPI InternetGetCookieW(LPCWSTR l } } } + + if (!domain_count) + { + TRACE("no cookies found for %s\n", debugstr_w(hostName)); + SetLastError(ERROR_NO_MORE_ITEMS); + return FALSE; + } + if (lpCookieData == NULL) { cnt += 1; /* NULL */ @@ -309,9 +317,6 @@ BOOL WINAPI InternetGetCookieW(LPCWSTR l return TRUE; } - if (!domain_count) - return FALSE; - *lpdwSize = (cnt + 1)*sizeof(WCHAR); TRACE("Returning %i (from %i domains): %s\n", cnt, domain_count, diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c index aeeee4e..293656c 100644 --- a/dlls/wininet/tests/internet.c +++ b/dlls/wininet/tests/internet.c @@ -27,7 +27,7 @@ #include "wine/test.h" -void InternetQueryOptionA_test() +static void InternetQueryOptionA_test(void) { HINTERNET hinet,hurl; DWORD len; @@ -107,7 +107,20 @@ void InternetQueryOptionA_test() InternetCloseHandle(hinet); } +static void test_get_cookie(void) +{ + DWORD len; + BOOL ret; + + SetLastError(0xdeadbeef); + ret = InternetGetCookie("
http://www.example.com
", NULL, NULL, &len); + ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS, + "InternetGetCookie should have failed with %s and error %ld\n", + ret ? "TRUE" : "FALSE", GetLastError()); +} + START_TEST(internet) { InternetQueryOptionA_test(); + test_get_cookie(); }
1
0
0
0
Robert Shearman : wininet: Fix an off-by-one error in InternetCreateUrlW.
by Alexandre Julliard
09 Mar '06
09 Mar '06
Module: wine Branch: refs/heads/master Commit: e4adc07333da62a6498e9c0e95fbb2dc2ff58f50 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=e4adc07333da62a6498e9c0…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Thu Mar 9 15:19:46 2006 +0000 wininet: Fix an off-by-one error in InternetCreateUrlW. Fix an off-by-one error in the size of buffer used to store the port number in InternetCreateUrlW. --- dlls/wininet/internet.c | 4 ++-- dlls/wininet/tests/http.c | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index e06c306..503c271 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -3786,7 +3786,7 @@ static BOOL calc_url_length(LPURL_COMPON if (!url_uses_default_port(nScheme, lpUrlComponents->nPort)) { - char szPort[MAX_WORD_DIGITS]; + char szPort[MAX_WORD_DIGITS+1]; sprintf(szPort, "%d", lpUrlComponents->nPort); *lpdwUrlLength += strlen(szPort); @@ -4021,7 +4021,7 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COM if (!url_uses_default_port(nScheme, lpUrlComponents->nPort)) { - WCHAR szPort[MAX_WORD_DIGITS]; + WCHAR szPort[MAX_WORD_DIGITS+1]; sprintfW(szPort, percentD, lpUrlComponents->nPort); *lpszUrl = ':'; diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index a202268..3f512cf 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -50,6 +50,7 @@ #define CREATE_URL9 "about:blank" #define CREATE_URL10 "about://host/blank" #define CREATE_URL11 "about:" +#define CREATE_URL12 "
http://www.winehq.org:65535
" static HANDLE hCompleteEvent; @@ -1140,7 +1141,6 @@ static void InternetCreateUrlA_test(void urlComp.nPort = 8080; urlComp.lpszScheme = "about"; len = strlen(CREATE_URL11); - len++; /* work around bug in native wininet */ szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len); ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len); ok(ret, "Expected success\n"); @@ -1148,6 +1148,23 @@ static void InternetCreateUrlA_test(void ok(!strcmp(szUrl, CREATE_URL11), "Expected %s, got %s\n", CREATE_URL11, szUrl); HeapFree(GetProcessHeap(), 0, szUrl); + + memset(&urlComp, 0, sizeof(urlComp)); + urlComp.dwStructSize = sizeof(URL_COMPONENTS); + urlComp.lpszScheme = "http"; + urlComp.dwSchemeLength = 0; + urlComp.nScheme = INTERNET_SCHEME_HTTP; + urlComp.lpszHostName = "
www.winehq.org
"; + urlComp.dwHostNameLength = 0; + urlComp.nPort = 65535; + len = strlen(CREATE_URL12); + szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len); + ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len); + ok(ret, "Expected success\n"); + ok(len == strlen(CREATE_URL12), "Expected len %d, got %ld\n", strlen(CREATE_URL12), len); + ok(!strcmp(szUrl, CREATE_URL12), "Expected %s, got %s\n", CREATE_URL12, szUrl); + + HeapFree(GetProcessHeap(), 0, szUrl); } static void HttpSendRequestEx_test(void)
1
0
0
0
Robert Shearman : wininet: Further InternetCreateFileW fixes.
by Alexandre Julliard
09 Mar '06
09 Mar '06
Module: wine Branch: refs/heads/master Commit: b0fcaf9d48fdc6fbc98fbaab5a8b833a7eae021e URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=b0fcaf9d48fdc6fbc98fbaa…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Thu Mar 9 15:19:15 2006 +0000 wininet: Further InternetCreateFileW fixes. - Add the slash after the port number. - Only add the port number if the host name is present. --- dlls/wininet/internet.c | 49 ++++++++++++++++++++++++++------------------- dlls/wininet/tests/http.c | 19 ++++++++++++++++- 2 files changed, 45 insertions(+), 23 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 5930ea5..e06c306 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -3783,20 +3783,23 @@ static BOOL calc_url_length(LPURL_COMPON if (lpUrlComponents->lpszHostName) { *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, HostName); + + if (!url_uses_default_port(nScheme, lpUrlComponents->nPort)) + { + char szPort[MAX_WORD_DIGITS]; + + sprintf(szPort, "%d", lpUrlComponents->nPort); + *lpdwUrlLength += strlen(szPort); + *lpdwUrlLength += strlen(":"); + } + if (lpUrlComponents->lpszUrlPath && *lpUrlComponents->lpszUrlPath != '/') (*lpdwUrlLength)++; /* '/' */ } - if (!url_uses_default_port(nScheme, lpUrlComponents->nPort)) - { - char szPort[MAX_WORD_DIGITS]; - - sprintf(szPort, "%d", lpUrlComponents->nPort); - *lpdwUrlLength += strlen(szPort); - *lpdwUrlLength += strlen(":"); - } + if (lpUrlComponents->lpszUrlPath) + *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, UrlPath); - *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, UrlPath); return TRUE; } @@ -4016,6 +4019,18 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COM memcpy(lpszUrl, lpUrlComponents->lpszHostName, dwLen * sizeof(WCHAR)); lpszUrl += dwLen; + if (!url_uses_default_port(nScheme, lpUrlComponents->nPort)) + { + WCHAR szPort[MAX_WORD_DIGITS]; + + sprintfW(szPort, percentD, lpUrlComponents->nPort); + *lpszUrl = ':'; + lpszUrl++; + dwLen = strlenW(szPort); + memcpy(lpszUrl, szPort, dwLen * sizeof(WCHAR)); + lpszUrl += dwLen; + } + /* add slash between hostname and path if necessary */ if (lpUrlComponents->lpszUrlPath && *lpUrlComponents->lpszUrlPath != '/') { @@ -4024,22 +4039,14 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COM } } - if (!url_uses_default_port(nScheme, lpUrlComponents->nPort)) - { - WCHAR szPort[MAX_WORD_DIGITS]; - sprintfW(szPort, percentD, lpUrlComponents->nPort); - *lpszUrl = ':'; - lpszUrl++; - dwLen = strlenW(szPort); - memcpy(lpszUrl, szPort, dwLen * sizeof(WCHAR)); + if (lpUrlComponents->lpszUrlPath) + { + dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, UrlPath); + memcpy(lpszUrl, lpUrlComponents->lpszUrlPath, dwLen * sizeof(WCHAR)); lpszUrl += dwLen; } - dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, UrlPath); - memcpy(lpszUrl, lpUrlComponents->lpszUrlPath, dwLen * sizeof(WCHAR)); - lpszUrl += dwLen; - *lpszUrl = '\0'; return TRUE; diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index a4b66eb..a202268 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -49,6 +49,7 @@ #define CREATE_URL8 "
https://username:password@www.winehq.org/site/about
" #define CREATE_URL9 "about:blank" #define CREATE_URL10 "about://host/blank" +#define CREATE_URL11 "about:" static HANDLE hCompleteEvent; @@ -1129,8 +1130,22 @@ static void InternetCreateUrlA_test(void szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len); ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len); ok(ret, "Expected success\n"); - ok(len == strlen(CREATE_URL10), "Expected len %d, got %ld\n", strlen(CREATE_URL9), len); - ok(!strcmp(szUrl, CREATE_URL10), "Expected %s, got %s\n", CREATE_URL9, szUrl); + ok(len == strlen(CREATE_URL10), "Expected len %d, got %ld\n", strlen(CREATE_URL10), len); + ok(!strcmp(szUrl, CREATE_URL10), "Expected %s, got %s\n", CREATE_URL10, szUrl); + + HeapFree(GetProcessHeap(), 0, szUrl); + + memset(&urlComp, 0, sizeof(urlComp)); + urlComp.dwStructSize = sizeof(URL_COMPONENTS); + urlComp.nPort = 8080; + urlComp.lpszScheme = "about"; + len = strlen(CREATE_URL11); + len++; /* work around bug in native wininet */ + szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len); + ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len); + ok(ret, "Expected success\n"); + ok(len == strlen(CREATE_URL11), "Expected len %d, got %ld\n", strlen(CREATE_URL11), len); + ok(!strcmp(szUrl, CREATE_URL11), "Expected %s, got %s\n", CREATE_URL11, szUrl); HeapFree(GetProcessHeap(), 0, szUrl); }
1
0
0
0
Robert Shearman : wininet: If necessary, add a slash between the hostname and path in
by Alexandre Julliard
09 Mar '06
09 Mar '06
Module: wine Branch: refs/heads/master Commit: d3047aaebabed5f04b2809a5069f50113d1deac4 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=d3047aaebabed5f04b2809a…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Thu Mar 9 15:18:24 2006 +0000 wininet: If necessary, add a slash between the hostname and path in InternetCreateUrlW. --- dlls/wininet/internet.c | 11 +++++++++++ dlls/wininet/tests/http.c | 17 +++++++++++++++++ 2 files changed, 28 insertions(+), 0 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 5beb622..5930ea5 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -3781,7 +3781,11 @@ static BOOL calc_url_length(LPURL_COMPON } if (lpUrlComponents->lpszHostName) + { *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, HostName); + if (lpUrlComponents->lpszUrlPath && *lpUrlComponents->lpszUrlPath != '/') + (*lpdwUrlLength)++; /* '/' */ + } if (!url_uses_default_port(nScheme, lpUrlComponents->nPort)) { @@ -4011,6 +4015,13 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COM dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, HostName); memcpy(lpszUrl, lpUrlComponents->lpszHostName, dwLen * sizeof(WCHAR)); lpszUrl += dwLen; + + /* add slash between hostname and path if necessary */ + if (lpUrlComponents->lpszUrlPath && *lpUrlComponents->lpszUrlPath != '/') + { + *lpszUrl = '/'; + lpszUrl++; + } } if (!url_uses_default_port(nScheme, lpUrlComponents->nPort)) diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 90a972c..a4b66eb 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -48,6 +48,7 @@ #define CREATE_URL7 "
http://username:password@www.winehq.org:42/site/about
" #define CREATE_URL8 "
https://username:password@www.winehq.org/site/about
" #define CREATE_URL9 "about:blank" +#define CREATE_URL10 "about://host/blank" static HANDLE hCompleteEvent; @@ -1109,6 +1110,7 @@ static void InternetCreateUrlA_test(void urlComp.lpszUrlPath = "blank"; urlComp.dwUrlPathLength = 5; len = strlen(CREATE_URL9); + len++; /* work around bug in native wininet */ szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len); ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len); ok(ret, "Expected success\n"); @@ -1116,6 +1118,21 @@ static void InternetCreateUrlA_test(void ok(!strcmp(szUrl, CREATE_URL9), "Expected %s, got %s\n", CREATE_URL9, szUrl); HeapFree(GetProcessHeap(), 0, szUrl); + + memset(&urlComp, 0, sizeof(urlComp)); + urlComp.dwStructSize = sizeof(URL_COMPONENTS); + urlComp.lpszScheme = "about"; + urlComp.lpszHostName = "host"; + urlComp.lpszUrlPath = "blank"; + len = strlen(CREATE_URL10); + len++; /* work around bug in native wininet */ + szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len); + ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len); + ok(ret, "Expected success\n"); + ok(len == strlen(CREATE_URL10), "Expected len %d, got %ld\n", strlen(CREATE_URL9), len); + ok(!strcmp(szUrl, CREATE_URL10), "Expected %s, got %s\n", CREATE_URL9, szUrl); + + HeapFree(GetProcessHeap(), 0, szUrl); } static void HttpSendRequestEx_test(void)
1
0
0
0
Robert Shearman : wininet: More InternetCreateUrlW fixes.
by Alexandre Julliard
09 Mar '06
09 Mar '06
Module: wine Branch: refs/heads/master Commit: 8eab78c235b10b8b359283e2a34c807823d1627b URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=8eab78c235b10b8b359283e…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Thu Mar 9 15:17:49 2006 +0000 wininet: More InternetCreateUrlW fixes. - Don't add double slashes for opaque URLs. - The default port number for all other schemes is 0. --- dlls/wininet/internet.c | 31 +++++++++++++++++++++++++++---- dlls/wininet/tests/http.c | 2 -- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 4a2f001..5beb622 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -3700,9 +3700,23 @@ static BOOL url_uses_default_port(INTERN (nPort == INTERNET_DEFAULT_GOPHER_PORT)) return TRUE; + if (nPort == INTERNET_INVALID_PORT_NUMBER) + return TRUE; + return FALSE; } +/* opaque urls do not fit into the standard url hierarchy and don't have + * two following slashes */ +static inline BOOL scheme_is_opaque(INTERNET_SCHEME nScheme) +{ + return (nScheme != INTERNET_SCHEME_FTP) && + (nScheme != INTERNET_SCHEME_GOPHER) && + (nScheme != INTERNET_SCHEME_HTTP) && + (nScheme != INTERNET_SCHEME_HTTPS) && + (nScheme != INTERNET_SCHEME_FILE); +} + static LPCWSTR INTERNET_GetSchemeString(INTERNET_SCHEME scheme) { int index; @@ -3742,7 +3756,9 @@ static BOOL calc_url_length(LPURL_COMPON *lpdwUrlLength += strlenW(scheme); } - *lpdwUrlLength += strlen("://"); + (*lpdwUrlLength)++; /* ':' */ + if (!scheme_is_opaque(nScheme) || lpUrlComponents->lpszHostName) + *lpdwUrlLength += strlen("//"); if (lpUrlComponents->lpszUserName) { @@ -3909,7 +3925,7 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COM DWORD dwLen; INTERNET_SCHEME nScheme; - static const WCHAR colonSlashW[] = {':','/','/'}; + static const WCHAR slashSlashW[] = {'/','/'}; static const WCHAR percentD[] = {'%','d',0}; TRACE("(%p,%ld,%p,%p)\n", lpUrlComponents, dwFlags, lpszUrl, lpdwUrlLength); @@ -3960,8 +3976,15 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COM lpszUrl += dwLen; } - memcpy(lpszUrl, colonSlashW, sizeof(colonSlashW)); - lpszUrl += sizeof(colonSlashW)/sizeof(colonSlashW[0]); + /* all schemes are followed by at least a colon */ + *lpszUrl = ':'; + lpszUrl++; + + if (!scheme_is_opaque(nScheme) || lpUrlComponents->lpszHostName) + { + memcpy(lpszUrl, slashSlashW, sizeof(slashSlashW)); + lpszUrl += sizeof(slashSlashW)/sizeof(slashSlashW[0]); + } if (lpUrlComponents->lpszUserName) { diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 72ab72c..90a972c 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -1111,11 +1111,9 @@ static void InternetCreateUrlA_test(void len = strlen(CREATE_URL9); szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len); ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len); - todo_wine { ok(ret, "Expected success\n"); ok(len == strlen(CREATE_URL9), "Expected len %d, got %ld\n", strlen(CREATE_URL9), len); ok(!strcmp(szUrl, CREATE_URL9), "Expected %s, got %s\n", CREATE_URL9, szUrl); - } HeapFree(GetProcessHeap(), 0, szUrl); }
1
0
0
0
Robert Shearman : wininet: Parse the scheme the string in InternetCreateFileW.
by Alexandre Julliard
09 Mar '06
09 Mar '06
Module: wine Branch: refs/heads/master Commit: e58a448c4a11c1d5058c81e1c786f10f4a80cf42 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=e58a448c4a11c1d5058c81e…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Thu Mar 9 15:16:41 2006 +0000 wininet: Parse the scheme the string in InternetCreateFileW. Parse the scheme the string in InternetCreateFileW and rewrite url_uses_default_port using schemes instead of strings. --- dlls/wininet/internet.c | 59 +++++++++++++++++++++++++++------------------ dlls/wininet/tests/http.c | 2 -- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 3255384..4a2f001 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -3685,28 +3685,19 @@ BOOL WINAPI InternetCombineUrlW(LPCWSTR #define URL_GET_COMP_LENGTHA(url, component) ((url)->dw##component##Length ? \ (url)->dw##component##Length : strlen((url)->lpsz##component)) -static BOOL url_uses_default_port(LPURL_COMPONENTSW lpUrlComponents) +static BOOL url_uses_default_port(INTERNET_SCHEME nScheme, INTERNET_PORT nPort) { - static const WCHAR httpW[] = {'h','t','t','p',0}; - static const WCHAR httpsW[] = {'h','t','t','p','s',0}; - static const WCHAR ftpW[] = {'f','t','p',0}; - static const WCHAR gopherW[] = {'g','o','p','h','e','r',0}; - DWORD len; - - if (!lpUrlComponents->lpszScheme) return FALSE; - - len = URL_GET_COMP_LENGTH(lpUrlComponents, Scheme); - if (!strncmpW(lpUrlComponents->lpszScheme, httpW, len) && - (lpUrlComponents->nPort == INTERNET_DEFAULT_HTTP_PORT)) + if ((nScheme == INTERNET_SCHEME_HTTP) && + (nPort == INTERNET_DEFAULT_HTTP_PORT)) return TRUE; - if (!strncmpW(lpUrlComponents->lpszScheme, httpsW, len) && - (lpUrlComponents->nPort == INTERNET_DEFAULT_HTTPS_PORT)) + if ((nScheme == INTERNET_SCHEME_HTTPS) && + (nPort == INTERNET_DEFAULT_HTTPS_PORT)) return TRUE; - if (!strncmpW(lpUrlComponents->lpszScheme, ftpW, len) && - (lpUrlComponents->nPort == INTERNET_DEFAULT_FTP_PORT)) + if ((nScheme == INTERNET_SCHEME_FTP) && + (nPort == INTERNET_DEFAULT_FTP_PORT)) return TRUE; - if (!strncmpW(lpUrlComponents->lpszScheme, gopherW, len) && - (lpUrlComponents->nPort == INTERNET_DEFAULT_GOPHER_PORT)) + if ((nScheme == INTERNET_SCHEME_GOPHER) && + (nPort == INTERNET_DEFAULT_GOPHER_PORT)) return TRUE; return FALSE; @@ -3729,14 +3720,25 @@ static LPCWSTR INTERNET_GetSchemeString( static BOOL calc_url_length(LPURL_COMPONENTSW lpUrlComponents, LPDWORD lpdwUrlLength) { + INTERNET_SCHEME nScheme; + *lpdwUrlLength = 0; if (lpUrlComponents->lpszScheme) - *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, Scheme); + { + DWORD dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, Scheme); + *lpdwUrlLength += dwLen; + nScheme = GetInternetSchemeW(lpUrlComponents->lpszScheme, dwLen); + } else { - LPCWSTR scheme = INTERNET_GetSchemeString(lpUrlComponents->nScheme); - TRACE("got scheme %s\n", debugstr_w(scheme)); + LPCWSTR scheme; + + nScheme = lpUrlComponents->nScheme; + + if (nScheme == INTERNET_SCHEME_DEFAULT) + nScheme = INTERNET_SCHEME_HTTP; + scheme = INTERNET_GetSchemeString(nScheme); *lpdwUrlLength += strlenW(scheme); } @@ -3765,7 +3767,7 @@ static BOOL calc_url_length(LPURL_COMPON if (lpUrlComponents->lpszHostName) *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, HostName); - if (!url_uses_default_port(lpUrlComponents)) + if (!url_uses_default_port(nScheme, lpUrlComponents->nPort)) { char szPort[MAX_WORD_DIGITS]; @@ -3905,6 +3907,7 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COM LPWSTR lpszUrl, LPDWORD lpdwUrlLength) { DWORD dwLen; + INTERNET_SCHEME nScheme; static const WCHAR colonSlashW[] = {':','/','/'}; static const WCHAR percentD[] = {'%','d',0}; @@ -3940,10 +3943,18 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COM dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, Scheme); memcpy(lpszUrl, lpUrlComponents->lpszScheme, dwLen * sizeof(WCHAR)); lpszUrl += dwLen; + + nScheme = GetInternetSchemeW(lpUrlComponents->lpszScheme, dwLen); } else { - LPCWSTR scheme = INTERNET_GetSchemeString(lpUrlComponents->nScheme); + LPCWSTR scheme; + nScheme = lpUrlComponents->nScheme; + + if (nScheme == INTERNET_SCHEME_DEFAULT) + nScheme = INTERNET_SCHEME_HTTP; + + scheme = INTERNET_GetSchemeString(nScheme); dwLen = strlenW(scheme); memcpy(lpszUrl, scheme, dwLen * sizeof(WCHAR)); lpszUrl += dwLen; @@ -3979,7 +3990,7 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COM lpszUrl += dwLen; } - if (!url_uses_default_port(lpUrlComponents)) + if (!url_uses_default_port(nScheme, lpUrlComponents->nPort)) { WCHAR szPort[MAX_WORD_DIGITS]; diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 92f4c60..72ab72c 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -917,13 +917,11 @@ static void InternetCreateUrlA_test(void SetLastError(0xdeadbeef); urlComp.lpszScheme = NULL; ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len); - todo_wine { ok(ret, "Expected success\n"); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(len == 50, "Expected len 50, got %ld\n", len); ok(!strcmp(szUrl, CREATE_URL1), "Expected %s, got %s\n", CREATE_URL1, szUrl); - } /* alloced szUrl, invalid nScheme * any nScheme out of range seems ignored
1
0
0
0
Robert Shearman : wininet: Get the string for the scheme if specified only by the
by Alexandre Julliard
09 Mar '06
09 Mar '06
Module: wine Branch: refs/heads/master Commit: 02839948d25a1cc99c5c89c9596ae3c3502631fe URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=02839948d25a1cc99c5c89c…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Thu Mar 9 15:15:45 2006 +0000 wininet: Get the string for the scheme if specified only by the INTERNET_SCHEME enumeration in InternetCreateUrlW. --- dlls/wininet/internet.c | 28 +++++++++++++++++++++++++++- dlls/wininet/tests/http.c | 18 ++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 7b87009..3255384 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -3712,6 +3712,17 @@ static BOOL url_uses_default_port(LPURL_ return FALSE; } +static LPCWSTR INTERNET_GetSchemeString(INTERNET_SCHEME scheme) +{ + int index; + if (scheme < INTERNET_SCHEME_FIRST) + return NULL; + index = scheme - INTERNET_SCHEME_FIRST; + if (index >= sizeof(url_schemes)/sizeof(url_schemes[0])) + return NULL; + return (LPCWSTR)&url_schemes[index]; +} + /* we can calculate using ansi strings because we're just * calculating string length, not size */ @@ -3720,7 +3731,15 @@ static BOOL calc_url_length(LPURL_COMPON { *lpdwUrlLength = 0; - *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, Scheme); + if (lpUrlComponents->lpszScheme) + *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, Scheme); + else + { + LPCWSTR scheme = INTERNET_GetSchemeString(lpUrlComponents->nScheme); + TRACE("got scheme %s\n", debugstr_w(scheme)); + *lpdwUrlLength += strlenW(scheme); + } + *lpdwUrlLength += strlen("://"); if (lpUrlComponents->lpszUserName) @@ -3922,6 +3941,13 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COM memcpy(lpszUrl, lpUrlComponents->lpszScheme, dwLen * sizeof(WCHAR)); lpszUrl += dwLen; } + else + { + LPCWSTR scheme = INTERNET_GetSchemeString(lpUrlComponents->nScheme); + dwLen = strlenW(scheme); + memcpy(lpszUrl, scheme, dwLen * sizeof(WCHAR)); + lpszUrl += dwLen; + } memcpy(lpszUrl, colonSlashW, sizeof(colonSlashW)); lpszUrl += sizeof(colonSlashW)/sizeof(colonSlashW[0]); diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 5d25f0c..92f4c60 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -47,6 +47,7 @@ #define CREATE_URL6 "nhttp://username:password@www.winehq.org:80/site/about" #define CREATE_URL7 "
http://username:password@www.winehq.org:42/site/about
" #define CREATE_URL8 "
https://username:password@www.winehq.org/site/about
" +#define CREATE_URL9 "about:blank" static HANDLE hCompleteEvent; @@ -1102,6 +1103,23 @@ static void InternetCreateUrlA_test(void ok(!strcmp(szUrl, CREATE_URL8), "Expected %s, got %s\n", CREATE_URL8, szUrl); HeapFree(GetProcessHeap(), 0, szUrl); + + memset(&urlComp, 0, sizeof(urlComp)); + urlComp.dwStructSize = sizeof(URL_COMPONENTS); + urlComp.lpszScheme = "about"; + urlComp.dwSchemeLength = 5; + urlComp.lpszUrlPath = "blank"; + urlComp.dwUrlPathLength = 5; + len = strlen(CREATE_URL9); + szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len); + ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len); + todo_wine { + ok(ret, "Expected success\n"); + ok(len == strlen(CREATE_URL9), "Expected len %d, got %ld\n", strlen(CREATE_URL9), len); + ok(!strcmp(szUrl, CREATE_URL9), "Expected %s, got %s\n", CREATE_URL9, szUrl); + } + + HeapFree(GetProcessHeap(), 0, szUrl); } static void HttpSendRequestEx_test(void)
1
0
0
0
Robert Shearman : wininet: The host name is optional in InternetCreateUrlW.
by Alexandre Julliard
09 Mar '06
09 Mar '06
Module: wine Branch: refs/heads/master Commit: 01219c65aa1d23bf56da3126039ffe5ee41e97e7 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=01219c65aa1d23bf56da312…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Thu Mar 9 15:15:00 2006 +0000 wininet: The host name is optional in InternetCreateUrlW. --- dlls/wininet/internet.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 55f6acc..7b87009 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -3743,7 +3743,8 @@ static BOOL calc_url_length(LPURL_COMPON *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, Password); } - *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, HostName); + if (lpUrlComponents->lpszHostName) + *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, HostName); if (!url_uses_default_port(lpUrlComponents)) { @@ -3945,9 +3946,12 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COM lpszUrl++; } - dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, HostName); - memcpy(lpszUrl, lpUrlComponents->lpszHostName, dwLen * sizeof(WCHAR)); - lpszUrl += dwLen; + if (lpUrlComponents->lpszHostName) + { + dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, HostName); + memcpy(lpszUrl, lpUrlComponents->lpszHostName, dwLen * sizeof(WCHAR)); + lpszUrl += dwLen; + } if (!url_uses_default_port(lpUrlComponents)) {
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
59
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
Results per page:
10
25
50
100
200