winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2018
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
638 discussions
Start a n
N
ew thread
Huw Davies : gdi32: Allocate the bitmap bits during CreateBitmapIndirect() to catch out-of-memory errors.
by Alexandre Julliard
23 Jan '18
23 Jan '18
Module: wine Branch: master Commit: 82973cfbd1e1ca04b73d0323d553043fff0db003 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=82973cfbd1e1ca04b73d0323…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Jan 23 09:44:23 2018 +0000 gdi32: Allocate the bitmap bits during CreateBitmapIndirect() to catch out-of-memory errors. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/bitmap.c | 20 ++++++++++++++++---- dlls/gdi32/dibdrv/dc.c | 7 ------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index c16793d..0ae5b20 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -145,6 +145,8 @@ HBITMAP WINAPI CreateBitmapIndirect( const BITMAP *bmp ) BITMAP bm; BITMAPOBJ *bmpobj; HBITMAP hbitmap; + INT dib_stride; + SIZE_T size; if (!bmp || bmp->bmType) { @@ -194,10 +196,13 @@ HBITMAP WINAPI CreateBitmapIndirect( const BITMAP *bmp ) /* Windows ignores the provided bm.bmWidthBytes */ bm.bmWidthBytes = get_bitmap_stride( bm.bmWidth, bm.bmBitsPixel ); - /* XP doesn't allow creating bitmaps larger than 128 MB */ - if (bm.bmHeight > 128 * 1024 * 1024 / bm.bmWidthBytes) + + dib_stride = get_dib_stride( bm.bmWidth, bm.bmBitsPixel ); + size = dib_stride * bm.bmHeight; + /* Check for overflow (dib_stride itself must be ok because of the constraint on bm.bmWidth above). */ + if (dib_stride != size / bm.bmHeight) { - SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + SetLastError( ERROR_INVALID_PARAMETER ); return 0; } @@ -209,10 +214,17 @@ HBITMAP WINAPI CreateBitmapIndirect( const BITMAP *bmp ) } bmpobj->dib.dsBm = bm; - bmpobj->dib.dsBm.bmBits = NULL; + bmpobj->dib.dsBm.bmBits = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size ); + if (!bmpobj->dib.dsBm.bmBits) + { + HeapFree( GetProcessHeap(), 0, bmpobj ); + SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + return 0; + } if (!(hbitmap = alloc_gdi_handle( bmpobj, OBJ_BITMAP, &bitmap_funcs ))) { + HeapFree( GetProcessHeap(), 0, bmpobj->dib.dsBm.bmBits ); HeapFree( GetProcessHeap(), 0, bmpobj ); return 0; } diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index aee305f..2447093 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -168,13 +168,6 @@ BOOL init_dib_info_from_bitmapobj(dib_info *dib, BITMAPOBJ *bmp) BITMAPINFO info; get_ddb_bitmapinfo( bmp, &info ); - if (!bmp->dib.dsBm.bmBits) - { - int width_bytes = get_dib_stride( bmp->dib.dsBm.bmWidth, bmp->dib.dsBm.bmBitsPixel ); - bmp->dib.dsBm.bmBits = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, - bmp->dib.dsBm.bmHeight * width_bytes ); - if (!bmp->dib.dsBm.bmBits) return FALSE; - } init_dib_info_from_bitmapinfo( dib, &info, bmp->dib.dsBm.bmBits ); } else init_dib_info( dib, &bmp->dib.dsBmih, bmp->dib.dsBm.bmWidthBytes,
1
0
0
0
Sergio Gómez Del Real : ole32: Prevent adding additional cache entries to static class caches.
by Alexandre Julliard
23 Jan '18
23 Jan '18
Module: wine Branch: master Commit: 3bf32809b0dae5973d2185795044809c5af33550 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3bf32809b0dae5973d218579…
Author: Sergio Gómez Del Real <sdelreal(a)codeweavers.com> Date: Tue Jan 23 08:47:24 2018 +0000 ole32: Prevent adding additional cache entries to static class caches. Signed-off-by: Sergio Gómez Del Real <sdelreal(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/datacache.c | 2 ++ dlls/ole32/tests/ole2.c | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index 8c5df32..60ddd38 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -2453,6 +2453,8 @@ static HRESULT WINAPI DataCache_Cache( return CACHE_S_SAMECACHE; } + if (This->clsid_static) return DV_E_FORMATETC; + hr = DataCache_CreateEntry(This, &fmt_cpy, advf, FALSE, &cache_entry); if (SUCCEEDED(hr)) diff --git a/dlls/ole32/tests/ole2.c b/dlls/ole32/tests/ole2.c index 7fcb1aa..d83ca00 100644 --- a/dlls/ole32/tests/ole2.c +++ b/dlls/ole32/tests/ole2.c @@ -2426,6 +2426,29 @@ static void test_data_cache_cache(void) IDataObject_Release( data ); IOleCache2_Release( cache ); + + /* tests for a static class cache */ + hr = CreateDataCache( NULL, &CLSID_Picture_Dib, &IID_IOleCache2, (void **)&cache ); + + fmt.cfFormat = CF_DIB; + fmt.dwAspect = DVASPECT_CONTENT; + fmt.tymed = TYMED_HGLOBAL; + hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); + ok( hr == CACHE_S_SAMECACHE, "got %08x\n", hr ); + + /* aspect other than DVASPECT_CONTENT should fail */ + fmt.dwAspect = DVASPECT_THUMBNAIL; + hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); + ok( FAILED(hr), "got %08x\n", hr ); + + /* try caching another clip format */ + fmt.dwAspect = DVASPECT_CONTENT; + fmt.cfFormat = CF_METAFILEPICT; + fmt.tymed = TYMED_MFPICT; + hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); + ok( FAILED(hr), "got %08x\n", hr ); + + IOleCache2_Release( cache ); } /* The CLSID_Picture_ classes automatically create appropriate cache entries */
1
0
0
0
Huw Davies : ole32: Explicitly enumerate the presentation streams rather than using EnumElements.
by Alexandre Julliard
23 Jan '18
23 Jan '18
Module: wine Branch: master Commit: c4a595e316f61bcb3ab08a1273de84b372b81c69 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c4a595e316f61bcb3ab08a12…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Jan 23 08:47:23 2018 +0000 ole32: Explicitly enumerate the presentation streams rather than using EnumElements. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/datacache.c | 75 +++++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 47 deletions(-) diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index 685abdb..8c5df32 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -446,23 +446,6 @@ static void DataCache_FireOnViewChange( } } -/* Helper for DataCacheEntry_OpenPresStream */ -static BOOL DataCache_IsPresentationStream(const STATSTG *elem) -{ - /* The presentation streams have names of the form "\002OlePresXXX", - * where XXX goes from 000 to 999. */ - static const WCHAR OlePres[] = { 2,'O','l','e','P','r','e','s' }; - - LPCWSTR name = elem->pwcsName; - - return (elem->type == STGTY_STREAM) - && (strlenW(name) == 11) - && (strncmpW(name, OlePres, 8) == 0) - && (name[8] >= '0') && (name[8] <= '9') - && (name[9] >= '0') && (name[9] <= '9') - && (name[10] >= '0') && (name[10] <= '9'); -} - static HRESULT read_clipformat(IStream *stream, CLIPFORMAT *clipformat) { DWORD length; @@ -583,6 +566,15 @@ static HRESULT DataCacheEntry_OpenPresStream(DataCacheEntry *cache_entry, IStrea return hr; } +static HRESULT open_pres_stream( IStorage *stg, int stream_number, IStream **stm ) +{ + WCHAR name[] = {2,'O','l','e','P','r','e','s', + '0' + (stream_number / 100) % 10, + '0' + (stream_number / 10) % 10, + '0' + stream_number % 10, 0}; + + return IStorage_OpenStream( stg, name, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, stm ); +} static HRESULT load_mf_pict( DataCacheEntry *cache_entry, IStream *stm ) { @@ -1734,49 +1726,38 @@ static HRESULT add_cache_entry( DataCache *This, const FORMATETC *fmt, DWORD adv return hr; } -static HRESULT parse_pres_streams( DataCache *This, IStorage *stg ) +static HRESULT parse_pres_streams( DataCache *cache, IStorage *stg ) { HRESULT hr; - IEnumSTATSTG *stat_enum; - STATSTG stat; IStream *stm; PresentationDataHeader header; ULONG actual_read; CLIPFORMAT clipformat; FORMATETC fmtetc; + int stream_number = 0; - hr = IStorage_EnumElements( stg, 0, NULL, 0, &stat_enum ); - if (FAILED( hr )) return hr; - - while ((hr = IEnumSTATSTG_Next( stat_enum, 1, &stat, NULL )) == S_OK) + do { - if (DataCache_IsPresentationStream( &stat )) - { - hr = IStorage_OpenStream( stg, stat.pwcsName, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, - 0, &stm ); - if (SUCCEEDED( hr )) - { - hr = read_clipformat( stm, &clipformat ); + hr = open_pres_stream( stg, stream_number, &stm ); + if (FAILED(hr)) break; - if (hr == S_OK) - hr = IStream_Read( stm, &header, sizeof(header), &actual_read ); + hr = read_clipformat( stm, &clipformat ); - if (hr == S_OK && actual_read == sizeof(header)) - { - fmtetc.cfFormat = clipformat; - fmtetc.ptd = NULL; /* FIXME */ - fmtetc.dwAspect = header.dvAspect; - fmtetc.lindex = header.lindex; - fmtetc.tymed = tymed_from_cf( clipformat ); + if (hr == S_OK) hr = IStream_Read( stm, &header, sizeof(header), &actual_read ); - add_cache_entry( This, &fmtetc, header.advf, stm, pres_stream ); - } - IStream_Release( stm ); - } + if (hr == S_OK && actual_read == sizeof(header)) + { + fmtetc.cfFormat = clipformat; + fmtetc.ptd = NULL; /* FIXME */ + fmtetc.dwAspect = header.dvAspect; + fmtetc.lindex = header.lindex; + fmtetc.tymed = tymed_from_cf( clipformat ); + + add_cache_entry( cache, &fmtetc, header.advf, stm, pres_stream ); } - CoTaskMemFree( stat.pwcsName ); - } - IEnumSTATSTG_Release( stat_enum ); + IStream_Release( stm ); + stream_number++; + } while (hr == S_OK); return S_OK; }
1
0
0
0
Huw Davies : ole32: Only load the contents stream for the static clsids.
by Alexandre Julliard
23 Jan '18
23 Jan '18
Module: wine Branch: master Commit: ce66c8d147f39af529a8a150dbea24e049d3f3cd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ce66c8d147f39af529a8a150…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Jan 23 08:47:22 2018 +0000 ole32: Only load the contents stream for the static clsids. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/datacache.c | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index e2ff928..685abdb 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -162,6 +162,9 @@ struct DataCache IAdviseSink *sinkInterface; CLSID clsid; + /* Is the clsid one of the CLSID_Picture classes */ + BOOL clsid_static; + IStorage *presentationStorage; /* list of cache entries */ @@ -1307,9 +1310,13 @@ static HRESULT create_automatic_entry(DataCache *cache, const CLSID *clsid) while (ptr->clsid) { if (IsEqualCLSID( clsid, ptr->clsid )) + { + cache->clsid_static = TRUE; return DataCache_CreateEntry( cache, &ptr->fmt, 0, TRUE, NULL ); + } ptr++; } + cache->clsid_static = FALSE; return S_OK; } @@ -1776,24 +1783,33 @@ static HRESULT parse_pres_streams( DataCache *This, IStorage *stg ) static const FORMATETC static_dib_fmt = { CF_DIB, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; -static HRESULT parse_contents_stream( DataCache *This, IStorage *stg, IStream *stm ) +static HRESULT parse_contents_stream( DataCache *This, IStorage *stg ) { HRESULT hr; STATSTG stat; const FORMATETC *fmt; + IStream *stm; - hr = IStorage_Stat( stg, &stat, STATFLAG_NONAME ); + hr = IStorage_OpenStream( stg, CONTENTS, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stm ); if (FAILED( hr )) return hr; + hr = IStorage_Stat( stg, &stat, STATFLAG_NONAME ); + if (FAILED( hr )) goto done; + if (IsEqualCLSID( &stat.clsid, &CLSID_Picture_Dib )) fmt = &static_dib_fmt; else { FIXME("unsupported format %s\n", debugstr_guid( &stat.clsid )); - return E_FAIL; + hr = E_FAIL; + goto done; } - return add_cache_entry( This, fmt, 0, stm, contents_stream ); + hr = add_cache_entry( This, fmt, 0, stm, contents_stream ); + +done: + IStream_Release( stm ); + return hr; } /************************************************************************ @@ -1804,42 +1820,38 @@ static HRESULT parse_contents_stream( DataCache *This, IStorage *stg, IStream *s * and it will load the presentation information when the * IDataObject_GetData or IViewObject2_Draw methods are called. */ -static HRESULT WINAPI DataCache_Load( IPersistStorage *iface, IStorage *pStg ) +static HRESULT WINAPI DataCache_Load( IPersistStorage *iface, IStorage *stg ) { DataCache *This = impl_from_IPersistStorage(iface); HRESULT hr; - IStream *stm; CLSID clsid; DataCacheEntry *entry, *cursor2; - TRACE("(%p, %p)\n", iface, pStg); + TRACE("(%p, %p)\n", iface, stg); IPersistStorage_HandsOffStorage( iface ); LIST_FOR_EACH_ENTRY_SAFE( entry, cursor2, &This->cache_list, DataCacheEntry, entry ) DataCacheEntry_Destroy( This, entry ); - ReadClassStg( pStg, &clsid ); + ReadClassStg( stg, &clsid ); hr = create_automatic_entry( This, &clsid ); if (FAILED( hr )) return hr; This->clsid = clsid; - hr = IStorage_OpenStream( pStg, CONTENTS, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, - 0, &stm ); - if (SUCCEEDED( hr )) + if (This->clsid_static) { - hr = parse_contents_stream( This, pStg, stm ); - IStream_Release( stm ); + hr = parse_contents_stream( This, stg ); + if (FAILED(hr)) hr = parse_pres_streams( This, stg ); } - - if (FAILED(hr)) - hr = parse_pres_streams( This, pStg ); + else + hr = parse_pres_streams( This, stg ); if (SUCCEEDED( hr )) { This->dirty = FALSE; - This->presentationStorage = pStg; + This->presentationStorage = stg; IStorage_AddRef( This->presentationStorage ); } @@ -2978,6 +2990,7 @@ static DataCache* DataCache_Construct( newObject->sinkAdviseFlag = 0; newObject->sinkInterface = 0; newObject->clsid = CLSID_NULL; + newObject->clsid_static = FALSE; newObject->presentationStorage = NULL; list_init(&newObject->cache_list); newObject->last_cache_id = 2;
1
0
0
0
Hans Leidekker : iphlpapi: Implement if_indextoname.
by Alexandre Julliard
23 Jan '18
23 Jan '18
Module: wine Branch: master Commit: e3fe10719e111c1c8f1a3e12df8bf35c37376736 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e3fe10719e111c1c8f1a3e12…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Jan 23 09:43:50 2018 +0100 iphlpapi: Implement if_indextoname. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/iphlpapi/iphlpapi.spec | 2 +- dlls/iphlpapi/iphlpapi_main.c | 10 ++++++++++ dlls/iphlpapi/tests/iphlpapi.c | 45 +++++++++++++++++++++++++++++------------- include/netioapi.h | 2 ++ 4 files changed, 44 insertions(+), 15 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi.spec b/dlls/iphlpapi/iphlpapi.spec index fee9960..b6c9aef 100644 --- a/dlls/iphlpapi/iphlpapi.spec +++ b/dlls/iphlpapi/iphlpapi.spec @@ -159,7 +159,7 @@ @ stdcall IcmpSendEcho2Ex(ptr ptr ptr ptr long long ptr long ptr ptr long long) @ stdcall IcmpSendEcho2(ptr ptr ptr ptr long ptr long ptr ptr long long) @ stdcall IcmpSendEcho(ptr long ptr long ptr ptr long long) -#@ stub if_indextoname +@ stdcall if_indextoname(long ptr) IPHLP_if_indextoname @ stdcall if_nametoindex(str) IPHLP_if_nametoindex #@ stub InitializeIpForwardEntry #@ stub InitializeIpInterfaceEntry diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 94bf825..48a8387 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -3235,3 +3235,13 @@ IF_INDEX WINAPI IPHLP_if_nametoindex(const char *name) return 0; } + +/****************************************************************** + * if_indextoname (IPHLPAPI.@) + */ +PCHAR WINAPI IPHLP_if_indextoname(NET_IFINDEX index, PCHAR name) +{ + TRACE("(%u, %p)\n", index, name); + + return getInterfaceNameByIndex(index, name); +} diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index dd0cb90..6397742 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -97,6 +97,7 @@ static DWORD (WINAPI *pConvertInterfaceLuidToNameA)(const NET_LUID*,char*,SIZE_T static DWORD (WINAPI *pConvertInterfaceNameToLuidA)(const char*,NET_LUID*); static DWORD (WINAPI *pConvertInterfaceNameToLuidW)(const WCHAR*,NET_LUID*); +static PCHAR (WINAPI *pif_indextoname)(NET_IFINDEX,PCHAR); static NET_IFINDEX (WINAPI *pif_nametoindex)(const char*); static void loadIPHlpApi(void) @@ -148,6 +149,7 @@ static void loadIPHlpApi(void) pConvertInterfaceLuidToNameW = (void *)GetProcAddress(hLibrary, "ConvertInterfaceLuidToNameW"); pConvertInterfaceNameToLuidA = (void *)GetProcAddress(hLibrary, "ConvertInterfaceNameToLuidA"); pConvertInterfaceNameToLuidW = (void *)GetProcAddress(hLibrary, "ConvertInterfaceNameToLuidW"); + pif_indextoname = (void *)GetProcAddress(hLibrary, "if_indextoname"); pif_nametoindex = (void *)GetProcAddress(hLibrary, "if_nametoindex"); } } @@ -1786,7 +1788,7 @@ static void test_interface_identifier_conversion(void) GUID guid; SIZE_T len; WCHAR nameW[IF_MAX_STRING_SIZE + 1]; - char nameA[IF_MAX_STRING_SIZE + 1]; + char nameA[IF_MAX_STRING_SIZE + 1], *name; NET_IFINDEX index, index2; if (!pConvertInterfaceIndexToLuid) @@ -1947,22 +1949,37 @@ static void test_interface_identifier_conversion(void) ok( luid.Info.NetLuidIndex != 0xdead, "index not set\n" ); ok( luid.Info.IfType == IF_TYPE_ETHERNET_CSMACD, "got %u\n", luid.Info.IfType ); - /* if_nametoindex */ - if (pif_nametoindex) + if (!pif_nametoindex || !pif_indextoname) { - index2 = pif_nametoindex( NULL ); - ok( !index2, "Got unexpected index %u\n", index2 ); - index2 = pif_nametoindex( nameA ); - ok( index2 == index, "Got index %u for %s, expected %u\n", index2, nameA, index ); - /*
Wargaming.net
Game Center passes a GUID-like string. */ - index2 = pif_nametoindex( "{00000001-0000-0000-0000-000000000000}" ); - ok( !index2, "Got unexpected index %u\n", index2 ); - index2 = pif_nametoindex( wine_dbgstr_guid( &guid ) ); - ok( !index2, "Got unexpected index %u for input %s\n", index2, wine_dbgstr_guid( &guid ) ); + skip("if_nametoindex/if_indextoname not supported\n"); + return; } - else + + index2 = pif_nametoindex( NULL ); + ok( !index2, "Got unexpected index %u\n", index2 ); + index2 = pif_nametoindex( nameA ); + ok( index2 == index, "Got index %u for %s, expected %u\n", index2, nameA, index ); + /*
Wargaming.net
Game Center passes a GUID-like string. */ + index2 = pif_nametoindex( "{00000001-0000-0000-0000-000000000000}" ); + ok( !index2, "Got unexpected index %u\n", index2 ); + index2 = pif_nametoindex( wine_dbgstr_guid( &guid ) ); + ok( !index2, "Got unexpected index %u for input %s\n", index2, wine_dbgstr_guid( &guid ) ); + + name = pif_indextoname( 0, NULL ); + ok( name == NULL, "got %s\n", name ); + + name = pif_indextoname( 0, nameA ); + ok( name == NULL, "got %p\n", name ); + + name = pif_indextoname( ~0u, nameA ); + ok( name == NULL, "got %p\n", name ); + + nameA[0] = 0; + name = pif_indextoname( 1, nameA ); + if (name != NULL) { - skip("if_nametoindex not supported\n"); + ok( name[0], "empty name\n" ); + ok( name == nameA, "got %p\n", name ); } } diff --git a/include/netioapi.h b/include/netioapi.h index 4f5f671..1095888 100644 --- a/include/netioapi.h +++ b/include/netioapi.h @@ -174,5 +174,7 @@ void WINAPI FreeMibTable(void*); DWORD WINAPI GetIfEntry2(MIB_IF_ROW2*); DWORD WINAPI GetIfTable2(MIB_IF_TABLE2**); DWORD WINAPI GetUnicastIpAddressEntry(MIB_UNICASTIPADDRESS_ROW*); +PCHAR WINAPI if_indextoname(NET_IFINDEX,PCHAR); +NET_IFINDEX WINAPI if_nametoindex(PCSTR); #endif /* __WINE_NETIOAPI_H */
1
0
0
0
Hans Leidekker : crypt32: Add a stub implementation of CertUnregisterPhysicalStore.
by Alexandre Julliard
23 Jan '18
23 Jan '18
Module: wine Branch: master Commit: 9bafbe10861149b117104f748c329b21eee97bac URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9bafbe10861149b117104f74…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Jan 23 09:43:49 2018 +0100 crypt32: Add a stub implementation of CertUnregisterPhysicalStore. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/crypt32.spec | 1 + dlls/crypt32/store.c | 7 +++++++ include/wincrypt.h | 3 +++ 3 files changed, 11 insertions(+) diff --git a/dlls/crypt32/crypt32.spec b/dlls/crypt32/crypt32.spec index 00a2d62..fc0955e 100644 --- a/dlls/crypt32/crypt32.spec +++ b/dlls/crypt32/crypt32.spec @@ -92,6 +92,7 @@ @ stdcall CertSetStoreProperty(ptr long long ptr) @ stdcall CertStrToNameA(long str long ptr ptr ptr ptr) @ stdcall CertStrToNameW(long wstr long ptr ptr ptr ptr) +@ stdcall CertUnregisterPhysicalStore(ptr long wstr) @ stdcall CertUnregisterSystemStore(ptr long) @ stdcall CertVerifyCRLRevocation(long ptr long ptr) @ stdcall CertVerifyCRLTimeValidity(ptr ptr) diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c index 19eca22..91a3cbc 100644 --- a/dlls/crypt32/store.c +++ b/dlls/crypt32/store.c @@ -1384,6 +1384,13 @@ BOOL WINAPI CertRegisterPhysicalStore(const void *pvSystemStore, DWORD dwFlags, return FALSE; } +BOOL WINAPI CertUnregisterPhysicalStore(const void *pvSystemStore, DWORD dwFlags, + LPCWSTR pwszStoreName) +{ + FIXME("(%p, %08x, %s): stub\n", pvSystemStore, dwFlags, debugstr_w(pwszStoreName)); + return TRUE; +} + BOOL WINAPI CertRegisterSystemStore(const void *pvSystemStore, DWORD dwFlags, PCERT_SYSTEM_STORE_INFO pStoreInfo, void *pvReserved) { diff --git a/include/wincrypt.h b/include/wincrypt.h index 83db673..6986bd8 100644 --- a/include/wincrypt.h +++ b/include/wincrypt.h @@ -4090,6 +4090,9 @@ BOOL WINAPI CertEnumPhysicalStore(const void *pvSystemStore, DWORD dwFlags, BOOL WINAPI CertRegisterPhysicalStore(const void *pvSystemStore, DWORD dwFlags, LPCWSTR pwszStoreName, PCERT_PHYSICAL_STORE_INFO pStoreInfo, void *pvReserved); +BOOL WINAPI CertUnregisterPhysicalStore(const void *pvSystemStore, DWORD dwFlags, + LPCWSTR pwszStoreName); + BOOL WINAPI CertSaveStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType, DWORD dwSaveAs, DWORD dwSaveTo, void* pvSaveToPara, DWORD dwFlags);
1
0
0
0
Nikolay Sivov : msxml3: Register msxsl:node-set() extension function.
by Alexandre Julliard
23 Jan '18
23 Jan '18
Module: wine Branch: master Commit: 5e947df1fe433ab69a1f90e8186411d8ae858ef0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5e947df1fe433ab69a1f90e8…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jan 23 11:27:56 2018 +0300 msxml3: Register msxsl:node-set() extension function. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msxml3/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/msxml3/main.c b/dlls/msxml3/main.c index 311fd66..0d056ea 100644 --- a/dlls/msxml3/main.c +++ b/dlls/msxml3/main.c @@ -40,6 +40,8 @@ # include <libxslt/variables.h> # include <libxslt/xsltInternals.h> # include <libxslt/documents.h> +# include <libxslt/extensions.h> +# include <libxslt/extra.h> # endif #endif @@ -172,10 +174,12 @@ DECL_FUNCPTR(xsltApplyStylesheetUser); DECL_FUNCPTR(xsltCleanupGlobals); DECL_FUNCPTR(xsltFreeStylesheet); DECL_FUNCPTR(xsltFreeTransformContext); +DECL_FUNCPTR(xsltFunctionNodeSet); DECL_FUNCPTR(xsltNewTransformContext); DECL_FUNCPTR(xsltNextImport); DECL_FUNCPTR(xsltParseStylesheetDoc); DECL_FUNCPTR(xsltQuoteUserParams); +DECL_FUNCPTR(xsltRegisterExtModuleFunction); DECL_FUNCPTR(xsltSaveResultTo); DECL_FUNCPTR(xsltSetLoaderFunc); # undef DECL_FUNCPTR @@ -199,10 +203,12 @@ static void init_libxslt(void) LOAD_FUNCPTR(xsltCleanupGlobals, 1); LOAD_FUNCPTR(xsltFreeStylesheet, 1); LOAD_FUNCPTR(xsltFreeTransformContext, 1); + LOAD_FUNCPTR(xsltFunctionNodeSet, 1); LOAD_FUNCPTR(xsltNewTransformContext, 1); LOAD_FUNCPTR(xsltNextImport, 1); LOAD_FUNCPTR(xsltParseStylesheetDoc, 1); LOAD_FUNCPTR(xsltQuoteUserParams, 1); + LOAD_FUNCPTR(xsltRegisterExtModuleFunction, 1); LOAD_FUNCPTR(xsltSaveResultTo, 1); LOAD_FUNCPTR(xsltSetLoaderFunc, 1); #undef LOAD_FUNCPTR @@ -211,6 +217,10 @@ static void init_libxslt(void) pxsltInit(); pxsltSetLoaderFunc(xslt_doc_default_loader); + pxsltRegisterExtModuleFunction( + (const xmlChar *)"node-set", + (const xmlChar *)"urn:schemas-microsoft-com:xslt", + pxsltFunctionNodeSet); return;
1
0
0
0
Nikolay Sivov : msxml3: Implement custom document importing callback.
by Alexandre Julliard
23 Jan '18
23 Jan '18
Module: wine Branch: master Commit: 92513a9edd0d4cab1583dee4f69366d90250ba67 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=92513a9edd0d4cab1583dee4…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jan 23 11:27:55 2018 +0300 msxml3: Implement custom document importing callback. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msxml3/domdoc.c | 1 + dlls/msxml3/main.c | 6 ++ dlls/msxml3/msxml_private.h | 12 ++- dlls/msxml3/node.c | 189 +++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 204 insertions(+), 4 deletions(-) diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 87a167e..ddd7565 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -2308,6 +2308,7 @@ static HRESULT WINAPI domdoc_load( This->error = E_FAIL; else { + get_doc(This)->name = (char *)xmlchar_from_wcharn(filename, -1, TRUE); This->properties->uri = uri; hr = This->error = S_OK; *isSuccessful = VARIANT_TRUE; diff --git a/dlls/msxml3/main.c b/dlls/msxml3/main.c index 1905f57..311fd66 100644 --- a/dlls/msxml3/main.c +++ b/dlls/msxml3/main.c @@ -39,6 +39,7 @@ # include <libxslt/xsltutils.h> # include <libxslt/variables.h> # include <libxslt/xsltInternals.h> +# include <libxslt/documents.h> # endif #endif @@ -176,6 +177,7 @@ DECL_FUNCPTR(xsltNextImport); DECL_FUNCPTR(xsltParseStylesheetDoc); DECL_FUNCPTR(xsltQuoteUserParams); DECL_FUNCPTR(xsltSaveResultTo); +DECL_FUNCPTR(xsltSetLoaderFunc); # undef DECL_FUNCPTR #endif @@ -202,10 +204,14 @@ static void init_libxslt(void) LOAD_FUNCPTR(xsltParseStylesheetDoc, 1); LOAD_FUNCPTR(xsltQuoteUserParams, 1); LOAD_FUNCPTR(xsltSaveResultTo, 1); + LOAD_FUNCPTR(xsltSetLoaderFunc, 1); #undef LOAD_FUNCPTR if (pxsltInit) pxsltInit(); + + pxsltSetLoaderFunc(xslt_doc_default_loader); + return; sym_not_found: diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index 8d7833b..1c05215 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -379,6 +379,12 @@ extern BSTR EnsureCorrectEOL(BSTR) DECLSPEC_HIDDEN; extern xmlChar* tagName_to_XPath(const BSTR tagName) DECLSPEC_HIDDEN; +#ifdef SONAME_LIBXSLT +# include <libxslt/documents.h> +extern xmlDocPtr xslt_doc_default_loader(const xmlChar *uri, xmlDictPtr dict, int options, + void *_ctxt, xsltLoadType type) DECLSPEC_HIDDEN; +#endif /* SONAME_LIBXSLT */ + static inline BSTR bstr_from_xmlChar(const xmlChar *str) { BSTR ret = NULL; @@ -395,12 +401,12 @@ static inline BSTR bstr_from_xmlChar(const xmlChar *str) return ret; } -static inline xmlChar *xmlchar_from_wcharn(const WCHAR *str, int nchars) +static inline xmlChar *xmlchar_from_wcharn(const WCHAR *str, int nchars, BOOL use_xml_alloc) { xmlChar *xmlstr; DWORD len = WideCharToMultiByte( CP_UTF8, 0, str, nchars, NULL, 0, NULL, NULL ); - xmlstr = heap_alloc( len+1 ); + xmlstr = use_xml_alloc ? xmlMalloc( len + 1 ) : heap_alloc( len + 1 ); if ( xmlstr ) { WideCharToMultiByte( CP_UTF8, 0, str, nchars, (LPSTR) xmlstr, len+1, NULL, NULL ); @@ -411,7 +417,7 @@ static inline xmlChar *xmlchar_from_wcharn(const WCHAR *str, int nchars) static inline xmlChar *xmlchar_from_wchar( const WCHAR *str ) { - return xmlchar_from_wcharn(str, -1); + return xmlchar_from_wcharn(str, -1, FALSE); } static inline xmlChar *heap_strdupxmlChar(const xmlChar *str) diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index ece82ef..bcb4181 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -26,6 +26,7 @@ #ifdef HAVE_LIBXML2 # include <libxml/parser.h> +# include <libxml/parserInternals.h> # include <libxml/xmlerror.h> # include <libxml/HTMLtree.h> # ifdef SONAME_LIBXSLT @@ -39,6 +40,7 @@ # include <libxslt/variables.h> # include <libxslt/xsltutils.h> # include <libxslt/xsltInternals.h> +# include <libxslt/documents.h> # endif #endif @@ -1313,7 +1315,192 @@ static HRESULT node_transform_write_to_stream(xsltStylesheetPtr style, xmlDocPtr return hr; } -#endif +struct import_buffer +{ + char *data; + int cur; + int len; +}; + +static int XMLCALL import_loader_io_read(void *context, char *out, int len) +{ + struct import_buffer *buffer = (struct import_buffer *)context; + + TRACE("%p, %p, %d\n", context, out, len); + + if (buffer->cur == buffer->len) + return 0; + + len = min(len, buffer->len - buffer->cur); + memcpy(out, &buffer->data[buffer->cur], len); + buffer->cur += len; + + TRACE("read %d\n", len); + + return len; +} + +static int XMLCALL import_loader_io_close(void * context) +{ + struct import_buffer *buffer = (struct import_buffer *)context; + + TRACE("%p\n", context); + + heap_free(buffer->data); + heap_free(buffer); + return 0; +} + +static HRESULT import_loader_onDataAvailable(void *ctxt, char *ptr, DWORD len) +{ + xmlParserInputPtr *input = (xmlParserInputPtr *)ctxt; + xmlParserInputBufferPtr inputbuffer; + struct import_buffer *buffer; + + buffer = heap_alloc(sizeof(*buffer)); + + buffer->data = heap_alloc(len); + memcpy(buffer->data, ptr, len); + buffer->cur = 0; + buffer->len = len; + + inputbuffer = xmlParserInputBufferCreateIO(import_loader_io_read, import_loader_io_close, buffer, + XML_CHAR_ENCODING_NONE); + *input = xmlNewIOInputStream(ctxt, inputbuffer, XML_CHAR_ENCODING_NONE); + if (!*input) + xmlFreeParserInputBuffer(inputbuffer); + + return *input ? S_OK : E_FAIL; +} + +static HRESULT xslt_doc_get_uri(const xmlChar *uri, void *_ctxt, xsltLoadType type, IUri **doc_uri) +{ + xsltStylesheetPtr style = (xsltStylesheetPtr)_ctxt; + IUri *href_uri; + HRESULT hr; + BSTR uriW; + + *doc_uri = NULL; + + uriW = bstr_from_xmlChar(uri); + hr = CreateUri(uriW, Uri_CREATE_ALLOW_RELATIVE | Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, 0, &href_uri); + SysFreeString(uriW); + if (FAILED(hr)) + { + WARN("Failed to create href uri, %#x.\n", hr); + return hr; + } + + if (type == XSLT_LOAD_STYLESHEET && style->doc && style->doc->name) + { + IUri *base_uri; + BSTR baseuriW; + + baseuriW = bstr_from_xmlChar((xmlChar *)style->doc->name); + hr = CreateUri(baseuriW, Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, 0, &base_uri); + SysFreeString(baseuriW); + if (FAILED(hr)) + { + WARN("Failed to create base uri, %#x.\n", hr); + return hr; + } + + hr = CoInternetCombineIUri(base_uri, href_uri, 0, doc_uri, 0); + IUri_Release(base_uri); + if (FAILED(hr)) + WARN("Failed to combine uris, %#x.\n", hr); + } + else + { + *doc_uri = href_uri; + IUri_AddRef(*doc_uri); + } + + IUri_Release(href_uri); + + return hr; +} + +xmlDocPtr xslt_doc_default_loader(const xmlChar *uri, xmlDictPtr dict, int options, + void *_ctxt, xsltLoadType type) +{ + IUri *import_uri = NULL; + xmlParserInputPtr input; + xmlParserCtxtPtr pctxt; + xmlDocPtr doc = NULL; + IMoniker *moniker; + HRESULT hr; + bsc_t *bsc; + BSTR uriW; + + TRACE("%s, %p, %#x, %p, %d\n", debugstr_a((const char *)uri), dict, options, _ctxt, type); + + pctxt = xmlNewParserCtxt(); + if (!pctxt) + return NULL; + + if (dict && pctxt->dict) + { + xmlDictFree(pctxt->dict); + pctxt->dict = NULL; + } + + if (dict) + { + pctxt->dict = dict; + xmlDictReference(pctxt->dict); + } + + xmlCtxtUseOptions(pctxt, options); + + hr = xslt_doc_get_uri(uri, _ctxt, type, &import_uri); + if (FAILED(hr)) + goto failed; + + hr = CreateURLMonikerEx2(NULL, import_uri, &moniker, 0); + if (FAILED(hr)) + goto failed; + + hr = bind_url(moniker, import_loader_onDataAvailable, &input, &bsc); + IMoniker_Release(moniker); + if (FAILED(hr)) + goto failed; + + if (FAILED(detach_bsc(bsc))) + goto failed; + + if (!input) + goto failed; + + inputPush(pctxt, input); + xmlParseDocument(pctxt); + + if (pctxt->wellFormed) + { + doc = pctxt->myDoc; + /* Set imported uri, to give nested imports a chance. */ + if (IUri_GetPropertyBSTR(import_uri, Uri_PROPERTY_ABSOLUTE_URI, &uriW, 0) == S_OK) + { + doc->name = (char *)xmlchar_from_wcharn(uriW, SysStringLen(uriW), TRUE); + SysFreeString(uriW); + } + } + else + { + doc = NULL; + xmlFreeDoc(pctxt->myDoc); + pctxt->myDoc = NULL; + } + +failed: + xmlFreeParserCtxt(pctxt); + if (import_uri) + IUri_Release(import_uri); + + return doc; +} + +#endif /* SONAME_LIBXSLT */ HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet, BSTR *p, ISequentialStream *stream, const struct xslprocessor_params *params)
1
0
0
0
Nikolay Sivov : msxml3: Use IUri API to load documents.
by Alexandre Julliard
23 Jan '18
23 Jan '18
Module: wine Branch: master Commit: cdaf5625d13457489e1a9e673471d2c19f34471d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cdaf5625d13457489e1a9e67…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jan 23 11:27:54 2018 +0300 msxml3: Use IUri API to load documents. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msxml3/bsc.c | 25 ++++++++-- dlls/msxml3/domdoc.c | 49 ++++++++---------- dlls/msxml3/msxml_private.h | 1 + dlls/msxml3/tests/domdoc.c | 118 ++++++++++++++++++++++++++++---------------- 4 files changed, 118 insertions(+), 75 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=cdaf5625d13457489e1a…
1
0
0
0
Jacek Caban : ole32/tests: Added more CoWaitForMultipleHandles tests.
by Alexandre Julliard
23 Jan '18
23 Jan '18
Module: wine Branch: master Commit: de90cca586b6a04340907ebefd31ede38f6894fa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=de90cca586b6a04340907ebe…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Jan 22 17:06:03 2018 +0100 ole32/tests: Added more CoWaitForMultipleHandles tests. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/tests/compobj.c | 182 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 179 insertions(+), 3 deletions(-) diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index a36e791..aef1037 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -938,6 +938,7 @@ static DWORD WINAPI MessageFilter_MessagePending( DWORD dwPendingType) { trace("MessagePending\n"); + todo_wine ok(0, "unexpected call\n"); return PENDINGMSG_WAITNOPROCESS; } @@ -2632,6 +2633,15 @@ static DWORD CALLBACK send_message_thread(LPVOID arg) return 0; } +static DWORD CALLBACK send_and_post_user_message_thread(void *arg) +{ + HWND hwnd = arg; + Sleep(30); + SendMessageA(hwnd, WM_USER, 0, 0); + PostMessageA(hwnd, WM_USER, 0, 0); + return 0; +} + static DWORD CALLBACK post_message_thread(LPVOID arg) { HWND hWnd = arg; @@ -2641,11 +2651,98 @@ static DWORD CALLBACK post_message_thread(LPVOID arg) } static const char cls_name[] = "cowait_test_class"; + +static UINT cowait_msgs[100], cowait_msgs_first, cowait_msgs_last; + +static void cowait_msgs_reset(void) +{ + cowait_msgs_first = cowait_msgs_last = 0; +} + +#define cowait_msgs_expect_empty() _cowait_msgs_expect_empty(__LINE__) +static void _cowait_msgs_expect_empty(unsigned line) +{ + while(cowait_msgs_first < cowait_msgs_last) { + ok_(__FILE__,line)(0, "unexpected message %u\n", cowait_msgs[cowait_msgs_first]); + cowait_msgs_first++; + } + cowait_msgs_reset(); +} + +#define cowait_msgs_expect_notified(a) _cowait_msgs_expect_notified(__LINE__,a) +static void _cowait_msgs_expect_notified(unsigned line, UINT expected_msg) +{ + if(cowait_msgs_first == cowait_msgs_last) { + ok_(__FILE__,line)(0, "expected message %u, received none\n", expected_msg); + }else { + ok_(__FILE__,line)(cowait_msgs[cowait_msgs_first] == expected_msg, + "expected message %u, received %u \n", + expected_msg, cowait_msgs[cowait_msgs_first]); + cowait_msgs_first++; + } +} + +#define cowait_msgs_expect_queued(a,b) _cowait_msgs_expect_queued(__LINE__,a,b) +static void _cowait_msgs_expect_queued(unsigned line, HWND hwnd, UINT expected_msg) +{ + MSG msg; + BOOL success; + + success = PeekMessageA(&msg, hwnd, expected_msg, expected_msg, PM_REMOVE); + ok_(__FILE__,line)(success, "PeekMessageA failed: %u\n", GetLastError()); + if(success) + ok_(__FILE__,line)(msg.message == expected_msg, "unexpected message %u, expected %u\n", + msg.message, expected_msg); +} + +static void flush_messages(void) +{ + MSG msg; + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )); +} + +static LRESULT CALLBACK cowait_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if(cowait_msgs_last < sizeof(cowait_msgs)/sizeof(*cowait_msgs)) + cowait_msgs[cowait_msgs_last++] = msg; + if(msg == WM_DDE_FIRST) + return 6; + return DefWindowProcA(hwnd, msg, wparam, lparam); +} + +static DWORD CALLBACK cowait_unmarshal_thread(void *arg) +{ + IStream *stream = arg; + IEnumOLEVERB *enum_verb; + LARGE_INTEGER zero; + IUnknown *unk; + HRESULT hr; + + CoInitialize(NULL); + + zero.QuadPart = 0; + hr = IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL); + ok(hr == S_OK, "Seek failed: %08x\n", hr); + + hr = CoUnmarshalInterface(stream, &IID_IUnknown, (void**)&unk); + ok(hr == S_OK, "CoUnmarshalInterface failed: %08x\n", hr); + + hr = IUnknown_QueryInterface(unk, &IID_IEnumOLEVERB, (void**)&enum_verb); + ok(hr == S_OK, "QueryInterface failed: %08x\n", hr); + + IEnumOLEVERB_Release(enum_verb); + IUnknown_Release(unk); + + CoUninitialize(); + return 0; +} + static DWORD CALLBACK test_CoWaitForMultipleHandles_thread(LPVOID arg) { - HANDLE *handles = arg; + HANDLE *handles = arg, event, thread; + IStream *stream; BOOL success; - DWORD index; + DWORD index, tid; HRESULT hr; HWND hWnd; UINT uMSG = 0xc065; @@ -2693,6 +2790,39 @@ static DWORD CALLBACK test_CoWaitForMultipleHandles_thread(LPVOID arg) DestroyWindow(hWnd); CoUninitialize(); + + hr = pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + ok(hr == S_OK, "CoInitializeEx failed with error 0x%08x\n", hr); + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok(hr == S_OK, "CreateStreamOnHGlobal failed: %08x", hr); + + hr = CoMarshalInterface(stream, &IID_IUnknown, &Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok(hr == S_OK, "CoMarshalInterface should have returned S_OK instead of 0x%08x\n", hr); + + event = CreateEventW(NULL, TRUE, FALSE, NULL); + + PostQuitMessage(66); + PostThreadMessageW(GetCurrentThreadId(), WM_QUIT, 0, 0); + + hr = CoRegisterMessageFilter(&MessageFilter, NULL); + ok(hr == S_OK, "CoRegisterMessageFilter failed: %08x", hr); + + thread = CreateThread(NULL, 0, cowait_unmarshal_thread, stream, 0, &tid); + ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); + hr = CoWaitForMultipleHandles(0, 50, 1, &event, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + index = WaitForSingleObject(thread, 200); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + + hr = CoRegisterMessageFilter(NULL, NULL); + ok(hr == S_OK, "CoRegisterMessageFilter failed: %08x", hr); + + IStream_Release(stream); + + CloseHandle(event); + CoUninitialize(); return 0; } @@ -2716,7 +2846,7 @@ static void test_CoWaitForMultipleHandles(void) wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); wc.hbrBackground = NULL; wc.lpszClassName = cls_name; - wc.lpfnWndProc = DefWindowProcA; + wc.lpfnWndProc = cowait_window_proc; success = RegisterClassExA(&wc) != 0; ok(success, "RegisterClassExA failed %u\n", GetLastError()); @@ -2891,6 +3021,29 @@ static void test_CoWaitForMultipleHandles(void) ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); CloseHandle(thread); + cowait_msgs_reset(); + PostMessageA(hWnd, 0, 0, 0); + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + PostMessageA(hWnd, WM_USER+1, 0, 0); + PostMessageA(hWnd, WM_DDE_FIRST+1, 0, 0); + thread = CreateThread(NULL, 0, send_and_post_user_message_thread, hWnd, 0, &tid); + ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); + + hr = CoWaitForMultipleHandles(0, 100, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + + cowait_msgs_expect_notified(WM_DDE_FIRST); + cowait_msgs_expect_notified(WM_DDE_FIRST+1); + cowait_msgs_expect_notified(WM_USER); + cowait_msgs_expect_empty(); + cowait_msgs_expect_queued(hWnd, WM_USER); + cowait_msgs_expect_queued(hWnd, WM_USER+1); + flush_messages(); + + index = WaitForSingleObject(thread, 200); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + /* test behaviour of WM_QUIT (semaphores are still locked) */ PostMessageA(hWnd, WM_QUIT, 40, 0); @@ -2902,6 +3055,29 @@ static void test_CoWaitForMultipleHandles(void) success = PeekMessageA(&msg, hWnd, WM_QUIT, WM_QUIT, PM_REMOVE); ok(!success, "PeekMessageA succeeded\n"); + cowait_msgs_reset(); + PostMessageA(hWnd, WM_QUIT, 40, 0); + PostMessageA(hWnd, 0, 0, 0); + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + PostMessageA(hWnd, WM_USER+1, 0, 0); + PostMessageA(hWnd, WM_DDE_FIRST+1, 0, 0); + thread = CreateThread(NULL, 0, send_and_post_user_message_thread, hWnd, 0, &tid); + ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); + + hr = CoWaitForMultipleHandles(0, 100, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + + cowait_msgs_expect_notified(WM_DDE_FIRST); + cowait_msgs_expect_notified(WM_DDE_FIRST+1); + cowait_msgs_expect_notified(WM_USER); + cowait_msgs_expect_empty(); + cowait_msgs_expect_queued(hWnd, WM_USER); + flush_messages(); + + index = WaitForSingleObject(thread, 200); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + index = 0xdeadbeef; PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); PostMessageA(hWnd, WM_QUIT, 41, 0);
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
...
64
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Results per page:
10
25
50
100
200