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
August 2008
----- 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
839 discussions
Start a n
N
ew thread
Kirill K. Smirnov : winhlp32: Fix offsets handling for old 3.0 files.
by Alexandre Julliard
19 Aug '08
19 Aug '08
Module: wine Branch: master Commit: 4c387a9567870173ea3b5c6540fe2d0b8f63fafa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4c387a9567870173ea3b5c654…
Author: Kirill K. Smirnov <lich(a)math.spbu.ru> Date: Wed Aug 6 19:48:03 2008 +0400 winhlp32: Fix offsets handling for old 3.0 files. --- programs/winhlp32/hlpfile.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/programs/winhlp32/hlpfile.c b/programs/winhlp32/hlpfile.c index c941bbd..e54d3bf 100644 --- a/programs/winhlp32/hlpfile.c +++ b/programs/winhlp32/hlpfile.c @@ -283,7 +283,7 @@ static BOOL HLPFILE_DoReadHlpFile(HLPFILE *hlpfile, LPCSTR lpszPath) OFSTRUCT ofs; BYTE* buf; DWORD ref = 0x0C; - unsigned index, old_index, offset, len, offs; + unsigned index, old_index, offset, len, offs, topicoffset; hFile = OpenFile(lpszPath, &ofs, OF_READ); if (hFile == HFILE_ERROR) return FALSE; @@ -339,7 +339,11 @@ static BOOL HLPFILE_DoReadHlpFile(HLPFILE *hlpfile, LPCSTR lpszPath) switch (buf[0x14]) { case 0x02: - if (!HLPFILE_AddPage(hlpfile, buf, end, ref, index * 0x8000L + offs)) return FALSE; + if (hlpfile->version <= 16) + topicoffset = ref + index * 12; + else + topicoffset = index * 0x8000 + offs; + if (!HLPFILE_AddPage(hlpfile, buf, end, ref, topicoffset)) return FALSE; break; case 0x01:
1
0
0
0
Kirill K. Smirnov : winhlp32: Load internal file containing pagenum-> topicoffset mapping.
by Alexandre Julliard
19 Aug '08
19 Aug '08
Module: wine Branch: master Commit: deb98a4e83837fa8d575c32302edb1516d21dc2b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=deb98a4e83837fa8d575c3230…
Author: Kirill K. Smirnov <lich(a)math.spbu.ru> Date: Wed Aug 6 19:47:11 2008 +0400 winhlp32: Load internal file containing pagenum->topicoffset mapping. --- programs/winhlp32/hlpfile.c | 23 +++++++++++++++++++++++ programs/winhlp32/hlpfile.h | 2 ++ 2 files changed, 25 insertions(+), 0 deletions(-) diff --git a/programs/winhlp32/hlpfile.c b/programs/winhlp32/hlpfile.c index 05d5347..c941bbd 100644 --- a/programs/winhlp32/hlpfile.c +++ b/programs/winhlp32/hlpfile.c @@ -63,6 +63,7 @@ static BOOL HLPFILE_Uncompress_Topic(HLPFILE*); static BOOL HLPFILE_GetContext(HLPFILE*); static BOOL HLPFILE_GetKeywords(HLPFILE*); static BOOL HLPFILE_GetMap(HLPFILE*); +static BOOL HLPFILE_GetTOMap(HLPFILE*); static BOOL HLPFILE_AddPage(HLPFILE*, const BYTE*, const BYTE*, unsigned, unsigned); static BOOL HLPFILE_SkipParagraph(HLPFILE*, const BYTE*, const BYTE*, unsigned*); static void HLPFILE_Uncompress2(HLPFILE*, const BYTE*, const BYTE*, BYTE*, const BYTE*); @@ -293,6 +294,8 @@ static BOOL HLPFILE_DoReadHlpFile(HLPFILE *hlpfile, LPCSTR lpszPath) if (!HLPFILE_SystemCommands(hlpfile)) return FALSE; + if (hlpfile->version <= 16 && !HLPFILE_GetTOMap(hlpfile)) return FALSE; + /* load phrases support */ if (!HLPFILE_UncompressLZ77_Phrases(hlpfile)) HLPFILE_Uncompress_Phrases40(hlpfile); @@ -2577,6 +2580,26 @@ static BOOL HLPFILE_GetMap(HLPFILE *hlpfile) /*********************************************************************** * + * HLPFILE_GetTOMap + */ +static BOOL HLPFILE_GetTOMap(HLPFILE *hlpfile) +{ + BYTE *cbuf, *cend; + unsigned clen; + + if (!HLPFILE_FindSubFile(hlpfile, "|TOMAP", &cbuf, &cend)) + {WINE_WARN("no tomap section\n"); return FALSE;} + + clen = cend - cbuf - 9; + hlpfile->TOMap = HeapAlloc(GetProcessHeap(), 0, clen); + if (!hlpfile->TOMap) return FALSE; + memcpy(hlpfile->TOMap, cbuf+9, clen); + hlpfile->wTOMapLen = clen/4; + return TRUE; +} + +/*********************************************************************** + * * DeleteMacro */ static void HLPFILE_DeleteMacro(HLPFILE_MACRO* macro) diff --git a/programs/winhlp32/hlpfile.h b/programs/winhlp32/hlpfile.h index 5097259..b0d1f23 100644 --- a/programs/winhlp32/hlpfile.h +++ b/programs/winhlp32/hlpfile.h @@ -100,6 +100,8 @@ typedef struct tagHlpFileFile BYTE* kwdata; unsigned wMapLen; HLPFILE_MAP* Map; + unsigned wTOMapLen; + unsigned* TOMap; unsigned long contents_start; struct tagHlpFileFile* prev;
1
0
0
0
Hans Leidekker : include: Add prototype for WinHttpQueryOption.
by Alexandre Julliard
19 Aug '08
19 Aug '08
Module: wine Branch: master Commit: a591c64ffd624a9577c3af5c798f29c6c3359e86 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a591c64ffd624a9577c3af5c7…
Author: Hans Leidekker <hans(a)meelstraat.net> Date: Fri Aug 15 14:44:32 2008 +0200 include: Add prototype for WinHttpQueryOption. --- include/winhttp.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/include/winhttp.h b/include/winhttp.h index 4c64768..e67d6c2 100644 --- a/include/winhttp.h +++ b/include/winhttp.h @@ -525,7 +525,7 @@ HINTERNET WINAPI WinHttpConnect(HINTERNET,LPCWSTR,INTERNET_PORT,DWORD); BOOL WINAPI WinHttpCrackUrl(LPCWSTR,DWORD,DWORD,LPURL_COMPONENTS); BOOL WINAPI WinHttpCreateUrl(LPURL_COMPONENTS,DWORD,LPWSTR,LPDWORD); BOOL WINAPI WinHttpGetDefaultProxyConfiguration(WINHTTP_PROXY_INFO*); -BOOL WINAPI WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG* config); +BOOL WINAPI WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG*); BOOL WINAPI WinHttpGetProxyForUrl(HINTERNET,LPCWSTR,WINHTTP_AUTOPROXY_OPTIONS*,WINHTTP_PROXY_INFO*); HINTERNET WINAPI WinHttpOpen(LPCWSTR,DWORD,LPCWSTR,LPCWSTR,DWORD); HINTERNET WINAPI WinHttpOpenRequest(HINTERNET,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR*,DWORD); @@ -533,6 +533,7 @@ BOOL WINAPI WinHttpQueryAuthParams(HINTERNET,DWORD,LPVOID*); BOOL WINAPI WinHttpQueryAuthSchemes(HINTERNET,LPDWORD,LPDWORD,LPDWORD); BOOL WINAPI WinHttpQueryDataAvailable(HINTERNET,LPDWORD); BOOL WINAPI WinHttpQueryHeaders(HINTERNET,DWORD,LPCWSTR,LPVOID,LPDWORD,LPDWORD); +BOOL WINAPI WinHttpQueryOption(HINTERNET,DWORD,LPVOID,LPDWORD); BOOL WINAPI WinHttpReadData(HINTERNET,LPVOID,DWORD,LPDWORD); BOOL WINAPI WinHttpReceiveResponse(HINTERNET,LPVOID); BOOL WINAPI WinHttpSendRequest(HINTERNET,LPCWSTR,DWORD,LPVOID,DWORD,DWORD,DWORD_PTR);
1
0
0
0
Hans Leidekker : winhttp: Implement WinHttpTimeFromSystemTime and WinHttpTimeToSystemTime.
by Alexandre Julliard
19 Aug '08
19 Aug '08
Module: wine Branch: master Commit: 250cac32ca5ff4e7c282bd25abb4f1ae171476b8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=250cac32ca5ff4e7c282bd25a…
Author: Hans Leidekker <hans(a)meelstraat.net> Date: Fri Aug 15 14:44:16 2008 +0200 winhttp: Implement WinHttpTimeFromSystemTime and WinHttpTimeToSystemTime. --- dlls/winhttp/main.c | 22 -------- dlls/winhttp/session.c | 113 ++++++++++++++++++++++++++++++++++++++++++ dlls/winhttp/tests/winhttp.c | 12 ++-- 3 files changed, 119 insertions(+), 28 deletions(-) diff --git a/dlls/winhttp/main.c b/dlls/winhttp/main.c index 6aa59df..c503e23 100644 --- a/dlls/winhttp/main.c +++ b/dlls/winhttp/main.c @@ -165,28 +165,6 @@ BOOL WINAPI WinHttpWriteData (HINTERNET hRequest, LPCVOID lpBuffer, } /*********************************************************************** - * WinHttpTimeFromSystemTime (winhttp.@) - */ -BOOL WINAPI WinHttpTimeFromSystemTime (CONST SYSTEMTIME* pst, LPWSTR pwszTime) -{ - FIXME("(%p, %p): stub\n", pst, pwszTime); - - SetLastError(ERROR_NOT_SUPPORTED); - return FALSE; -} - -/*********************************************************************** - * WinHttpTimeToSystemTime (winhttp.@) - */ -BOOL WINAPI WinHttpTimeToSystemTime (LPCWSTR pwszTime, SYSTEMTIME* pst) -{ - FIXME("(%s, %p): stub\n", debugstr_w(pwszTime), pst); - - SetLastError(ERROR_NOT_SUPPORTED); - return FALSE; -} - -/*********************************************************************** * WinHttpQueryHeaders (winhttp.@) */ BOOL WINAPI WinHttpQueryHeaders (HINTERNET hRequest, DWORD dwInfoLevel, LPCWSTR pwszName, diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index dd612ec..eb2c71f 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -391,3 +391,116 @@ WINHTTP_STATUS_CALLBACK WINAPI WinHttpSetStatusCallback( HINTERNET handle, WINHT release_object( hdr ); return ret; } + +static const WCHAR wkday[7][4] = + {{'S','u','n', 0}, {'M','o','n', 0}, {'T','u','e', 0}, {'W','e','d', 0}, + {'T','h','u', 0}, {'F','r','i', 0}, {'S','a','t', 0}}; +static const WCHAR month[12][4] = + {{'J','a','n', 0}, {'F','e','b', 0}, {'M','a','r', 0}, {'A','p','r', 0}, + {'M','a','y', 0}, {'J','u','n', 0}, {'J','u','l', 0}, {'A','u','g', 0}, + {'S','e','p', 0}, {'O','c','t', 0}, {'N','o','v', 0}, {'D','e','c', 0}}; + +/*********************************************************************** + * WinHttpTimeFromSystemTime (WININET.@) + */ +BOOL WINAPI WinHttpTimeFromSystemTime( const SYSTEMTIME *time, LPWSTR string ) +{ + static const WCHAR format[] = + {'%','s',',',' ','%','0','2','d',' ','%','s',' ','%','4','d',' ','%','0', + '2','d',':','%','0','2','d',':','%','0','2','d',' ','G','M','T', 0}; + + TRACE("%p, %p\n", time, string); + + if (!time || !string) return FALSE; + + sprintfW( string, format, + wkday[time->wDayOfWeek], + time->wDay, + month[time->wMonth - 1], + time->wYear, + time->wHour, + time->wMinute, + time->wSecond ); + + return TRUE; +} + +/*********************************************************************** + * WinHttpTimeToSystemTime (WININET.@) + */ +BOOL WINAPI WinHttpTimeToSystemTime( LPCWSTR string, SYSTEMTIME *time ) +{ + unsigned int i; + const WCHAR *s = string; + WCHAR *end; + + TRACE("%s, %p\n", debugstr_w(string), time); + + if (!string || !time) return FALSE; + + /* Windows does this too */ + GetSystemTime( time ); + + /* Convert an RFC1123 time such as 'Fri, 07 Jan 2005 12:06:35 GMT' into + * a SYSTEMTIME structure. + */ + + while (*s && !isalphaW( *s )) s++; + if (s[0] == '\0' || s[1] == '\0' || s[2] == '\0') return TRUE; + time->wDayOfWeek = 7; + + for (i = 0; i < 7; i++) + { + if (toupperW( wkday[i][0] ) == toupperW( s[0] ) && + toupperW( wkday[i][1] ) == toupperW( s[1] ) && + toupperW( wkday[i][2] ) == toupperW( s[2] ) ) + { + time->wDayOfWeek = i; + break; + } + } + + if (time->wDayOfWeek > 6) return TRUE; + while (*s && !isdigitW( *s )) s++; + time->wDay = strtolW( s, &end, 10 ); + s = end; + + while (*s && !isalphaW( *s )) s++; + if (s[0] == '\0' || s[1] == '\0' || s[2] == '\0') return TRUE; + time->wMonth = 0; + + for (i = 0; i < 12; i++) + { + if (toupperW( month[i][0]) == toupperW( s[0] ) && + toupperW( month[i][1]) == toupperW( s[1] ) && + toupperW( month[i][2]) == toupperW( s[2] ) ) + { + time->wMonth = i + 1; + break; + } + } + if (time->wMonth == 0) return TRUE; + + while (*s && !isdigitW( *s )) s++; + if (*s == '\0') return TRUE; + time->wYear = strtolW( s, &end, 10 ); + s = end; + + while (*s && !isdigitW( *s )) s++; + if (*s == '\0') return TRUE; + time->wHour = strtolW( s, &end, 10 ); + s = end; + + while (*s && !isdigitW( *s )) s++; + if (*s == '\0') return TRUE; + time->wMinute = strtolW( s, &end, 10 ); + s = end; + + while (*s && !isdigitW( *s )) s++; + if (*s == '\0') return TRUE; + time->wSecond = strtolW( s, &end, 10 ); + s = end; + + time->wMilliseconds = 0; + return TRUE; +} diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index abfa713..395d66f 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -151,8 +151,8 @@ static void test_WinHttpTimeFromSystemTime(void) WCHAR time_string[WINHTTP_TIME_FORMAT_BUFSIZE+1]; ret = WinHttpTimeFromSystemTime(&time, time_string); - todo_wine ok(ret == TRUE, "WinHttpTimeFromSystemTime failed: %u\n", GetLastError()); - todo_wine ok(memcmp(time_string, expected_string, sizeof(expected_string)) == 0, + ok(ret == TRUE, "WinHttpTimeFromSystemTime failed: %u\n", GetLastError()); + ok(memcmp(time_string, expected_string, sizeof(expected_string)) == 0, "Time string returned did not match expected time string.\n"); } @@ -169,13 +169,13 @@ static void test_WinHttpTimeToSystemTime(void) '1','0',' ','0','5',' ','5','2','\n',0}; ret = WinHttpTimeToSystemTime(time_string1, &time); - todo_wine ok(ret == TRUE, "WinHttpTimeToSystemTime failed: %u\n", GetLastError()); - todo_wine ok(memcmp(&time, &expected_time, sizeof(SYSTEMTIME)) == 0, + ok(ret == TRUE, "WinHttpTimeToSystemTime failed: %u\n", GetLastError()); + ok(memcmp(&time, &expected_time, sizeof(SYSTEMTIME)) == 0, "Returned SYSTEMTIME structure did not match expected SYSTEMTIME structure.\n"); ret = WinHttpTimeToSystemTime(time_string2, &time); - todo_wine ok(ret == TRUE, "WinHttpTimeToSystemTime failed: %u\n", GetLastError()); - todo_wine ok(memcmp(&time, &expected_time, sizeof(SYSTEMTIME)) == 0, + ok(ret == TRUE, "WinHttpTimeToSystemTime failed: %u\n", GetLastError()); + ok(memcmp(&time, &expected_time, sizeof(SYSTEMTIME)) == 0, "Returned SYSTEMTIME structure did not match expected SYSTEMTIME structure.\n"); }
1
0
0
0
Hans Leidekker : winhttp: Forward WinHttpCrackUrl and WinHttpCreateUrl to wininet for the time being .
by Alexandre Julliard
19 Aug '08
19 Aug '08
Module: wine Branch: master Commit: 877d6c95c6e341cf3fc5f968fb4f88509c0b6937 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=877d6c95c6e341cf3fc5f968f…
Author: Hans Leidekker <hans(a)meelstraat.net> Date: Fri Aug 15 14:43:47 2008 +0200 winhttp: Forward WinHttpCrackUrl and WinHttpCreateUrl to wininet for the time being. --- dlls/winhttp/Makefile.in | 2 +- dlls/winhttp/main.c | 21 +++++++++++++++++++++ dlls/winhttp/winhttp.spec | 4 ++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/dlls/winhttp/Makefile.in b/dlls/winhttp/Makefile.in index c83e630..c65adbd 100644 --- a/dlls/winhttp/Makefile.in +++ b/dlls/winhttp/Makefile.in @@ -4,7 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = winhttp.dll IMPORTLIB = winhttp -IMPORTS = kernel32 +IMPORTS = wininet kernel32 C_SRCS = \ handle.c \ diff --git a/dlls/winhttp/main.c b/dlls/winhttp/main.c index bec3cc0..6aa59df 100644 --- a/dlls/winhttp/main.c +++ b/dlls/winhttp/main.c @@ -209,3 +209,24 @@ BOOL WINAPI WinHttpAddRequestHeaders (HINTERNET hRequest, LPCWSTR pwszHeaders, SetLastError(ERROR_NOT_SUPPORTED); return FALSE; } + +BOOL WINAPI InternetCrackUrlW( LPCWSTR, DWORD, DWORD, LPURL_COMPONENTSW ); +BOOL WINAPI InternetCreateUrlW( LPURL_COMPONENTS, DWORD, LPWSTR, LPDWORD ); + +/*********************************************************************** + * WinHttpCrackUrl (winhttp.@) + */ +BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONENTSW components ) +{ + TRACE("%s, %d, %x, %p\n", debugstr_w(url), len, flags, components); + return InternetCrackUrlW( url, len, flags, components ); +} + +/*********************************************************************** + * WinHttpCreateUrl (winhttp.@) + */ +BOOL WINAPI WinHttpCreateUrl( LPURL_COMPONENTS comps, DWORD flags, LPWSTR url, LPDWORD len ) +{ + TRACE("%p, 0x%08x, %p, %p\n", comps, flags, url, len); + return InternetCreateUrlW( comps, flags, url, len ); +} diff --git a/dlls/winhttp/winhttp.spec b/dlls/winhttp/winhttp.spec index e86fe60..08e4d93 100644 --- a/dlls/winhttp/winhttp.spec +++ b/dlls/winhttp/winhttp.spec @@ -6,8 +6,8 @@ @ stdcall WinHttpCheckPlatform() @ stdcall WinHttpCloseHandle(ptr) @ stdcall WinHttpConnect(ptr wstr long long) -@ stub WinHttpCrackUrl -@ stub WinHttpCreateUrl +@ stdcall WinHttpCrackUrl(wstr long long ptr) +@ stdcall WinHttpCreateUrl(ptr long ptr ptr) @ stdcall WinHttpDetectAutoProxyConfigUrl(long ptr) @ stdcall WinHttpGetDefaultProxyConfiguration(ptr) @ stdcall WinHttpGetIEProxyConfigForCurrentUser(ptr)
1
0
0
0
Hans Leidekker : winhttp: Add stub implementations for WinHttpGetDefaultProxyConfiguration, WinHttpGetProxyForUrl and WinHttpSetDefaultProxyConfiguration.
by Alexandre Julliard
19 Aug '08
19 Aug '08
Module: wine Branch: master Commit: 587162c3b6ffe0dc977fbd037521234f52e42f39 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=587162c3b6ffe0dc977fbd037…
Author: Hans Leidekker <hans(a)meelstraat.net> Date: Fri Aug 15 14:43:23 2008 +0200 winhttp: Add stub implementations for WinHttpGetDefaultProxyConfiguration, WinHttpGetProxyForUrl and WinHttpSetDefaultProxyConfiguration. --- dlls/winhttp/main.c | 33 --------------------- dlls/winhttp/session.c | 71 +++++++++++++++++++++++++++++++++++++++++++++ dlls/winhttp/winhttp.spec | 6 ++-- 3 files changed, 74 insertions(+), 36 deletions(-) diff --git a/dlls/winhttp/main.c b/dlls/winhttp/main.c index 44a1e42..bec3cc0 100644 --- a/dlls/winhttp/main.c +++ b/dlls/winhttp/main.c @@ -84,39 +84,6 @@ HRESULT WINAPI DllUnregisterServer(void) } /*********************************************************************** - * WinHttpDetectAutoProxyConfigUrl (winhttp.@) - */ -BOOL WINAPI WinHttpDetectAutoProxyConfigUrl(DWORD flags, LPWSTR *url) -{ - FIXME("(%x %p)\n", flags, url); - - SetLastError(ERROR_WINHTTP_AUTODETECTION_FAILED); - return FALSE; -} - -/*********************************************************************** - * WinHttpGetIEProxyConfigForCurrentUser (winhttp.@) - */ -BOOL WINAPI WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG* config) -{ - if(!config) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - /* TODO: read from HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings */ - FIXME("returning no proxy used\n"); - config->fAutoDetect = FALSE; - config->lpszAutoConfigUrl = NULL; - config->lpszProxy = NULL; - config->lpszProxyBypass = NULL; - - SetLastError(ERROR_SUCCESS); - return TRUE; -} - -/*********************************************************************** * WinHttpSendRequest (winhttp.@) */ BOOL WINAPI WinHttpSendRequest (HINTERNET hRequest, LPCWSTR pwszHeaders, DWORD dwHeadersLength, diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 26f229e..dd612ec 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -298,6 +298,77 @@ BOOL WINAPI WinHttpCloseHandle( HINTERNET handle ) } /*********************************************************************** + * WinHttpDetectAutoProxyConfigUrl (winhttp.@) + */ +BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url ) +{ + FIXME("0x%08x, %p\n", flags, url); + + set_last_error( ERROR_WINHTTP_AUTODETECTION_FAILED ); + return FALSE; +} + +/*********************************************************************** + * WinHttpGetDefaultProxyConfiguration (winhttp.@) + */ +BOOL WINAPI WinHttpGetDefaultProxyConfiguration( WINHTTP_PROXY_INFO *info ) +{ + FIXME("%p\n", info); + + info->dwAccessType = WINHTTP_ACCESS_TYPE_NO_PROXY; + info->lpszProxy = NULL; + info->lpszProxyBypass = NULL; + + return TRUE; +} + +/*********************************************************************** + * WinHttpGetIEProxyConfigForCurrentUser (winhttp.@) + */ +BOOL WINAPI WinHttpGetIEProxyConfigForCurrentUser( WINHTTP_CURRENT_USER_IE_PROXY_CONFIG *config ) +{ + TRACE("%p\n", config); + + if (!config) + { + set_last_error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + + /* FIXME: read from HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings */ + + FIXME("returning no proxy used\n"); + config->fAutoDetect = FALSE; + config->lpszAutoConfigUrl = NULL; + config->lpszProxy = NULL; + config->lpszProxyBypass = NULL; + + return TRUE; +} + +/*********************************************************************** + * WinHttpGetProxyForUrl (winhttp.@) + */ +BOOL WINAPI WinHttpGetProxyForUrl( HINTERNET hsession, LPCWSTR url, WINHTTP_AUTOPROXY_OPTIONS *options, + WINHTTP_PROXY_INFO *info ) +{ + FIXME("%p, %s, %p, %p\n", hsession, debugstr_w(url), options, info); + + set_last_error( ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR ); + return FALSE; +} + +/*********************************************************************** + * WinHttpSetDefaultProxyConfiguration (winhttp.@) + */ +BOOL WINAPI WinHttpSetDefaultProxyConfiguration( WINHTTP_PROXY_INFO *info ) +{ + FIXME("%p [%u, %s, %s]\n", info, info->dwAccessType, debugstr_w(info->lpszProxy), + debugstr_w(info->lpszProxyBypass)); + return TRUE; +} + +/*********************************************************************** * WinHttpSetStatusCallback (winhttp.@) */ WINHTTP_STATUS_CALLBACK WINAPI WinHttpSetStatusCallback( HINTERNET handle, WINHTTP_STATUS_CALLBACK callback, diff --git a/dlls/winhttp/winhttp.spec b/dlls/winhttp/winhttp.spec index dc13d5d..e86fe60 100644 --- a/dlls/winhttp/winhttp.spec +++ b/dlls/winhttp/winhttp.spec @@ -9,9 +9,9 @@ @ stub WinHttpCrackUrl @ stub WinHttpCreateUrl @ stdcall WinHttpDetectAutoProxyConfigUrl(long ptr) -@ stub WinHttpGetDefaultProxyConfiguration +@ stdcall WinHttpGetDefaultProxyConfiguration(ptr) @ stdcall WinHttpGetIEProxyConfigForCurrentUser(ptr) -@ stub WinHttpGetProxyForUrl +@ stdcall WinHttpGetProxyForUrl(ptr wstr ptr ptr) @ stdcall WinHttpOpen(wstr long wstr wstr long) @ stdcall WinHttpOpenRequest(ptr wstr wstr wstr wstr ptr long) @ stub WinHttpQueryAuthSchemes @@ -22,7 +22,7 @@ @ stdcall WinHttpReceiveResponse(ptr ptr) @ stdcall WinHttpSendRequest(ptr wstr long ptr long long ptr) @ stub WinHttpSetCredentials -@ stub WinHttpSetDefaultProxyConfiguration +@ stdcall WinHttpSetDefaultProxyConfiguration(ptr long long wstr ptr ptr) @ stdcall WinHttpSetOption(ptr long ptr long) @ stdcall WinHttpSetStatusCallback(ptr ptr long ptr) @ stub WinHttpSetTimeouts
1
0
0
0
Hans Leidekker : winhttp: Implement WinHttpSetStatusCallback. Start sending notifications.
by Alexandre Julliard
19 Aug '08
19 Aug '08
Module: wine Branch: master Commit: a3d9df7d4d6ab85a44468494c79251a26c692503 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a3d9df7d4d6ab85a44468494c…
Author: Hans Leidekker <hans(a)meelstraat.net> Date: Fri Aug 15 14:43:07 2008 +0200 winhttp: Implement WinHttpSetStatusCallback. Start sending notifications. --- dlls/winhttp/handle.c | 2 ++ dlls/winhttp/session.c | 33 +++++++++++++++++++++++++++++++++ dlls/winhttp/winhttp.spec | 2 +- dlls/winhttp/winhttp_private.h | 2 ++ 4 files changed, 38 insertions(+), 1 deletions(-) diff --git a/dlls/winhttp/handle.c b/dlls/winhttp/handle.c index 8886788..607bfcd 100644 --- a/dlls/winhttp/handle.c +++ b/dlls/winhttp/handle.c @@ -77,6 +77,8 @@ void release_object( object_header_t *hdr ) TRACE("object %p refcount = %d\n", hdr, refs); if (!refs) { + send_callback( hdr, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, &hdr->handle, sizeof(HINTERNET) ); + TRACE("destroying object %p\n", hdr); if (hdr->type != WINHTTP_HANDLE_TYPE_SESSION) list_remove( &hdr->entry ); hdr->vtbl->destroy( hdr ); diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 9a668b3..26f229e 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -37,6 +37,11 @@ static void set_last_error( DWORD error ) SetLastError( error ); } +void send_callback( object_header_t *hdr, DWORD status, LPVOID info, DWORD buflen ) +{ + FIXME("%p, %u, %p, %u\n", hdr, status, info, buflen); +} + /*********************************************************************** * WinHttpCheckPlatform (winhttp.@) */ @@ -175,6 +180,8 @@ HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, LPCWSTR server, INTERNET_PO if (!(hconnect = alloc_handle( &connect->hdr ))) goto end; connect->hdr.handle = hconnect; + send_callback( &session->hdr, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, &hconnect, sizeof(hconnect) ); + end: release_object( &connect->hdr ); @@ -262,6 +269,8 @@ HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR o if (!(hrequest = alloc_handle( &request->hdr ))) goto end; request->hdr.handle = hrequest; + send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, &hrequest, sizeof(hrequest) ); + end: release_object( &request->hdr ); @@ -287,3 +296,27 @@ BOOL WINAPI WinHttpCloseHandle( HINTERNET handle ) free_handle( handle ); return TRUE; } + +/*********************************************************************** + * WinHttpSetStatusCallback (winhttp.@) + */ +WINHTTP_STATUS_CALLBACK WINAPI WinHttpSetStatusCallback( HINTERNET handle, WINHTTP_STATUS_CALLBACK callback, + DWORD flags, DWORD_PTR reserved ) +{ + object_header_t *hdr; + WINHTTP_STATUS_CALLBACK ret; + + TRACE("%p, %p, 0x%08x, 0x%lx\n", handle, callback, flags, reserved); + + if (!(hdr = grab_object( handle ))) + { + set_last_error( ERROR_INVALID_HANDLE ); + return WINHTTP_INVALID_STATUS_CALLBACK; + } + ret = hdr->callback; + hdr->callback = callback; + hdr->notify_mask = flags; + + release_object( hdr ); + return ret; +} diff --git a/dlls/winhttp/winhttp.spec b/dlls/winhttp/winhttp.spec index ce9407e..dc13d5d 100644 --- a/dlls/winhttp/winhttp.spec +++ b/dlls/winhttp/winhttp.spec @@ -24,7 +24,7 @@ @ stub WinHttpSetCredentials @ stub WinHttpSetDefaultProxyConfiguration @ stdcall WinHttpSetOption(ptr long ptr long) -@ stub WinHttpSetStatusCallback +@ stdcall WinHttpSetStatusCallback(ptr ptr long ptr) @ stub WinHttpSetTimeouts @ stdcall WinHttpTimeFromSystemTime(ptr ptr) @ stdcall WinHttpTimeToSystemTime(wstr ptr) diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index 0f87466..c13a63a 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -116,6 +116,8 @@ void release_object( object_header_t * ); HINTERNET alloc_handle( object_header_t * ); BOOL free_handle( HINTERNET ); +void send_callback( object_header_t *, DWORD, LPVOID, DWORD ); + static inline void *heap_alloc( SIZE_T size ) { return HeapAlloc( GetProcessHeap(), 0, size );
1
0
0
0
Hans Leidekker : winhttp: Implement WinHttpOpenRequest.
by Alexandre Julliard
19 Aug '08
19 Aug '08
Module: wine Branch: master Commit: ce00aa019f344403a41eb56f9ed8799a97304b26 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ce00aa019f344403a41eb56f9…
Author: Hans Leidekker <hans(a)meelstraat.net> Date: Fri Aug 15 14:42:41 2008 +0200 winhttp: Implement WinHttpOpenRequest. --- dlls/winhttp/main.c | 14 ------ dlls/winhttp/session.c | 87 ++++++++++++++++++++++++++++++++++++++++ dlls/winhttp/tests/winhttp.c | 13 +++--- dlls/winhttp/winhttp_private.h | 32 +++++++++++++++ 4 files changed, 125 insertions(+), 21 deletions(-) diff --git a/dlls/winhttp/main.c b/dlls/winhttp/main.c index 6133590..44a1e42 100644 --- a/dlls/winhttp/main.c +++ b/dlls/winhttp/main.c @@ -117,20 +117,6 @@ BOOL WINAPI WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PROXY_ } /*********************************************************************** - * WinHttpOpenRequest (winhttp.@) - */ -HINTERNET WINAPI WinHttpOpenRequest (HINTERNET hConnect, LPCWSTR pwszVerb, LPCWSTR pwszObjectName, - LPCWSTR pwszVersion, LPCWSTR pwszReferrer, LPCWSTR* ppwszAcceptTypes, - DWORD dwFlags) -{ - FIXME("(%s, %s, %s, %s, 0x%x): stub\n", debugstr_w(pwszVerb), debugstr_w(pwszObjectName), - debugstr_w(pwszVersion), debugstr_w(pwszReferrer), dwFlags); - - SetLastError(ERROR_NOT_SUPPORTED); - return NULL; -} - -/*********************************************************************** * WinHttpSendRequest (winhttp.@) */ BOOL WINAPI WinHttpSendRequest (HINTERNET hRequest, LPCWSTR pwszHeaders, DWORD dwHeadersLength, diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 8f8ac2f..9a668b3 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -183,6 +183,93 @@ end: } /*********************************************************************** + * request_destroy (internal) + */ +static void request_destroy( object_header_t *hdr ) +{ + request_t *request = (request_t *)hdr; + int i; + + TRACE("%p\n", request); + + release_object( &request->connect->hdr ); + + heap_free( request->verb ); + heap_free( request->path ); + heap_free( request->version ); + heap_free( request->raw_headers ); + heap_free( request->status_text ); + for (i = 0; i < request->num_headers; i++) + { + heap_free( request->headers[i].field ); + heap_free( request->headers[i].value ); + } + heap_free( request->headers ); + heap_free( request ); +} + +static const object_vtbl_t request_vtbl = +{ + request_destroy, + NULL, + NULL +}; + +/*********************************************************************** + * WinHttpOpenRequest (winhttp.@) + */ +HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR object, LPCWSTR version, + LPCWSTR referrer, LPCWSTR *types, DWORD flags ) +{ + request_t *request; + connect_t *connect; + HINTERNET hrequest = NULL; + + TRACE("%p, %s, %s, %s, %s, %p, 0x%08x\n", hconnect, debugstr_w(verb), debugstr_w(object), + debugstr_w(version), debugstr_w(referrer), types, flags); + + if (!(connect = (connect_t *)grab_object( hconnect ))) + { + set_last_error( ERROR_INVALID_HANDLE ); + return NULL; + } + if (connect->hdr.type != WINHTTP_HANDLE_TYPE_CONNECT) + { + release_object( &connect->hdr ); + set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE ); + return NULL; + } + if (!(request = heap_alloc_zero( sizeof(request_t) ))) + { + release_object( &connect->hdr ); + return NULL; + } + request->hdr.type = WINHTTP_HANDLE_TYPE_REQUEST; + request->hdr.vtbl = &request_vtbl; + request->hdr.refs = 1; + request->hdr.flags = flags; + request->hdr.callback = connect->hdr.callback; + request->hdr.notify_mask = connect->hdr.notify_mask; + + addref_object( &connect->hdr ); + request->connect = connect; + list_add_head( &connect->hdr.children, &request->hdr.entry ); + + if (verb && !(request->verb = strdupW( verb ))) goto end; + if (object && !(request->path = strdupW( object ))) goto end; + if (version && !(request->version = strdupW( version ))) goto end; + + if (!(hrequest = alloc_handle( &request->hdr ))) goto end; + request->hdr.handle = hrequest; + +end: + release_object( &request->hdr ); + + TRACE("returning %p\n", hrequest); + return hrequest; +} + +/*********************************************************************** * WinHttpCloseHandle (winhttp.@) */ BOOL WINAPI WinHttpCloseHandle( HINTERNET handle ) diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 5f6ce7c..abfa713 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -55,13 +55,12 @@ static void test_OpenRequest (void) skip("Network unreachable, skipping.\n"); goto done; } - todo_wine ok(request != NULL, - "WinHttpOpenrequest failed to open a request, error: %u.\n", GetLastError()); + ok(request != NULL, "WinHttpOpenrequest failed to open a request, error: %u.\n", GetLastError()); ret = WinHttpSendRequest(request, WINHTTP_NO_ADDITIONAL_HEADERS, 0, NULL, 0, 0, 0); todo_wine ok(ret == TRUE, "WinHttpSendRequest failed: %u\n", GetLastError()); ret = WinHttpCloseHandle(request); - todo_wine ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); done: ret = WinHttpCloseHandle(connection); @@ -108,7 +107,7 @@ static void test_SendRequest (void) skip("Network unreachable, skipping.\n"); goto done; } - todo_wine ok(request != NULL, "WinHttpOpenrequest failed to open a request, error: %u.\n", GetLastError()); + ok(request != NULL, "WinHttpOpenrequest failed to open a request, error: %u.\n", GetLastError()); ret = WinHttpSendRequest(request, content_type, header_len, post_data, optional_len, total_len, 0); todo_wine ok(ret == TRUE, "WinHttpSendRequest failed: %u\n", GetLastError()); @@ -134,7 +133,7 @@ static void test_SendRequest (void) "Data read did not match, got '%s'.\n", buffer); ret = WinHttpCloseHandle(request); - todo_wine ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); done: ret = WinHttpCloseHandle(connection); ok(ret == TRUE, "WinHttpCloseHandle failed on closing connection, got %d.\n", ret); @@ -236,7 +235,7 @@ static void test_WinHttpAddHeaders(void) skip("Network unreachable, skipping.\n"); goto done; } - todo_wine ok(request != NULL, "WinHttpOpenRequest failed to open a request, error: %u.\n", GetLastError()); + ok(request != NULL, "WinHttpOpenRequest failed to open a request, error: %u.\n", GetLastError()); index = 0; len = sizeof(buffer); @@ -540,7 +539,7 @@ static void test_WinHttpAddHeaders(void) ok(ret == FALSE, "WinHttpQueryHeaders succeeded unexpectedly, found third header.\n"); ret = WinHttpCloseHandle(request); - todo_wine ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); done: ret = WinHttpCloseHandle(connection); ok(ret == TRUE, "WinHttpCloseHandle failed on closing connection, got %d.\n", ret); diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index 74398a6..0f87466 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -78,6 +78,38 @@ typedef struct struct sockaddr_in sockaddr; } connect_t; +typedef struct +{ + int socket; + char *peek_msg; + char *peek_msg_mem; + size_t peek_len; +} netconn_t; + +typedef struct +{ + LPWSTR field; + LPWSTR value; + WORD flags; + WORD count; +} header_t; + +typedef struct +{ + object_header_t hdr; + connect_t *connect; + LPWSTR verb; + LPWSTR path; + LPWSTR version; + LPWSTR raw_headers; + netconn_t netconn; + LPWSTR status_text; + DWORD content_length; /* total number of bytes to be read (per chunk) */ + DWORD content_read; /* bytes read so far */ + header_t *headers; + DWORD num_headers; +} request_t; + object_header_t *addref_object( object_header_t * ); object_header_t *grab_object( HINTERNET ); void release_object( object_header_t * );
1
0
0
0
Hans Leidekker : winhttp: Implement WinHttpConnect.
by Alexandre Julliard
19 Aug '08
19 Aug '08
Module: wine Branch: master Commit: 770ee20461ba7a262f291a7c295ec2dfbd32333d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=770ee20461ba7a262f291a7c2…
Author: Hans Leidekker <hans(a)meelstraat.net> Date: Fri Aug 15 14:42:28 2008 +0200 winhttp: Implement WinHttpConnect. --- dlls/winhttp/main.c | 13 ------ dlls/winhttp/session.c | 81 ++++++++++++++++++++++++++++++++++++++++ dlls/winhttp/tests/winhttp.c | 18 +++----- dlls/winhttp/winhttp_private.h | 21 ++++++++++ 4 files changed, 109 insertions(+), 24 deletions(-) diff --git a/dlls/winhttp/main.c b/dlls/winhttp/main.c index e5c904b..6133590 100644 --- a/dlls/winhttp/main.c +++ b/dlls/winhttp/main.c @@ -117,19 +117,6 @@ BOOL WINAPI WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PROXY_ } /*********************************************************************** - * WinHttpConnect (winhttp.@) - */ - -HINTERNET WINAPI WinHttpConnect (HINTERNET hSession, LPCWSTR pwszServerName, - INTERNET_PORT nServerPort, DWORD dwReserved) -{ - FIXME("(%s, %d, 0x%x): stub\n", debugstr_w(pwszServerName), nServerPort, dwReserved); - - SetLastError(ERROR_NOT_SUPPORTED); - return NULL; -} - -/*********************************************************************** * WinHttpOpenRequest (winhttp.@) */ HINTERNET WINAPI WinHttpOpenRequest (HINTERNET hConnect, LPCWSTR pwszVerb, LPCWSTR pwszObjectName, diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 76a878e..8f8ac2f 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -102,6 +102,87 @@ end: } /*********************************************************************** + * connect_destroy (internal) + */ +static void connect_destroy( object_header_t *hdr ) +{ + connect_t *connect = (connect_t *)hdr; + + TRACE("%p\n", connect); + + release_object( &connect->session->hdr ); + + heap_free( connect->hostname ); + heap_free( connect->servername ); + heap_free( connect->username ); + heap_free( connect->password ); + heap_free( connect ); +} + +static const object_vtbl_t connect_vtbl = +{ + connect_destroy, + NULL, + NULL +}; + +/*********************************************************************** + * WinHttpConnect (winhttp.@) + */ +HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, LPCWSTR server, INTERNET_PORT port, DWORD reserved ) +{ + connect_t *connect; + session_t *session; + HINTERNET hconnect = NULL; + + TRACE("%p, %s, %u, %x\n", hsession, debugstr_w(server), port, reserved); + + if (!server) + { + set_last_error( ERROR_INVALID_PARAMETER ); + return NULL; + } + if (!(session = (session_t *)grab_object( hsession ))) + { + set_last_error( ERROR_INVALID_HANDLE ); + return NULL; + } + if (session->hdr.type != WINHTTP_HANDLE_TYPE_SESSION) + { + release_object( &session->hdr ); + set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE ); + return NULL; + } + if (!(connect = heap_alloc_zero( sizeof(connect_t) ))) + { + release_object( &session->hdr ); + return NULL; + } + connect->hdr.type = WINHTTP_HANDLE_TYPE_CONNECT; + connect->hdr.vtbl = &connect_vtbl; + connect->hdr.refs = 1; + connect->hdr.flags = session->hdr.flags; + connect->hdr.callback = session->hdr.callback; + connect->hdr.notify_mask = session->hdr.notify_mask; + + addref_object( &session->hdr ); + connect->session = session; + list_add_head( &session->hdr.children, &connect->hdr.entry ); + + if (server && !(connect->hostname = strdupW( server ))) goto end; + connect->hostport = port; + + if (!(hconnect = alloc_handle( &connect->hdr ))) goto end; + connect->hdr.handle = hconnect; + +end: + release_object( &connect->hdr ); + + TRACE("returning %p\n", hconnect); + return hconnect; +} + +/*********************************************************************** * WinHttpCloseHandle (winhttp.@) */ BOOL WINAPI WinHttpCloseHandle( HINTERNET handle ) diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 2c7143e..5f6ce7c 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -42,13 +42,11 @@ static void test_OpenRequest (void) SetLastError(0xdeadbeef); connection = WinHttpConnect(session, NULL, INTERNET_DEFAULT_HTTP_PORT, 0); ok (connection == NULL, "WinHttpConnect succeeded in opening connection to NULL server argument.\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %u.\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u.\n", GetLastError()); /* Test with a valid server name */ connection = WinHttpConnect (session, test_server, INTERNET_DEFAULT_HTTP_PORT, 0); - todo_wine ok(connection != NULL, - "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); + ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); request = WinHttpOpenRequest(connection, NULL, NULL, NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, 0); @@ -67,7 +65,7 @@ static void test_OpenRequest (void) done: ret = WinHttpCloseHandle(connection); - todo_wine ok(ret == TRUE, "WinHttpCloseHandle failed on closing connection, got %d.\n", ret); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing connection, got %d.\n", ret); ret = WinHttpCloseHandle(session); ok(ret == TRUE, "WinHttpCloseHandle failed on closing session, got %d.\n", ret); @@ -101,8 +99,7 @@ static void test_SendRequest (void) ok(session != NULL, "WinHttpOpen failed to open session.\n"); connection = WinHttpConnect (session, test_site, INTERNET_DEFAULT_HTTP_PORT, 0); - todo_wine ok(connection != NULL, - "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); + ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); request = WinHttpOpenRequest(connection, test_verb, test_file, NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, WINHTTP_FLAG_BYPASS_PROXY_CACHE); @@ -140,7 +137,7 @@ static void test_SendRequest (void) todo_wine ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); done: ret = WinHttpCloseHandle(connection); - todo_wine ok(ret == TRUE, "WinHttpCloseHandle failed on closing connection, got %d.\n", ret); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing connection, got %d.\n", ret); ret = WinHttpCloseHandle(session); ok(ret == TRUE, "WinHttpCloseHandle failed on closing session, got %d.\n", ret); } @@ -230,8 +227,7 @@ static void test_WinHttpAddHeaders(void) ok(session != NULL, "WinHttpOpen failed to open session.\n"); connection = WinHttpConnect (session, test_site, INTERNET_DEFAULT_HTTP_PORT, 0); - todo_wine ok(connection != NULL, - "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); + ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); request = WinHttpOpenRequest(connection, test_verb, test_file, NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, 0); @@ -547,7 +543,7 @@ static void test_WinHttpAddHeaders(void) todo_wine ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); done: ret = WinHttpCloseHandle(connection); - todo_wine ok(ret == TRUE, "WinHttpCloseHandle failed on closing connection, got %d.\n", ret); + ok(ret == TRUE, "WinHttpCloseHandle failed on closing connection, got %d.\n", ret); ret = WinHttpCloseHandle(session); ok(ret == TRUE, "WinHttpCloseHandle failed on closing session, got %d.\n", ret); diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index 1d40fcb..74398a6 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -19,9 +19,17 @@ #ifndef _WINE_WINHTTP_PRIVATE_H_ #define _WINE_WINHTTP_PRIVATE_H_ +#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif + #include "wine/list.h" #include "wine/unicode.h" +#ifdef HAVE_NETDB_H +# include <netdb.h> +#endif + typedef struct _object_header_t object_header_t; typedef struct @@ -57,6 +65,19 @@ typedef struct LPWSTR proxy_password; } session_t; +typedef struct +{ + object_header_t hdr; + session_t *session; + LPWSTR hostname; /* final destination of the request */ + LPWSTR servername; /* name of the server we directly connect to */ + LPWSTR username; + LPWSTR password; + INTERNET_PORT hostport; + INTERNET_PORT serverport; + struct sockaddr_in sockaddr; +} connect_t; + object_header_t *addref_object( object_header_t * ); object_header_t *grab_object( HINTERNET ); void release_object( object_header_t * );
1
0
0
0
Hans Leidekker : winhttp: Implement WinHttpOpen and WinHttpCloseHandle.
by Alexandre Julliard
19 Aug '08
19 Aug '08
Module: wine Branch: master Commit: 405e8cda4116e6ecbc52b91031100f57cce205d7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=405e8cda4116e6ecbc52b9103…
Author: Hans Leidekker <hans(a)meelstraat.net> Date: Fri Aug 15 14:42:15 2008 +0200 winhttp: Implement WinHttpOpen and WinHttpCloseHandle. --- dlls/winhttp/Makefile.in | 3 +- dlls/winhttp/main.c | 36 ------------ dlls/winhttp/session.c | 121 ++++++++++++++++++++++++++++++++++++++++ dlls/winhttp/tests/winhttp.c | 12 ++-- dlls/winhttp/winhttp_private.h | 28 +++++++++ 5 files changed, 157 insertions(+), 43 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=405e8cda4116e6ecbc52b…
1
0
0
0
← Newer
1
...
48
49
50
51
52
53
54
...
84
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
Results per page:
10
25
50
100
200