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 2009
----- 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
834 discussions
Start a n
N
ew thread
Jacek Caban : urlmon: Move HttpProtocol:: Continue implementation to generic Protocol object.
by Alexandre Julliard
02 Mar '09
02 Mar '09
Module: wine Branch: master Commit: c2ffe977793a62a4c0bfddda395d9baf6e602826 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c2ffe977793a62a4c0bfddda3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 2 03:20:46 2009 +0100 urlmon: Move HttpProtocol::Continue implementation to generic Protocol object. --- dlls/urlmon/http.c | 271 +++++++++++++++------------------------------ dlls/urlmon/protocol.c | 68 +++++++++++ dlls/urlmon/urlmon_main.h | 2 + 3 files changed, 157 insertions(+), 184 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c2ffe977793a62a4c0bfd…
1
0
0
0
Jacek Caban : urlmon: Move HttpProtocol:: Read implementation to generic Protocol object.
by Alexandre Julliard
02 Mar '09
02 Mar '09
Module: wine Branch: master Commit: 4c129514b5aa9acc4c71e391235a2bb6ec14d462 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4c129514b5aa9acc4c71e3912…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 2 03:20:26 2009 +0100 urlmon: Move HttpProtocol::Read implementation to generic Protocol object. --- dlls/urlmon/http.c | 80 +------------------------- dlls/urlmon/protocol.c | 143 +++++++++++++++++++++++++++++++++++++++++++++ dlls/urlmon/urlmon_main.h | 1 + 3 files changed, 145 insertions(+), 79 deletions(-) diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index 5d102a6..c7d463b 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -144,14 +144,6 @@ static void HTTPPROTOCOL_ReportData(HttpProtocol *This) } } -static void HTTPPROTOCOL_AllDataRead(HttpProtocol *This) -{ - if (!(This->base.flags & FLAG_ALL_DATA_READ)) - This->base.flags |= FLAG_ALL_DATA_READ; - HTTPPROTOCOL_ReportData(This); - HTTPPROTOCOL_ReportResult(This, S_OK); -} - static void CALLBACK HTTPPROTOCOL_InternetStatusCallback( HINTERNET hInternet, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength) @@ -735,80 +727,10 @@ static HRESULT WINAPI HttpProtocol_Read(IInternetProtocol *iface, void *pv, ULONG cb, ULONG *pcbRead) { HttpProtocol *This = PROTOCOL_THIS(iface); - ULONG read = 0, len = 0; - HRESULT hres = S_FALSE; TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead); - if (!(This->base.flags & FLAG_REQUEST_COMPLETE)) - { - hres = E_PENDING; - } - else while (!(This->base.flags & FLAG_ALL_DATA_READ) && - read < cb) - { - if (This->base.available_bytes == 0) - { - /* InternetQueryDataAvailable may immediately fork and perform its asynchronous - * read, so clear the flag _before_ calling so it does not incorrectly get cleared - * after the status callback is called */ - This->base.flags &= ~FLAG_REQUEST_COMPLETE; - if (!InternetQueryDataAvailable(This->base.request, &This->base.available_bytes, 0, 0)) - { - if (GetLastError() == ERROR_IO_PENDING) - { - hres = E_PENDING; - } - else - { - WARN("InternetQueryDataAvailable failed: %d\n", GetLastError()); - hres = INET_E_DATA_NOT_AVAILABLE; - HTTPPROTOCOL_ReportResult(This, hres); - } - goto done; - } - else if (This->base.available_bytes == 0) - { - HTTPPROTOCOL_AllDataRead(This); - } - } - else - { - if (!InternetReadFile(This->base.request, ((BYTE *)pv)+read, - This->base.available_bytes > cb-read ? - cb-read : This->base.available_bytes, &len)) - { - WARN("InternetReadFile failed: %d\n", GetLastError()); - hres = INET_E_DOWNLOAD_FAILURE; - HTTPPROTOCOL_ReportResult(This, hres); - goto done; - } - else if (len == 0) - { - HTTPPROTOCOL_AllDataRead(This); - } - else - { - read += len; - This->base.current_position += len; - This->base.available_bytes -= len; - } - } - } - - /* Per MSDN this should be if (read == cb), but native returns S_OK - * if any bytes were read, so we will too */ - if (read) - hres = S_OK; - -done: - if (pcbRead) - *pcbRead = read; - - if (hres != E_PENDING) - This->base.flags |= FLAG_REQUEST_COMPLETE; - - return hres; + return protocol_read(&This->base, pv, cb, pcbRead); } static HRESULT WINAPI HttpProtocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove, diff --git a/dlls/urlmon/protocol.c b/dlls/urlmon/protocol.c index a2e801b..46e6264 100644 --- a/dlls/urlmon/protocol.c +++ b/dlls/urlmon/protocol.c @@ -23,6 +23,149 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon); +/* Flags are needed for, among other things, return HRESULTs from the Read function + * to conform to native. For example, Read returns: + * + * 1. E_PENDING if called before the request has completed, + * (flags = 0) + * 2. S_FALSE after all data has been read and S_OK has been reported, + * (flags = FLAG_REQUEST_COMPLETE | FLAG_ALL_DATA_READ | FLAG_RESULT_REPORTED) + * 3. INET_E_DATA_NOT_AVAILABLE if InternetQueryDataAvailable fails. The first time + * this occurs, INET_E_DATA_NOT_AVAILABLE will also be reported to the sink, + * (flags = FLAG_REQUEST_COMPLETE) + * but upon subsequent calls to Read no reporting will take place, yet + * InternetQueryDataAvailable will still be called, and, on failure, + * INET_E_DATA_NOT_AVAILABLE will still be returned. + * (flags = FLAG_REQUEST_COMPLETE | FLAG_RESULT_REPORTED) + * + * FLAG_FIRST_DATA_REPORTED and FLAG_LAST_DATA_REPORTED are needed for proper + * ReportData reporting. For example, if OnResponse returns S_OK, Continue will + * report BSCF_FIRSTDATANOTIFICATION, and when all data has been read Read will + * report BSCF_INTERMEDIATEDATANOTIFICATION|BSCF_LASTDATANOTIFICATION. However, + * if OnResponse does not return S_OK, Continue will not report data, and Read + * will report BSCF_FIRSTDATANOTIFICATION|BSCF_LASTDATANOTIFICATION when all + * data has been read. + */ +#define FLAG_REQUEST_COMPLETE 0x0001 +#define FLAG_FIRST_CONTINUE_COMPLETE 0x0002 +#define FLAG_FIRST_DATA_REPORTED 0x0004 +#define FLAG_ALL_DATA_READ 0x0008 +#define FLAG_LAST_DATA_REPORTED 0x0010 +#define FLAG_RESULT_REPORTED 0x0020 + +static inline HRESULT report_result(Protocol *protocol, HRESULT hres) +{ + if (!(protocol->flags & FLAG_RESULT_REPORTED) && protocol->protocol_sink) { + protocol->flags |= FLAG_RESULT_REPORTED; + IInternetProtocolSink_ReportResult(protocol->protocol_sink, hres, 0, NULL); + } + + return hres; +} + +static void report_data(Protocol *protocol) +{ + DWORD bscf; + + if((protocol->flags & FLAG_LAST_DATA_REPORTED) || !protocol->protocol_sink) + return; + + if(protocol->flags & FLAG_FIRST_DATA_REPORTED) { + bscf = BSCF_INTERMEDIATEDATANOTIFICATION; + }else { + protocol->flags |= FLAG_FIRST_DATA_REPORTED; + bscf = BSCF_FIRSTDATANOTIFICATION; + } + + if(protocol->flags & FLAG_ALL_DATA_READ && !(protocol->flags & FLAG_LAST_DATA_REPORTED)) { + protocol->flags |= FLAG_LAST_DATA_REPORTED; + bscf |= BSCF_LASTDATANOTIFICATION; + } + + IInternetProtocolSink_ReportData(protocol->protocol_sink, bscf, + protocol->current_position+protocol->available_bytes, + protocol->content_length); +} + +static void all_data_read(Protocol *protocol) +{ + protocol->flags |= FLAG_ALL_DATA_READ; + + report_data(protocol); + report_result(protocol, S_OK); +} + +HRESULT protocol_read(Protocol *protocol, void *buf, ULONG size, ULONG *read_ret) +{ + ULONG read = 0; + BOOL res; + HRESULT hres = S_FALSE; + + if(!(protocol->flags & FLAG_REQUEST_COMPLETE)) { + *read_ret = 0; + return E_PENDING; + } + + if(protocol->flags & FLAG_ALL_DATA_READ) { + *read_ret = 0; + return S_FALSE; + } + + while(read < size) { + if(protocol->available_bytes) { + ULONG len; + + res = InternetReadFile(protocol->request, ((BYTE *)buf)+read, + protocol->available_bytes > size-read ? size-read : protocol->available_bytes, &len); + if(!res) { + WARN("InternetReadFile failed: %d\n", GetLastError()); + hres = INET_E_DOWNLOAD_FAILURE; + report_result(protocol, hres); + break; + } + + if(!len) { + all_data_read(protocol); + break; + } + + read += len; + protocol->current_position += len; + protocol->available_bytes -= len; + }else { + /* InternetQueryDataAvailable may immediately fork and perform its asynchronous + * read, so clear the flag _before_ calling so it does not incorrectly get cleared + * after the status callback is called */ + protocol->flags &= ~FLAG_REQUEST_COMPLETE; + res = InternetQueryDataAvailable(protocol->request, &protocol->available_bytes, 0, 0); + if(!res) { + if (GetLastError() == ERROR_IO_PENDING) { + hres = E_PENDING; + }else { + WARN("InternetQueryDataAvailable failed: %d\n", GetLastError()); + hres = INET_E_DATA_NOT_AVAILABLE; + report_result(protocol, hres); + } + break; + } + + if(!protocol->available_bytes) { + all_data_read(protocol); + break; + } + } + } + + *read_ret = read; + + if (hres != E_PENDING) + protocol->flags |= FLAG_REQUEST_COMPLETE; + if(FAILED(hres)) + return hres; + + return read ? S_OK : S_FALSE; +} + HRESULT protocol_lock_request(Protocol *protocol) { if (!InternetLockRequestFile(protocol->request, &protocol->lock)) diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h index 6519630..a75c1ed 100644 --- a/dlls/urlmon/urlmon_main.h +++ b/dlls/urlmon/urlmon_main.h @@ -106,6 +106,7 @@ struct ProtocolVtbl { void (*close_connection)(Protocol*); }; +HRESULT protocol_read(Protocol*,void*,ULONG,ULONG*); HRESULT protocol_lock_request(Protocol*); HRESULT protocol_unlock_request(Protocol*); void protocol_close_connection(Protocol*);
1
0
0
0
Jacek Caban : urlmon: Move close_connection implementation to common Protocol object.
by Alexandre Julliard
02 Mar '09
02 Mar '09
Module: wine Branch: master Commit: a30ffca108d905e4e77d1cc6651722d8ce671085 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a30ffca108d905e4e77d1cc66…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 2 03:20:09 2009 +0100 urlmon: Move close_connection implementation to common Protocol object. --- dlls/urlmon/http.c | 61 ++++++++++++++++++++++----------------------- dlls/urlmon/protocol.c | 14 ++++++++++ dlls/urlmon/urlmon_main.h | 9 ++++++ 3 files changed, 53 insertions(+), 31 deletions(-) diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index ab5aa38..5d102a6 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -80,9 +80,32 @@ typedef struct { static const WCHAR wszHeaders[] = {'A','c','c','e','p','t','-','E','n','c','o','d','i','n','g', ':',' ','g','z','i','p',',',' ','d','e','f','l','a','t','e',0}; -/* - * Helpers - */ +#define ASYNCPROTOCOL_THIS(iface) DEFINE_THIS2(HttpProtocol, base, iface) + +static void HttpProtocol_close_connection(Protocol *prot) +{ + HttpProtocol *This = ASYNCPROTOCOL_THIS(prot); + + if(This->connection) + InternetCloseHandle(This->connection); + + if(This->http_negotiate) { + IHttpNegotiate_Release(This->http_negotiate); + This->http_negotiate = 0; + } + + if(This->full_header) { + if(This->full_header != wszHeaders) + heap_free(This->full_header); + This->full_header = 0; + } +} + +#undef ASYNCPROTOCOL_THIS + +static const ProtocolVtbl AsyncProtocolVtbl = { + HttpProtocol_close_connection +}; static void HTTPPROTOCOL_ReportResult(HttpProtocol *This, HRESULT hres) { @@ -129,31 +152,6 @@ static void HTTPPROTOCOL_AllDataRead(HttpProtocol *This) HTTPPROTOCOL_ReportResult(This, S_OK); } -static void HTTPPROTOCOL_Close(HttpProtocol *This) -{ - if (This->http_negotiate) - { - IHttpNegotiate_Release(This->http_negotiate); - This->http_negotiate = 0; - } - if (This->base.request) - InternetCloseHandle(This->base.request); - if (This->connection) - InternetCloseHandle(This->connection); - if (This->base.internet) - { - InternetCloseHandle(This->base.internet); - This->base.internet = 0; - } - if (This->full_header) - { - if (This->full_header != wszHeaders) - heap_free(This->full_header); - This->full_header = 0; - } - This->base.flags = 0; -} - static void CALLBACK HTTPPROTOCOL_InternetStatusCallback( HINTERNET hInternet, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength) @@ -269,7 +267,7 @@ static ULONG WINAPI HttpProtocol_Release(IInternetProtocol *iface) TRACE("(%p) ref=%d\n", This, ref); if(!ref) { - HTTPPROTOCOL_Close(This); + protocol_close_connection(&This->base); heap_free(This); URLMON_UnlockModule(); @@ -523,7 +521,7 @@ done: if (hres != S_OK) { IInternetProtocolSink_ReportResult(This->base.protocol_sink, hres, 0, NULL); - HTTPPROTOCOL_Close(This); + protocol_close_connection(&This->base); } CoTaskMemFree(post_cookie); @@ -714,8 +712,8 @@ static HRESULT WINAPI HttpProtocol_Terminate(IInternetProtocol *iface, DWORD dwO HttpProtocol *This = PROTOCOL_THIS(iface); TRACE("(%p)->(%08x)\n", This, dwOptions); - HTTPPROTOCOL_Close(This); + protocol_close_connection(&This->base); return S_OK; } @@ -915,6 +913,7 @@ static HRESULT create_http_protocol(BOOL https, void **ppobj) if(!ret) return E_OUTOFMEMORY; + ret->base.vtbl = &AsyncProtocolVtbl; ret->lpInternetProtocolVtbl = &HttpProtocolVtbl; ret->lpInternetPriorityVtbl = &HttpPriorityVtbl; diff --git a/dlls/urlmon/protocol.c b/dlls/urlmon/protocol.c index b25c9de..a2e801b 100644 --- a/dlls/urlmon/protocol.c +++ b/dlls/urlmon/protocol.c @@ -42,3 +42,17 @@ HRESULT protocol_unlock_request(Protocol *protocol) return S_OK; } + +void protocol_close_connection(Protocol *protocol) +{ + protocol->vtbl->close_connection(protocol); + + if(protocol->request) + InternetCloseHandle(protocol->request); + if(protocol->internet) { + InternetCloseHandle(protocol->internet); + protocol->internet = 0; + } + + protocol->flags = 0; +} diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h index 906cd31..6519630 100644 --- a/dlls/urlmon/urlmon_main.h +++ b/dlls/urlmon/urlmon_main.h @@ -79,7 +79,11 @@ HRESULT bind_to_object(IMoniker *mon, LPCWSTR url, IBindCtx *pbc, REFIID riid, v HRESULT create_binding_protocol(LPCWSTR url, BOOL from_urlmon, IInternetProtocol **protocol); void set_binding_sink(IInternetProtocol *bind_protocol, IInternetProtocolSink *sink); +typedef struct ProtocolVtbl ProtocolVtbl; + typedef struct { + const ProtocolVtbl *vtbl; + IInternetProtocol *protocol; IInternetProtocolSink *protocol_sink; @@ -98,8 +102,13 @@ typedef struct { LONG priority; } Protocol; +struct ProtocolVtbl { + void (*close_connection)(Protocol*); +}; + HRESULT protocol_lock_request(Protocol*); HRESULT protocol_unlock_request(Protocol*); +void protocol_close_connection(Protocol*); static inline void *heap_alloc(size_t len) {
1
0
0
0
Jacek Caban : urlmon: Moved HttpProtocol::[Lock|Unlock] Request implementation to generic Protocol object.
by Alexandre Julliard
02 Mar '09
02 Mar '09
Module: wine Branch: master Commit: 7c77c57ab85ee03d68b54161aa4410d3c2e94486 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7c77c57ab85ee03d68b54161a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 2 03:19:44 2009 +0100 urlmon: Moved HttpProtocol::[Lock|Unlock]Request implementation to generic Protocol object. --- dlls/urlmon/Makefile.in | 1 + dlls/urlmon/http.c | 14 ++------------ dlls/urlmon/protocol.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ dlls/urlmon/urlmon_main.h | 3 +++ 4 files changed, 50 insertions(+), 12 deletions(-) diff --git a/dlls/urlmon/Makefile.in b/dlls/urlmon/Makefile.in index d853541..0a9497c 100644 --- a/dlls/urlmon/Makefile.in +++ b/dlls/urlmon/Makefile.in @@ -17,6 +17,7 @@ C_SRCS = \ http.c \ internet.c \ mk.c \ + protocol.c \ regsvr.c \ sec_mgr.c \ session.c \ diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index 87d2036..ab5aa38 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -827,10 +827,7 @@ static HRESULT WINAPI HttpProtocol_LockRequest(IInternetProtocol *iface, DWORD d TRACE("(%p)->(%08x)\n", This, dwOptions); - if (!InternetLockRequestFile(This->base.request, &This->base.lock)) - WARN("InternetLockRequest failed: %d\n", GetLastError()); - - return S_OK; + return protocol_lock_request(&This->base); } static HRESULT WINAPI HttpProtocol_UnlockRequest(IInternetProtocol *iface) @@ -839,14 +836,7 @@ static HRESULT WINAPI HttpProtocol_UnlockRequest(IInternetProtocol *iface) TRACE("(%p)\n", This); - if (This->base.lock) - { - if (!InternetUnlockRequestFile(This->base.lock)) - WARN("InternetUnlockRequest failed: %d\n", GetLastError()); - This->base.lock = 0; - } - - return S_OK; + return protocol_unlock_request(&This->base); } #undef PROTOCOL_THIS diff --git a/dlls/urlmon/protocol.c b/dlls/urlmon/protocol.c new file mode 100644 index 0000000..b25c9de --- /dev/null +++ b/dlls/urlmon/protocol.c @@ -0,0 +1,44 @@ +/* + * Copyright 2007 Misha Koshelev + * Copyright 2009 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "urlmon_main.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(urlmon); + +HRESULT protocol_lock_request(Protocol *protocol) +{ + if (!InternetLockRequestFile(protocol->request, &protocol->lock)) + WARN("InternetLockRequest failed: %d\n", GetLastError()); + + return S_OK; +} + +HRESULT protocol_unlock_request(Protocol *protocol) +{ + if(!protocol->lock) + return S_OK; + + if(!InternetUnlockRequestFile(protocol->lock)) + WARN("InternetUnlockRequest failed: %d\n", GetLastError()); + protocol->lock = 0; + + return S_OK; +} diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h index 36862d1..906cd31 100644 --- a/dlls/urlmon/urlmon_main.h +++ b/dlls/urlmon/urlmon_main.h @@ -98,6 +98,9 @@ typedef struct { LONG priority; } Protocol; +HRESULT protocol_lock_request(Protocol*); +HRESULT protocol_unlock_request(Protocol*); + static inline void *heap_alloc(size_t len) { return HeapAlloc(GetProcessHeap(), 0, len);
1
0
0
0
Jacek Caban : urlmon: Move strndupW implementation to header file.
by Alexandre Julliard
02 Mar '09
02 Mar '09
Module: wine Branch: master Commit: 4ae60c6f006a1f6da054b46bbc371b5256a12db9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4ae60c6f006a1f6da054b46bb…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 2 03:19:18 2009 +0100 urlmon: Move strndupW implementation to header file. --- dlls/urlmon/http.c | 20 ++++---------------- dlls/urlmon/urlmon_main.h | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index edaa340..87d2036 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -219,18 +219,6 @@ static void CALLBACK HTTPPROTOCOL_InternetStatusCallback( IInternetProtocolSink_ReportProgress(This->base.protocol_sink, ulStatusCode, (LPWSTR)lpvStatusInformation); } -static inline LPWSTR strndupW(LPCWSTR string, int len) -{ - LPWSTR ret = NULL; - if (string && - (ret = heap_alloc((len+1)*sizeof(WCHAR))) != NULL) - { - memcpy(ret, string, len*sizeof(WCHAR)); - ret[len] = 0; - } - return ret; -} - /* * Interface implementations */ @@ -345,10 +333,10 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl hres = MK_E_SYNTAX; goto done; } - host = strndupW(url.lpszHostName, url.dwHostNameLength); - path = strndupW(url.lpszUrlPath, url.dwUrlPathLength); - user = strndupW(url.lpszUserName, url.dwUserNameLength); - pass = strndupW(url.lpszPassword, url.dwPasswordLength); + host = heap_strndupW(url.lpszHostName, url.dwHostNameLength); + path = heap_strndupW(url.lpszUrlPath, url.dwUrlPathLength); + user = heap_strndupW(url.lpszUserName, url.dwUserNameLength); + pass = heap_strndupW(url.lpszPassword, url.dwPasswordLength); if (!url.nPort) url.nPort = This->https ? INTERNET_DEFAULT_HTTPS_PORT : INTERNET_DEFAULT_HTTP_PORT; diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h index bc2fea8..36862d1 100644 --- a/dlls/urlmon/urlmon_main.h +++ b/dlls/urlmon/urlmon_main.h @@ -133,6 +133,21 @@ static inline LPWSTR heap_strdupW(LPCWSTR str) return ret; } +static inline LPWSTR heap_strndupW(LPCWSTR str, int len) +{ + LPWSTR ret = NULL; + + if(str) { + ret = heap_alloc((len+1)*sizeof(WCHAR)); + if(ret) { + memcpy(ret, str, len*sizeof(WCHAR)); + ret[len] = 0; + } + } + + return ret; +} + static inline LPWSTR heap_strdupAtoW(const char *str) { LPWSTR ret = NULL;
1
0
0
0
Jacek Caban : urlmon: Move some HttpProtocol variables to generic Protocol object.
by Alexandre Julliard
02 Mar '09
02 Mar '09
Module: wine Branch: master Commit: b0a9ddae670d1661d86954d8013390b754d12031 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b0a9ddae670d1661d86954d80…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 2 03:19:00 2009 +0100 urlmon: Move some HttpProtocol variables to generic Protocol object. --- dlls/urlmon/http.c | 230 ++++++++++++++++++++++----------------------- dlls/urlmon/urlmon_main.h | 24 +++++- 2 files changed, 136 insertions(+), 118 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b0a9ddae670d1661d8695…
1
0
0
0
Jacek Caban : urlmon: Ignore report_data call if binding is stopped.
by Alexandre Julliard
02 Mar '09
02 Mar '09
Module: wine Branch: master Commit: b105b084a2efdd09c1a8827ab257f68cac8a0cfd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b105b084a2efdd09c1a8827ab…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 2 03:18:19 2009 +0100 urlmon: Ignore report_data call if binding is stopped. --- dlls/urlmon/binding.c | 2 +- dlls/urlmon/tests/url.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/urlmon/binding.c b/dlls/urlmon/binding.c index 41fa677..fb30367 100644 --- a/dlls/urlmon/binding.c +++ b/dlls/urlmon/binding.c @@ -1200,7 +1200,7 @@ static void report_data(Binding *This, DWORD bscf, ULONG progress, ULONG progres TRACE("(%p)->(%d %u %u)\n", This, bscf, progress, progress_max); - if(This->download_state == END_DOWNLOAD) + if(This->download_state == END_DOWNLOAD || (This->state & BINDING_STOPPED)) return; if(GetCurrentThreadId() != This->apartment_thread) diff --git a/dlls/urlmon/tests/url.c b/dlls/urlmon/tests/url.c index 094d21d..e56d0ca 100644 --- a/dlls/urlmon/tests/url.c +++ b/dlls/urlmon/tests/url.c @@ -1201,8 +1201,7 @@ static HRESULT WINAPI statusclb_OnProgress(IBindStatusCallback *iface, ULONG ulP break; case BINDSTATUS_DOWNLOADINGDATA: CHECK_EXPECT2(OnProgress_DOWNLOADINGDATA); - if(iface == &objbsc) - todo_wine ok(0, "unexpected call\n"); + ok(iface != &objbsc, "unexpected call\n"); ok(download_state == DOWNLOADING, "Download state was %d, expected DOWNLOADING\n", download_state); break;
1
0
0
0
Mike Ruprecht : winedbg: Fix typo in a comment.
by Alexandre Julliard
02 Mar '09
02 Mar '09
Module: wine Branch: master Commit: c7b204e98ae84e43a1724a26e33e2ae082d6de41 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c7b204e98ae84e43a1724a26e…
Author: Mike Ruprecht <cmaiku(a)gmail.com> Date: Sun Mar 1 14:09:19 2009 -0600 winedbg: Fix typo in a comment. --- programs/winedbg/be_i386.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/programs/winedbg/be_i386.c b/programs/winedbg/be_i386.c index c3bf155..0d6d058 100644 --- a/programs/winedbg/be_i386.c +++ b/programs/winedbg/be_i386.c @@ -226,7 +226,7 @@ static void be_i386_print_context(HANDLE hThread, const CONTEXT* ctx, int all_re if (ctx->EFlags & 0x00004000) *pt-- = 'N'; /* Nested Task Flag */ if (ctx->EFlags & 0x00008000) *pt-- = '-'; if (ctx->EFlags & 0x00010000) *pt-- = 'R'; /* Resume Flag */ - if (ctx->EFlags & 0x00020000) *pt-- = 'V'; /* Vritual Mode Flag */ + if (ctx->EFlags & 0x00020000) *pt-- = 'V'; /* Virtual Mode Flag */ if (ctx->EFlags & 0x00040000) *pt-- = 'a'; /* Alignment Check Flag */ switch (get_selector_type(hThread, ctx, ctx->SegCs))
1
0
0
0
Rico Schüller : mshtml/tests: Add SysFreeString( sDefault) after the variable isn't used any more.
by Alexandre Julliard
02 Mar '09
02 Mar '09
Module: wine Branch: master Commit: 9f60f4e30d376ed70c99fe131676f0001ea5c5d8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9f60f4e30d376ed70c99fe131…
Author: Rico Schüller <kgbricola(a)web.de> Date: Sun Mar 1 14:14:43 2009 +0100 mshtml/tests: Add SysFreeString(sDefault) after the variable isn't used any more. --- dlls/mshtml/tests/dom.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 1e7acae..37cc549 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2668,6 +2668,7 @@ static void test_default_style(IHTMLStyle *style) hres = IHTMLStyle_put_fontWeight(style, sDefault); ok(hres == S_OK, "put_fontWeight failed: %08x\n", hres); + SysFreeString(sDefault); /* font Variant */ hres = IHTMLStyle_get_fontVariant(style, NULL); @@ -3071,6 +3072,7 @@ static void test_default_style(IHTMLStyle *style) hres = IHTMLStyle_put_fontStyle(style, sDefault); ok(hres == S_OK, "put_fontStyle failed: %08x\n", hres); + SysFreeString(sDefault); /* overflow */ hres = IHTMLStyle_get_overflow(style, NULL);
1
0
0
0
Rico Schüller : mshtml/tests: Fix SysFreeString call with wrong variable.
by Alexandre Julliard
02 Mar '09
02 Mar '09
Module: wine Branch: master Commit: 0215c75260e3c1a22ac3134550550748f5431fb4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0215c75260e3c1a22ac313455…
Author: Rico Schüller <kgbricola(a)web.de> Date: Sun Mar 1 14:11:40 2009 +0100 mshtml/tests: Fix SysFreeString call with wrong variable. --- dlls/mshtml/tests/dom.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index c39f79f..1e7acae 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -3225,7 +3225,7 @@ static void test_default_style(IHTMLStyle *style) hres = IHTMLStyle_put_backgroundRepeat(style, sDefault); ok(hres == S_OK, "put_backgroundRepeat failed: %08x\n", hres); - SysFreeString(str); + SysFreeString(sDefault); hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle2, (void**)&style2); ok(hres == S_OK, "Could not get IHTMLStyle2 iface: %08x\n", hres);
1
0
0
0
← Newer
1
...
80
81
82
83
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