ReactOS.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
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
List overview
Download
Ros-diffs
April 2014
----- 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
ros-diffs@reactos.org
15 participants
492 discussions
Start a n
N
ew thread
[akhaldi] 62995: [PROPSYS] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Apr 26 17:56:51 2014 New Revision: 62995 URL:
http://svn.reactos.org/svn/reactos?rev=62995&view=rev
Log: [PROPSYS] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/propsys/propstore.c trunk/reactos/dll/win32/propsys/propsys.spec trunk/reactos/dll/win32/propsys/propsys_classes.idl trunk/reactos/dll/win32/propsys/propsys_main.c trunk/reactos/dll/win32/propsys/propvar.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/propsys/propstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propstor…
============================================================================== --- trunk/reactos/dll/win32/propsys/propstore.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/propsys/propstore.c [iso-8859-1] Sat Apr 26 17:56:51 2014 @@ -190,7 +190,7 @@ } static HRESULT PropertyStore_LookupValue(PropertyStore *This, REFPROPERTYKEY key, - int insert, propstore_value **result) + BOOL insert, propstore_value **result) { propstore_format *format=NULL, *format_candidate; propstore_value *value=NULL, *value_candidate; @@ -268,7 +268,7 @@ EnterCriticalSection(&This->lock); - hr = PropertyStore_LookupValue(This, key, 0, &value); + hr = PropertyStore_LookupValue(This, key, FALSE, &value); if (SUCCEEDED(hr)) hr = PropVariantCopy(pv, &value->propvar); @@ -295,7 +295,7 @@ EnterCriticalSection(&This->lock); - hr = PropertyStore_LookupValue(This, key, 1, &value); + hr = PropertyStore_LookupValue(This, key, TRUE, &value); if (SUCCEEDED(hr)) hr = PropVariantCopy(&temp, propvar); @@ -328,7 +328,7 @@ EnterCriticalSection(&This->lock); - hr = PropertyStore_LookupValue(This, key, 0, &value); + hr = PropertyStore_LookupValue(This, key, FALSE, &value); if (SUCCEEDED(hr)) *pstate = value->state; @@ -352,7 +352,7 @@ EnterCriticalSection(&This->lock); - hr = PropertyStore_LookupValue(This, key, 0, &value); + hr = PropertyStore_LookupValue(This, key, FALSE, &value); if (SUCCEEDED(hr)) hr = PropVariantCopy(ppropvar, &value->propvar); @@ -382,7 +382,7 @@ EnterCriticalSection(&This->lock); - hr = PropertyStore_LookupValue(This, key, 0, &value); + hr = PropertyStore_LookupValue(This, key, FALSE, &value); if (SUCCEEDED(hr)) value->state = pstate; @@ -404,7 +404,7 @@ EnterCriticalSection(&This->lock); - hr = PropertyStore_LookupValue(This, key, 1, &value); + hr = PropertyStore_LookupValue(This, key, TRUE, &value); if (SUCCEEDED(hr)) hr = PropVariantCopy(&temp, ppropvar); Modified: trunk/reactos/dll/win32/propsys/propsys.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propsys.…
============================================================================== --- trunk/reactos/dll/win32/propsys/propsys.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/propsys/propsys.spec [iso-8859-1] Sat Apr 26 17:56:51 2014 @@ -82,7 +82,7 @@ @ stub PSGetNamedPropertyFromPropertyStorage @ stdcall PSGetPropertyDescription(ptr ptr ptr) @ stub PSGetPropertyDescriptionByName -@ stub PSGetPropertyDescriptionListFromString +@ stdcall PSGetPropertyDescriptionListFromString(ptr ptr ptr) @ stub PSGetPropertyFromPropertyStorage @ stub PSGetPropertyKeyFromName @ stub PSGetPropertySystem Modified: trunk/reactos/dll/win32/propsys/propsys_classes.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propsys_…
============================================================================== --- trunk/reactos/dll/win32/propsys/propsys_classes.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/propsys/propsys_classes.idl [iso-8859-1] Sat Apr 26 17:56:51 2014 @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ helpstring("Packed Property Storage Object"), threading(both), Modified: trunk/reactos/dll/win32/propsys/propsys_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propsys_…
============================================================================== --- trunk/reactos/dll/win32/propsys/propsys_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/propsys/propsys_main.c [iso-8859-1] Sat Apr 26 17:56:51 2014 @@ -146,6 +146,12 @@ return E_NOTIMPL; } +HRESULT WINAPI PSGetPropertyDescriptionListFromString(LPCWSTR proplist, REFIID riid, void **ppv) +{ + FIXME("%s, %p, %p\n", debugstr_w(proplist), riid, ppv); + return E_NOTIMPL; +} + HRESULT WINAPI PSRefreshPropertySchema(void) { FIXME("\n"); @@ -302,7 +308,7 @@ HRESULT WINAPI PSPropertyKeyFromString(LPCWSTR pszString, PROPERTYKEY *pkey) { - int has_minus = 0, has_comma = 0; + BOOL has_minus = FALSE, has_comma = FALSE; TRACE("(%s, %p)\n", debugstr_w(pszString), pkey); @@ -328,7 +334,7 @@ if (has_comma) return S_OK; else - has_comma = 1; + has_comma = TRUE; } pszString++; } @@ -344,7 +350,7 @@ { if (*pszString == '-') { - has_minus = 1; + has_minus = TRUE; pszString++; } } @@ -359,7 +365,7 @@ if (*pszString == '-') { - has_minus = 1; + has_minus = TRUE; pszString++; } Modified: trunk/reactos/dll/win32/propsys/propvar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propvar.…
============================================================================== --- trunk/reactos/dll/win32/propsys/propvar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/propsys/propvar.c [iso-8859-1] Sat Apr 26 17:56:51 2014 @@ -58,46 +58,46 @@ } static HRESULT PROPVAR_ConvertNumber(REFPROPVARIANT pv, int dest_bits, - int dest_signed, LONGLONG *res) -{ - int src_signed; + BOOL dest_signed, LONGLONG *res) +{ + BOOL src_signed; switch (pv->vt) { case VT_I1: - src_signed = 1; + src_signed = TRUE; *res = pv->u.cVal; break; case VT_UI1: - src_signed = 0; + src_signed = FALSE; *res = pv->u.bVal; break; case VT_I2: - src_signed = 1; + src_signed = TRUE; *res = pv->u.iVal; break; case VT_UI2: - src_signed = 0; + src_signed = FALSE; *res = pv->u.uiVal; break; case VT_I4: - src_signed = 1; + src_signed = TRUE; *res = pv->u.lVal; break; case VT_UI4: - src_signed = 0; + src_signed = FALSE; *res = pv->u.ulVal; break; case VT_I8: - src_signed = 1; + src_signed = TRUE; *res = pv->u.hVal.QuadPart; break; case VT_UI8: - src_signed = 0; + src_signed = FALSE; *res = pv->u.uhVal.QuadPart; break; case VT_EMPTY: - src_signed = 0; + src_signed = FALSE; *res = 0; break; default: @@ -133,7 +133,7 @@ TRACE("%p,%p\n", propvarIn, ret); - hr = PROPVAR_ConvertNumber(propvarIn, 16, 1, &res); + hr = PROPVAR_ConvertNumber(propvarIn, 16, TRUE, &res); if (SUCCEEDED(hr)) *ret = (SHORT)res; return hr; } @@ -145,7 +145,7 @@ TRACE("%p,%p\n", propvarIn, ret); - hr = PROPVAR_ConvertNumber(propvarIn, 32, 1, &res); + hr = PROPVAR_ConvertNumber(propvarIn, 32, TRUE, &res); if (SUCCEEDED(hr)) *ret = (LONG)res; return hr; } @@ -157,7 +157,7 @@ TRACE("%p,%p\n", propvarIn, ret); - hr = PROPVAR_ConvertNumber(propvarIn, 64, 1, &res); + hr = PROPVAR_ConvertNumber(propvarIn, 64, TRUE, &res); if (SUCCEEDED(hr)) *ret = (LONGLONG)res; return hr; } @@ -169,7 +169,7 @@ TRACE("%p,%p\n", propvarIn, ret); - hr = PROPVAR_ConvertNumber(propvarIn, 16, 0, &res); + hr = PROPVAR_ConvertNumber(propvarIn, 16, FALSE, &res); if (SUCCEEDED(hr)) *ret = (USHORT)res; return hr; } @@ -181,7 +181,7 @@ TRACE("%p,%p\n", propvarIn, ret); - hr = PROPVAR_ConvertNumber(propvarIn, 32, 0, &res); + hr = PROPVAR_ConvertNumber(propvarIn, 32, FALSE, &res); if (SUCCEEDED(hr)) *ret = (ULONG)res; return hr; } @@ -193,7 +193,7 @@ TRACE("%p,%p\n", propvarIn, ret); - hr = PROPVAR_ConvertNumber(propvarIn, 64, 0, &res); + hr = PROPVAR_ConvertNumber(propvarIn, 64, FALSE, &res); if (SUCCEEDED(hr)) *ret = (ULONGLONG)res; return hr; } @@ -486,10 +486,10 @@ } } -static int isemptyornull(const PROPVARIANT *propvar) +static BOOL isemptyornull(const PROPVARIANT *propvar) { if (propvar->vt == VT_EMPTY || propvar->vt == VT_NULL) - return 1; + return TRUE; if ((propvar->vt & VT_ARRAY) == VT_ARRAY) { int i; @@ -501,7 +501,7 @@ return i == propvar->u.parray->cDims; } /* FIXME: vectors, byrefs, errors? */ - return 0; + return FALSE; } INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2, Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Apr 26 17:56:51 2014 @@ -157,7 +157,7 @@ reactos/dll/win32/pidgen # Synced to Wine-1.7.1 reactos/dll/win32/powrprof # Forked at Wine-1.0rc5 reactos/dll/win32/printui # Synced to Wine-1.7.1 -reactos/dll/win32/propsys # Synced to Wine-1.7.1 +reactos/dll/win32/propsys # Synced to Wine-1.7.17 reactos/dll/win32/pstorec # Synced to Wine-1.7.1 reactos/dll/win32/qmgr # Synced to Wine-1.7.1 reactos/dll/win32/qmgrprxy # Synced to Wine-1.7.1
10 years, 8 months
1
0
0
0
[akhaldi] 62994: [WININET_WINETEST] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Apr 26 17:50:30 2014 New Revision: 62994 URL:
http://svn.reactos.org/svn/reactos?rev=62994&view=rev
Log: [WININET_WINETEST] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/rostests/winetests/wininet/ftp.c trunk/rostests/winetests/wininet/http.c trunk/rostests/winetests/wininet/internet.c trunk/rostests/winetests/wininet/url.c trunk/rostests/winetests/wininet/urlcache.c trunk/rostests/winetests/wininet/wininet_test.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/rostests/winetests/wininet/ftp.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/ftp.c?r…
Modified: trunk/rostests/winetests/wininet/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/http.c?…
Modified: trunk/rostests/winetests/wininet/internet.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/interne…
Modified: trunk/rostests/winetests/wininet/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/url.c?r…
Modified: trunk/rostests/winetests/wininet/urlcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/urlcach…
Modified: trunk/rostests/winetests/wininet/wininet_test.h URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/wininet…
10 years, 8 months
1
0
0
0
[akhaldi] 62993: [WININET] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Apr 26 17:50:05 2014 New Revision: 62993 URL:
http://svn.reactos.org/svn/reactos?rev=62993&view=rev
Log: [WININET] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/wininet/dialogs.c trunk/reactos/dll/win32/wininet/ftp.c trunk/reactos/dll/win32/wininet/http.c trunk/reactos/dll/win32/wininet/internet.c trunk/reactos/dll/win32/wininet/internet.h trunk/reactos/dll/win32/wininet/netconnection.c trunk/reactos/dll/win32/wininet/utility.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/wininet/dialogs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/dialogs.…
============================================================================== --- trunk/reactos/dll/win32/wininet/dialogs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/dialogs.c [iso-8859-1] Sat Apr 26 17:50:05 2014 @@ -433,7 +433,7 @@ /* FIXME: Use helper function */ flags |= SECURITY_FLAG_SECURE; req->security_flags |= flags; - if(req->netconn) + if(is_valid_netconn(req->netconn)) req->netconn->security_flags |= flags; } Modified: trunk/reactos/dll/win32/wininet/ftp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/ftp.c?re…
============================================================================== --- trunk/reactos/dll/win32/wininet/ftp.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/ftp.c [iso-8859-1] Sat Apr 26 17:50:05 2014 @@ -489,7 +489,7 @@ { INT nResCode; appinfo_t *hIC = NULL; - DWORD bSuccess = FALSE; + BOOL bSuccess = FALSE; TRACE("lpszDirectory(%s)\n", debugstr_w(lpszDirectory)); @@ -1004,7 +1004,7 @@ { INT nResCode; appinfo_t *hIC = NULL; - DWORD bSuccess = FALSE; + BOOL bSuccess = FALSE; /* Clear any error information */ INTERNET_SetLastError(0); @@ -1249,6 +1249,12 @@ return ERROR_SUCCESS; } +static DWORD FTPFILE_LockRequestFile(object_header_t *hdr, req_file_t **ret) +{ + ftp_file_t *file = (ftp_file_t*)hdr; + FIXME("%p\n", file); + return ERROR_NOT_SUPPORTED; +} static const object_vtbl_t FTPFILEVtbl = { FTPFILE_Destroy, @@ -1259,7 +1265,8 @@ FTPFILE_ReadFileEx, FTPFILE_WriteFile, FTPFILE_QueryDataAvailable, - NULL + NULL, + FTPFILE_LockRequestFile }; /*********************************************************************** Modified: trunk/reactos/dll/win32/wininet/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/http.c?r…
============================================================================== --- trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] Sat Apr 26 17:50:05 2014 @@ -351,16 +351,10 @@ return &req->custHeaders[HeaderIndex]; } -typedef enum { - READMODE_SYNC, - READMODE_ASYNC, - READMODE_NOBLOCK -} read_mode_t; - struct data_stream_vtbl_t { DWORD (*get_avail_data)(data_stream_t*,http_request_t*); BOOL (*end_of_data)(data_stream_t*,http_request_t*); - DWORD (*read)(data_stream_t*,http_request_t*,BYTE*,DWORD,DWORD*,read_mode_t); + DWORD (*read)(data_stream_t*,http_request_t*,BYTE*,DWORD,DWORD*,blocking_mode_t); BOOL (*drain_content)(data_stream_t*,http_request_t*); void (*destroy)(data_stream_t*); }; @@ -372,6 +366,7 @@ DWORD buf_size; DWORD buf_pos; DWORD chunk_size; + BOOL end_of_data; } chunked_stream_t; static inline void destroy_data_stream(data_stream_t *stream) @@ -408,47 +403,45 @@ static BOOL gzip_end_of_data(data_stream_t *stream, http_request_t *req) { gzip_stream_t *gzip_stream = (gzip_stream_t*)stream; - return gzip_stream->end_of_data; + return gzip_stream->end_of_data + || (!gzip_stream->buf_size && gzip_stream->parent_stream->vtbl->end_of_data(gzip_stream->parent_stream, req)); } static DWORD gzip_read(data_stream_t *stream, http_request_t *req, BYTE *buf, DWORD size, - DWORD *read, read_mode_t read_mode) + DWORD *read, blocking_mode_t blocking_mode) { gzip_stream_t *gzip_stream = (gzip_stream_t*)stream; z_stream *zstream = &gzip_stream->zstream; DWORD current_read, ret_read = 0; - BOOL end; int zres; DWORD res = ERROR_SUCCESS; + TRACE("(%d %d)\n", size, blocking_mode); + while(size && !gzip_stream->end_of_data) { - end = gzip_stream->parent_stream->vtbl->end_of_data(gzip_stream->parent_stream, req); - - if(gzip_stream->buf_size <= 64 && !end) { + if(!gzip_stream->buf_size) { if(gzip_stream->buf_pos) { if(gzip_stream->buf_size) memmove(gzip_stream->buf, gzip_stream->buf+gzip_stream->buf_pos, gzip_stream->buf_size); gzip_stream->buf_pos = 0; } res = gzip_stream->parent_stream->vtbl->read(gzip_stream->parent_stream, req, gzip_stream->buf+gzip_stream->buf_size, - sizeof(gzip_stream->buf)-gzip_stream->buf_size, ¤t_read, read_mode); + sizeof(gzip_stream->buf)-gzip_stream->buf_size, ¤t_read, blocking_mode); gzip_stream->buf_size += current_read; if(res != ERROR_SUCCESS) break; - end = gzip_stream->parent_stream->vtbl->end_of_data(gzip_stream->parent_stream, req); - if(!current_read && !end) { - if(read_mode != READMODE_NOBLOCK) { + + if(!current_read) { + if(blocking_mode != BLOCKING_DISALLOW) { WARN("unexpected end of data\n"); gzip_stream->end_of_data = TRUE; } break; } - if(gzip_stream->buf_size <= 64 && !end) - continue; } zstream->next_in = gzip_stream->buf+gzip_stream->buf_pos; - zstream->avail_in = gzip_stream->buf_size-(end ? 0 : 64); + zstream->avail_in = gzip_stream->buf_size; zstream->next_out = buf+ret_read; zstream->avail_out = size; zres = inflate(&gzip_stream->zstream, 0); @@ -468,8 +461,8 @@ break; } - if(ret_read && read_mode == READMODE_ASYNC) - read_mode = READMODE_NOBLOCK; + if(ret_read && blocking_mode == BLOCKING_ALLOW) + blocking_mode = BLOCKING_DISALLOW; } TRACE("read %u bytes\n", ret_read); @@ -512,7 +505,7 @@ heap_free(address); } -static DWORD init_gzip_stream(http_request_t *req) +static DWORD init_gzip_stream(http_request_t *req, BOOL is_gzip) { gzip_stream_t *gzip_stream; int index, zres; @@ -525,7 +518,7 @@ gzip_stream->zstream.zalloc = wininet_zalloc; gzip_stream->zstream.zfree = wininet_zfree; - zres = inflateInit2(&gzip_stream->zstream, 0x1f); + zres = inflateInit2(&gzip_stream->zstream, is_gzip ? 0x1f : -15); if(zres != Z_OK) { ERR("inflateInit failed: %d\n", zres); heap_free(gzip_stream); @@ -550,7 +543,7 @@ #else -static DWORD init_gzip_stream(http_request_t *req) +static DWORD init_gzip_stream(http_request_t *req, BOOL is_gzip) { ERR("gzip stream not supported, missing zlib.\n"); return ERROR_SUCCESS; @@ -1422,7 +1415,7 @@ { LPWSTR szVerb = NULL, szObjectName = NULL; LPWSTR szVersion = NULL, szReferrer = NULL, *szAcceptTypes = NULL; - HINTERNET rc = FALSE; + HINTERNET rc = NULL; TRACE("(%p, %s, %s, %s, %s, %p, %08x, %08lx)\n", hHttpSession, debugstr_a(lpszVerb), debugstr_a(lpszObjectName), @@ -1883,11 +1876,10 @@ TRACE("\n"); - if(request->hCacheFile) { + if(request->hCacheFile) CloseHandle(request->hCacheFile); - DeleteFileW(request->cacheFile); - } - heap_free(request->cacheFile); + if(request->req_file) + req_file_release(request->req_file); request->read_section.DebugInfo->Spare[0] = 0; DeleteCriticalSection( &request->read_section ); @@ -1917,9 +1909,9 @@ static void http_release_netconn(http_request_t *req, BOOL reuse) { - TRACE("%p %p\n",req, req->netconn); - - if(!req->netconn) + TRACE("%p %p %x\n",req, req->netconn, reuse); + + if(!is_valid_netconn(req->netconn)) return; #ifndef __REACTOS__ @@ -1965,8 +1957,7 @@ INTERNET_SendCallback(&req->hdr, req->hdr.dwContext, INTERNET_STATUS_CLOSING_CONNECTION, 0, 0); - free_netconn(req->netconn); - req->netconn = NULL; + close_netconn(req->netconn); INTERNET_SendCallback(&req->hdr, req->hdr.dwContext, INTERNET_STATUS_CONNECTION_CLOSED, 0, 0); @@ -2069,7 +2060,7 @@ info->Flags |= IDSI_FLAG_KEEP_ALIVE; if (req->proxy) info->Flags |= IDSI_FLAG_PROXY; - if (req->netconn && req->netconn->secure) + if (is_valid_netconn(req->netconn) && req->netconn->secure) info->Flags |= IDSI_FLAG_SECURE; return ERROR_SUCCESS; @@ -2086,7 +2077,7 @@ return ERROR_INSUFFICIENT_BUFFER; *size = sizeof(DWORD); - flags = req->netconn ? req->netconn->security_flags : req->security_flags | req->server->security_flags; + flags = is_valid_netconn(req->netconn) ? req->netconn->security_flags : req->security_flags | req->server->security_flags; *(DWORD *)buffer = flags; TRACE("INTERNET_OPTION_SECURITY_FLAGS %x\n", flags); @@ -2170,25 +2161,25 @@ TRACE("INTERNET_OPTION_DATAFILE_NAME\n"); - if(!req->cacheFile) { + if(!req->req_file) { *size = 0; return ERROR_INTERNET_ITEM_NOT_FOUND; } if(unicode) { - req_size = (lstrlenW(req->cacheFile)+1) * sizeof(WCHAR); + req_size = (lstrlenW(req->req_file->file_name)+1) * sizeof(WCHAR); if(*size < req_size) return ERROR_INSUFFICIENT_BUFFER; *size = req_size; - memcpy(buffer, req->cacheFile, *size); + memcpy(buffer, req->req_file->file_name, *size); return ERROR_SUCCESS; }else { - req_size = WideCharToMultiByte(CP_ACP, 0, req->cacheFile, -1, NULL, 0, NULL, NULL); + req_size = WideCharToMultiByte(CP_ACP, 0, req->req_file->file_name, -1, NULL, 0, NULL, NULL); if (req_size > *size) return ERROR_INSUFFICIENT_BUFFER; - *size = WideCharToMultiByte(CP_ACP, 0, req->cacheFile, + *size = WideCharToMultiByte(CP_ACP, 0, req->req_file->file_name, -1, buffer, *size, NULL, NULL); return ERROR_SUCCESS; } @@ -2291,7 +2282,7 @@ TRACE("INTERNET_OPTION_SECURITY_FLAGS %08x\n", flags); flags &= SECURITY_SET_MASK; req->security_flags |= flags; - if(req->netconn) + if(is_valid_netconn(req->netconn)) req->netconn->security_flags |= flags; return ERROR_SUCCESS; } @@ -2352,12 +2343,17 @@ if(HTTP_GetRequestURL(req, url)) { WCHAR *header; DWORD header_len; + BOOL res; header = build_response_header(req, TRUE); header_len = (header ? strlenW(header) : 0); - CommitUrlCacheEntryW(url, req->cacheFile, req->expires, + res = CommitUrlCacheEntryW(url, req->req_file->file_name, req->expires, req->last_modified, NORMAL_CACHE_ENTRY, header, header_len, NULL, 0); + if(res) + req->req_file->is_committed = TRUE; + else + WARN("CommitUrlCacheEntry failed: %u\n", GetLastError()); heap_free(header); } } @@ -2372,9 +2368,14 @@ BOOL b = TRUE; /* FIXME: We should free previous cache file earlier */ - heap_free(req->cacheFile); - CloseHandle(req->hCacheFile); - req->hCacheFile = NULL; + if(req->req_file) { + req_file_release(req->req_file); + req->req_file = NULL; + } + if(req->hCacheFile) { + CloseHandle(req->hCacheFile); + req->hCacheFile = NULL; + } if(req->hdr.dwFlags & INTERNET_FLAG_NO_CACHE_WRITE) b = FALSE; @@ -2426,8 +2427,9 @@ return; } - req->cacheFile = heap_strdupW(file_name); - req->hCacheFile = CreateFileW(req->cacheFile, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, + create_req_file(file_name, &req->req_file); + + req->hCacheFile = CreateFileW(file_name, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if(req->hCacheFile == INVALID_HANDLE_VALUE) { WARN("Could not create file: %u\n", GetLastError()); @@ -2464,7 +2466,7 @@ if (maxlen == -1) maxlen = sizeof(req->read_buf); res = NETCON_recv( req->netconn, req->read_buf + req->read_size, - maxlen - req->read_size, 0, &len ); + maxlen - req->read_size, BLOCKING_ALLOW, &len ); if(res == ERROR_SUCCESS) req->read_size += len; @@ -2533,11 +2535,11 @@ return !req->read_size && req->data_stream->vtbl->end_of_data(req->data_stream, req); } -static DWORD read_http_stream(http_request_t *req, BYTE *buf, DWORD size, DWORD *read, read_mode_t read_mode) +static DWORD read_http_stream(http_request_t *req, BYTE *buf, DWORD size, DWORD *read, blocking_mode_t blocking_mode) { DWORD res; - res = req->data_stream->vtbl->read(req->data_stream, req, buf, size, read, read_mode); + res = req->data_stream->vtbl->read(req->data_stream, req, buf, size, read, blocking_mode); assert(*read <= size); if(req->hCacheFile) { @@ -2558,7 +2560,7 @@ } /* fetch some more data into the read buffer (the read section must be held) */ -static DWORD refill_read_buffer(http_request_t *req, read_mode_t read_mode, DWORD *read_bytes) +static DWORD refill_read_buffer(http_request_t *req, blocking_mode_t blocking_mode, DWORD *read_bytes) { DWORD res, read=0; @@ -2572,7 +2574,7 @@ } res = read_http_stream(req, req->read_buf+req->read_size, sizeof(req->read_buf) - req->read_size, - &read, read_mode); + &read, blocking_mode); req->read_size += read; TRACE("read %u bytes, read_size %u\n", read, req->read_size); @@ -2592,7 +2594,7 @@ netconn_stream_t *netconn_stream = (netconn_stream_t*)stream; DWORD avail = 0; - if(req->netconn) + if(is_valid_netconn(req->netconn)) NETCON_query_data_available(req->netconn, &avail); return netconn_stream->content_length == ~0u ? avail @@ -2602,11 +2604,11 @@ static BOOL netconn_end_of_data(data_stream_t *stream, http_request_t *req) { netconn_stream_t *netconn_stream = (netconn_stream_t*)stream; - return netconn_stream->content_read == netconn_stream->content_length || !req->netconn; + return netconn_stream->content_read == netconn_stream->content_length || !is_valid_netconn(req->netconn); } static DWORD netconn_read(data_stream_t *stream, http_request_t *req, BYTE *buf, DWORD size, - DWORD *read, read_mode_t read_mode) + DWORD *read, blocking_mode_t blocking_mode) { netconn_stream_t *netconn_stream = (netconn_stream_t*)stream; DWORD res = ERROR_SUCCESS; @@ -2614,17 +2616,16 @@ size = min(size, netconn_stream->content_length-netconn_stream->content_read); - if(read_mode == READMODE_NOBLOCK) { - DWORD avail = netconn_get_avail_data(stream, req); - if (size > avail) - size = avail; - } - - if(size && req->netconn) { - if((res = NETCON_recv(req->netconn, buf, size, read_mode == READMODE_SYNC ? MSG_WAITALL : 0, &len))) + if(size && is_valid_netconn(req->netconn)) { + if((res = NETCON_recv(req->netconn, buf, size, blocking_mode, &len))) { len = 0; - if(!len) + if(blocking_mode == BLOCKING_DISALLOW && res == WSAEWOULDBLOCK) + res = ERROR_SUCCESS; + else + netconn_stream->content_length = netconn_stream->content_read; + }else if(!len) { netconn_stream->content_length = netconn_stream->content_read; + } } netconn_stream->content_read += *read = len; @@ -2636,18 +2637,13 @@ { netconn_stream_t *netconn_stream = (netconn_stream_t*)stream; BYTE buf[1024]; - DWORD avail; int len; if(netconn_end_of_data(stream, req)) return TRUE; do { - avail = netconn_get_avail_data(stream, req); - if(!avail) - return FALSE; - - if(NETCON_recv(req->netconn, buf, min(avail, sizeof(buf)), 0, &len) != ERROR_SUCCESS) + if(NETCON_recv(req->netconn, buf, sizeof(buf), BLOCKING_DISALLOW, &len) != ERROR_SUCCESS) return FALSE; netconn_stream->content_read += len; @@ -2674,6 +2670,8 @@ DWORD res; int len; + assert(!stream->end_of_data); + if (stream->buf_pos) { /* move existing data to the start of the buffer */ @@ -2685,7 +2683,7 @@ if (maxlen == -1) maxlen = sizeof(stream->buf); res = NETCON_recv( req->netconn, stream->buf + stream->buf_size, - maxlen - stream->buf_size, 0, &len ); + maxlen - stream->buf_size, BLOCKING_ALLOW, &len ); if(res == ERROR_SUCCESS) stream->buf_size += len; @@ -2721,10 +2719,14 @@ /* read the size of the next chunk (the read section must be held) */ static DWORD start_next_chunk(chunked_stream_t *stream, http_request_t *req) { - /* TODOO */ DWORD chunk_size = 0, res; - if(stream->chunk_size != ~0u && (res = discard_chunked_eol(stream, req)) != ERROR_SUCCESS) + assert(!stream->chunk_size || stream->chunk_size == ~0u); + + if (stream->end_of_data) return ERROR_SUCCESS; + + /* read terminator for the previous chunk */ + if(!stream->chunk_size && (res = discard_chunked_eol(stream, req)) != ERROR_SUCCESS) return res; for (;;) @@ -2739,7 +2741,10 @@ { TRACE( "reading %u byte chunk\n", chunk_size ); stream->chunk_size = chunk_size; - req->contentLength += chunk_size; + if (req->contentLength == ~0u) req->contentLength = chunk_size; + else req->contentLength += chunk_size; + + if (!chunk_size) stream->end_of_data = TRUE; return discard_chunked_eol(stream, req); } remove_chunked_data(stream, 1); @@ -2762,27 +2767,27 @@ static BOOL chunked_end_of_data(data_stream_t *stream, http_request_t *req) { chunked_stream_t *chunked_stream = (chunked_stream_t*)stream; - return !chunked_stream->chunk_size; + return chunked_stream->end_of_data; } static DWORD chunked_read(data_stream_t *stream, http_request_t *req, BYTE *buf, DWORD size, - DWORD *read, read_mode_t read_mode) + DWORD *read, blocking_mode_t blocking_mode) { chunked_stream_t *chunked_stream = (chunked_stream_t*)stream; DWORD read_bytes = 0, ret_read = 0, res = ERROR_SUCCESS; - if(chunked_stream->chunk_size == ~0u) { + if(!chunked_stream->chunk_size || chunked_stream->chunk_size == ~0u) { res = start_next_chunk(chunked_stream, req); if(res != ERROR_SUCCESS) return res; } - while(size && chunked_stream->chunk_size) { + while(size && chunked_stream->chunk_size && !chunked_stream->end_of_data) { if(chunked_stream->buf_size) { read_bytes = min(size, min(chunked_stream->buf_size, chunked_stream->chunk_size)); /* this could block */ - if(read_mode == READMODE_NOBLOCK && read_bytes == chunked_stream->chunk_size) + if(blocking_mode == BLOCKING_DISALLOW && read_bytes == chunked_stream->chunk_size) break; memcpy(buf+ret_read, chunked_stream->buf+chunked_stream->buf_pos, read_bytes); @@ -2790,10 +2795,10 @@ }else { read_bytes = min(size, chunked_stream->chunk_size); - if(read_mode == READMODE_NOBLOCK) { + if(blocking_mode == BLOCKING_DISALLOW) { DWORD avail; - if(!req->netconn || !NETCON_query_data_available(req->netconn, &avail) || !avail) + if(!is_valid_netconn(req->netconn) || !NETCON_query_data_available(req->netconn, &avail) || !avail) break; if(read_bytes > avail) read_bytes = avail; @@ -2803,7 +2808,7 @@ break; } - res = NETCON_recv(req->netconn, (char *)buf+ret_read, read_bytes, 0, (int*)&read_bytes); + res = NETCON_recv(req->netconn, (char *)buf+ret_read, read_bytes, BLOCKING_ALLOW, (int*)&read_bytes); if(res != ERROR_SUCCESS) break; } @@ -2811,15 +2816,15 @@ chunked_stream->chunk_size -= read_bytes; size -= read_bytes; ret_read += read_bytes; - if(!chunked_stream->chunk_size) { - assert(read_mode != READMODE_NOBLOCK); + if(size && !chunked_stream->chunk_size) { + assert(blocking_mode != BLOCKING_DISALLOW); res = start_next_chunk(chunked_stream, req); if(res != ERROR_SUCCESS) break; } - if(read_mode == READMODE_ASYNC) - read_mode = READMODE_NOBLOCK; + if(blocking_mode == BLOCKING_ALLOW) + blocking_mode = BLOCKING_DISALLOW; } TRACE("read %u bytes\n", ret_read); @@ -2831,8 +2836,8 @@ { chunked_stream_t *chunked_stream = (chunked_stream_t*)stream; - /* FIXME: we can do better */ - return !chunked_stream->chunk_size; + remove_chunked_data(chunked_stream, chunked_stream->buf_size); + return chunked_stream->end_of_data; } static void chunked_destroy(data_stream_t *stream) @@ -2881,6 +2886,7 @@ chunked_stream->data_stream.vtbl = &chunked_stream_vtbl; chunked_stream->buf_size = chunked_stream->buf_pos = 0; chunked_stream->chunk_size = ~0u; + chunked_stream->end_of_data = FALSE; if(request->read_size) { memcpy(chunked_stream->buf, request->read_buf+request->read_pos, request->read_size); @@ -2896,12 +2902,19 @@ if(request->decoding) { int encoding_idx; + static const WCHAR deflateW[] = {'d','e','f','l','a','t','e',0}; static const WCHAR gzipW[] = {'g','z','i','p',0}; encoding_idx = HTTP_GetCustomHeaderIndex(request, szContent_Encoding, 0, FALSE); - if(encoding_idx != -1 && !strcmpiW(request->custHeaders[encoding_idx].lpszValue, gzipW)) { - HTTP_DeleteCustomHeader(request, encoding_idx); - return init_gzip_stream(request); + if(encoding_idx != -1) { + if(!strcmpiW(request->custHeaders[encoding_idx].lpszValue, gzipW)) { + HTTP_DeleteCustomHeader(request, encoding_idx); + return init_gzip_stream(request, TRUE); + } + if(!strcmpiW(request->custHeaders[encoding_idx].lpszValue, deflateW)) { + HTTP_DeleteCustomHeader(request, encoding_idx); + return init_gzip_stream(request, FALSE); + } } } @@ -2922,20 +2935,20 @@ static void HTTP_ReceiveRequestData(http_request_t *req, BOOL first_notif, DWORD *ret_size) { DWORD res, read = 0, avail = 0; - read_mode_t mode; + blocking_mode_t mode; TRACE("%p\n", req); EnterCriticalSection( &req->read_section ); - mode = first_notif && req->read_size ? READMODE_NOBLOCK : READMODE_ASYNC; + mode = first_notif && req->read_size ? BLOCKING_DISALLOW : BLOCKING_ALLOW; res = refill_read_buffer(req, mode, &read); if(res == ERROR_SUCCESS) avail = get_avail_data(req); LeaveCriticalSection( &req->read_section ); - if(res != ERROR_SUCCESS || (mode != READMODE_NOBLOCK && !read)) { + if(res != ERROR_SUCCESS || (mode != BLOCKING_DISALLOW && !read)) { WARN("res %u read %u, closing connection\n", res, read); http_release_netconn(req, FALSE); } @@ -2957,10 +2970,10 @@ static DWORD HTTPREQ_Read(http_request_t *req, void *buffer, DWORD size, DWORD *read, BOOL sync) { DWORD current_read = 0, ret_read = 0; - read_mode_t read_mode; + blocking_mode_t blocking_mode; DWORD res = ERROR_SUCCESS; - read_mode = req->session->appInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC ? READMODE_ASYNC : READMODE_SYNC; + blocking_mode = req->session->appInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC ? BLOCKING_ALLOW : BLOCKING_WAITALL; EnterCriticalSection( &req->read_section ); @@ -2969,12 +2982,12 @@ memcpy(buffer, req->read_buf+req->read_pos, ret_read); req->read_size -= ret_read; req->read_pos += ret_read; - if(read_mode == READMODE_ASYNC) - read_mode = READMODE_NOBLOCK; + if(blocking_mode == BLOCKING_ALLOW) + blocking_mode = BLOCKING_DISALLOW; } if(ret_read < size) { - res = read_http_stream(req, (BYTE*)buffer+ret_read, size-ret_read, ¤t_read, read_mode); + res = read_http_stream(req, (BYTE*)buffer+ret_read, size-ret_read, ¤t_read, blocking_mode); ret_read += current_read; } @@ -2993,7 +3006,7 @@ { BOOL ret; - if(!req->netconn || req->contentLength == -1) + if(!is_valid_netconn(req->netconn) || req->contentLength == -1) return FALSE; if(!strcmpW(req->verb, szHEAD)) @@ -3181,7 +3194,7 @@ /* never wait, if we can't enter the section we queue an async request right away */ if (TryEnterCriticalSection( &req->read_section )) { - refill_read_buffer(req, READMODE_NOBLOCK, NULL); + refill_read_buffer(req, BLOCKING_DISALLOW, NULL); if ((*available = get_avail_data( req ))) goto done; if (end_of_read_data( req )) goto done; LeaveCriticalSection( &req->read_section ); @@ -3197,7 +3210,7 @@ if (!(*available = get_avail_data( req )) && !end_of_read_data( req )) { - refill_read_buffer( req, READMODE_ASYNC, NULL ); + refill_read_buffer( req, BLOCKING_ALLOW, NULL ); *available = get_avail_data( req ); } @@ -3205,6 +3218,21 @@ LeaveCriticalSection( &req->read_section ); TRACE( "returning %u\n", *available ); + return ERROR_SUCCESS; +} + +static DWORD HTTPREQ_LockRequestFile(object_header_t *hdr, req_file_t **ret) +{ + http_request_t *req = (http_request_t*)hdr; + + TRACE("(%p)\n", req); + + if(!req->req_file) { + WARN("No cache file name available\n"); + return ERROR_FILE_NOT_FOUND; + } + + *ret = req_file_addref(req->req_file); return ERROR_SUCCESS; } @@ -3217,7 +3245,8 @@ HTTPREQ_ReadFileEx, HTTPREQ_WriteFile, HTTPREQ_QueryDataAvailable, - NULL + NULL, + HTTPREQ_LockRequestFile }; /*********************************************************************** @@ -3237,7 +3266,7 @@ { appinfo_t *hIC = session->appInfo; http_request_t *request; - DWORD len, res = ERROR_SUCCESS; + DWORD len; TRACE("-->\n"); @@ -3326,13 +3355,7 @@ INTERNET_STATUS_HANDLE_CREATED, &request->hdr.hInternet, sizeof(HINTERNET)); - TRACE("<-- %u (%p)\n", res, request); - - if(res != ERROR_SUCCESS) { - WININET_Release( &request->hdr ); - *ret = NULL; - return res; - } + TRACE("<-- (%p)\n", request); *ret = request->hdr.hInternet; return ERROR_SUCCESS; @@ -3999,8 +4022,8 @@ WCHAR userName[INTERNET_MAX_USER_NAME_LENGTH]; BOOL custom_port = FALSE; - static WCHAR httpW[] = {'h','t','t','p',0}; - static WCHAR httpsW[] = {'h','t','t','p','s',0}; + static const WCHAR httpW[] = {'h','t','t','p',0}; + static const WCHAR httpsW[] = {'h','t','t','p','s',0}; userName[0] = 0; hostName[0] = 0; @@ -4726,8 +4749,21 @@ netconn_t *netconn = NULL; DWORD res; - assert(!request->netconn); reset_data_stream(request); + + if (request->netconn) + { + if (is_valid_netconn(request->netconn) && NETCON_is_alive(request->netconn)) + { + *reusing = TRUE; + return ERROR_SUCCESS; + } + else + { + free_netconn(request->netconn); + request->netconn = NULL; + } + } res = HTTP_ResolveName(request); if(res != ERROR_SUCCESS) @@ -4739,7 +4775,7 @@ netconn = LIST_ENTRY(list_head(&request->server->conn_pool), netconn_t, pool_entry); list_remove(&netconn->pool_entry); - if(NETCON_is_alive(netconn)) + if(is_valid_netconn(netconn) && NETCON_is_alive(netconn)) break; TRACE("connection %p closed during idle\n", netconn); @@ -4875,7 +4911,6 @@ char *ascii_req; loop_next = FALSE; - reusing_connection = request->netconn != NULL; if(redirected) { request->contentLength = ~0u; @@ -4911,7 +4946,8 @@ TRACE("Request header -> %s\n", debugstr_w(requestString) ); - if (!reusing_connection && (res = open_http_connection(request, &reusing_connection)) != ERROR_SUCCESS) + res = open_http_connection(request, &reusing_connection); + if (res != ERROR_SUCCESS) break; /* send the request as ASCII, tack on the optional data */ @@ -5146,7 +5182,7 @@ INT responseLen; DWORD res = ERROR_SUCCESS; - if(!request->netconn) { + if(!is_valid_netconn(request->netconn)) { WARN("Not connected\n"); send_request_complete(request, 0, ERROR_INTERNET_OPERATION_CANCELLED); return ERROR_INTERNET_OPERATION_CANCELLED; @@ -5818,7 +5854,7 @@ TRACE("-->\n"); - if(!request->netconn) + if(!is_valid_netconn(request->netconn)) goto lend; /* clear old response headers (eg. from a redirect response) */ Modified: trunk/reactos/dll/win32/wininet/internet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
============================================================================== --- trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] Sat Apr 26 17:50:05 2014 @@ -1177,7 +1177,7 @@ WARN("always returning LAN connection.\n"); *lpdwStatus = INTERNET_CONNECTION_LAN; } - return LoadStringW(WININET_hModule, IDS_LANCONNECTION, lpszConnectionName, dwNameLen); + return LoadStringW(WININET_hModule, IDS_LANCONNECTION, lpszConnectionName, dwNameLen) > 0; } @@ -1723,7 +1723,7 @@ if(!found_colon){ SetLastError(ERROR_INTERNET_UNRECOGNIZED_SCHEME); - return 0; + return FALSE; } lpUC->nScheme = INTERNET_SCHEME_UNKNOWN; @@ -2870,13 +2870,17 @@ } break; + case INTERNET_PER_CONN_PROXY_BYPASS: + heap_free(pi.proxyBypass); + pi.proxyBypass = heap_strdupW(option->Value.pszValue); + break; + case INTERNET_PER_CONN_AUTOCONFIG_URL: case INTERNET_PER_CONN_AUTODISCOVERY_FLAGS: case INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL: case INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS: case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME: case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL: - case INTERNET_PER_CONN_PROXY_BYPASS: FIXME("Unhandled dwOption %d\n", option->dwOption); break; @@ -3863,21 +3867,84 @@ return res == ERROR_SUCCESS; } +DWORD create_req_file(const WCHAR *file_name, req_file_t **ret) +{ + req_file_t *req_file; + + req_file = heap_alloc_zero(sizeof(*req_file)); + if(!req_file) + return ERROR_NOT_ENOUGH_MEMORY; + + req_file->ref = 1; + + req_file->file_name = heap_strdupW(file_name); + if(!req_file->file_name) { + heap_free(req_file); + return ERROR_NOT_ENOUGH_MEMORY; + } + + req_file->file_handle = CreateFileW(req_file->file_name, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if(req_file->file_handle == INVALID_HANDLE_VALUE) { + req_file_release(req_file); + return GetLastError(); + } + + *ret = req_file; + return ERROR_SUCCESS; +} + +void req_file_release(req_file_t *req_file) +{ + if(InterlockedDecrement(&req_file->ref)) + return; + + if(!req_file->is_committed) + DeleteFileW(req_file->file_name); + if(req_file->file_handle && req_file->file_handle != INVALID_HANDLE_VALUE) + CloseHandle(req_file->file_handle); + heap_free(req_file->file_name); + heap_free(req_file); +} /*********************************************************************** * InternetLockRequestFile (WININET.@) */ -BOOL WINAPI InternetLockRequestFile( HINTERNET hInternet, HANDLE -*lphLockReqHandle) -{ - FIXME("STUB\n"); - return FALSE; -} - -BOOL WINAPI InternetUnlockRequestFile( HANDLE hLockHandle) -{ - FIXME("STUB\n"); - return FALSE; +BOOL WINAPI InternetLockRequestFile(HINTERNET hInternet, HANDLE *lphLockReqHandle) +{ + req_file_t *req_file = NULL; + object_header_t *hdr; + DWORD res; + + TRACE("(%p %p)\n", hInternet, lphLockReqHandle); + + hdr = get_handle_object(hInternet); + if (!hdr) { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + if(hdr->vtbl->LockRequestFile) { + res = hdr->vtbl->LockRequestFile(hdr, &req_file); + }else { + WARN("wrong handle\n"); + res = ERROR_INTERNET_INCORRECT_HANDLE_TYPE; + } + + WININET_Release(hdr); + + *lphLockReqHandle = req_file; + if(res != ERROR_SUCCESS) + SetLastError(res); + return res == ERROR_SUCCESS; +} + +BOOL WINAPI InternetUnlockRequestFile(HANDLE hLockHandle) +{ + TRACE("(%p)\n", hLockHandle); + + req_file_release(hLockHandle); + return TRUE; } @@ -4526,7 +4593,7 @@ BOOL WINAPI InternetQueryFortezzaStatus(DWORD *a, DWORD_PTR b) { FIXME("(%p, %08lx) stub\n", a, b); - return 0; + return FALSE; } DWORD WINAPI ShowClientAuthCerts(HWND parent) Modified: trunk/reactos/dll/win32/wininet/internet.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
============================================================================== --- trunk/reactos/dll/win32/wininet/internet.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/internet.h [iso-8859-1] Sat Apr 26 17:50:05 2014 @@ -146,6 +146,9 @@ struct list pool_entry; } netconn_t; +BOOL is_valid_netconn(netconn_t *) DECLSPEC_HIDDEN; +void close_netconn(netconn_t *) DECLSPEC_HIDDEN; + static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len) { return HeapAlloc(GetProcessHeap(), 0, len); @@ -285,6 +288,14 @@ #define INET_OPENURL 0x0001 #define INET_CALLBACKW 0x0002 +typedef struct +{ + LONG ref; + HANDLE file_handle; + WCHAR *file_name; + BOOL is_committed; +} req_file_t; + typedef struct _object_header_t object_header_t; typedef struct { @@ -297,6 +308,7 @@ DWORD (*WriteFile)(object_header_t*,const void*,DWORD,DWORD*); DWORD (*QueryDataAvailable)(object_header_t*,DWORD*,DWORD,DWORD_PTR); DWORD (*FindNextFileW)(object_header_t*,void*); + DWORD (*LockRequestFile)(object_header_t*,req_file_t**); } object_vtbl_t; #define INTERNET_HANDLE_IN_USE 1 @@ -317,7 +329,6 @@ struct list entry; struct list children; }; - typedef struct { @@ -395,7 +406,7 @@ DWORD nCustHeaders; FILETIME last_modified; HANDLE hCacheFile; - LPWSTR cacheFile; + req_file_t *req_file; FILETIME expires; struct HttpAuthInfo *authInfo; struct HttpAuthInfo *proxyAuthInfo; @@ -465,14 +476,19 @@ DWORD dwStatusInfoLength) DECLSPEC_HIDDEN; BOOL INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto, WCHAR *foundProxy, DWORD *foundProxyLen) DECLSPEC_HIDDEN; +typedef enum { + BLOCKING_ALLOW, + BLOCKING_DISALLOW, + BLOCKING_WAITALL +} blocking_mode_t; + DWORD create_netconn(BOOL,server_t*,DWORD,BOOL,DWORD,netconn_t**) DECLSPEC_HIDDEN; void free_netconn(netconn_t*) DECLSPEC_HIDDEN; void NETCON_unload(void) DECLSPEC_HIDDEN; DWORD NETCON_secure_connect(netconn_t*,server_t*) DECLSPEC_HIDDEN; DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags, int *sent /* out */) DECLSPEC_HIDDEN; -DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, int flags, - int *recvd /* out */) DECLSPEC_HIDDEN; +DWORD NETCON_recv(netconn_t*,void*,size_t,blocking_mode_t,int*) DECLSPEC_HIDDEN; BOOL NETCON_query_data_available(netconn_t *connection, DWORD *available) DECLSPEC_HIDDEN; BOOL NETCON_is_alive(netconn_t*) DECLSPEC_HIDDEN; LPCVOID NETCON_GetCert(netconn_t *connection) DECLSPEC_HIDDEN; @@ -505,6 +521,15 @@ server_t *get_server(const WCHAR*,INTERNET_PORT,BOOL,BOOL); +DWORD create_req_file(const WCHAR*,req_file_t**) DECLSPEC_HIDDEN; +void req_file_release(req_file_t*) DECLSPEC_HIDDEN; + +static inline req_file_t *req_file_addref(req_file_t *req_file) +{ + InterlockedIncrement(&req_file->ref); + return req_file; +} + BOOL init_urlcache(void) DECLSPEC_HIDDEN; void free_urlcache(void) DECLSPEC_HIDDEN; void free_cookie(void) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/wininet/netconnection.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/netconne…
============================================================================== --- trunk/reactos/dll/win32/wininet/netconnection.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/netconnection.c [iso-8859-1] Sat Apr 26 17:50:05 2014 @@ -34,7 +34,15 @@ # include <netinet/tcp.h> #endif +#include <errno.h> + #define RESPONSE_TIMEOUT 30 /* FROM internet.c */ + +#ifdef MSG_DONTWAIT +#define WINE_MSG_DONTWAIT MSG_DONTWAIT +#else +#define WINE_MSG_DONTWAIT 0 +#endif /* FIXME!!!!!! * This should use winsock - To use winsock the functions will have to change a bit @@ -284,7 +292,10 @@ } } if(result == -1) + { closesocket(netconn->socket); + netconn->socket = -1; + } else { flag = 0; ioctlsocket(netconn->socket, FIONBIO, &flag); @@ -316,6 +327,7 @@ netconn->security_flags = security_flags | server->security_flags; netconn->mask_errors = mask_errors; list_init(&netconn->pool_entry); + SecInvalidateHandle(&netconn->ssl_ctx); result = create_netconn_socket(server, netconn, timeout); if (result != ERROR_SUCCESS) { @@ -327,6 +339,17 @@ netconn->server = server; *ret = netconn; return result; +} + +BOOL is_valid_netconn(netconn_t *netconn) +{ + return netconn && netconn->socket != -1; +} + +void close_netconn(netconn_t *netconn) +{ + closesocket(netconn->socket); + netconn->socket = -1; } void free_netconn(netconn_t *netconn) @@ -343,10 +366,10 @@ heap_free(netconn->extra_buf); netconn->extra_buf = NULL; netconn->extra_len = 0; - DeleteSecurityContext(&netconn->ssl_ctx); - } - - closesocket(netconn->socket); + if (SecIsValidHandle(&netconn->ssl_ctx)) + DeleteSecurityContext(&netconn->ssl_ctx); + } + heap_free(netconn); } @@ -428,6 +451,14 @@ } #endif +static void set_socket_blocking(int socket, blocking_mode_t mode) +{ +#if defined(__MINGW32__) || defined (_MSC_VER) + ULONG arg = mode == BLOCKING_DISALLOW; + ioctlsocket(socket, FIONBIO, &arg); +#endif +} + static DWORD netcon_secure_connect_setup(netconn_t *connection, BOOL compat_mode) { SecBuffer out_buf = {0, SECBUFFER_TOKEN, NULL}, in_bufs[2] = {{0, SECBUFFER_TOKEN}, {0, SECBUFFER_EMPTY}}; @@ -447,7 +478,7 @@ |ISC_REQ_SEQUENCE_DETECT|ISC_REQ_REPLAY_DETECT|ISC_REQ_MANUAL_CRED_VALIDATION; if(!ensure_cred_handle()) - return FALSE; + return ERROR_INTERNET_SECURITY_CHANNEL_ERROR; if(compat_mode) { if(!have_compat_cred_handle) @@ -525,6 +556,10 @@ TRACE("InitializeSecurityContext ret %08x\n", status); if(status == SEC_E_OK) { + if(SecIsValidHandle(&connection->ssl_ctx)) + DeleteSecurityContext(&connection->ssl_ctx); + connection->ssl_ctx = ctx; + if(in_bufs[1].BufferType == SECBUFFER_EXTRA) FIXME("SECBUFFER_EXTRA not supported\n"); @@ -556,19 +591,14 @@ } } - if(status != SEC_E_OK || res != ERROR_SUCCESS) { - WARN("Failed to initialize security context failed: %08x\n", status); + WARN("Failed to establish SSL connection: %08x (%u)\n", status, res); heap_free(connection->ssl_buf); connection->ssl_buf = NULL; - DeleteSecurityContext(&ctx); return res ? res : ERROR_INTERNET_SECURITY_CHANNEL_ERROR; } - TRACE("established SSL connection\n"); - connection->ssl_ctx = ctx; - connection->secure = TRUE; connection->security_flags |= SECURITY_FLAG_SECURE; @@ -685,16 +715,21 @@ } } -static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, SIZE_T *ret_size, BOOL *eof) +static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, blocking_mode_t mode, SIZE_T *ret_size, BOOL *eof) { const SIZE_T ssl_buf_size = conn->ssl_sizes.cbHeader+conn->ssl_sizes.cbMaximumMessage+conn->ssl_sizes.cbTrailer; SecBuffer bufs[4]; SecBufferDesc buf_desc = {SECBUFFER_VERSION, sizeof(bufs)/sizeof(*bufs), bufs}; - SSIZE_T size, buf_len; + SSIZE_T size, buf_len = 0; + blocking_mode_t tmp_mode; int i; SECURITY_STATUS res; assert(conn->extra_len < ssl_buf_size); + + /* BLOCKING_WAITALL is handled by caller */ + if(mode == BLOCKING_WAITALL) + mode = BLOCKING_ALLOW; if(conn->extra_len) { memcpy(conn->ssl_buf, conn->extra_buf, conn->extra_len); @@ -702,20 +737,31 @@ conn->extra_len = 0; heap_free(conn->extra_buf); conn->extra_buf = NULL; + } + + tmp_mode = buf_len ? BLOCKING_DISALLOW : mode; + set_socket_blocking(conn->socket, tmp_mode); + size = recv(conn->socket, conn->ssl_buf+buf_len, ssl_buf_size-buf_len, tmp_mode == BLOCKING_ALLOW ? 0 : WINE_MSG_DONTWAIT); + if(size < 0) { + if(!buf_len) { + if(errno == EAGAIN || errno == EWOULDBLOCK) { + TRACE("would block\n"); + return WSAEWOULDBLOCK; + } + WARN("recv failed\n"); + return ERROR_INTERNET_CONNECTION_ABORTED; + } }else { - buf_len = recv(conn->socket, conn->ssl_buf+conn->extra_len, ssl_buf_size-conn->extra_len, 0); - if(buf_len < 0) { - WARN("recv failed\n"); - return FALSE; - } - - if(!buf_len) { - *eof = TRUE; - return TRUE; - } - } - - *ret_size = 0; + buf_len += size; + } + + *ret_size = buf_len; + + if(!buf_len) { + *eof = TRUE; + return ERROR_SUCCESS; + } + *eof = FALSE; do { @@ -731,19 +777,34 @@ case SEC_I_CONTEXT_EXPIRED: TRACE("context expired\n"); *eof = TRUE; - return TRUE; + return ERROR_SUCCESS; case SEC_E_INCOMPLETE_MESSAGE: assert(buf_len < ssl_buf_size); - size = recv(conn->socket, conn->ssl_buf+buf_len, ssl_buf_size-buf_len, 0); - if(size < 1) - return FALSE; + set_socket_blocking(conn->socket, mode); + size = recv(conn->socket, conn->ssl_buf+buf_len, ssl_buf_size-buf_len, mode == BLOCKING_ALLOW ? 0 : WINE_MSG_DONTWAIT); + if(size < 1) { + if(size < 0 && (errno == EAGAIN || errno == EWOULDBLOCK)) { + TRACE("would block\n"); + + /* FIXME: Optimize extra_buf usage. */ + conn->extra_buf = heap_alloc(buf_len); + if(!conn->extra_buf) + return ERROR_NOT_ENOUGH_MEMORY; + + conn->extra_len = buf_len; + memcpy(conn->extra_buf, conn->ssl_buf, conn->extra_len); + return WSAEWOULDBLOCK; + } + + return ERROR_INTERNET_CONNECTION_ABORTED; + } buf_len += size; continue; default: WARN("failed: %08x\n", res); - return FALSE; + return ERROR_INTERNET_CONNECTION_ABORTED; } } while(res != SEC_E_OK); @@ -755,7 +816,7 @@ assert(!conn->peek_len); conn->peek_msg_mem = conn->peek_msg = heap_alloc(bufs[i].cbBuffer - size); if(!conn->peek_msg) - return FALSE; + return ERROR_NOT_ENOUGH_MEMORY; conn->peek_len = bufs[i].cbBuffer-size; memcpy(conn->peek_msg, (char*)bufs[i].pvBuffer+size, conn->peek_len); } @@ -768,14 +829,14 @@ if(bufs[i].BufferType == SECBUFFER_EXTRA) { conn->extra_buf = heap_alloc(bufs[i].cbBuffer); if(!conn->extra_buf) - return FALSE; + return ERROR_NOT_ENOUGH_MEMORY; conn->extra_len = bufs[i].cbBuffer; memcpy(conn->extra_buf, bufs[i].pvBuffer, conn->extra_len); } } - return TRUE; + return ERROR_SUCCESS; } /****************************************************************************** @@ -783,7 +844,7 @@ * Basically calls 'recv()' unless we should use SSL * number of chars received is put in *recvd */ -DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, int flags, int *recvd) +DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, blocking_mode_t mode, int *recvd) { *recvd = 0; if (!len) @@ -791,13 +852,28 @@ if (!connection->secure) { + int flags = 0; + + switch(mode) { + case BLOCKING_ALLOW: + break; + case BLOCKING_DISALLOW: + flags = WINE_MSG_DONTWAIT; + break; + case BLOCKING_WAITALL: + flags = MSG_WAITALL; + break; + } + + set_socket_blocking(connection->socket, mode); *recvd = recv(connection->socket, buf, len, flags); return *recvd == -1 ? sock_get_error(errno) : ERROR_SUCCESS; } else { SIZE_T size = 0, cread; - BOOL res, eof; + BOOL eof; + DWORD res; if(connection->peek_msg) { size = min(len, connection->peek_len); @@ -810,18 +886,23 @@ connection->peek_msg_mem = connection->peek_msg = NULL; } /* check if we have enough data from the peek buffer */ - if(!(flags & MSG_WAITALL) || size == len) { + if(mode != BLOCKING_WAITALL || size == len) { *recvd = size; return ERROR_SUCCESS; } + + mode = BLOCKING_DISALLOW; } do { - res = read_ssl_chunk(connection, (BYTE*)buf+size, len-size, &cread, &eof); - if(!res) { - WARN("read_ssl_chunk failed\n"); - if(!size) - return ERROR_INTERNET_CONNECTION_ABORTED; + res = read_ssl_chunk(connection, (BYTE*)buf+size, len-size, mode, &cread, &eof); + if(res != ERROR_SUCCESS) { + if(res == WSAEWOULDBLOCK) { + if(size) + res = ERROR_SUCCESS; + }else { + WARN("read_ssl_chunk failed\n"); + } break; } @@ -831,11 +912,11 @@ } size += cread; - }while(!size || ((flags & MSG_WAITALL) && size < len)); + }while(!size || (mode == BLOCKING_WAITALL && size < len)); TRACE("received %ld bytes\n", size); *recvd = size; - return ERROR_SUCCESS; + return res; } } @@ -902,9 +983,6 @@ const CERT_CONTEXT *ret; SECURITY_STATUS res; - if (!connection->secure) - return NULL; - res = QueryContextAttributesW(&connection->ssl_ctx, SECPKG_ATTR_REMOTE_CERT_CONTEXT, (void*)&ret); return res == SEC_E_OK ? ret : NULL; } Modified: trunk/reactos/dll/win32/wininet/utility.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/utility.…
============================================================================== --- trunk/reactos/dll/win32/wininet/utility.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/utility.c [iso-8859-1] Sat Apr 26 17:50:05 2014 @@ -141,7 +141,7 @@ TRACE("%s\n", debugstr_w(lpszServerName)); /* Validate server name first - * Check if there is sth. like + * Check if there is something like * pinger.macromedia.com:80 * if yes, eliminate the :80.... */ Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Apr 26 17:50:05 2014 @@ -208,7 +208,7 @@ reactos/dll/win32/winemp3.acm # Synced to Wine-1.7.1 reactos/dll/win32/wing32 # Out of sync reactos/dll/win32/winhttp # Synced to Wine-1.7.17 -reactos/dll/win32/wininet # Synced to Wine-1.7.1 +reactos/dll/win32/wininet # Synced to Wine-1.7.17 reactos/dll/win32/winmm # Forked at Wine-20050628 reactos/dll/win32/winmm/midimap # Forked at Wine-20050628 reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628
10 years, 8 months
1
0
0
0
[akhaldi] 62992: [CRT] * Add missing EWOULDBLOCK define. [ADNS] * Make sure we get the intended EWOULDBLOCK here.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Apr 26 17:46:43 2014 New Revision: 62992 URL:
http://svn.reactos.org/svn/reactos?rev=62992&view=rev
Log: [CRT] * Add missing EWOULDBLOCK define. [ADNS] * Make sure we get the intended EWOULDBLOCK here. Modified: trunk/reactos/include/crt/errno.h trunk/reactos/lib/3rdparty/adns/adns_win32/adns_win32.h Modified: trunk/reactos/include/crt/errno.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/errno.h?rev=62…
============================================================================== --- trunk/reactos/include/crt/errno.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/errno.h [iso-8859-1] Sat Apr 26 17:46:43 2014 @@ -69,6 +69,8 @@ #define EDEADLOCK EDEADLK +#define EWOULDBLOCK 140 + #ifdef __cplusplus } #endif Modified: trunk/reactos/lib/3rdparty/adns/adns_win32/adns_win32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/adns/adns_win…
============================================================================== --- trunk/reactos/lib/3rdparty/adns/adns_win32/adns_win32.h [iso-8859-1] (original) +++ trunk/reactos/lib/3rdparty/adns/adns_win32/adns_win32.h [iso-8859-1] Sat Apr 26 17:46:43 2014 @@ -108,7 +108,15 @@ #define ADNS_CLEAR_ERRNO {WSASetLastError(errno = 0);} #define ENOBUFS WSAENOBUFS + +/* FIXME: there are two types of defines for this, + * one points to WSAEWOULDBLOCK and the other is from errno.h */ +#ifdef EWOULDBLOCK +#undef EWOULDBLOCK +#endif + #define EWOULDBLOCK WSAEWOULDBLOCK + #define EINPROGRESS WSAEINPROGRESS #define EMSGSIZE WSAEMSGSIZE #define ENOPROTOOPT WSAENOPROTOOPT
10 years, 8 months
1
0
0
0
[akhaldi] 62991: [WINHTTP_WINETEST] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Apr 26 17:36:17 2014 New Revision: 62991 URL:
http://svn.reactos.org/svn/reactos?rev=62991&view=rev
Log: [WINHTTP_WINETEST] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/rostests/winetests/winhttp/notification.c trunk/rostests/winetests/winhttp/url.c trunk/rostests/winetests/winhttp/winhttp.c Modified: trunk/rostests/winetests/winhttp/notification.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/notific…
============================================================================== --- trunk/rostests/winetests/winhttp/notification.c [iso-8859-1] (original) +++ trunk/rostests/winetests/winhttp/notification.c [iso-8859-1] Sat Apr 26 17:36:17 2014 @@ -27,6 +27,7 @@ #include "wine/test.h" static const WCHAR user_agent[] = {'w','i','n','e','t','e','s','t',0}; +static const WCHAR test_winehq[] = {'t','e','s','t','.','w','i','n','e','h','q','.','o','r','g',0}; enum api { @@ -44,9 +45,9 @@ { enum api function; /* api responsible for notification */ unsigned int status; /* status received */ - int todo; - int ignore; - int skipped_for_proxy; + BOOL todo; + BOOL ignore; + BOOL skipped_for_proxy; }; struct info @@ -89,7 +90,7 @@ DWORD size = sizeof(struct info *); WinHttpQueryOption( handle, WINHTTP_OPTION_CONTEXT_VALUE, &info, &size ); } - ok(i < info->count, "unexpected notification 0x%08x\n", status); + ok(i < info->count, "%u: unexpected notification 0x%08x\n", info->line, status); if (i >= info->count) return; status_ok = (info->test[i].status == status); @@ -107,7 +108,7 @@ todo_wine ok(function_ok, "%u: expected function %u got %u\n", info->line, info->test[i].function, info->function); } } - if (status_ok) info->index++; + if (status_ok && function_ok) info->index++; if (proxy_active()) { while (info->test[info->index].skipped_for_proxy) @@ -122,31 +123,31 @@ static const struct notification cache_test[] = { - { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, 0 }, - { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, 0 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, 0, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, 0, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 0, 1 }, - { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, 0 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, 0, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, 0, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 0, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 1, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 1, 1 } + { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, + { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, FALSE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, FALSE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, FALSE, TRUE }, + { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, FALSE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, FALSE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, FALSE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, TRUE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, TRUE, TRUE } }; static void setup_test( struct info *info, enum api function, unsigned int line ) @@ -157,8 +158,6 @@ static void test_connection_cache( void ) { - static const WCHAR codeweavers[] = {'w','w','w','.','c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; - HANDLE ses, con, req; DWORD size, status; BOOL ret; @@ -178,7 +177,7 @@ ok(ret, "failed to set context value %u\n", GetLastError()); setup_test( &info, winhttp_connect, __LINE__ ); - con = WinHttpConnect( ses, codeweavers, 0, 0 ); + con = WinHttpConnect( ses, test_winehq, 0, 0 ); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); setup_test( &info, winhttp_open_request, __LINE__ ); @@ -242,7 +241,7 @@ ok(ret, "failed to set context value %u\n", GetLastError()); setup_test( &info, winhttp_connect, __LINE__ ); - con = WinHttpConnect( ses, codeweavers, 0, 0 ); + con = WinHttpConnect( ses, test_winehq, 0, 0 ); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); setup_test( &info, winhttp_open_request, __LINE__ ); @@ -298,36 +297,34 @@ static const struct notification redirect_test[] = { - { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, 0 }, - { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REDIRECT, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, 0, 0, 1 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, 0, 0, 1 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, 0, 0, 1 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, 0, 0, 1 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REQUEST_SENT, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, 0 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, 0, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, 0, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 0, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 1, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 1, 1 } + { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, + { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, FALSE, TRUE }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, FALSE, TRUE }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REDIRECT }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, FALSE, TRUE, TRUE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, FALSE, TRUE, TRUE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, FALSE, FALSE, TRUE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, FALSE, FALSE, TRUE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, FALSE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, FALSE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, FALSE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, TRUE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, TRUE, TRUE } }; static void test_redirect( void ) { - static const WCHAR codeweavers[] = {'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; - HANDLE ses, con, req; DWORD size, status; BOOL ret; @@ -347,7 +344,7 @@ ok(ret, "failed to set context value %u\n", GetLastError()); setup_test( &info, winhttp_connect, __LINE__ ); - con = WinHttpConnect( ses, codeweavers, 0, 0 ); + con = WinHttpConnect( ses, test_winehq, 0, 0 ); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); setup_test( &info, winhttp_open_request, __LINE__ ); @@ -375,42 +372,40 @@ static const struct notification async_test[] = { - { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, 0 }, - { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT, 0 }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REDIRECT, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, 0, 0, 1 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, 0, 0, 1 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, 0, 0, 1 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, 0, 0, 1 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REQUEST_SENT, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, 0 }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE, 0 }, - { winhttp_query_data, WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE, 0 }, - { winhttp_read_data, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, 0, 1 }, - { winhttp_read_data, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, 0, 1 }, - { winhttp_read_data, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, 0, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, 0, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, 0, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 0, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 1, 1 }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 1, 1 } + { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, + { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, FALSE, TRUE }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, FALSE, TRUE }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REDIRECT }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, FALSE, TRUE, TRUE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, FALSE, TRUE, TRUE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, FALSE, FALSE, TRUE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, FALSE, FALSE, TRUE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE }, + { winhttp_query_data, WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE }, + { winhttp_read_data, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, FALSE, TRUE }, + { winhttp_read_data, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, FALSE, TRUE }, + { winhttp_read_data, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, FALSE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, FALSE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, FALSE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, FALSE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, TRUE, TRUE }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, TRUE, TRUE } }; static void test_async( void ) { - static const WCHAR codeweavers[] = {'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; - HANDLE ses, con, req; DWORD size, status; BOOL ret; @@ -420,7 +415,7 @@ info.test = async_test; info.count = sizeof(async_test) / sizeof(async_test[0]); info.index = 0; - info.wait = CreateEvent( NULL, FALSE, FALSE, NULL ); + info.wait = CreateEventW( NULL, FALSE, FALSE, NULL ); ses = WinHttpOpen( user_agent, 0, NULL, NULL, WINHTTP_FLAG_ASYNC ); ok(ses != NULL, "failed to open session %u\n", GetLastError()); @@ -431,7 +426,7 @@ ok(ret, "failed to set context value %u\n", GetLastError()); setup_test( &info, winhttp_connect, __LINE__ ); - con = WinHttpConnect( ses, codeweavers, 0, 0 ); + con = WinHttpConnect( ses, test_winehq, 0, 0 ); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); setup_test( &info, winhttp_open_request, __LINE__ ); Modified: trunk/rostests/winetests/winhttp/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/url.c?r…
============================================================================== --- trunk/rostests/winetests/winhttp/url.c [iso-8859-1] (original) +++ trunk/rostests/winetests/winhttp/url.c [iso-8859-1] Sat Apr 26 17:36:17 2014 @@ -353,21 +353,21 @@ uc.dwExtraInfoLength = 20; ret = WinHttpCrackUrl( url1, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed\n" ); - ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" ); - ok( !memcmp( uc.lpszScheme, http, sizeof(http) ), "unexpected scheme\n" ); - ok( uc.dwSchemeLength == 4, "unexpected scheme length\n" ); - ok( !memcmp( uc.lpszUserName, username, sizeof(username) ), "unexpected username\n" ); - ok( uc.dwUserNameLength == 8, "unexpected username length\n" ); - ok( !memcmp( uc.lpszPassword, password, sizeof(password) ), "unexpected password\n" ); - ok( uc.dwPasswordLength == 8, "unexpected password length\n" ); - ok( !memcmp( uc.lpszHostName, winehq, sizeof(winehq) ), "unexpected hostname\n" ); - ok( uc.dwHostNameLength == 14, "unexpected hostname length\n" ); + ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme: %u\n", uc.nScheme ); + ok( !memcmp( uc.lpszScheme, http, sizeof(http) ), "unexpected scheme: %s\n", wine_dbgstr_w(uc.lpszScheme) ); + ok( uc.dwSchemeLength == 4, "unexpected scheme length: %u\n", uc.dwSchemeLength ); + ok( !memcmp( uc.lpszUserName, username, sizeof(username) ), "unexpected username: %s\n", wine_dbgstr_w(uc.lpszUserName) ); + ok( uc.dwUserNameLength == 8, "unexpected username length: %u\n", uc.dwUserNameLength ); + ok( !memcmp( uc.lpszPassword, password, sizeof(password) ), "unexpected password: %s\n", wine_dbgstr_w(uc.lpszPassword) ); + ok( uc.dwPasswordLength == 8, "unexpected password length: %u\n", uc.dwPasswordLength ); + ok( !memcmp( uc.lpszHostName, winehq, sizeof(winehq) ), "unexpected hostname: %s\n", wine_dbgstr_w(uc.lpszHostName) ); + ok( uc.dwHostNameLength == 14, "unexpected hostname length: %u\n", uc.dwHostNameLength ); ok( uc.nPort == 80, "unexpected port: %u\n", uc.nPort ); - ok( !memcmp( uc.lpszUrlPath, about, sizeof(about) ), "unexpected path\n" ); - ok( uc.dwUrlPathLength == 11, "unexpected path length\n" ); - ok( !memcmp( uc.lpszExtraInfo, query, sizeof(query) ), "unexpected extra info\n" ); - ok( uc.dwExtraInfoLength == 6, "unexpected extra info length\n" ); + ok( !memcmp( uc.lpszUrlPath, about, sizeof(about) ), "unexpected path: %s\n", wine_dbgstr_w(uc.lpszUrlPath) ); + ok( uc.dwUrlPathLength == 11, "unexpected path length: %u\n", uc.dwUrlPathLength ); + ok( !memcmp( uc.lpszExtraInfo, query, sizeof(query) ), "unexpected extra info: %s\n", wine_dbgstr_w(uc.lpszExtraInfo) ); + ok( uc.dwExtraInfoLength == 6, "unexpected extra info length: %u\n", uc.dwExtraInfoLength ); /* buffer of insufficient length */ scheme[0] = 0; @@ -376,15 +376,15 @@ SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url1, 0, 0, &uc ); error = GetLastError(); - ok( !ret, "WinHttpCrackUrl failed\n" ); - ok( error == ERROR_INSUFFICIENT_BUFFER, "WinHttpCrackUrl failed\n" ); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); + ok( error == ERROR_INSUFFICIENT_BUFFER, "got %u, expected ERROR_INSUFFICIENT_BUFFER\n", error ); ok( uc.dwSchemeLength == 5, "unexpected scheme length: %u\n", uc.dwSchemeLength ); /* no buffers */ reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k1, 0, 0,&uc); - ok( ret, "WinHttpCrackUrl failed\n" ); + ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" ); ok( uc.lpszScheme == url_k1,"unexpected scheme\n" ); ok( uc.dwSchemeLength == 4, "unexpected scheme length\n" ); @@ -403,7 +403,7 @@ reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k2, 0, 0,&uc); - ok( ret, "WinHttpCrackUrl failed\n" ); + ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" ); ok( uc.lpszScheme == url_k2, "unexpected scheme\n" ); ok( uc.dwSchemeLength == 4, "unexpected scheme length\n" ); @@ -422,7 +422,7 @@ reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k3, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed\n" ); + ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); ok( uc.nScheme == INTERNET_SCHEME_HTTPS, "unexpected scheme\n" ); ok( uc.lpszScheme == url_k3, "unexpected scheme\n" ); ok( uc.dwSchemeLength == 5, "unexpected scheme length\n" ); @@ -441,61 +441,61 @@ /* bad parameters */ reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k4, 0, 0, &uc ); - ok( !ret, "WinHttpCrackUrl failed\n" ); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k5, 0, 0, &uc ); - ok( !ret, "WinHttpCrackUrl failed\n" ); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k6, 0, 0, &uc ); - ok( !ret, "WinHttpCrackUrl failed\n" ); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k7, 0, 0, &uc ); - ok( !ret, "WinHttpCrackUrl failed\n" ); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k8, 0, 0, &uc ); - ok( !ret, "WinHttpCrackUrl failed\n" ); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k9, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed\n" ); - ok( uc.lpszUrlPath == url_k9 + 14, "unexpected path\n" ); - ok( uc.dwUrlPathLength == 0, "unexpected path length\n" ); - ok( uc.lpszExtraInfo == url_k9 + 14, "unexpected extra info\n" ); - ok( uc.dwExtraInfoLength == 0, "unexpected extra info length\n" ); + ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( uc.lpszUrlPath == url_k9 + 14, "unexpected path: %s\n", wine_dbgstr_w(uc.lpszUrlPath) ); + ok( uc.dwUrlPathLength == 0, "unexpected path length: %u\n", uc.dwUrlPathLength ); + ok( uc.lpszExtraInfo == url_k9 + 14, "unexpected extra info: %s\n", wine_dbgstr_w(uc.lpszExtraInfo) ); + ok( uc.dwExtraInfoLength == 0, "unexpected extra info length: %u\n", uc.dwExtraInfoLength ); reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k10, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed\n" ); - ok( uc.lpszUrlPath == url_k10 + 13, "unexpected path\n" ); - ok( uc.dwUrlPathLength == 7, "unexpected path length\n" ); - ok( uc.lpszExtraInfo == url_k10 + 20, "unexpected extra info\n" ); - ok( uc.dwExtraInfoLength == 0, "unexpected extra info length\n" ); + ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( uc.lpszUrlPath == url_k10 + 13, "unexpected path: %s\n", wine_dbgstr_w(uc.lpszUrlPath) ); + ok( uc.dwUrlPathLength == 7, "unexpected path length: %u\n", uc.dwUrlPathLength ); + ok( uc.lpszExtraInfo == url_k10 + 20, "unexpected extra info: %s\n", wine_dbgstr_w(uc.lpszExtraInfo) ); + ok( uc.dwExtraInfoLength == 0, "unexpected extra info length: %u\n", uc.dwExtraInfoLength ); reset_url_components( &uc ); ret = WinHttpCrackUrl( url5, 0, 0, &uc ); - ok( !ret, "WinHttpCrackUrl failed\n" ); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); reset_url_components( &uc ); ret = WinHttpCrackUrl( empty, 0, 0, &uc ); - ok( !ret, "WinHttpCrackUrl failed\n" ); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); ret = WinHttpCrackUrl( url1, 0, 0, NULL ); - ok( !ret, "WinHttpCrackUrl failed\n" ); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); ret = WinHttpCrackUrl( NULL, 0, 0, &uc ); - ok( !ret, "WinHttpCrackUrl failed\n" ); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); /* decoding without buffers */ reset_url_components( &uc ); SetLastError(0xdeadbeef); ret = WinHttpCrackUrl( url8, 0, ICU_DECODE, &uc ); error = GetLastError(); - ok( !ret, "WinHttpCrackUrl failed\n" ); - ok( error == ERROR_INVALID_PARAMETER, "WinHttpCrackUrl failed\n" ); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); + ok( error == ERROR_INVALID_PARAMETER, "got %u, expected ERROR_INVALID_PARAMETER\n", error ); /* decoding with buffers */ uc.lpszScheme = scheme; @@ -538,7 +538,7 @@ path[0] = 0; ret = WinHttpCrackUrl( url7, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed\n" ); + ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); ok( !memcmp( uc.lpszHostName, winehq, sizeof(winehq) ), "unexpected host name: %s\n", wine_dbgstr_w(uc.lpszHostName) ); ok( uc.dwHostNameLength == 14, "unexpected host name length: %d\n", uc.dwHostNameLength ); ok( uc.nPort == 42, "unexpected port: %u\n", uc.nPort ); @@ -546,17 +546,17 @@ /* decoding without buffers */ reset_url_components( &uc ); ret = WinHttpCrackUrl( url9, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed\n" ); + ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); ok( uc.nPort == 0, "unexpected port: %u\n", uc.nPort ); reset_url_components( &uc ); ret = WinHttpCrackUrl( url10, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed\n" ); + ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); ok( uc.nPort == 80, "unexpected port: %u\n", uc.nPort ); reset_url_components( &uc ); ret = WinHttpCrackUrl( url11, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed\n" ); + ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); ok( uc.nPort == 443, "unexpected port: %u\n", uc.nPort ); reset_url_components( &uc ); @@ -575,7 +575,7 @@ reset_url_components( &uc ); ret = WinHttpCrackUrl( url12, 0, 0, &uc); - ok( ret, "WinHttpCrackUrl failed\n" ); + ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" ); ok( uc.lpszScheme == url12,"unexpected scheme\n" ); ok( uc.dwSchemeLength == 4, "unexpected scheme length\n" ); @@ -603,7 +603,7 @@ uc.dwExtraInfoLength = 0; uc.nPort = 0; ret = WinHttpCrackUrl( url13, 0, ICU_DECODE, &uc ); - ok( ret, "WinHttpCrackUrl failed\n" ); + ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); uc.lpszScheme = scheme; uc.dwSchemeLength = 20; @@ -619,7 +619,7 @@ uc.dwExtraInfoLength = 0; uc.nPort = 0; ret = WinHttpCrackUrl( url14, 0, ICU_ESCAPE|ICU_DECODE, &uc ); - ok( ret, "WinHttpCrackUrl failed\n" ); + ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); ok( !lstrcmpW( uc.lpszHostName, hostnameW ), "unexpected host name\n" ); ok( !lstrcmpW( uc.lpszUrlPath, pathW ), "unexpected path\n" ); } Modified: trunk/rostests/winetests/winhttp/winhttp.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/winhttp…
============================================================================== --- trunk/rostests/winetests/winhttp/winhttp.c [iso-8859-1] (original) +++ trunk/rostests/winetests/winhttp/winhttp.c [iso-8859-1] Sat Apr 26 17:36:17 2014 @@ -41,7 +41,7 @@ static const WCHAR test_useragent[] = {'W','i','n','e',' ','R','e','g','r','e','s','s','i','o','n',' ','T','e','s','t',0}; -static const WCHAR test_server[] = {'w','i','n','e','h','q','.','o','r','g',0}; +static const WCHAR test_winehq[] = {'t','e','s','t','.','w','i','n','e','h','q','.','o','r','g',0}; static const WCHAR localhostW[] = {'l','o','c','a','l','h','o','s','t',0}; static BOOL proxy_active(void) @@ -146,7 +146,7 @@ "expected ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, got %u\n", GetLastError()); SetLastError(0xdeadbeef); - connection = WinHttpConnect(session, test_server, INTERNET_DEFAULT_HTTP_PORT, 0); + connection = WinHttpConnect(session, test_winehq, INTERNET_DEFAULT_HTTP_PORT, 0); ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u\n", GetLastError()); feature = WINHTTP_DISABLE_COOKIES; @@ -227,7 +227,7 @@ 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); + connection = WinHttpConnect (session, test_winehq, INTERNET_DEFAULT_HTTP_PORT, 0); ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); request = WinHttpOpenRequest(connection, NULL, NULL, NULL, WINHTTP_NO_REFERER, @@ -259,7 +259,6 @@ static void test_empty_headers_param(void) { - static const WCHAR winehq[] = {'w','i','n','e','h','q','.','o','r','g',0}; static const WCHAR empty[] = {0}; HINTERNET ses, con, req; BOOL ret; @@ -267,7 +266,7 @@ ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); ok(ses != NULL, "failed to open session %u\n", GetLastError()); - con = WinHttpConnect(ses, winehq, 80, 0); + con = WinHttpConnect(ses, test_winehq, 80, 0); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); @@ -283,6 +282,13 @@ static void test_SendRequest (void) { + static const WCHAR content_type[] = + {'C','o','n','t','e','n','t','-','T','y','p','e',':',' ','a','p','p','l','i','c','a','t','i','o','n', + '/','x','-','w','w','w','-','f','o','r','m','-','u','r','l','e','n','c','o','d','e','d',0}; + static const WCHAR test_file[] = {'t','e','s','t','s','/','p','o','s','t','.','p','h','p',0}; + static const WCHAR test_verb[] = {'P','O','S','T',0}; + static CHAR post_data[] = "mode=Test"; + static const char test_post[] = "mode => Test\0\n"; HINTERNET session, request, connection; DWORD header_len, optional_len, total_len, bytes_rw, size; DWORD_PTR context; @@ -290,16 +296,6 @@ CHAR buffer[256]; int i; - static const WCHAR test_site[] = {'c','r','o','s','s','o','v','e','r','.', - 'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; - static const WCHAR content_type[] = - {'C','o','n','t','e','n','t','-','T','y','p','e',':',' ','a','p','p','l','i','c','a','t','i','o','n', - '/','x','-','w','w','w','-','f','o','r','m','-','u','r','l','e','n','c','o','d','e','d',0}; - static const WCHAR test_file[] = {'/','p','o','s','t','t','e','s','t','.','p','h','p',0}; - static const WCHAR test_verb[] = {'P','O','S','T',0}; - static CHAR post_data[] = "mode=Test"; - static CHAR test_post[] = "mode => Test\\0\n"; - header_len = -1L; total_len = optional_len = sizeof(post_data); memset(buffer, 0xff, sizeof(buffer)); @@ -308,7 +304,7 @@ WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); ok(session != NULL, "WinHttpOpen failed to open session.\n"); - connection = WinHttpConnect (session, test_site, INTERNET_DEFAULT_HTTP_PORT, 0); + connection = WinHttpConnect (session, test_winehq, INTERNET_DEFAULT_HTTP_PORT, 0); ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); request = WinHttpOpenRequest(connection, test_verb, test_file, NULL, WINHTTP_NO_REFERER, @@ -355,8 +351,8 @@ ret = WinHttpReadData(request, buffer, sizeof(buffer) - 1, &bytes_rw); ok(ret == TRUE, "WinHttpReadData failed: %u.\n", GetLastError()); - ok(bytes_rw == strlen(test_post), "Read %u bytes instead of %d.\n", bytes_rw, lstrlen(test_post)); - ok(strncmp(buffer, test_post, bytes_rw) == 0, "Data read did not match, got '%s'.\n", buffer); + ok(bytes_rw == sizeof(test_post) - 1, "Read %u bytes\n", bytes_rw); + ok(!memcmp(buffer, test_post, sizeof(test_post) - 1), "Data read did not match.\n"); ret = WinHttpCloseHandle(request); ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); @@ -413,15 +409,12 @@ WCHAR check_buffer[MAX_PATH]; DWORD index, len, oldlen; - static const WCHAR test_site[] = {'c','r','o','s','s','o','v','e','r','.', - 'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; static const WCHAR test_file[] = {'/','p','o','s','t','t','e','s','t','.','p','h','p',0}; static const WCHAR test_verb[] = {'P','O','S','T',0}; - static const WCHAR test_header_begin[] = {'P','O','S','T',' ','/','p','o','s','t','t','e','s','t','.','p','h','p',' ','H','T','T','P','/','1'}; static const WCHAR full_path_test_header_begin[] = - {'P','O','S','T',' ','h','t','t','p',':','/','/','c','r','o','s','s','o','v','e','r','.','c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',':','8','0','/','p','o','s','t','t','e','s','t','.','p','h','p',' ','H','T','T','P','/','1'}; + {'P','O','S','T',' ','h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g',':','8','0','/','p','o','s','t','.','p','h','p',' ','H','T','T','P','/','1'}; static const WCHAR test_header_end[] = {'\r','\n','\r','\n',0}; static const WCHAR test_header_name[] = {'W','a','r','n','i','n','g',0}; @@ -469,7 +462,7 @@ WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); ok(session != NULL, "WinHttpOpen failed to open session.\n"); - connection = WinHttpConnect (session, test_site, INTERNET_DEFAULT_HTTP_PORT, 0); + connection = WinHttpConnect (session, test_winehq, INTERNET_DEFAULT_HTTP_PORT, 0); ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); request = WinHttpOpenRequest(connection, test_verb, test_file, NULL, WINHTTP_NO_REFERER, @@ -816,8 +809,6 @@ static void test_secure_connection(void) { - static const WCHAR google[] = {'w','w','w','.','g','o','o','g','l','e','.','c','o','m',0}; - HINTERNET ses, con, req; DWORD size, status, policy, bitness, read_size; BOOL ret; @@ -832,7 +823,7 @@ ret = WinHttpSetOption(ses, WINHTTP_OPTION_REDIRECT_POLICY, &policy, sizeof(policy)); ok(ret, "failed to set redirect policy %u\n", GetLastError()); - con = WinHttpConnect(ses, google, 443, 0); + con = WinHttpConnect(ses, test_winehq, 443, 0); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); /* try without setting WINHTTP_FLAG_SECURE */ @@ -922,8 +913,6 @@ static void test_request_parameter_defaults(void) { static const WCHAR empty[] = {0}; - static const WCHAR codeweavers[] = {'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; - HINTERNET ses, con, req; DWORD size, status, error; WCHAR *version; @@ -932,7 +921,7 @@ ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); ok(ses != NULL, "failed to open session %u\n", GetLastError()); - con = WinHttpConnect(ses, codeweavers, 0, 0); + con = WinHttpConnect(ses, test_winehq, 0, 0); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); @@ -1126,8 +1115,6 @@ BOOL ret; DWORD value, size; HINTERNET ses, req, con; - static const WCHAR codeweavers[] = {'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; - ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); ok(ses != NULL, "failed to open session %u\n", GetLastError()); @@ -1288,7 +1275,7 @@ ok(ret, "%u\n", GetLastError()); ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); - con = WinHttpConnect(ses, codeweavers, 0, 0); + con = WinHttpConnect(ses, test_winehq, 0, 0); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); /* Timeout values should match the last one set for session */ @@ -1717,11 +1704,8 @@ static void test_resolve_timeout(void) { - static const WCHAR codeweavers[] = - {'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; static const WCHAR nxdomain[] = - {'n','x','d','o','m','a','i','n','.','c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; - + {'n','x','d','o','m','a','i','n','.','w','i','n','e','h','q','.','o','r','g',0}; HINTERNET ses, con, req; DWORD timeout; BOOL ret; @@ -1743,6 +1727,11 @@ SetLastError(0xdeadbeef); ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); + if(ret == 1) + { + skip("nxdomain returned success. Broken ISP redirects?\n"); + return; + } ok(!ret, "sent request\n"); ok(GetLastError() == ERROR_WINHTTP_NAME_NOT_RESOLVED, "expected ERROR_WINHTTP_NAME_NOT_RESOLVED got %u\n", GetLastError()); @@ -1761,7 +1750,7 @@ ret = WinHttpSetOption(ses, WINHTTP_OPTION_RESOLVE_TIMEOUT, &timeout, sizeof(timeout)); ok(ret, "failed to set resolve timeout %u\n", GetLastError()); - con = WinHttpConnect(ses, codeweavers, 0, 0); + con = WinHttpConnect(ses, test_winehq, 0, 0); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); @@ -1805,6 +1794,8 @@ HANDLE event; int port; }; + +#define BIG_BUFFER_LEN 0x2250 static DWORD CALLBACK server_thread(LPVOID param) { @@ -1863,6 +1854,13 @@ else send(c, noauthmsg, sizeof noauthmsg - 1, 0); } + if (strstr(buffer, "/big")) + { + char msg[BIG_BUFFER_LEN]; + memset(msg, 'm', sizeof(msg)); + send(c, okmsg, sizeof(okmsg) - 1, 0); + send(c, msg, sizeof(msg), 0); + } if (strstr(buffer, "/no_headers")) { send(c, page1, sizeof page1 - 1, 0); @@ -2085,13 +2083,19 @@ ok(req != NULL, "failed to open a request %u\n", GetLastError()); ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - ok(ret, "failed to send request %u\n", GetLastError()); - - SetLastError(0xdeadbeef); - ret = WinHttpReceiveResponse(req, NULL); - error = GetLastError(); - ok(!ret, "expected failure\n"); - ok(error == ERROR_WINHTTP_INVALID_SERVER_RESPONSE, "got %u\n", error); + if (!ret) + { + error = GetLastError(); + ok(error == ERROR_WINHTTP_INVALID_SERVER_RESPONSE, "got %u\n", error); + } + else + { + SetLastError(0xdeadbeef); + ret = WinHttpReceiveResponse(req, NULL); + error = GetLastError(); + ok(!ret, "expected failure\n"); + ok(error == ERROR_WINHTTP_INVALID_SERVER_RESPONSE, "got %u\n", error); + } WinHttpCloseHandle(req); WinHttpCloseHandle(con); @@ -2133,6 +2137,55 @@ WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); WinHttpCloseHandle( ses ); +} + +static void test_multiple_reads(int port) +{ + static const WCHAR bigW[] = {'b','i','g',0}; + HINTERNET ses, con, req; + DWORD total_len = 0; + BOOL ret; + + ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ok(ses != NULL, "failed to open session %u\n", GetLastError()); + + con = WinHttpConnect(ses, localhostW, port, 0); + ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + + req = WinHttpOpenRequest(con, NULL, bigW, NULL, NULL, NULL, 0); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); + ok(ret, "failed to send request %u\n", GetLastError()); + + ret = WinHttpReceiveResponse(req, NULL); + ok(ret == TRUE, "expected success\n"); + + for (;;) + { + DWORD len = 0xdeadbeef; + ret = WinHttpQueryDataAvailable( req, &len ); + ok( ret, "WinHttpQueryDataAvailable failed with error %u\n", GetLastError() ); + if (ret) ok( len != 0xdeadbeef, "WinHttpQueryDataAvailable return wrong length\n" ); + if (len) + { + DWORD bytes_read; + char *buf = HeapAlloc( GetProcessHeap(), 0, len + 1 ); + + ret = WinHttpReadData( req, buf, len, &bytes_read ); + ok( len == bytes_read, "only got %u of %u available\n", bytes_read, len ); + + HeapFree( GetProcessHeap(), 0, buf ); + if (!bytes_read) break; + total_len += bytes_read; + } + if (!len) break; + } + ok(total_len == BIG_BUFFER_LEN, "got wrong length: 0x%x\n", total_len); + + WinHttpCloseHandle(req); + WinHttpCloseHandle(con); + WinHttpCloseHandle(ses); } static void test_connection_info( int port ) @@ -2319,11 +2372,10 @@ { static const WCHAR usernameW[] = {'u','s','e','r','n','a','m','e',0}; static const WCHAR passwordW[] = {'p','a','s','s','w','o','r','d',0}; - static const WCHAR url1W[] = {'h','t','t','p',':','/','/','w','i','n','e','h','q','.','o','r','g',0}; - static const WCHAR url2W[] = {'w','i','n','e','h','q','.','o','r','g',0}; - static const WCHAR url3W[] = {'h','t','t','p',':','/','/','c','r','o','s','s','o','v','e','r','.', - 'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m','/', - 'p','o','s','t','t','e','s','t','.','p','h','p',0}; + static const WCHAR url1W[] = {'h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g',0}; + static const WCHAR url2W[] = {'t','e','s','t','.','w','i','n','e','h','q','.','o','r','g',0}; + static const WCHAR url3W[] = {'h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.', + 'o','r','g','/','t','e','s','t','s','/','p','o','s','t','.','p','h','p',0}; static const WCHAR method1W[] = {'G','E','T',0}; static const WCHAR method2W[] = {'I','N','V','A','L','I','D',0}; static const WCHAR method3W[] = {'P','O','S','T',0}; @@ -2764,7 +2816,7 @@ if (!ret) { ok( error == ERROR_WINHTTP_AUTODETECTION_FAILED, "got %u\n", error ); - ok( url == (WCHAR *)0xdeadbeef, "got %p\n", url ); + ok( !url || broken(url == (WCHAR *)0xdeadbeef), "got %p\n", url ); } else { @@ -2779,7 +2831,7 @@ if (!ret) { ok( error == ERROR_WINHTTP_AUTODETECTION_FAILED, "got %u\n", error ); - ok( url == (WCHAR *)0xdeadbeef, "got %p\n", url ); + ok( !url || broken(url == (WCHAR *)0xdeadbeef), "got %p\n", url ); } else { @@ -2926,7 +2978,6 @@ static void test_chunked_read(void) { - static const WCHAR host[] = {'t','e','s','t','.','w','i','n','e','h','q','.','o','r','g',0}; static const WCHAR verb[] = {'/','t','e','s','t','c','h','u','n','k','e','d',0}; static const WCHAR chunked[] = {'c','h','u','n','k','e','d',0}; WCHAR header[32]; @@ -2940,7 +2991,7 @@ ok( ses != NULL, "WinHttpOpen failed with error %u\n", GetLastError() ); if (!ses) goto done; - con = WinHttpConnect( ses, host, 0, 0 ); + con = WinHttpConnect( ses, test_winehq, 0, 0 ); ok( con != NULL, "WinHttpConnect failed with error %u\n", GetLastError() ); if (!con) goto done; @@ -3028,7 +3079,7 @@ test_WinHttpGetProxyForUrl(); test_chunked_read(); - si.event = CreateEvent(NULL, 0, 0, NULL); + si.event = CreateEventW(NULL, 0, 0, NULL); si.port = 7532; thread = CreateThread(NULL, 0, server_thread, (LPVOID)&si, 0, NULL); @@ -3044,6 +3095,7 @@ test_no_headers(si.port); test_basic_authentication(si.port); test_bad_header(si.port); + test_multiple_reads(si.port); /* send the basic request again to shutdown the server thread */ test_basic_request(si.port, NULL, quitW);
10 years, 8 months
1
0
0
0
[akhaldi] 62990: [WINHTTP] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Apr 26 17:34:51 2014 New Revision: 62990 URL:
http://svn.reactos.org/svn/reactos?rev=62990&view=rev
Log: [WINHTTP] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/winhttp/cookie.c trunk/reactos/dll/win32/winhttp/main.c trunk/reactos/dll/win32/winhttp/net.c trunk/reactos/dll/win32/winhttp/request.c trunk/reactos/dll/win32/winhttp/session.c trunk/reactos/dll/win32/winhttp/winhttp_private.h trunk/reactos/dll/win32/winhttp/winhttp_tlb.idl trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/winhttp/cookie.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/cookie.c…
============================================================================== --- trunk/reactos/dll/win32/winhttp/cookie.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/cookie.c [iso-8859-1] Sat Apr 26 17:34:51 2014 @@ -122,20 +122,21 @@ const WCHAR *p; int len; + if (!(p = strchrW( string, '=' ))) + { + WARN("no '=' in %s\n", debugstr_w(string)); + return NULL; + } + if (p == string) + { + WARN("empty cookie name in %s\n", debugstr_w(string)); + return NULL; + } + if (!(cookie = heap_alloc_zero( sizeof(cookie_t) ))) return NULL; list_init( &cookie->entry ); - if (!(p = strchrW( string, '=' ))) - { - WARN("no '=' in %s\n", debugstr_w(string)); - return NULL; - } - if (p == string) - { - WARN("empty cookie name in %s\n", debugstr_w(string)); - return NULL; - } len = p - string; if (!(cookie->name = heap_alloc( (len + 1) * sizeof(WCHAR) ))) { Modified: trunk/reactos/dll/win32/winhttp/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/main.c?r…
============================================================================== --- trunk/reactos/dll/win32/winhttp/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/main.c [iso-8859-1] Sat Apr 26 17:34:51 2014 @@ -42,7 +42,7 @@ return TRUE; } -typedef HRESULT (*fnCreateInstance)( IUnknown *outer, void **obj ); +typedef HRESULT (*fnCreateInstance)( void **obj ); struct winhttp_cf { @@ -99,14 +99,11 @@ if (outer) return CLASS_E_NOAGGREGATION; - hr = cf->pfnCreateInstance( outer, (void **)&unknown ); + hr = cf->pfnCreateInstance( (void **)&unknown ); if (FAILED(hr)) return hr; hr = IUnknown_QueryInterface( unknown, riid, obj ); - if (FAILED(hr)) - return hr; - IUnknown_Release( unknown ); return hr; } Modified: trunk/reactos/dll/win32/winhttp/net.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/net.c?re…
============================================================================== --- trunk/reactos/dll/win32/winhttp/net.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/net.c [iso-8859-1] Sat Apr 26 17:34:51 2014 @@ -705,24 +705,23 @@ return TRUE; } -BOOL netconn_query_data_available( netconn_t *conn, DWORD *available ) -{ +ULONG netconn_query_data_available( netconn_t *conn ) +{ + if(!netconn_connected(conn)) + return 0; + + if(conn->secure) { + return conn->peek_len; + }else { #ifdef FIONREAD - int ret; - ULONG unread; -#endif - *available = 0; - if (!netconn_connected( conn )) return FALSE; - - if (conn->secure) - { - *available = conn->peek_len; - return TRUE; - } -#ifdef FIONREAD - if (!(ret = ioctlsocket( conn->socket, FIONREAD, &unread ))) *available = unread; -#endif - return TRUE; + ULONG unread; + + if(!ioctlsocket(conn->socket, FIONREAD, &unread)) + return unread; +#endif + } + + return 0; } DWORD netconn_set_timeout( netconn_t *netconn, BOOL send, int value ) Modified: trunk/reactos/dll/win32/winhttp/request.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/request.…
============================================================================== --- trunk/reactos/dll/win32/winhttp/request.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/request.c [iso-8859-1] Sat Apr 26 17:34:51 2014 @@ -25,6 +25,7 @@ # include <arpa/inet.h> #endif +#include <assert.h> #include <winuser.h> #include <httprequest.h> @@ -852,7 +853,7 @@ /* * Set (header) termination string for request - * Make sure there's exactly two new lines at the end of the request + * Make sure there are exactly two new lines at the end of the request */ p = &requestString[strlenW(requestString)-1]; while ( (*p == '\n') || (*p == '\r') ) @@ -995,6 +996,8 @@ done: request->read_pos = request->read_size = 0; request->read_chunked = FALSE; + request->read_chunked_size = ~0u; + request->read_chunked_eof = FALSE; heap_free( addressW ); return TRUE; } @@ -1121,7 +1124,7 @@ request->optional_len = optional_len; len += optional_len; } - send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REQUEST_SENT, &len, sizeof(DWORD) ); + send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REQUEST_SENT, &len, sizeof(len) ); end: if (async) @@ -1374,7 +1377,7 @@ char c0, c1, c2, c3; const WCHAR *p = base64; - while (len >= 4) + while (len > 4) { if ((c0 = decode_char( p[0] )) > 63) return 0; if ((c1 = decode_char( p[1] )) > 63) return 0; @@ -1411,6 +1414,21 @@ buf[i + 1] = (c1 << 4) | (c2 >> 2); } i += 2; + } + else + { + if ((c0 = decode_char( p[0] )) > 63) return 0; + if ((c1 = decode_char( p[1] )) > 63) return 0; + if ((c2 = decode_char( p[2] )) > 63) return 0; + if ((c3 = decode_char( p[3] )) > 63) return 0; + + if (buf) + { + buf[i + 0] = (c0 << 2) | (c1 >> 4); + buf[i + 1] = (c1 << 4) | (c2 >> 2); + buf[i + 2] = (c2 << 6) | c3; + } + i += 3; } return i; } @@ -1600,7 +1618,11 @@ { int len = strlenW( ++p ); in.cbBuffer = decode_base64( p, len, NULL ); - if (!(in.pvBuffer = heap_alloc( in.cbBuffer ))) return FALSE; + if (!(in.pvBuffer = heap_alloc( in.cbBuffer ))) { + destroy_authinfo( authinfo ); + *auth_ptr = NULL; + return FALSE; + } decode_base64( p, len, in.pvBuffer ); } out.BufferType = SECBUFFER_TOKEN; @@ -1608,6 +1630,8 @@ if (!(out.pvBuffer = heap_alloc( authinfo->max_token ))) { heap_free( in.pvBuffer ); + destroy_authinfo( authinfo ); + *auth_ptr = NULL; return FALSE; } out_desc.ulVersion = 0; @@ -1783,15 +1807,20 @@ { request->content_length = ~0u; request->read_chunked = TRUE; + request->read_chunked_size = ~0u; + request->read_chunked_eof = FALSE; } request->content_read = 0; return request->content_length; } /* read some more data into the read buffer */ -static BOOL read_more_data( request_t *request, int maxlen ) +static BOOL read_more_data( request_t *request, int maxlen, BOOL notify ) { int len; + BOOL ret; + + if (request->read_chunked_eof) return FALSE; if (request->read_size && request->read_pos) { @@ -1800,10 +1829,16 @@ request->read_pos = 0; } if (maxlen == -1) maxlen = sizeof(request->read_buf); - if (!netconn_recv( &request->netconn, request->read_buf + request->read_size, - maxlen - request->read_size, 0, &len )) return FALSE; + + if (notify) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, NULL, 0 ); + + ret = netconn_recv( &request->netconn, request->read_buf + request->read_size, + maxlen - request->read_size, 0, &len ); + + if (notify) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, &len, sizeof(len) ); + request->read_size += len; - return TRUE; + return ret; } /* remove some amount of data from the read buffer */ @@ -1833,7 +1868,7 @@ remove_data( request, bytes_read ); if (eol) break; - if (!read_more_data( request, -1 )) return FALSE; + if (!read_more_data( request, -1, TRUE )) return FALSE; if (!request->read_size) { *len = 0; @@ -1852,7 +1887,7 @@ } /* discard data contents until we reach end of line */ -static BOOL discard_eol( request_t *request ) +static BOOL discard_eol( request_t *request, BOOL notify ) { do { @@ -1863,24 +1898,23 @@ break; } request->read_pos = request->read_size = 0; /* discard everything */ - if (!read_more_data( request, -1 )) return FALSE; + if (!read_more_data( request, -1, notify )) return FALSE; } while (request->read_size); return TRUE; } /* read the size of the next chunk */ -static BOOL start_next_chunk( request_t *request ) +static BOOL start_next_chunk( request_t *request, BOOL notify ) { DWORD chunk_size = 0; - if (!request->content_length) return TRUE; - if (request->content_length == request->content_read) - { - /* read terminator for the previous chunk */ - if (!discard_eol( request )) return FALSE; - request->content_length = ~0u; - request->content_read = 0; - } + assert(!request->read_chunked_size || request->read_chunked_size == ~0u); + + if (request->read_chunked_eof) return FALSE; + + /* read terminator for the previous chunk */ + if (!request->read_chunked_size && !discard_eol( request, notify )) return FALSE; + for (;;) { while (request->read_size) @@ -1892,17 +1926,22 @@ else if (ch == ';' || ch == '\r' || ch == '\n') { TRACE("reading %u byte chunk\n", chunk_size); - request->content_length = chunk_size; - request->content_read = 0; - if (!discard_eol( request )) return FALSE; - return TRUE; + + if (request->content_length == ~0u) request->content_length = chunk_size; + else request->content_length += chunk_size; + + request->read_chunked_size = chunk_size; + if (!chunk_size) request->read_chunked_eof = TRUE; + + return discard_eol( request, notify ); } remove_data( request, 1 ); } - if (!read_more_data( request, -1 )) return FALSE; + if (!read_more_data( request, -1, notify )) return FALSE; if (!request->read_size) { request->content_length = request->content_read = 0; + request->read_chunked_size = 0; return TRUE; } } @@ -1911,32 +1950,34 @@ /* return the size of data available to be read immediately */ static DWORD get_available_data( request_t *request ) { - if (request->read_chunked && - (request->content_length == ~0u || request->content_length == request->content_read)) - return 0; - return min( request->read_size, request->content_length - request->content_read ); + if (request->read_chunked) return min( request->read_chunked_size, request->read_size ); + return request->read_size; } /* check if we have reached the end of the data to read */ static BOOL end_of_read_data( request_t *request ) { - if (request->read_chunked) return (request->content_length == 0); + if (request->read_chunked) return request->read_chunked_eof; if (request->content_length == ~0u) return FALSE; return (request->content_length == request->content_read); } -static BOOL refill_buffer( request_t *request ) +static BOOL refill_buffer( request_t *request, BOOL notify ) { int len = sizeof(request->read_buf); - if (request->read_chunked && - (request->content_length == ~0u || request->content_length == request->content_read)) - { - if (!start_next_chunk( request )) return FALSE; - } - if (request->content_length != ~0u) len = min( len, request->content_length - request->content_read ); + if (request->read_chunked) + { + if (request->read_chunked_eof) return FALSE; + if (request->read_chunked_size == ~0u || !request->read_chunked_size) + { + if (!start_next_chunk( request, notify )) return FALSE; + } + } + if (!request->read_chunked && request->content_length != ~0u) + len = min( len, request->content_length - request->content_read ); if (len <= request->read_size) return TRUE; - if (!read_more_data( request, len )) return FALSE; + if (!read_more_data( request, len, notify )) return FALSE; if (!request->read_size) request->content_length = request->content_read = 0; return TRUE; } @@ -1955,8 +1996,6 @@ WCHAR status_codeW[4]; /* sizeof("nnn") */ if (!netconn_connected( &request->netconn )) return FALSE; - - send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, NULL, 0 ); received_len = 0; do @@ -2013,7 +2052,7 @@ header_t *header; buflen = MAX_REPLY_LEN; - if (!read_line( request, buffer, &buflen )) goto end; + if (!read_line( request, buffer, &buflen )) return TRUE; received_len += buflen; if (!*buffer) break; @@ -2038,9 +2077,6 @@ } TRACE("raw headers: %s\n", debugstr_w(raw_headers)); - -end: - send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, &received_len, sizeof(DWORD) ); return TRUE; } @@ -2064,46 +2100,35 @@ static BOOL read_data( request_t *request, void *buffer, DWORD size, DWORD *read, BOOL async ) { - BOOL ret = TRUE; - int len, bytes_read = 0; - - if (request->read_chunked && - (request->content_length == ~0u || request->content_length == request->content_read)) - { - if (!start_next_chunk( request )) goto done; - } - if (request->content_length != ~0u) size = min( size, request->content_length - request->content_read ); - - if (request->read_size) - { - bytes_read = min( request->read_size, size ); - memcpy( buffer, request->read_buf + request->read_pos, bytes_read ); - remove_data( request, bytes_read ); - } - if (size > bytes_read && (!bytes_read || !async)) - { - if ((ret = netconn_recv( &request->netconn, (char *)buffer + bytes_read, size - bytes_read, - async ? 0 : MSG_WAITALL, &len ))) - bytes_read += len; - } + int count, bytes_read = 0; + + if (end_of_read_data( request )) goto done; + + while (size) + { + if (!(count = get_available_data( request ))) + { + if (!refill_buffer( request, async )) goto done; + if (!(count = get_available_data( request ))) goto done; + } + count = min( count, size ); + memcpy( (char *)buffer + bytes_read, request->read_buf + request->read_pos, count ); + remove_data( request, count ); + if (request->read_chunked) request->read_chunked_size -= count; + size -= count; + bytes_read += count; + request->content_read += count; + if (end_of_read_data( request )) goto done; + } + if (request->read_chunked && !request->read_chunked_size) refill_buffer( request, async ); done: - request->content_read += bytes_read; TRACE( "retrieved %u bytes (%u/%u)\n", bytes_read, request->content_read, request->content_length ); - if (async) - { - if (ret) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, buffer, bytes_read ); - else - { - WINHTTP_ASYNC_RESULT result; - result.dwResult = API_READ_DATA; - result.dwError = get_last_error(); - send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, &result, sizeof(result) ); - } - } + + if (async) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, buffer, bytes_read ); if (read) *read = bytes_read; - if (!bytes_read && request->content_read == request->content_length) finished_reading( request ); - return ret; + if (end_of_read_data( request )) finished_reading( request ); + return TRUE; } /* read any content returned by the server so that the connection can be reused */ @@ -2112,11 +2137,6 @@ DWORD bytes_read; char buffer[2048]; - if (request->content_length == ~0u) - { - finished_reading( request ); - return; - } for (;;) { if (!read_data( request, buffer, sizeof(buffer), &bytes_read, FALSE ) || !bytes_read) return; @@ -2218,6 +2238,7 @@ if (!(ret = netconn_init( &request->netconn ))) goto end; request->read_pos = request->read_size = 0; request->read_chunked = FALSE; + request->read_chunked_eof = FALSE; } if (!(ret = add_host_header( request, WINHTTP_ADDREQ_FLAG_REPLACE ))) goto end; if (!(ret = open_connection( request ))) goto end; @@ -2300,6 +2321,8 @@ break; } + if (ret) refill_buffer( request, FALSE ); + if (async) { if (ret) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE, NULL, 0 ); @@ -2362,45 +2385,22 @@ static BOOL query_data_available( request_t *request, DWORD *available, BOOL async ) { - BOOL ret = TRUE; - DWORD count; - - if (!(count = get_available_data( request ))) - { - if (end_of_read_data( request )) - { - if (available) *available = 0; - return TRUE; - } - } - refill_buffer( request ); - count = get_available_data( request ); - - if (count == sizeof(request->read_buf)) /* check if we have even more pending in the socket */ - { - DWORD extra; - if ((ret = netconn_query_data_available( &request->netconn, &extra ))) - { - count = min( count + extra, request->content_length - request->content_read ); - } - } - if (async) - { - if (ret) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE, &count, sizeof(count) ); - else - { - WINHTTP_ASYNC_RESULT result; - result.dwResult = API_QUERY_DATA_AVAILABLE; - result.dwError = get_last_error(); - send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, &result, sizeof(result) ); - } - } - if (ret) - { - TRACE("%u bytes available\n", count); - if (available) *available = count; - } - return ret; + DWORD count = get_available_data( request ); + + if (!request->read_chunked) + count += netconn_query_data_available( &request->netconn ); + if (!count) + { + refill_buffer( request, async ); + count = get_available_data( request ); + if (!request->read_chunked) + count += netconn_query_data_available( &request->netconn ); + } + + if (async) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE, &count, sizeof(count) ); + TRACE("%u bytes available\n", count); + if (available) *available = count; + return TRUE; } static void task_query_data_available( task_header_t *task ) @@ -2508,7 +2508,7 @@ if (async) { - if (ret) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE, &num_bytes, sizeof(DWORD) ); + if (ret) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE, &num_bytes, sizeof(num_bytes) ); else { WINHTTP_ASYNC_RESULT result; @@ -3810,11 +3810,11 @@ winhttp_request_SetAutoLogonPolicy }; -HRESULT WinHttpRequest_create( IUnknown *unknown, void **obj ) +HRESULT WinHttpRequest_create( void **obj ) { struct winhttp_request *request; - TRACE("%p, %p\n", unknown, obj); + TRACE("%p\n", obj); if (!(request = heap_alloc( sizeof(*request) ))) return E_OUTOFMEMORY; request->IWinHttpRequest_iface.lpVtbl = &winhttp_request_vtbl; Modified: trunk/reactos/dll/win32/winhttp/session.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/session.…
============================================================================== --- trunk/reactos/dll/win32/winhttp/session.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/session.c [iso-8859-1] Sat Apr 26 17:34:51 2014 @@ -1354,7 +1354,11 @@ FIXME("getaddrinfo not found at build time\n"); #endif } - if (!ret) set_last_error( ERROR_WINHTTP_AUTODETECTION_FAILED ); + if (!ret) + { + set_last_error( ERROR_WINHTTP_AUTODETECTION_FAILED ); + *url = NULL; + } return ret; } @@ -1597,11 +1601,11 @@ heap_free( hdr ); if (!ret) { - heap_free( config->lpszAutoConfigUrl ); + GlobalFree( config->lpszAutoConfigUrl ); config->lpszAutoConfigUrl = NULL; - heap_free( config->lpszProxy ); + GlobalFree( config->lpszProxy ); config->lpszProxy = NULL; - heap_free( config->lpszProxyBypass ); + GlobalFree( config->lpszProxyBypass ); config->lpszProxyBypass = NULL; } return ret; Modified: trunk/reactos/dll/win32/winhttp/winhttp_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/winhttp_…
============================================================================== --- trunk/reactos/dll/win32/winhttp/winhttp_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/winhttp_private.h [iso-8859-1] Sat Apr 26 17:34:51 2014 @@ -202,9 +202,11 @@ int send_timeout; int recv_timeout; LPWSTR status_text; - DWORD content_length; /* total number of bytes to be read (per chunk) */ + DWORD content_length; /* total number of bytes to be read */ DWORD content_read; /* bytes read so far */ BOOL read_chunked; /* are we reading in chunked mode? */ + BOOL read_chunked_eof; /* end of stream in chunked mode */ + BOOL read_chunked_size; /* chunk size remaining */ DWORD read_pos; /* current read position in read_buf */ DWORD read_size; /* valid data size in read_buf */ char read_buf[4096]; /* buffer for already read but not returned data */ @@ -279,7 +281,7 @@ BOOL netconn_create( netconn_t *, int, int, int ) DECLSPEC_HIDDEN; BOOL netconn_init( netconn_t * ) DECLSPEC_HIDDEN; void netconn_unload( void ) DECLSPEC_HIDDEN; -BOOL netconn_query_data_available( netconn_t *, DWORD * ) DECLSPEC_HIDDEN; +ULONG netconn_query_data_available( netconn_t * ) DECLSPEC_HIDDEN; BOOL netconn_recv( netconn_t *, void *, size_t, int, int * ) DECLSPEC_HIDDEN; BOOL netconn_resolve( WCHAR *, INTERNET_PORT, struct sockaddr *, socklen_t *, int ) DECLSPEC_HIDDEN; BOOL netconn_secure_connect( netconn_t *, WCHAR * ) DECLSPEC_HIDDEN; @@ -295,7 +297,7 @@ BOOL set_server_for_hostname( connect_t *, LPCWSTR, INTERNET_PORT ) DECLSPEC_HIDDEN; void destroy_authinfo( struct authinfo * ) DECLSPEC_HIDDEN; -extern HRESULT WinHttpRequest_create( IUnknown *, void ** ) DECLSPEC_HIDDEN; +extern HRESULT WinHttpRequest_create( void ** ) DECLSPEC_HIDDEN; static inline const char *debugstr_variant( const VARIANT *v ) { Modified: trunk/reactos/dll/win32/winhttp/winhttp_tlb.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/winhttp_…
============================================================================== --- trunk/reactos/dll/win32/winhttp/winhttp_tlb.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/winhttp_tlb.idl [iso-8859-1] Sat Apr 26 17:34:51 2014 @@ -18,4 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep regtypelib + #include "httprequest.idl" Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Apr 26 17:34:51 2014 @@ -207,7 +207,7 @@ reactos/dll/win32/windowscodecsext # Synced to Wine-1.7.1 reactos/dll/win32/winemp3.acm # Synced to Wine-1.7.1 reactos/dll/win32/wing32 # Out of sync -reactos/dll/win32/winhttp # Synced to Wine-1.7.1 +reactos/dll/win32/winhttp # Synced to Wine-1.7.17 reactos/dll/win32/wininet # Synced to Wine-1.7.1 reactos/dll/win32/winmm # Forked at Wine-20050628 reactos/dll/win32/winmm/midimap # Forked at Wine-20050628
10 years, 8 months
1
0
0
0
[akhaldi] 62989: [WUAPI] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Apr 26 17:23:51 2014 New Revision: 62989 URL:
http://svn.reactos.org/svn/reactos?rev=62989&view=rev
Log: [WUAPI] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/wuapi/downloader.c trunk/reactos/dll/win32/wuapi/installer.c trunk/reactos/dll/win32/wuapi/main.c trunk/reactos/dll/win32/wuapi/searcher.c trunk/reactos/dll/win32/wuapi/session.c trunk/reactos/dll/win32/wuapi/systeminfo.c trunk/reactos/dll/win32/wuapi/updates.c trunk/reactos/dll/win32/wuapi/wuapi_private.h trunk/reactos/dll/win32/wuapi/wuapi_tlb.idl trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/wuapi/downloader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wuapi/downloader…
============================================================================== --- trunk/reactos/dll/win32/wuapi/downloader.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wuapi/downloader.c [iso-8859-1] Sat Apr 26 17:23:51 2014 @@ -234,11 +234,11 @@ update_downloader_EndDownload }; -HRESULT UpdateDownloader_create( IUnknown *pUnkOuter, LPVOID *ppObj ) +HRESULT UpdateDownloader_create( LPVOID *ppObj ) { update_downloader *downloader; - TRACE("(%p,%p)\n", pUnkOuter, ppObj); + TRACE("(%p)\n", ppObj); downloader = HeapAlloc( GetProcessHeap(), 0, sizeof(*downloader) ); if (!downloader) return E_OUTOFMEMORY; Modified: trunk/reactos/dll/win32/wuapi/installer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wuapi/installer.…
============================================================================== --- trunk/reactos/dll/win32/wuapi/installer.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wuapi/installer.c [iso-8859-1] Sat Apr 26 17:23:51 2014 @@ -329,11 +329,11 @@ update_installer_get_RebootRequiredBeforeInstallation }; -HRESULT UpdateInstaller_create( IUnknown *pUnkOuter, LPVOID *ppObj ) +HRESULT UpdateInstaller_create( LPVOID *ppObj ) { update_installer *installer; - TRACE("(%p,%p)\n", pUnkOuter, ppObj); + TRACE("(%p)\n", ppObj); installer = HeapAlloc( GetProcessHeap(), 0, sizeof(*installer) ); if (!installer) return E_OUTOFMEMORY; Modified: trunk/reactos/dll/win32/wuapi/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wuapi/main.c?rev…
============================================================================== --- trunk/reactos/dll/win32/wuapi/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wuapi/main.c [iso-8859-1] Sat Apr 26 17:23:51 2014 @@ -22,7 +22,7 @@ #include <rpcproxy.h> -typedef HRESULT (*fnCreateInstance)( IUnknown *pUnkOuter, LPVOID *ppObj ); +typedef HRESULT (*fnCreateInstance)( LPVOID *ppObj ); typedef struct _wucf { @@ -72,14 +72,11 @@ if (pOuter) return CLASS_E_NOAGGREGATION; - r = This->pfnCreateInstance( pOuter, (LPVOID *)&punk ); + r = This->pfnCreateInstance( (LPVOID *)&punk ); if (FAILED(r)) return r; r = IUnknown_QueryInterface( punk, riid, ppobj ); - if (FAILED(r)) - return r; - IUnknown_Release( punk ); return r; } Modified: trunk/reactos/dll/win32/wuapi/searcher.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wuapi/searcher.c…
============================================================================== --- trunk/reactos/dll/win32/wuapi/searcher.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wuapi/searcher.c [iso-8859-1] Sat Apr 26 17:23:51 2014 @@ -301,11 +301,11 @@ update_searcher_put_ServiceID }; -HRESULT UpdateSearcher_create( IUnknown *pUnkOuter, LPVOID *ppObj ) +HRESULT UpdateSearcher_create( LPVOID *ppObj ) { update_searcher *searcher; - TRACE("(%p,%p)\n", pUnkOuter, ppObj); + TRACE("(%p)\n", ppObj); searcher = HeapAlloc( GetProcessHeap(), 0, sizeof(*searcher) ); if (!searcher) return E_OUTOFMEMORY; Modified: trunk/reactos/dll/win32/wuapi/session.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wuapi/session.c?…
============================================================================== --- trunk/reactos/dll/win32/wuapi/session.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wuapi/session.c [iso-8859-1] Sat Apr 26 17:23:51 2014 @@ -165,7 +165,7 @@ IUpdateSearcher **retval ) { TRACE("%p\n", This); - return UpdateSearcher_create( NULL, (LPVOID *)retval ); + return UpdateSearcher_create( (LPVOID *)retval ); } static HRESULT WINAPI update_session_CreateUpdateDownloader( @@ -173,7 +173,7 @@ IUpdateDownloader **retval ) { TRACE("%p\n", This); - return UpdateDownloader_create( NULL, (LPVOID *)retval ); + return UpdateDownloader_create( (LPVOID *)retval ); } static HRESULT WINAPI update_session_CreateUpdateInstaller( @@ -181,7 +181,7 @@ IUpdateInstaller **retval ) { TRACE("%p\n", This); - return UpdateInstaller_create( NULL, (LPVOID *)retval ); + return UpdateInstaller_create( (LPVOID *)retval ); } static const struct IUpdateSessionVtbl update_session_vtbl = @@ -203,11 +203,11 @@ update_session_CreateUpdateInstaller }; -HRESULT UpdateSession_create( IUnknown *pUnkOuter, LPVOID *ppObj ) +HRESULT UpdateSession_create( LPVOID *ppObj ) { update_session *session; - TRACE("(%p,%p)\n", pUnkOuter, ppObj); + TRACE("(%p)\n", ppObj); session = HeapAlloc( GetProcessHeap(), 0, sizeof(*session) ); if (!session) return E_OUTOFMEMORY; Modified: trunk/reactos/dll/win32/wuapi/systeminfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wuapi/systeminfo…
============================================================================== --- trunk/reactos/dll/win32/wuapi/systeminfo.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wuapi/systeminfo.c [iso-8859-1] Sat Apr 26 17:23:51 2014 @@ -130,11 +130,11 @@ systeminfo_get_RebootRequired }; -HRESULT SystemInformation_create(IUnknown *pUnkOuter, LPVOID *ppObj) +HRESULT SystemInformation_create(LPVOID *ppObj) { systeminfo *info; - TRACE("(%p,%p)\n", pUnkOuter, ppObj); + TRACE("(%p)\n", ppObj); info = HeapAlloc(GetProcessHeap(), 0, sizeof(*info)); if (!info) Modified: trunk/reactos/dll/win32/wuapi/updates.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wuapi/updates.c?…
============================================================================== --- trunk/reactos/dll/win32/wuapi/updates.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wuapi/updates.c [iso-8859-1] Sat Apr 26 17:23:51 2014 @@ -189,11 +189,11 @@ automatic_updates_EnableService }; -HRESULT AutomaticUpdates_create( IUnknown *pUnkOuter, LPVOID *ppObj ) +HRESULT AutomaticUpdates_create( LPVOID *ppObj ) { automatic_updates *updates; - TRACE("(%p,%p)\n", pUnkOuter, ppObj); + TRACE("(%p)\n", ppObj); updates = HeapAlloc( GetProcessHeap(), 0, sizeof(*updates) ); if (!updates) return E_OUTOFMEMORY; Modified: trunk/reactos/dll/win32/wuapi/wuapi_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wuapi/wuapi_priv…
============================================================================== --- trunk/reactos/dll/win32/wuapi/wuapi_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wuapi/wuapi_private.h [iso-8859-1] Sat Apr 26 17:23:51 2014 @@ -36,11 +36,11 @@ #include <wine/debug.h> WINE_DEFAULT_DEBUG_CHANNEL(wuapi); -extern HRESULT AutomaticUpdates_create( IUnknown *pUnkOuter, LPVOID *ppObj ) DECLSPEC_HIDDEN; -extern HRESULT UpdateSession_create( IUnknown *pUnkOuter, LPVOID *ppObj ) DECLSPEC_HIDDEN; -extern HRESULT UpdateSearcher_create( IUnknown *pUnkOuter, LPVOID *ppObj ) DECLSPEC_HIDDEN; -extern HRESULT UpdateDownloader_create( IUnknown *pUnkOuter, LPVOID *ppObj ) DECLSPEC_HIDDEN; -extern HRESULT UpdateInstaller_create( IUnknown *pUnkOuter, LPVOID *ppObj ) DECLSPEC_HIDDEN; -extern HRESULT SystemInformation_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; +extern HRESULT AutomaticUpdates_create( LPVOID *ppObj ) DECLSPEC_HIDDEN; +extern HRESULT UpdateSession_create( LPVOID *ppObj ) DECLSPEC_HIDDEN; +extern HRESULT UpdateSearcher_create( LPVOID *ppObj ) DECLSPEC_HIDDEN; +extern HRESULT UpdateDownloader_create( LPVOID *ppObj ) DECLSPEC_HIDDEN; +extern HRESULT UpdateInstaller_create( LPVOID *ppObj ) DECLSPEC_HIDDEN; +extern HRESULT SystemInformation_create( LPVOID *ppObj ) DECLSPEC_HIDDEN; #endif /* _WUAPI_PRIVATE_H_ */ Modified: trunk/reactos/dll/win32/wuapi/wuapi_tlb.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wuapi/wuapi_tlb.…
============================================================================== --- trunk/reactos/dll/win32/wuapi/wuapi_tlb.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wuapi/wuapi_tlb.idl [iso-8859-1] Sat Apr 26 17:23:51 2014 @@ -18,4 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep regtypelib + #include "wuapi.idl" Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Apr 26 17:23:51 2014 @@ -216,7 +216,7 @@ reactos/dll/win32/wldap32 # Synced to Wine-1.7.17 reactos/dll/win32/wmi # Synced to Wine-1.7.17 reactos/dll/win32/wtsapi32 # Synced to Wine-1.7.17 -reactos/dll/win32/wuapi # Synced to Wine-1.7.1 +reactos/dll/win32/wuapi # Synced to Wine-1.7.17 reactos/dll/win32/xinput1_1 # Synced to Wine-1.7.1 reactos/dll/win32/xinput1_2 # Synced to Wine-1.7.1 reactos/dll/win32/xinput1_3 # Synced to Wine-1.7.1
10 years, 8 months
1
0
0
0
[akhaldi] 62988: [README.WINE] * Fix some inconsistencies. Spotted by Radek Liska.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Apr 26 17:15:50 2014 New Revision: 62988 URL:
http://svn.reactos.org/svn/reactos?rev=62988&view=rev
Log: [README.WINE] * Fix some inconsistencies. Spotted by Radek Liska. Modified: trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Apr 26 17:15:50 2014 @@ -60,8 +60,8 @@ reactos/dll/win32/cabinet # Synced to Wine-1.7.17 reactos/dll/win32/clusapi # Synced to Wine-1.7.1 reactos/dll/win32/comcat # Synced to Wine-1.7.1 -reactos/dll/win32/comctl32 # Synced to Wine 1.7.17 -reactos/dll/win32/comdlg32 # Synced to Wine 1.7.17 +reactos/dll/win32/comctl32 # Synced to Wine-1.7.17 +reactos/dll/win32/comdlg32 # Synced to Wine-1.7.17 reactos/dll/win32/compstui # Synced to Wine-1.7.1 reactos/dll/win32/credui # Synced to Wine-1.7.1 reactos/dll/win32/crypt32 # Synced to Wine-1.7.17 @@ -290,9 +290,9 @@ reactos/dll/win32/user32/controls/scrollbar.c # Forked reactos/dll/win32/user32/controls/static.c # Synced to Wine-1_1_39 - reactos/dll/win32/user32/include/dde_private.h # Synced to wine 1.1.24 - - reactos/dll/win32/user32/misc/dde.c # Synced to wine 1.1.24 (dde_misc.c) + reactos/dll/win32/user32/include/dde_private.h # Synced to Wine-1.1.24 + + reactos/dll/win32/user32/misc/dde.c # Synced to Wine-1.1.24 (dde_misc.c) reactos/dll/win32/user32/misc/ddeclient.c # Synced to Wine-1_1_23 reactos/dll/win32/user32/misc/ddeserver.c # Synced to Wine-1_1_23 reactos/dll/win32/user32/misc/exticon.c # Synced to Wine-1_1_22 @@ -300,7 +300,7 @@ reactos/dll/win32/user32/misc/winhelp.c # Last sync date unknown reactos/dll/win32/user32/misc/wsprintf.c # Synced to Wine-1_1_23 - reactos/dll/win32/user32/windows/cursoricon # Forked from wine 1.2-rc7 + reactos/dll/win32/user32/windows/cursoricon # Forked from Wine-1.2-rc7 reactos/dll/win32/user32/windows/defwnd.c # Forked reactos/dll/win32/user32/windows/draw.c # Forked at Wine-20020904 (uitools.c) reactos/dll/win32/user32/windows/mdi.c # Synced to Wine-1_1_40
10 years, 8 months
1
0
0
0
[akhaldi] 62987: [WBEMPROX_WINETEST] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Apr 26 17:13:09 2014 New Revision: 62987 URL:
http://svn.reactos.org/svn/reactos?rev=62987&view=rev
Log: [WBEMPROX_WINETEST] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/rostests/winetests/wbemprox/query.c trunk/rostests/winetests/wbemprox/services.c Modified: trunk/rostests/winetests/wbemprox/query.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wbemprox/query.…
============================================================================== --- trunk/rostests/winetests/wbemprox/query.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wbemprox/query.c [iso-8859-1] Sat Apr 26 17:13:09 2014 @@ -46,7 +46,7 @@ { VARIANT var; - IEnumWbemClassObject_Next( *result, WBEM_INFINITE, 1, &obj, &count ); + IEnumWbemClassObject_Next( *result, 10000, 1, &obj, &count ); if (!count) break; if (IWbemClassObject_Get( obj, captionW, 0, &var, NULL, NULL ) == WBEM_S_NO_ERROR) @@ -616,6 +616,40 @@ SysFreeString( query ); } +static void test_GetNames( IWbemServices *services ) +{ + static const WCHAR queryW[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', + 'O','p','e','r','a','t','i','n','g','S','y','s','t','e','m',0}; + BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); + IEnumWbemClassObject *result; + HRESULT hr; + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK, "got %08x\n", hr ); + + for (;;) + { + IWbemClassObject *obj; + SAFEARRAY *names; + ULONG count; + VARIANT val; + + IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + if (!count) break; + + VariantInit( &val ); + hr = IWbemClassObject_GetNames( obj, NULL, WBEM_FLAG_NONSYSTEM_ONLY, &val, &names ); + ok( hr == S_OK, "got %08x\n", hr ); + + SafeArrayDestroy( names ); + IWbemClassObject_Release( obj ); + } + IEnumWbemClassObject_Release( result ); + SysFreeString( query ); + SysFreeString( wql ); +} + START_TEST(query) { static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0}; @@ -654,6 +688,7 @@ test_StdRegProv( services ); test_notification_query_async( services ); test_query_async( services ); + test_GetNames( services ); SysFreeString( path ); IWbemServices_Release( services ); Modified: trunk/rostests/winetests/wbemprox/services.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wbemprox/servic…
============================================================================== --- trunk/rostests/winetests/wbemprox/services.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wbemprox/services.c [iso-8859-1] Sat Apr 26 17:13:09 2014 @@ -115,7 +115,7 @@ { const WCHAR *path; HRESULT result; - int todo; + BOOL todo; HRESULT result_broken; } test[] = @@ -124,10 +124,10 @@ { path1W, WBEM_E_INVALID_NAMESPACE }, { path2W, WBEM_E_INVALID_NAMESPACE }, { path3W, WBEM_E_INVALID_NAMESPACE }, - { path4W, WBEM_E_INVALID_NAMESPACE, 0, WBEM_E_INVALID_PARAMETER }, + { path4W, WBEM_E_INVALID_NAMESPACE, FALSE, WBEM_E_INVALID_PARAMETER }, { path5W, WBEM_E_INVALID_NAMESPACE }, - { path6W, 0x800706ba, 1 }, - { path7W, 0x800706ba, 1 }, + { path6W, 0x800706ba, TRUE }, + { path7W, 0x800706ba, TRUE }, { path8W, WBEM_E_INVALID_NAMESPACE }, { path9W, S_OK }, { path10W, WBEM_E_INVALID_PARAMETER },
10 years, 8 months
1
0
0
0
[akhaldi] 62986: [WBEMPROX] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Apr 26 17:12:58 2014 New Revision: 62986 URL:
http://svn.reactos.org/svn/reactos?rev=62986&view=rev
Log: [WBEMPROX] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/wbemprox/builtin.c trunk/reactos/dll/win32/wbemprox/class.c trunk/reactos/dll/win32/wbemprox/main.c trunk/reactos/dll/win32/wbemprox/qualifier.c trunk/reactos/dll/win32/wbemprox/query.c trunk/reactos/dll/win32/wbemprox/services.c trunk/reactos/dll/win32/wbemprox/wbemlocator.c trunk/reactos/dll/win32/wbemprox/wbemprox.idl trunk/reactos/dll/win32/wbemprox/wbemprox_private.h trunk/reactos/dll/win32/wbemprox/wql.tab.c trunk/reactos/dll/win32/wbemprox/wql.y trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/wbemprox/builtin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/builtin…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/builtin.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/builtin.c [iso-8859-1] Sat Apr 26 17:12:58 2014 @@ -51,10 +51,17 @@ {'C','I','M','_','L','o','g','i','c','a','l','D','i','s','k',0}; static const WCHAR class_networkadapterW[] = {'W','i','n','3','2','_','N','e','t','w','o','r','k','A','d','a','p','t','e','r',0}; +static const WCHAR class_networkadapterconfigW[] = + {'W','i','n','3','2','_','N','e','t','w','o','r','k','A','d','a','p','t','e','r', + 'C','o','n','f','i','g','u','r','a','t','i','o','n',0}; static const WCHAR class_osW[] = {'W','i','n','3','2','_','O','p','e','r','a','t','i','n','g','S','y','s','t','e','m',0}; static const WCHAR class_paramsW[] = {'_','_','P','A','R','A','M','E','T','E','R','S',0}; +static const WCHAR class_physicalmediaW[] = + {'W','i','n','3','2','_','P','h','y','s','i','c','a','l','M','e','d','i','a',0}; +static const WCHAR class_physicalmemoryW[] = + {'W','i','n','3','2','_','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0}; static const WCHAR class_qualifiersW[] = {'_','_','Q','U','A','L','I','F','I','E','R','S',0}; static const WCHAR class_process_getowner_outW[] = @@ -81,10 +88,16 @@ {'A','d','a','p','t','e','r','T','y','p','e',0}; static const WCHAR prop_addresswidthW[] = {'A','d','d','r','e','s','s','W','i','d','t','h',0}; +static const WCHAR prop_availabilityW[] = + {'A','v','a','i','l','a','b','i','l','i','t','y',0}; static const WCHAR prop_bootableW[] = {'B','o','o','t','a','b','l','e',0}; static const WCHAR prop_bootpartitionW[] = {'B','o','o','t','P','a','r','t','i','t','i','o','n',0}; +static const WCHAR prop_buildnumberW[] = + {'B','u','i','l','d','N','u','m','b','e','r',0}; +static const WCHAR prop_capacityW[] = + {'C','a','p','a','c','i','t','y',0}; static const WCHAR prop_captionW[] = {'C','a','p','t','i','o','n',0}; static const WCHAR prop_classW[] = @@ -137,12 +150,22 @@ {'H','a','n','d','l','e',0}; static const WCHAR prop_idW[] = {'I','D',0}; +static const WCHAR prop_identificationcodeW[] = + {'I','d','e','n','t','i','f','i','c','a','t','i','o','n','C','o','d','e',0}; static const WCHAR prop_indexW[] = {'I','n','d','e','x',0}; +static const WCHAR prop_installdateW[] = + {'I','n','s','t','a','l','l','D','a','t','e',0}; static const WCHAR prop_interfaceindexW[] = {'I','n','t','e','r','f','a','c','e','I','n','d','e','x',0}; +static const WCHAR prop_interfacetypeW[] = + {'I','n','t','e','r','f','a','c','e','T','y','p','e',0}; static const WCHAR prop_intvalueW[] = {'I','n','t','e','g','e','r','V','a','l','u','e',0}; +static const WCHAR prop_ipconnectionmetricW[] = + {'I','P','C','o','n','n','e','c','t','i','o','n','M','e','t','r','i','c',0}; +static const WCHAR prop_ipenabledW[] = + {'I','P','E','n','a','b','l','e','d',0}; static const WCHAR prop_lastbootuptimeW[] = {'L','a','s','t','B','o','o','t','U','p','T','i','m','e',0}; static const WCHAR prop_localdatetimeW[] = @@ -155,6 +178,8 @@ {'M','a','n','u','f','a','c','t','u','r','e','r',0}; static const WCHAR prop_maxclockspeedW[] = {'M','a','x','C','l','o','c','k','S','p','e','e','d',0}; +static const WCHAR prop_mediatypeW[] = + {'M','e','d','i','a','T','y','p','e',0}; static const WCHAR prop_memberW[] = {'M','e','m','b','e','r',0}; static const WCHAR prop_methodW[] = @@ -201,6 +226,8 @@ {'S','e','r','v','i','c','e','P','a','c','k','M','i','n','o','r','V','e','r','s','i','o','n',0}; static const WCHAR prop_servicetypeW[] = {'S','e','r','v','i','c','e','T','y','p','e',0}; +static const WCHAR prop_smbiosbiosversionW[] = + {'S','M','B','I','O','S','B','I','O','S','V','e','r','s','i','o','n',0}; static const WCHAR prop_startmodeW[] = {'S','t','a','r','t','M','o','d','e',0}; static const WCHAR prop_sizeW[] = @@ -233,26 +260,33 @@ {'V','a','r','i','a','n','t','T','y','p','e',0}; static const WCHAR prop_versionW[] = {'V','e','r','s','i','o','n',0}; +static const WCHAR prop_volumeserialnumberW[] = + {'V','o','l','u','m','e','S','e','r','i','a','l','N','u','m','b','e','r',0}; /* column definitions must be kept in sync with record structures below */ static const struct column col_baseboard[] = { { prop_manufacturerW, CIM_STRING }, + { prop_modelW, CIM_STRING }, + { prop_nameW, CIM_STRING }, { prop_serialnumberW, CIM_STRING }, { prop_tagW, CIM_STRING|COL_FLAG_KEY } }; static const struct column col_bios[] = { - { prop_descriptionW, CIM_STRING }, - { prop_manufacturerW, CIM_STRING }, - { prop_releasedateW, CIM_DATETIME }, - { prop_serialnumberW, CIM_STRING }, - { prop_versionW, CIM_STRING|COL_FLAG_KEY } + { prop_descriptionW, CIM_STRING }, + { prop_identificationcodeW, CIM_STRING }, + { prop_manufacturerW, CIM_STRING }, + { prop_releasedateW, CIM_DATETIME }, + { prop_serialnumberW, CIM_STRING }, + { prop_smbiosbiosversionW, CIM_STRING }, + { prop_versionW, CIM_STRING|COL_FLAG_KEY } }; static const struct column col_cdromdrive[] = { { prop_deviceidW, CIM_STRING|COL_FLAG_KEY }, { prop_driveW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_mediatypeW, CIM_STRING }, { prop_nameW, CIM_STRING }, { prop_pnpdeviceidW, CIM_STRING } }; @@ -280,11 +314,14 @@ }; static const struct column col_diskdrive[] = { - { prop_deviceidW, CIM_STRING|COL_FLAG_KEY }, - { prop_indexW, CIM_UINT32, VT_I4 }, - { prop_manufacturerW, CIM_STRING }, - { prop_modelW, CIM_STRING }, - { prop_serialnumberW, CIM_STRING } + { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, + { prop_indexW, CIM_UINT32, VT_I4 }, + { prop_interfacetypeW, CIM_STRING }, + { prop_manufacturerW, CIM_STRING }, + { prop_mediatypeW, CIM_STRING }, + { prop_modelW, CIM_STRING }, + { prop_serialnumberW, CIM_STRING }, + { prop_sizeW, CIM_UINT64 } }; static const struct column col_diskpartition[] = { @@ -300,38 +337,52 @@ }; static const struct column col_logicaldisk[] = { - { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, - { prop_drivetypeW, CIM_UINT32, VT_I4 }, - { prop_filesystemW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_freespaceW, CIM_UINT64 }, - { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_sizeW, CIM_UINT64 } + { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, + { prop_drivetypeW, CIM_UINT32, VT_I4 }, + { prop_filesystemW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_freespaceW, CIM_UINT64 }, + { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_sizeW, CIM_UINT64 }, + { prop_volumeserialnumberW, CIM_STRING|COL_FLAG_DYNAMIC } }; static const struct column col_networkadapter[] = { { prop_adaptertypeW, CIM_STRING }, { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, + { prop_indexW, CIM_UINT32, VT_I4 }, { prop_interfaceindexW, CIM_UINT32, VT_I4 }, { prop_macaddressW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_manufacturerW, CIM_STRING }, + { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_netconnectionstatusW, CIM_UINT16, VT_I4 }, { prop_physicaladapterW, CIM_BOOLEAN }, { prop_pnpdeviceidW, CIM_STRING }, { prop_speedW, CIM_UINT64 } }; +static const struct column col_networkadapterconfig[] = +{ + { prop_indexW, CIM_UINT32|COL_FLAG_KEY }, + { prop_ipconnectionmetricW, CIM_UINT32 }, + { prop_ipenabledW, CIM_BOOLEAN }, + { prop_macaddressW, CIM_STRING|COL_FLAG_DYNAMIC } +}; static const struct column col_os[] = { + { prop_buildnumberW, CIM_STRING }, { prop_captionW, CIM_STRING }, { prop_codesetW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_countrycodeW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_csdversionW, CIM_STRING }, + { prop_installdateW, CIM_DATETIME }, { prop_lastbootuptimeW, CIM_DATETIME|COL_FLAG_DYNAMIC }, { prop_localdatetimeW, CIM_DATETIME|COL_FLAG_DYNAMIC }, { prop_localeW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_nameW, CIM_STRING }, { prop_osarchitectureW, CIM_STRING }, { prop_oslanguageW, CIM_UINT32, VT_I4 }, { prop_osproductsuiteW, CIM_UINT32, VT_I4 }, { prop_ostypeW, CIM_UINT16, VT_I4 }, + { prop_serialnumberW, CIM_STRING }, { prop_servicepackmajorW, CIM_UINT16, VT_I4 }, { prop_servicepackminorW, CIM_UINT16, VT_I4 }, { prop_suitemaskW, CIM_UINT32, VT_I4 }, @@ -347,6 +398,15 @@ { prop_typeW, CIM_UINT32 }, { prop_varianttypeW, CIM_UINT32 }, { prop_defaultvalueW, CIM_UINT32 } +}; +static const struct column col_physicalmedia[] = +{ + { prop_serialnumberW, CIM_STRING }, + { prop_tagW, CIM_STRING } +}; +static const struct column col_physicalmemory[] = +{ + { prop_capacityW, CIM_UINT64 } }; static const struct column col_process[] = { @@ -417,6 +477,7 @@ { { prop_adapterdactypeW, CIM_STRING }, { prop_adapterramW, CIM_UINT32, VT_I4 }, + { prop_availabilityW, CIM_UINT16 }, { prop_currentbitsperpixelW, CIM_UINT32 }, { prop_currenthorizontalresW, CIM_UINT32 }, { prop_currentverticalresW, CIM_UINT32 }, @@ -440,8 +501,12 @@ {'2','0','1','2','0','6','0','8','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0}; static const WCHAR bios_serialnumberW[] = {'0',0}; +static const WCHAR bios_smbiosbiosversionW[] = + {'W','i','n','e',0}; static const WCHAR bios_versionW[] = {'W','I','N','E',' ',' ',' ','-',' ','1',0}; +static const WCHAR cdromdrive_mediatypeW[] = + {'C','D','-','R','O','M',0}; static const WCHAR cdromdrive_nameW[] = {'W','i','n','e',' ','C','D','-','R','O','M',' ','A','T','A',' ','D','e','v','i','c','e',0}; static const WCHAR cdromdrive_pnpdeviceidW[]= @@ -457,29 +522,46 @@ {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0}; static const WCHAR compsys_modelW[] = {'W','i','n','e',0}; -static const WCHAR diskdrive_deviceidW[] = - {'\\','\\','\\','\\','.','\\','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','0',0}; +static const WCHAR diskdrive_interfacetypeW[] = + {'I','D','E',0}; +static const WCHAR diskdrive_manufacturerW[] = + {'(','S','t','a','n','d','a','r','d',' ','d','i','s','k',' ','d','r','i','v','e','s',')',0}; +static const WCHAR diskdrive_mediatype_fixedW[] = + {'F','i','x','e','d',' ','h','a','r','d',' ','d','i','s','k',0}; +static const WCHAR diskdrive_mediatype_removableW[] = + {'R','e','m','o','v','a','b','l','e',' ','m','e','d','i','a',0}; static const WCHAR diskdrive_modelW[] = {'W','i','n','e',' ','D','i','s','k',' ','D','r','i','v','e',0}; -static const WCHAR diskdrive_manufacturerW[] = - {'(','S','t','a','n','d','a','r','d',' ','d','i','s','k',' ','d','r','i','v','e','s',')',0}; static const WCHAR diskdrive_serialW[] = {'W','I','N','E','H','D','I','S','K',0}; static const WCHAR networkadapter_pnpdeviceidW[]= {'P','C','I','\\','V','E','N','_','8','0','8','6','&','D','E','V','_','1','0','0','E','&', 'S','U','B','S','Y','S','_','0','0','1','E','8','0','8','6','&','R','E','V','_','0','2','\\', '3','&','2','6','7','A','6','1','6','A','&','1','&','1','8',0}; +static const WCHAR os_32bitW[] = + {'3','2','-','b','i','t',0}; +static const WCHAR os_64bitW[] = + {'6','4','-','b','i','t',0}; +static const WCHAR os_buildnumberW[] = + {'2','6','0','0',0}; static const WCHAR os_captionW[] = {'M','i','c','r','o','s','o','f','t',' ','W','i','n','d','o','w','s',' ','X','P',' ', 'V','e','r','s','i','o','n',' ','=',' ','5','.','1','.','2','6','0','0',0}; static const WCHAR os_csdversionW[] = {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','3',0}; -static const WCHAR os_32bitW[] = - {'3','2','-','b','i','t',0}; -static const WCHAR os_64bitW[] = - {'6','4','-','b','i','t',0}; +static const WCHAR os_installdateW[] = + {'2','0','1','4','0','1','0','1','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0}; +static const WCHAR os_nameW[] = + {'M','i','c','r','o','s','o','f','t',' ','W','i','n','d','o','w','s',' ','X','P',' ', + 'P','r','o','f','e','s','s','i','o','n','a','l','|','C',':','\\','W','I','N','D','O','W','S', + '|','\\','D','e','v','i','c','e','\\','H','a','r','d','d','i','s','k','0', + '\\','P','a','r','t','i','t','i','o','n','1',0}; +static const WCHAR os_serialnumberW[] = + {'1','2','3','4','5','-','O','E','M','-','1','2','3','4','5','6','7','-','1','2','3','4','5',0}; static const WCHAR os_versionW[] = {'5','.','1','.','2','6','0','0',0}; +static const WCHAR physicalmedia_tagW[] = + {'\\','\\','.','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','0',0}; static const WCHAR sounddevice_productnameW[] = {'W','i','n','e',' ','A','u','d','i','o',' ','D','e','v','i','c','e',0}; static const WCHAR videocontroller_dactypeW[] = @@ -491,21 +573,26 @@ struct record_baseboard { const WCHAR *manufacturer; + const WCHAR *model; + const WCHAR *name; const WCHAR *serialnumber; const WCHAR *tag; }; struct record_bios { const WCHAR *description; + const WCHAR *identificationcode; const WCHAR *manufacturer; const WCHAR *releasedate; const WCHAR *serialnumber; + const WCHAR *smbiosbiosversion; const WCHAR *version; }; struct record_cdromdrive { const WCHAR *device_id; const WCHAR *drive; + const WCHAR *mediatype; const WCHAR *name; const WCHAR *pnpdevice_id; }; @@ -535,9 +622,12 @@ { const WCHAR *device_id; UINT32 index; + const WCHAR *interfacetype; const WCHAR *manufacturer; - const WCHAR *name; + const WCHAR *mediatype; + const WCHAR *model; const WCHAR *serialnumber; + UINT64 size; }; struct record_diskpartition { @@ -559,32 +649,46 @@ UINT64 freespace; const WCHAR *name; UINT64 size; + const WCHAR *volumeserialnumber; }; struct record_networkadapter { const WCHAR *adaptertype; const WCHAR *device_id; - INT32 interface_index; + UINT32 index; + UINT32 interface_index; const WCHAR *mac_address; const WCHAR *manufacturer; + const WCHAR *name; UINT16 netconnection_status; int physicaladapter; const WCHAR *pnpdevice_id; UINT64 speed; }; +struct record_networkadapterconfig +{ + UINT32 index; + UINT32 ipconnectionmetric; + int ipenabled; + const WCHAR *mac_address; +}; struct record_operatingsystem { + const WCHAR *buildnumber; const WCHAR *caption; const WCHAR *codeset; const WCHAR *countrycode; const WCHAR *csdversion; + const WCHAR *installdate; const WCHAR *lastbootuptime; const WCHAR *localdatetime; const WCHAR *locale; + const WCHAR *name; const WCHAR *osarchitecture; UINT32 oslanguage; UINT32 osproductsuite; UINT16 ostype; + const WCHAR *serialnumber; UINT16 servicepackmajor; UINT16 servicepackminor; UINT32 suitemask; @@ -600,6 +704,15 @@ UINT32 type; UINT32 varianttype; UINT32 defaultvalue; +}; +struct record_physicalmedia +{ + const WCHAR *serialnumber; + const WCHAR *tag; +}; +struct record_physicalmemory +{ + UINT64 capacity; }; struct record_process { @@ -670,6 +783,7 @@ { const WCHAR *adapter_dactype; UINT32 adapter_ram; + UINT16 availability; UINT32 current_bitsperpixel; UINT32 current_horizontalres; UINT32 current_verticalres; @@ -682,15 +796,12 @@ static const struct record_baseboard data_baseboard[] = { - { baseboard_manufacturerW, baseboard_serialnumberW, baseboard_tagW } + { baseboard_manufacturerW, baseboard_tagW, baseboard_tagW, baseboard_serialnumberW, baseboard_tagW } }; static const struct record_bios data_bios[] = { - { bios_descriptionW, bios_manufacturerW, bios_releasedateW, bios_serialnumberW, bios_versionW } -}; -static const struct record_diskdrive data_diskdrive[] = -{ - { diskdrive_deviceidW, 0, diskdrive_manufacturerW, diskdrive_modelW, diskdrive_serialW } + { bios_descriptionW, bios_descriptionW, bios_manufacturerW, bios_releasedateW, bios_serialnumberW, + bios_smbiosbiosversionW, bios_versionW } }; static const struct record_param data_param[] = { @@ -720,6 +831,10 @@ #define FLAVOR_ID (WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE | WBEM_FLAVOR_NOT_OVERRIDABLE |\ WBEM_FLAVOR_ORIGIN_PROPAGATED) +static const struct record_physicalmedia data_physicalmedia[] = +{ + { diskdrive_serialW, physicalmedia_tagW } +}; static const struct record_qualifier data_qualifier[] = { { class_process_getowner_outW, param_userW, CIM_SINT32, FLAVOR_ID, prop_idW, 0 }, @@ -738,12 +853,14 @@ static BOOL match_row( const struct table *table, UINT row, const struct expr *cond, enum fill_status *status ) { LONGLONG val; + UINT type; + if (!cond) { *status = FILL_STATUS_UNFILTERED; return TRUE; } - if (eval_cond( table, row, cond, &val ) != S_OK) + if (eval_cond( table, row, cond, &val, &type ) != S_OK) { *status = FILL_STATUS_FAILED; return FALSE; @@ -796,6 +913,7 @@ rec->device_id = cdromdrive_pnpdeviceidW; sprintfW( drive, fmtW, 'A' + i ); rec->drive = heap_strdupW( drive ); + rec->mediatype = cdromdrive_mediatypeW; rec->name = cdromdrive_nameW; rec->pnpdevice_id = cdromdrive_pnpdeviceidW; if (!match_row( table, row, cond, &status )) @@ -1177,10 +1295,12 @@ DWORD drives = GetLogicalDrives(); WIN32_FIND_DATAW data; HANDLE handle; - struct dirstack *dirstack = alloc_dirstack(2); + struct dirstack *dirstack; enum fill_status status = FILL_STATUS_UNFILTERED; if (!resize_table( table, 8, sizeof(*rec) )) return FILL_STATUS_FAILED; + + dirstack = alloc_dirstack(2); for (i = 0; i < sizeof(drives); i++) { @@ -1207,6 +1327,7 @@ if (!resize_table( table, row + 1, sizeof(*rec) )) { status = FILL_STATUS_FAILED; + FindClose( handle ); goto done; } if (!strcmpW( data.cFileName, dotW ) || !strcmpW( data.cFileName, dotdotW )) continue; @@ -1216,6 +1337,7 @@ { if (push_dir( dirstack, new_path, len )) continue; heap_free( new_path ); + FindClose( handle ); status = FILL_STATUS_FAILED; goto done; } @@ -1349,16 +1471,6 @@ return status; } -static WCHAR *get_filesystem( const WCHAR *root ) -{ - static const WCHAR ntfsW[] = {'N','T','F','S',0}; - WCHAR buffer[MAX_PATH + 1]; - - if (GetVolumeInformationW( root, NULL, 0, NULL, NULL, NULL, buffer, MAX_PATH + 1 )) - return heap_strdupW( buffer ); - return heap_strdupW( ntfsW ); -} - static UINT64 get_freespace( const WCHAR *dir, UINT64 *disksize ) { WCHAR root[] = {'\\','\\','.','\\','A',':',0}; @@ -1378,6 +1490,69 @@ CloseHandle( handle ); } return free.QuadPart; +} + +static enum fill_status fill_diskdrive( struct table *table, const struct expr *cond ) +{ + static const WCHAR fmtW[] = + {'\\','\\','\\','\\','.','\\','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','%','u',0}; + WCHAR device_id[sizeof(fmtW)/sizeof(fmtW[0]) + 10], root[] = {'A',':','\\',0}; + struct record_diskdrive *rec; + UINT i, row = 0, offset = 0, index = 0, type; + UINT64 size = 1024 * 1024 * 1024; + DWORD drives = GetLogicalDrives(); + enum fill_status status = FILL_STATUS_UNFILTERED; + + if (!resize_table( table, 2, sizeof(*rec) )) return FILL_STATUS_FAILED; + + for (i = 0; i < sizeof(drives); i++) + { + if (drives & (1 << i)) + { + root[0] = 'A' + i; + type = GetDriveTypeW( root ); + if (type != DRIVE_FIXED && type != DRIVE_REMOVABLE) + continue; + + if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED; + + rec = (struct record_diskdrive *)(table->data + offset); + sprintfW( device_id, fmtW, index ); + rec->device_id = heap_strdupW( device_id ); + rec->index = index; + rec->interfacetype = diskdrive_interfacetypeW; + rec->manufacturer = diskdrive_manufacturerW; + if (type == DRIVE_FIXED) + rec->mediatype = diskdrive_mediatype_fixedW; + else + rec->mediatype = diskdrive_mediatype_removableW; + rec->model = diskdrive_modelW; + rec->serialnumber = diskdrive_serialW; + get_freespace( root, &size ); + rec->size = size; + if (!match_row( table, row, cond, &status )) + { + free_row_values( table, row ); + continue; + } + offset += sizeof(*rec); + index++; + row++; + } + } + TRACE("created %u rows\n", row); + table->num_rows = row; + return status; +} + +static WCHAR *get_filesystem( const WCHAR *root ) +{ + static const WCHAR ntfsW[] = {'N','T','F','S',0}; + WCHAR buffer[MAX_PATH + 1]; + + if (GetVolumeInformationW( root, NULL, 0, NULL, NULL, NULL, buffer, MAX_PATH + 1 )) + return heap_strdupW( buffer ); + return heap_strdupW( ntfsW ); } static enum fill_status fill_diskpartition( struct table *table, const struct expr *cond ) @@ -1431,6 +1606,17 @@ return status; } +static WCHAR *get_volumeserialnumber( const WCHAR *root ) +{ + static const WCHAR fmtW[] = {'%','0','8','X',0}; + DWORD serial = 0; + WCHAR buffer[9]; + + GetVolumeInformationW( root, NULL, 0, &serial, NULL, NULL, NULL, 0 ); + sprintfW( buffer, fmtW, serial ); + return heap_strdupW( buffer ); +} + static enum fill_status fill_logicaldisk( struct table *table, const struct expr *cond ) { static const WCHAR fmtW[] = {'%','c',':',0}; @@ -1456,12 +1642,13 @@ rec = (struct record_logicaldisk *)(table->data + offset); sprintfW( device_id, fmtW, 'A' + i ); - rec->device_id = heap_strdupW( device_id ); - rec->drivetype = type; - rec->filesystem = get_filesystem( root ); - rec->freespace = get_freespace( root, &size ); - rec->name = heap_strdupW( device_id ); - rec->size = size; + rec->device_id = heap_strdupW( device_id ); + rec->drivetype = type; + rec->filesystem = get_filesystem( root ); + rec->freespace = get_freespace( root, &size ); + rec->name = heap_strdupW( device_id ); + rec->size = size; + rec->volumeserialnumber = get_volumeserialnumber( root ); if (!match_row( table, row, cond, &status )) { free_row_values( table, row ); @@ -1538,7 +1725,10 @@ heap_free( buffer ); return FILL_STATUS_FAILED; } - for (aa = buffer; aa; aa = aa->Next) count++; + for (aa = buffer; aa; aa = aa->Next) + { + if (aa->IfType != IF_TYPE_SOFTWARE_LOOPBACK) count++; + } if (!resize_table( table, count, sizeof(*rec) )) { heap_free( buffer ); @@ -1546,13 +1736,17 @@ } for (aa = buffer; aa; aa = aa->Next) { + if (aa->IfType == IF_TYPE_SOFTWARE_LOOPBACK) continue; + rec = (struct record_networkadapter *)(table->data + offset); sprintfW( device_id, fmtW, aa->u.s.IfIndex ); rec->adaptertype = get_adaptertype( aa->IfType, &physical ); rec->device_id = heap_strdupW( device_id ); + rec->index = aa->u.s.IfIndex; rec->interface_index = aa->u.s.IfIndex; rec->mac_address = get_mac_address( aa->PhysicalAddress, aa->PhysicalAddressLength ); rec->manufacturer = compsys_manufacturerW; + rec->name = heap_strdupW( aa->FriendlyName ); rec->netconnection_status = get_connection_status( aa->OperStatus ); rec->physicaladapter = physical; rec->pnpdevice_id = networkadapter_pnpdeviceidW; @@ -1569,6 +1763,74 @@ table->num_rows = row; heap_free( buffer ); + return status; +} + +static enum fill_status fill_networkadapterconfig( struct table *table, const struct expr *cond ) +{ + struct record_networkadapterconfig *rec; + IP_ADAPTER_ADDRESSES *aa, *buffer; + UINT row = 0, offset = 0, count = 0; + DWORD size = 0, ret; + enum fill_status status = FILL_STATUS_UNFILTERED; + + ret = GetAdaptersAddresses( AF_UNSPEC, 0, NULL, NULL, &size ); + if (ret != ERROR_BUFFER_OVERFLOW) return FILL_STATUS_FAILED; + + if (!(buffer = heap_alloc( size ))) return FILL_STATUS_FAILED; + if (GetAdaptersAddresses( AF_UNSPEC, 0, NULL, buffer, &size )) + { + heap_free( buffer ); + return FILL_STATUS_FAILED; + } + for (aa = buffer; aa; aa = aa->Next) + { + if (aa->IfType != IF_TYPE_SOFTWARE_LOOPBACK) count++; + } + if (!resize_table( table, count, sizeof(*rec) )) + { + heap_free( buffer ); + return FILL_STATUS_FAILED; + } + for (aa = buffer; aa; aa = aa->Next) + { + if (aa->IfType == IF_TYPE_SOFTWARE_LOOPBACK) continue; + + rec = (struct record_networkadapterconfig *)(table->data + offset); + rec->index = aa->u.s.IfIndex; + rec->ipconnectionmetric = 20; + rec->ipenabled = -1; + rec->mac_address = get_mac_address( aa->PhysicalAddress, aa->PhysicalAddressLength ); + if (!match_row( table, row, cond, &status )) + { + free_row_values( table, row ); + continue; + } + offset += sizeof(*rec); + row++; + } + TRACE("created %u rows\n", row); + table->num_rows = row; + + heap_free( buffer ); + return status; +} + +static enum fill_status fill_physicalmemory( struct table *table, const struct expr *cond ) +{ + struct record_physicalmemory *rec; + enum fill_status status = FILL_STATUS_UNFILTERED; + UINT row = 0; + + if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; + + rec = (struct record_physicalmemory *)table->data; + rec->capacity = get_total_physical_memory(); + if (!match_row( table, row, cond, &status )) free_row_values( table, row ); + else row++; + + TRACE("created %u rows\n", row); + table->num_rows = row; return status; } @@ -1835,17 +2097,21 @@ if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; rec = (struct record_operatingsystem *)table->data; + rec->buildnumber = os_buildnumberW; rec->caption = os_captionW; rec->codeset = get_codeset(); rec->countrycode = get_countrycode(); rec->csdversion = os_csdversionW; + rec->installdate = os_installdateW; rec->lastbootuptime = get_lastbootuptime(); rec->localdatetime = get_localdatetime(); rec->locale = get_locale(); + rec->name = os_nameW; rec->osarchitecture = get_osarchitecture(); rec->oslanguage = GetSystemDefaultLangID(); rec->osproductsuite = 2461140; /* Windows XP Professional */ rec->ostype = 18; /* WINNT */ + rec->serialnumber = os_serialnumberW; rec->servicepackmajor = 3; rec->servicepackminor = 0; rec->suitemask = 272; /* Single User + Terminal */ @@ -2073,6 +2339,7 @@ rec = (struct record_videocontroller *)table->data; rec->adapter_dactype = videocontroller_dactypeW; rec->adapter_ram = vidmem; + rec->availability = 3; /* Running or Full Power */ rec->current_bitsperpixel = get_bits_per_pixel( &hres, &vres ); rec->current_horizontalres = hres; rec->current_verticalres = vres; @@ -2099,13 +2366,17 @@ { class_compsysW, SIZEOF(col_compsys), col_compsys, 0, 0, NULL, fill_compsys }, { class_datafileW, SIZEOF(col_datafile), col_datafile, 0, 0, NULL, fill_datafile }, { class_directoryW, SIZEOF(col_directory), col_directory, 0, 0, NULL, fill_directory }, - { class_diskdriveW, SIZEOF(col_diskdrive), col_diskdrive, SIZEOF(data_diskdrive), 0, (BYTE *)data_diskdrive }, + { class_diskdriveW, SIZEOF(col_diskdrive), col_diskdrive, 0, 0, NULL, fill_diskdrive }, { class_diskpartitionW, SIZEOF(col_diskpartition), col_diskpartition, 0, 0, NULL, fill_diskpartition }, { class_logicaldiskW, SIZEOF(col_logicaldisk), col_logicaldisk, 0, 0, NULL, fill_logicaldisk }, { class_logicaldisk2W, SIZEOF(col_logicaldisk), col_logicaldisk, 0, 0, NULL, fill_logicaldisk }, { class_networkadapterW, SIZEOF(col_networkadapter), col_networkadapter, 0, 0, NULL, fill_networkadapter }, + { class_networkadapterconfigW, SIZEOF(col_networkadapterconfig), col_networkadapterconfig, 0, 0, NULL, + fill_networkadapterconfig }, { class_osW, SIZEOF(col_os), col_os, 0, 0, NULL, fill_os }, { class_paramsW, SIZEOF(col_param), col_param, SIZEOF(data_param), 0, (BYTE *)data_param }, + { class_physicalmediaW, SIZEOF(col_physicalmedia), col_physicalmedia, SIZEOF(data_physicalmedia), 0, (BYTE *)data_physicalmedia }, + { class_physicalmemoryW, SIZEOF(col_physicalmemory), col_physicalmemory, 0, 0, NULL, fill_physicalmemory }, { class_processW, SIZEOF(col_process), col_process, 0, 0, NULL, fill_process }, { class_processorW, SIZEOF(col_processor), col_processor, 0, 0, NULL, fill_processor }, { class_qualifiersW, SIZEOF(col_qualifier), col_qualifier, SIZEOF(data_qualifier), 0, (BYTE *)data_qualifier }, Modified: trunk/reactos/dll/win32/wbemprox/class.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/class.c…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/class.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/class.c [iso-8859-1] Sat Apr 26 17:12:58 2014 @@ -139,7 +139,7 @@ TRACE("%p, %p\n", iface, ppEnum); - return EnumWbemClassObject_create( NULL, ec->query, (void **)ppEnum ); + return EnumWbemClassObject_create( ec->query, (void **)ppEnum ); } static HRESULT WINAPI enum_class_object_Skip( @@ -177,12 +177,11 @@ enum_class_object_Skip }; -HRESULT EnumWbemClassObject_create( - IUnknown *pUnkOuter, struct query *query, LPVOID *ppObj ) +HRESULT EnumWbemClassObject_create( struct query *query, LPVOID *ppObj ) { struct enum_class_object *ec; - TRACE("%p, %p\n", pUnkOuter, ppObj); + TRACE("%p\n", ppObj); ec = heap_alloc( sizeof(*ec) ); if (!ec) return E_OUTOFMEMORY; @@ -464,17 +463,17 @@ TRACE("%p, %s, %08x, %s, %p\n", iface, debugstr_w(wszQualifierName), lFlags, debugstr_variant(pQualifierVal), pNames); - if (wszQualifierName || pQualifierVal) - { - FIXME("qualifier not supported\n"); - return E_NOTIMPL; - } - if (lFlags != WBEM_FLAG_ALWAYS) + if (lFlags != WBEM_FLAG_ALWAYS && + lFlags != WBEM_FLAG_NONSYSTEM_ONLY && + lFlags != WBEM_FLAG_SYSTEM_ONLY) { FIXME("flags %08x not supported\n", lFlags); return E_NOTIMPL; } - return get_properties( ec->query->view, pNames ); + if (wszQualifierName || pQualifierVal) + FIXME("qualifier not supported\n"); + + return get_properties( ec->query->view, lFlags, pNames ); } static HRESULT WINAPI class_object_BeginEnumeration( @@ -538,7 +537,7 @@ TRACE("%p, %s, %p\n", iface, debugstr_w(wszProperty), ppQualSet); - return WbemQualifierSet_create( NULL, co->name, wszProperty, (void **)ppQualSet ); + return WbemQualifierSet_create( co->name, wszProperty, (void **)ppQualSet ); } static HRESULT WINAPI class_object_Clone( Modified: trunk/reactos/dll/win32/wbemprox/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/main.c?…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/main.c [iso-8859-1] Sat Apr 26 17:12:58 2014 @@ -24,7 +24,7 @@ static HINSTANCE instance; -typedef HRESULT (*fnCreateInstance)( IUnknown *pUnkOuter, LPVOID *ppObj ); +typedef HRESULT (*fnCreateInstance)( LPVOID *ppObj ); typedef struct { @@ -74,14 +74,11 @@ if (pOuter) return CLASS_E_NOAGGREGATION; - r = This->pfnCreateInstance( pOuter, (LPVOID *)&punk ); + r = This->pfnCreateInstance( (LPVOID *)&punk ); if (FAILED(r)) return r; r = IUnknown_QueryInterface( punk, riid, ppobj ); - if (FAILED(r)) - return r; - IUnknown_Release( punk ); return r; } Modified: trunk/reactos/dll/win32/wbemprox/qualifier.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/qualifi…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/qualifier.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/qualifier.c [iso-8859-1] Sat Apr 26 17:12:58 2014 @@ -234,12 +234,11 @@ qualifier_set_EndEnumeration }; -HRESULT WbemQualifierSet_create( - IUnknown *pUnkOuter, const WCHAR *class, const WCHAR *member, LPVOID *ppObj ) +HRESULT WbemQualifierSet_create( const WCHAR *class, const WCHAR *member, LPVOID *ppObj ) { struct qualifier_set *set; - TRACE("%p, %p\n", pUnkOuter, ppObj); + TRACE("%p\n", ppObj); if (!(set = heap_alloc( sizeof(*set) ))) return E_OUTOFMEMORY; Modified: trunk/reactos/dll/win32/wbemprox/query.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/query.c…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/query.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/query.c [iso-8859-1] Sat Apr 26 17:12:58 2014 @@ -102,15 +102,93 @@ (expr->left->type == EXPR_SVAL && expr->right->type == EXPR_PROPVAL)); } +static inline BOOL is_boolcmp( const struct complex_expr *expr, UINT ltype, UINT rtype ) +{ + if (ltype == CIM_BOOLEAN && expr->left->type == EXPR_PROPVAL && + (expr->right->type == EXPR_SVAL || expr->right->type == EXPR_BVAL)) return TRUE; + else if (rtype == CIM_BOOLEAN && expr->right->type == EXPR_PROPVAL && + (expr->left->type == EXPR_SVAL || expr->left->type == EXPR_BVAL)) return TRUE; + return FALSE; +} + +static HRESULT eval_boolcmp( UINT op, LONGLONG lval, LONGLONG rval, UINT ltype, UINT rtype, LONGLONG *val ) +{ + static const WCHAR trueW[] = {'T','r','u','e',0}; + + if (ltype == CIM_STRING) lval = !strcmpiW( (const WCHAR *)(INT_PTR)lval, trueW ) ? -1 : 0; + else if (rtype == CIM_STRING) rval = !strcmpiW( (const WCHAR *)(INT_PTR)rval, trueW ) ? -1 : 0; + + switch (op) + { + case OP_EQ: + *val = (lval == rval); + break; + case OP_NE: + *val = (lval != rval); + break; + default: + ERR("unhandled operator %u\n", op); + return WBEM_E_INVALID_QUERY; + } + return S_OK; +} + +static UINT resolve_type( UINT left, UINT right ) +{ + switch (left) + { + case CIM_SINT8: + case CIM_SINT16: + case CIM_SINT32: + case CIM_SINT64: + case CIM_UINT8: + case CIM_UINT16: + case CIM_UINT32: + case CIM_UINT64: + switch (right) + { + case CIM_SINT8: + case CIM_SINT16: + case CIM_SINT32: + case CIM_SINT64: + case CIM_UINT8: + case CIM_UINT16: + case CIM_UINT32: + case CIM_UINT64: + return CIM_UINT64; + default: break; + } + break; + + case CIM_STRING: + if (right == CIM_STRING) return CIM_STRING; + break; + + case CIM_BOOLEAN: + if (right == CIM_BOOLEAN) return CIM_BOOLEAN; + break; + + default: + break; + } + return CIM_ILLEGAL; +} + static HRESULT eval_binary( const struct table *table, UINT row, const struct complex_expr *expr, - LONGLONG *val ) + LONGLONG *val, UINT *type ) { HRESULT lret, rret; LONGLONG lval, rval; - - lret = eval_cond( table, row, expr->left, &lval ); - rret = eval_cond( table, row, expr->right, &rval ); + UINT ltype, rtype; + + lret = eval_cond( table, row, expr->left, &lval, <ype ); + rret = eval_cond( table, row, expr->right, &rval, &rtype ); if (lret != S_OK || rret != S_OK) return WBEM_E_INVALID_QUERY; + + *type = resolve_type( ltype, rtype ); + + if (is_boolcmp( expr, ltype, rtype )) + return eval_boolcmp( expr->op, lval, rval, ltype, rtype, val ); if (is_strcmp( expr )) { @@ -153,13 +231,22 @@ } static HRESULT eval_unary( const struct table *table, UINT row, const struct complex_expr *expr, - LONGLONG *val ) + LONGLONG *val, UINT *type ) { HRESULT hr; UINT column; LONGLONG lval; + if (expr->op == OP_NOT) + { + hr = eval_cond( table, row, expr->left, &lval, type ); + if (hr != S_OK) + return hr; + *val = !lval; + return S_OK; + } + hr = get_column_index( table, expr->left->u.propval->name, &column ); if (hr != S_OK) return hr; @@ -180,11 +267,13 @@ ERR("unknown operator %u\n", expr->op); return WBEM_E_INVALID_QUERY; } + + *type = table->columns[column].type & CIM_TYPE_MASK; return S_OK; } static HRESULT eval_propval( const struct table *table, UINT row, const struct property *propval, - LONGLONG *val ) + LONGLONG *val, UINT *type ) { HRESULT hr; @@ -194,31 +283,44 @@ if (hr != S_OK) return hr; + *type = table->columns[column].type & CIM_TYPE_MASK; return get_value( table, row, column, val ); } -HRESULT eval_cond( const struct table *table, UINT row, const struct expr *cond, LONGLONG *val ) +HRESULT eval_cond( const struct table *table, UINT row, const struct expr *cond, LONGLONG *val, UINT *type ) { if (!cond) { *val = 1; + *type = CIM_UINT64; return S_OK; } switch (cond->type) { case EXPR_COMPLEX: - return eval_binary( table, row, &cond->u.expr, val ); + return eval_binary( table, row, &cond->u.expr, val, type ); + case EXPR_UNARY: - return eval_unary( table, row, &cond->u.expr, val ); + return eval_unary( table, row, &cond->u.expr, val, type ); + case EXPR_PROPVAL: - return eval_propval( table, row, cond->u.propval, val ); + return eval_propval( table, row, cond->u.propval, val, type ); + case EXPR_SVAL: *val = (INT_PTR)cond->u.sval; - return S_OK; + *type = CIM_STRING; + return S_OK; + case EXPR_IVAL: + *val = cond->u.ival; + *type = CIM_UINT64; + return S_OK; + case EXPR_BVAL: *val = cond->u.ival; - return S_OK; + *type = CIM_BOOLEAN; + return S_OK; + default: ERR("invalid expression type\n"); break; @@ -245,6 +347,7 @@ { HRESULT hr; LONGLONG val = 0; + UINT type; if (j >= len) { @@ -253,7 +356,7 @@ if (!(tmp = heap_realloc( view->result, len * sizeof(UINT) ))) return E_OUTOFMEMORY; view->result = tmp; } - if ((hr = eval_cond( view->table, i, view->cond, &val )) != S_OK) return hr; + if ((hr = eval_cond( view->table, i, view->cond, &val, &type )) != S_OK) return hr; if (val) view->result[j++] = i; } view->count = j; @@ -302,7 +405,7 @@ if (hr != S_OK) goto done; hr = execute_view( query->view ); if (hr != S_OK) goto done; - hr = EnumWbemClassObject_create( NULL, query, (void **)result ); + hr = EnumWbemClassObject_create( query, (void **)result ); done: release_query( query ); @@ -844,7 +947,7 @@ return set_value( view->table, row, column, val, type ); } -HRESULT get_properties( const struct view *view, SAFEARRAY **props ) +HRESULT get_properties( const struct view *view, LONG flags, SAFEARRAY **props ) { SAFEARRAY *sa; BSTR str; @@ -855,7 +958,13 @@ for (i = 0; i < view->table->num_cols; i++) { + BOOL is_system; + if (is_method( view->table, i )) continue; + + is_system = is_system_prop( view->table->columns[i].name ); + if ((flags & WBEM_FLAG_NONSYSTEM_ONLY) && is_system) continue; + else if ((flags & WBEM_FLAG_SYSTEM_ONLY) && !is_system) continue; str = SysAllocString( view->table->columns[i].name ); if (!str || SafeArrayPutElement( sa, &i, str ) != S_OK) Modified: trunk/reactos/dll/win32/wbemprox/services.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/service…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/services.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/services.c [iso-8859-1] Sat Apr 26 17:12:58 2014 @@ -268,7 +268,7 @@ if ((strcmpiW( strNamespace, cimv2W ) && strcmpiW( strNamespace, defaultW )) || ws->namespace) return WBEM_E_INVALID_NAMESPACE; - return WbemServices_create( NULL, cimv2W, (void **)ppWorkingNamespace ); + return WbemServices_create( cimv2W, (void **)ppWorkingNamespace ); } static HRESULT WINAPI wbem_services_CancelAsyncCall( @@ -802,7 +802,7 @@ hr = execute_view( query->view ); if (hr != S_OK) goto done; - hr = EnumWbemClassObject_create( NULL, query, (void **)&result ); + hr = EnumWbemClassObject_create( query, (void **)&result ); if (hr != S_OK) goto done; hr = create_class_object( query->view->table->name, result, 0, NULL, &obj ); @@ -865,11 +865,11 @@ wbem_services_ExecMethodAsync }; -HRESULT WbemServices_create( IUnknown *pUnkOuter, const WCHAR *namespace, LPVOID *ppObj ) +HRESULT WbemServices_create( const WCHAR *namespace, LPVOID *ppObj ) { struct wbem_services *ws; - TRACE("(%p,%p)\n", pUnkOuter, ppObj); + TRACE("(%p)\n", ppObj); ws = heap_alloc( sizeof(*ws) ); if (!ws) return E_OUTOFMEMORY; Modified: trunk/reactos/dll/win32/wbemprox/wbemlocator.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/wbemloc…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/wbemlocator.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/wbemlocator.c [iso-8859-1] Sat Apr 26 17:12:58 2014 @@ -180,7 +180,7 @@ if (SecurityFlags) FIXME("unsupported flags\n"); - hr = WbemServices_create( NULL, namespace, (void **)ppNamespace ); + hr = WbemServices_create( namespace, (void **)ppNamespace ); heap_free( namespace ); heap_free( server ); if (SUCCEEDED( hr )) @@ -197,11 +197,11 @@ wbem_locator_ConnectServer }; -HRESULT WbemLocator_create( IUnknown *pUnkOuter, LPVOID *ppObj ) +HRESULT WbemLocator_create( LPVOID *ppObj ) { wbem_locator *wl; - TRACE("(%p,%p)\n", pUnkOuter, ppObj); + TRACE("(%p)\n", ppObj); wl = heap_alloc( sizeof(*wl) ); if (!wl) return E_OUTOFMEMORY; Modified: trunk/reactos/dll/win32/wbemprox/wbemprox.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/wbempro…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/wbemprox.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/wbemprox.idl [iso-8859-1] Sat Apr 26 17:12:58 2014 @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ helpstring("WBEM Locator"), threading(both), Modified: trunk/reactos/dll/win32/wbemprox/wbemprox_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/wbempro…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/wbemprox_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/wbemprox_private.h [iso-8859-1] Sat Apr 26 17:12:58 2014 @@ -78,7 +78,8 @@ OP_NE = 8, OP_ISNULL = 9, OP_NOTNULL = 10, - OP_LIKE = 11 + OP_LIKE = 11, + OP_NOT = 12 }; struct expr; @@ -211,7 +212,7 @@ void clear_table( struct table * ) DECLSPEC_HIDDEN; void free_table( struct table * ) DECLSPEC_HIDDEN; UINT get_type_size( CIMTYPE ) DECLSPEC_HIDDEN; -HRESULT eval_cond( const struct table *, UINT, const struct expr *, LONGLONG * ) DECLSPEC_HIDDEN; +HRESULT eval_cond( const struct table *, UINT, const struct expr *, LONGLONG *, UINT * ) DECLSPEC_HIDDEN; HRESULT get_column_index( const struct table *, const WCHAR *, UINT * ) DECLSPEC_HIDDEN; HRESULT get_value( const struct table *, UINT, UINT, LONGLONG * ) DECLSPEC_HIDDEN; BSTR get_value_bstr( const struct table *, UINT, UINT ) DECLSPEC_HIDDEN; @@ -224,7 +225,7 @@ SAFEARRAY *to_safearray( const struct array *, CIMTYPE ) DECLSPEC_HIDDEN; VARTYPE to_vartype( CIMTYPE ) DECLSPEC_HIDDEN; void destroy_array( struct array *, CIMTYPE ) DECLSPEC_HIDDEN; -HRESULT get_properties( const struct view *, SAFEARRAY ** ) DECLSPEC_HIDDEN; +HRESULT get_properties( const struct view *, LONG, SAFEARRAY ** ) DECLSPEC_HIDDEN; HRESULT get_object( const WCHAR *, IWbemClassObject ** ) DECLSPEC_HIDDEN; BSTR get_method_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN; BSTR get_property_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN; @@ -232,12 +233,12 @@ HRESULT create_signature( const WCHAR *, const WCHAR *, enum param_direction, IWbemClassObject ** ) DECLSPEC_HIDDEN; -HRESULT WbemLocator_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN; -HRESULT WbemServices_create(IUnknown *, const WCHAR *, LPVOID *) DECLSPEC_HIDDEN; +HRESULT WbemLocator_create(LPVOID *) DECLSPEC_HIDDEN; +HRESULT WbemServices_create(const WCHAR *, LPVOID *) DECLSPEC_HIDDEN; HRESULT create_class_object(const WCHAR *, IEnumWbemClassObject *, UINT, struct record *, IWbemClassObject **) DECLSPEC_HIDDEN; -HRESULT EnumWbemClassObject_create(IUnknown *, struct query *, LPVOID *) DECLSPEC_HIDDEN; -HRESULT WbemQualifierSet_create(IUnknown *, const WCHAR *, const WCHAR *, LPVOID *) DECLSPEC_HIDDEN; +HRESULT EnumWbemClassObject_create(struct query *, LPVOID *) DECLSPEC_HIDDEN; +HRESULT WbemQualifierSet_create(const WCHAR *, const WCHAR *, LPVOID *) DECLSPEC_HIDDEN; HRESULT process_get_owner(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN; HRESULT reg_enum_key(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/wbemprox/wql.tab.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/wql.tab…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/wql.tab.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/wql.tab.c [iso-8859-1] Sat Apr 26 17:12:58 2014 @@ -560,16 +560,16 @@ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 9 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 67 +#define YYLAST 68 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 32 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 10 /* YYNRULES -- Number of rules. */ -#define YYNRULES 35 +#define YYNRULES 36 /* YYNRULES -- Number of states. */ -#define YYNSTATES 65 +#define YYNSTATES 67 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -618,9 +618,9 @@ static const yytype_uint8 yyprhs[] = { 0, 0, 3, 7, 12, 19, 21, 25, 27, 31, - 33, 35, 37, 41, 45, 49, 53, 57, 61, 65, - 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, - 110, 112, 114, 116, 118, 120 + 33, 35, 37, 41, 45, 49, 52, 56, 60, 64, + 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, + 108, 113, 115, 117, 119, 121, 123 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -630,15 +630,15 @@ 36, -1, 3, 34, 4, 36, 15, 38, -1, 35, -1, 35, 6, 34, -1, 5, -1, 36, 7, 36, -1, 36, -1, 21, -1, 14, -1, 9, 38, 10, - -1, 38, 23, 38, -1, 38, 22, 38, -1, 40, - 31, 41, -1, 40, 28, 41, -1, 40, 29, 41, - -1, 40, 27, 41, -1, 40, 26, 41, -1, 40, - 30, 41, -1, 41, 31, 40, -1, 41, 28, 40, - -1, 41, 29, 40, -1, 41, 27, 40, -1, 41, - 26, 40, -1, 41, 30, 40, -1, 40, 25, 39, - -1, 40, 8, 11, -1, 40, 8, 24, 11, -1, - 20, -1, 35, -1, 37, -1, 20, -1, 13, -1, - 12, -1 + -1, 38, 23, 38, -1, 38, 22, 38, -1, 24, + 38, -1, 40, 31, 41, -1, 40, 28, 41, -1, + 40, 29, 41, -1, 40, 27, 41, -1, 40, 26, + 41, -1, 40, 30, 41, -1, 41, 31, 40, -1, + 41, 28, 40, -1, 41, 29, 40, -1, 41, 27, + 40, -1, 41, 26, 40, -1, 41, 30, 40, -1, + 40, 25, 39, -1, 40, 8, 11, -1, 40, 8, + 24, 11, -1, 20, -1, 35, -1, 37, -1, 20, + -1, 13, -1, 12, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -647,7 +647,7 @@ 0, 221, 221, 233, 245, 260, 261, 265, 272, 278, 287, 296, 303, 309, 315, 321, 327, 333, 339, 345, 351, 357, 363, 369, 375, 381, 387, 393, 399, 405, - 414, 423, 432, 438, 444, 450 + 411, 420, 429, 438, 444, 450, 456 }; #endif @@ -684,16 +684,16 @@ 0, 32, 33, 33, 33, 34, 34, 34, 35, 35, 36, 37, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 39, 40, 41, 41, 41, 41 + 38, 39, 40, 41, 41, 41, 41 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 3, 4, 6, 1, 3, 1, 3, 1, - 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, - 1, 1, 1, 1, 1, 1 + 1, 1, 3, 3, 3, 2, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 4, 1, 1, 1, 1, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. @@ -702,38 +702,38 @@ static const yytype_uint8 yydefact[] = { 0, 0, 0, 0, 7, 10, 0, 5, 9, 1, - 2, 0, 0, 0, 3, 6, 8, 0, 0, 35, - 34, 11, 33, 31, 32, 4, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 12, 14, 13, 28, 0, - 30, 27, 19, 18, 16, 17, 20, 15, 25, 24, - 22, 23, 26, 21, 29 + 2, 0, 0, 0, 3, 6, 8, 0, 0, 36, + 35, 11, 34, 0, 32, 33, 4, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 12, 14, 13, + 29, 0, 31, 28, 20, 19, 17, 18, 21, 16, + 26, 25, 23, 24, 27, 22, 30 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 2, 6, 23, 8, 24, 25, 51, 26, 27 + -1, 2, 6, 24, 8, 25, 26, 53, 27, 28 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -20 +#define YYPACT_NINF -18 static const yytype_int8 yypact[] = { - 2, 3, 6, -10, -20, -20, 24, 31, 33, -20, - -20, -10, 4, -10, 26, -20, -20, 18, 18, -20, - -20, -20, -20, -20, -20, -19, -8, 20, -9, 18, - 18, 5, 23, 22, 22, 22, 22, 22, 22, -10, - -10, -10, -10, -10, -10, -20, 41, -20, -20, 54, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20 + 7, 3, 12, -5, -18, -18, 31, 30, 21, -18, + -18, -5, 4, -5, 28, -18, -18, 17, 17, -18, + -18, -18, -18, 17, -18, -18, 11, -8, 24, 22, + -18, 17, 17, 16, 26, -9, -9, -9, -9, -9, + -9, -5, -5, -5, -5, -5, -5, -18, 19, -18, + -18, 37, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -20, -20, 55, 14, -1, -20, 15, -20, 13, 25 + -18, -18, 56, 1, 36, -18, -17, -18, 15, 27 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -742,30 +742,30 @@ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 31, 45, 10, 29, 30, 1, 9, 3, 4, 4, - 14, 5, 16, 29, 30, 7, 48, 32, 33, 34, - 35, 36, 37, 38, 5, 5, 7, 18, 11, 49, - 19, 20, 21, 28, 19, 20, 21, 12, 22, 5, - 13, 17, 22, 50, 46, 47, 39, 40, 41, 42, - 43, 44, 58, 59, 60, 61, 62, 63, 52, 53, - 54, 55, 56, 57, 30, 64, 0, 15 + 33, 29, 7, 19, 20, 21, 30, 3, 4, 4, + 1, 22, 9, 7, 48, 49, 5, 34, 35, 36, + 37, 38, 39, 40, 5, 5, 18, 50, 13, 19, + 20, 21, 47, 31, 32, 11, 12, 22, 5, 10, + 51, 23, 32, 17, 31, 32, 52, 14, 66, 16, + 41, 42, 43, 44, 45, 46, 60, 61, 62, 63, + 64, 65, 54, 55, 56, 57, 58, 59, 15 }; #define yypact_value_is_default(yystate) \ - ((yystate) == (-20)) + ((yystate) == (-18)) #define yytable_value_is_error(yytable_value) \ YYID (0) -static const yytype_int8 yycheck[] = -{ - 8, 10, 3, 22, 23, 3, 0, 4, 5, 5, - 11, 21, 13, 22, 23, 1, 11, 25, 26, 27, - 28, 29, 30, 31, 21, 21, 12, 9, 4, 24, - 12, 13, 14, 18, 12, 13, 14, 6, 20, 21, - 7, 15, 20, 20, 29, 30, 26, 27, 28, 29, - 30, 31, 39, 40, 41, 42, 43, 44, 33, 34, - 35, 36, 37, 38, 23, 11, -1, 12 +static const yytype_uint8 yycheck[] = +{ + 8, 18, 1, 12, 13, 14, 23, 4, 5, 5, + 3, 20, 0, 12, 31, 32, 21, 25, 26, 27, + 28, 29, 30, 31, 21, 21, 9, 11, 7, 12, + 13, 14, 10, 22, 23, 4, 6, 20, 21, 3, + 24, 24, 23, 15, 22, 23, 20, 11, 11, 13, + 26, 27, 28, 29, 30, 31, 41, 42, 43, 44, + 45, 46, 35, 36, 37, 38, 39, 40, 12 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -774,11 +774,11 @@ { 0, 3, 33, 4, 5, 21, 34, 35, 36, 0, 36, 4, 6, 7, 36, 34, 36, 15, 9, 12, - 13, 14, 20, 35, 37, 38, 40, 41, 38, 22, - 23, 8, 25, 26, 27, 28, 29, 30, 31, 26, - 27, 28, 29, 30, 31, 10, 38, 38, 11, 24, - 20, 39, 41, 41, 41, 41, 41, 41, 40, 40, - 40, 40, 40, 40, 11 + 13, 14, 20, 24, 35, 37, 38, 40, 41, 38, + 38, 22, 23, 8, 25, 26, 27, 28, 29, 30, + 31, 26, 27, 28, 29, 30, 31, 10, 38, 38, + 11, 24, 20, 39, 41, 41, 41, 41, 41, 41, + 40, 40, 40, 40, 40, 40, 11 }; #define yyerrok (yyerrstatus = 0) @@ -1766,16 +1766,27 @@ /* Line 1806 of yacc.c */ #line 322 "wql.y" { + (yyval.expr) = expr_unary( ctx, (yyvsp[(2) - (2)].expr), OP_NOT ); + if (!(yyval.expr)) + YYABORT; + } + break; + + case 16: + +/* Line 1806 of yacc.c */ +#line 328 "wql.y" + { (yyval.expr) = expr_complex( ctx, (yyvsp[(1) - (3)].expr), OP_EQ, (yyvsp[(3) - (3)].expr) ); if (!(yyval.expr)) YYABORT; } break; - case 16: - -/* Line 1806 of yacc.c */ -#line 328 "wql.y" + case 17: + +/* Line 1806 of yacc.c */ +#line 334 "wql.y" { (yyval.expr) = expr_complex( ctx, (yyvsp[(1) - (3)].expr), OP_GT, (yyvsp[(3) - (3)].expr) ); if (!(yyval.expr)) @@ -1783,10 +1794,10 @@ } break; - case 17: - -/* Line 1806 of yacc.c */ -#line 334 "wql.y" + case 18: + +/* Line 1806 of yacc.c */ +#line 340 "wql.y" { (yyval.expr) = expr_complex( ctx, (yyvsp[(1) - (3)].expr), OP_LT, (yyvsp[(3) - (3)].expr) ); if (!(yyval.expr)) @@ -1794,10 +1805,10 @@ } break; - case 18: - -/* Line 1806 of yacc.c */ -#line 340 "wql.y" + case 19: + +/* Line 1806 of yacc.c */ +#line 346 "wql.y" { (yyval.expr) = expr_complex( ctx, (yyvsp[(1) - (3)].expr), OP_LE, (yyvsp[(3) - (3)].expr) ); if (!(yyval.expr)) @@ -1805,10 +1816,10 @@ } break; - case 19: - -/* Line 1806 of yacc.c */ -#line 346 "wql.y" + case 20: + +/* Line 1806 of yacc.c */ +#line 352 "wql.y" { (yyval.expr) = expr_complex( ctx, (yyvsp[(1) - (3)].expr), OP_GE, (yyvsp[(3) - (3)].expr) ); if (!(yyval.expr)) @@ -1816,10 +1827,10 @@ } break; - case 20: - -/* Line 1806 of yacc.c */ -#line 352 "wql.y" + case 21: + +/* Line 1806 of yacc.c */ +#line 358 "wql.y" { (yyval.expr) = expr_complex( ctx, (yyvsp[(1) - (3)].expr), OP_NE, (yyvsp[(3) - (3)].expr) ); if (!(yyval.expr)) @@ -1827,10 +1838,10 @@ } break; - case 21: - -/* Line 1806 of yacc.c */ -#line 358 "wql.y" + case 22: + +/* Line 1806 of yacc.c */ +#line 364 "wql.y" { (yyval.expr) = expr_complex( ctx, (yyvsp[(1) - (3)].expr), OP_EQ, (yyvsp[(3) - (3)].expr) ); if (!(yyval.expr)) @@ -1838,10 +1849,10 @@ } break; - case 22: - -/* Line 1806 of yacc.c */ -#line 364 "wql.y" + case 23: + +/* Line 1806 of yacc.c */ +#line 370 "wql.y" { (yyval.expr) = expr_complex( ctx, (yyvsp[(1) - (3)].expr), OP_GT, (yyvsp[(3) - (3)].expr) ); if (!(yyval.expr)) @@ -1849,10 +1860,10 @@ } break; - case 23: - -/* Line 1806 of yacc.c */ -#line 370 "wql.y" + case 24: + +/* Line 1806 of yacc.c */ +#line 376 "wql.y" { (yyval.expr) = expr_complex( ctx, (yyvsp[(1) - (3)].expr), OP_LT, (yyvsp[(3) - (3)].expr) ); if (!(yyval.expr)) @@ -1860,10 +1871,10 @@ } break; - case 24: - -/* Line 1806 of yacc.c */ -#line 376 "wql.y" + case 25: + +/* Line 1806 of yacc.c */ +#line 382 "wql.y" { (yyval.expr) = expr_complex( ctx, (yyvsp[(1) - (3)].expr), OP_LE, (yyvsp[(3) - (3)].expr) ); if (!(yyval.expr)) @@ -1871,10 +1882,10 @@ } break; - case 25: - -/* Line 1806 of yacc.c */ -#line 382 "wql.y" + case 26: + +/* Line 1806 of yacc.c */ +#line 388 "wql.y" { (yyval.expr) = expr_complex( ctx, (yyvsp[(1) - (3)].expr), OP_GE, (yyvsp[(3) - (3)].expr) ); if (!(yyval.expr)) @@ -1882,10 +1893,10 @@ } break; - case 26: - -/* Line 1806 of yacc.c */ -#line 388 "wql.y" + case 27: + +/* Line 1806 of yacc.c */ +#line 394 "wql.y" { (yyval.expr) = expr_complex( ctx, (yyvsp[(1) - (3)].expr), OP_NE, (yyvsp[(3) - (3)].expr) ); if (!(yyval.expr)) @@ -1893,10 +1904,10 @@ } break; - case 27: - -/* Line 1806 of yacc.c */ -#line 394 "wql.y" + case 28: + +/* Line 1806 of yacc.c */ +#line 400 "wql.y" { (yyval.expr) = expr_complex( ctx, (yyvsp[(1) - (3)].expr), OP_LIKE, (yyvsp[(3) - (3)].expr) ); if (!(yyval.expr)) @@ -1904,10 +1915,10 @@ } break; - case 28: - -/* Line 1806 of yacc.c */ -#line 400 "wql.y" + case 29: + +/* Line 1806 of yacc.c */ +#line 406 "wql.y" { (yyval.expr) = expr_unary( ctx, (yyvsp[(1) - (3)].expr), OP_ISNULL ); if (!(yyval.expr)) @@ -1915,10 +1926,10 @@ } break; - case 29: - -/* Line 1806 of yacc.c */ -#line 406 "wql.y" + case 30: + +/* Line 1806 of yacc.c */ +#line 412 "wql.y" { (yyval.expr) = expr_unary( ctx, (yyvsp[(1) - (4)].expr), OP_NOTNULL ); if (!(yyval.expr)) @@ -1926,10 +1937,10 @@ } break; - case 30: - -/* Line 1806 of yacc.c */ -#line 415 "wql.y" + case 31: + +/* Line 1806 of yacc.c */ +#line 421 "wql.y" { (yyval.expr) = expr_sval( ctx, &(yyvsp[(1) - (1)].str) ); if (!(yyval.expr)) @@ -1937,10 +1948,10 @@ } break; - case 31: - -/* Line 1806 of yacc.c */ -#line 424 "wql.y" + case 32: + +/* Line 1806 of yacc.c */ +#line 430 "wql.y" { (yyval.expr) = expr_propval( ctx, (yyvsp[(1) - (1)].proplist) ); if (!(yyval.expr)) @@ -1948,10 +1959,10 @@ } break; - case 32: - -/* Line 1806 of yacc.c */ -#line 433 "wql.y" + case 33: + +/* Line 1806 of yacc.c */ +#line 439 "wql.y" { (yyval.expr) = expr_ival( ctx, (yyvsp[(1) - (1)].integer) ); if (!(yyval.expr)) @@ -1959,10 +1970,10 @@ } break; - case 33: - -/* Line 1806 of yacc.c */ -#line 439 "wql.y" + case 34: + +/* Line 1806 of yacc.c */ +#line 445 "wql.y" { (yyval.expr) = expr_sval( ctx, &(yyvsp[(1) - (1)].str) ); if (!(yyval.expr)) @@ -1970,10 +1981,10 @@ } break; - case 34: - -/* Line 1806 of yacc.c */ -#line 445 "wql.y" + case 35: + +/* Line 1806 of yacc.c */ +#line 451 "wql.y" { (yyval.expr) = expr_bval( ctx, -1 ); if (!(yyval.expr)) @@ -1981,10 +1992,10 @@ } break; - case 35: - -/* Line 1806 of yacc.c */ -#line 451 "wql.y" + case 36: + +/* Line 1806 of yacc.c */ +#line 457 "wql.y" { (yyval.expr) = expr_bval( ctx, 0 ); if (!(yyval.expr)) @@ -1995,7 +2006,7 @@ /* Line 1806 of yacc.c */ -#line 2011 "wql.tab.c" +#line 2022 "wql.tab.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2226,7 +2237,7 @@ /* Line 2067 of yacc.c */ -#line 458 "wql.y" +#line 464 "wql.y" HRESULT parse_query( const WCHAR *str, struct view **view, struct list *mem ) Modified: trunk/reactos/dll/win32/wbemprox/wql.y URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/wql.y?r…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/wql.y [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/wql.y [iso-8859-1] Sat Apr 26 17:12:58 2014 @@ -315,6 +315,12 @@ | expr TK_OR expr { $$ = expr_complex( ctx, $1, OP_OR, $3 ); + if (!$$) + YYABORT; + } + | TK_NOT expr + { + $$ = expr_unary( ctx, $2, OP_NOT ); if (!$$) YYABORT; } Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Apr 26 17:12:58 2014 @@ -201,7 +201,7 @@ reactos/dll/win32/vbscript # Synced to Wine-1.7.17 reactos/dll/win32/version # Synced to Wine-1.7.1 reactos/dll/win32/wbemdisp # Synced to Wine-1.7.17 -reactos/dll/win32/wbemprox # Synced to Wine-1.7.2 +reactos/dll/win32/wbemprox # Synced to Wine-1.7.17 reactos/dll/win32/wer # Autosync reactos/dll/win32/windowscodecs # Synced to Wine-1.7.17 reactos/dll/win32/windowscodecsext # Synced to Wine-1.7.1
10 years, 8 months
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
50
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
Results per page:
10
25
50
100
200