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
March 2017
----- 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
14 participants
251 discussions
Start a n
N
ew thread
[akhaldi] 74097: [PSDK] Update wincodec.idl. CORE-12823
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 5 21:08:10 2017 New Revision: 74097 URL:
http://svn.reactos.org/svn/reactos?rev=74097&view=rev
Log: [PSDK] Update wincodec.idl. CORE-12823 Modified: trunk/reactos/sdk/include/psdk/wincodec.idl Modified: trunk/reactos/sdk/include/psdk/wincodec.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/wincodec.…
============================================================================== --- trunk/reactos/sdk/include/psdk/wincodec.idl [iso-8859-1] (original) +++ trunk/reactos/sdk/include/psdk/wincodec.idl [iso-8859-1] Sun Mar 5 21:08:10 2017 @@ -168,6 +168,17 @@ WICTIFFCOMPRESSIONOPTION_FORCE_DWORD = CODEC_FORCE_DWORD } WICTiffCompressionOption; +typedef enum WICPngFilterOption { + WICPngFilterUnspecified = 0, + WICPngFilterNone = 1, + WICPngFilterSub = 2, + WICPngFilterUp = 3, + WICPngFilterAverage = 4, + WICPngFilterPaeth = 5, + WICPngFilterAdaptive = 6, + WICPNFFILTEROPTION_FORCE_DWORD = CODEC_FORCE_DWORD +} WICPngFilterOption; + typedef enum WICSectionAccessLevel { WICSectionAccessLevelRead = 0x00000001, WICSectionAccessLevelReadWrite = 0x00000003, @@ -208,7 +219,10 @@ cpp_quote("DEFINE_GUID(GUID_WICPixelFormat64bppRGBA, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x16);") cpp_quote("DEFINE_GUID(GUID_WICPixelFormat64bppPRGBA, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x17);") -cpp_quote("DEFINE_GUID(GUID_WICPixelFormat32bppCMYK, 0x6fddc324,0x4e03,0x4fbe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x1c);") +cpp_quote("DEFINE_GUID(GUID_WICPixelFormat128bppRGBAFloat, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x19);") + +cpp_quote("DEFINE_GUID(GUID_WICPixelFormat32bppCMYK, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x1c);") +cpp_quote("DEFINE_GUID(GUID_WICPixelFormat64bppCMYK, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x1f);") typedef struct WICRect { INT X;
7 years, 9 months
1
0
0
0
[akhaldi] 74096: [PSDK] Update gdiplusenums.h and gdiplusflat.h. CORE-12823
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 5 21:06:16 2017 New Revision: 74096 URL:
http://svn.reactos.org/svn/reactos?rev=74096&view=rev
Log: [PSDK] Update gdiplusenums.h and gdiplusflat.h. CORE-12823 Modified: trunk/reactos/sdk/include/psdk/gdiplusenums.h trunk/reactos/sdk/include/psdk/gdiplusflat.h Modified: trunk/reactos/sdk/include/psdk/gdiplusenums.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/gdiplusen…
============================================================================== --- trunk/reactos/sdk/include/psdk/gdiplusenums.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/psdk/gdiplusenums.h [iso-8859-1] Sun Mar 5 21:06:16 2017 @@ -71,6 +71,12 @@ LineCapCustom = 0xff, LineCapAnchorMask = 0xf0 +}; + +enum CustomLineCapType +{ + CustomLineCapTypeDefault = 0, + CustomLineCapTypeAdjustableArrow = 1 }; enum PathPointType{ @@ -720,6 +726,7 @@ typedef enum DriverStringOptions DriverStringOptions; typedef enum FillMode FillMode; typedef enum LineCap LineCap; +typedef enum CustomLineCapType CustomLineCapType; typedef enum PathPointType PathPointType; typedef enum LineJoin LineJoin; typedef enum QualityMode QualityMode; Modified: trunk/reactos/sdk/include/psdk/gdiplusflat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/gdiplusfl…
============================================================================== --- trunk/reactos/sdk/include/psdk/gdiplusflat.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/psdk/gdiplusflat.h [iso-8859-1] Sun Mar 5 21:06:16 2017 @@ -94,6 +94,7 @@ GpStatus WINGDIPAPI GdipGetCustomLineCapWidthScale(GpCustomLineCap*,REAL*); GpStatus WINGDIPAPI GdipSetCustomLineCapWidthScale(GpCustomLineCap*,REAL); GpStatus WINGDIPAPI GdipSetCustomLineCapBaseInset(GpCustomLineCap*,REAL); +GpStatus WINGDIPAPI GdipGetCustomLineCapType(GpCustomLineCap*,CustomLineCapType*); /* Font */ GpStatus WINGDIPAPI GdipCloneFont(GpFont*,GpFont**); @@ -617,6 +618,7 @@ GpStatus WINGDIPAPI GdipDeletePen(GpPen*); GpStatus WINGDIPAPI GdipGetPenBrushFill(GpPen*,GpBrush**); GpStatus WINGDIPAPI GdipGetPenColor(GpPen*,ARGB*); +GpStatus WINGDIPAPI GdipGetPenCompoundCount(GpPen*,INT*); GpStatus WINGDIPAPI GdipGetPenCustomStartCap(GpPen*,GpCustomLineCap**); GpStatus WINGDIPAPI GdipGetPenCustomEndCap(GpPen*,GpCustomLineCap**); GpStatus WINGDIPAPI GdipGetPenDashArray(GpPen*,REAL*,INT);
7 years, 9 months
1
0
0
0
[akhaldi] 74095: [OLE32_WINETEST] Sync with Wine Staging 2.2. CORE-12823
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 5 21:03:59 2017 New Revision: 74095 URL:
http://svn.reactos.org/svn/reactos?rev=74095&view=rev
Log: [OLE32_WINETEST] Sync with Wine Staging 2.2. CORE-12823 Modified: trunk/rostests/winetests/ole32/clipboard.c trunk/rostests/winetests/ole32/compobj.c trunk/rostests/winetests/ole32/marshal.c trunk/rostests/winetests/ole32/propvariant.c Modified: trunk/rostests/winetests/ole32/clipboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/clipboard…
============================================================================== --- trunk/rostests/winetests/ole32/clipboard.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/clipboard.c [iso-8859-1] Sun Mar 5 21:03:59 2017 @@ -198,7 +198,7 @@ ret->fmtetc_cnt = fmtetc_cnt; ret->fmtetc = HeapAlloc(GetProcessHeap(), 0, fmtetc_cnt*sizeof(FORMATETC)); memcpy(ret->fmtetc, fmtetc, fmtetc_cnt*sizeof(FORMATETC)); - *lplpformatetc = (LPENUMFORMATETC)ret; + *lplpformatetc = &ret->IEnumFORMATETC_iface; return S_OK; } @@ -401,7 +401,7 @@ obj->fmtetc = HeapAlloc(GetProcessHeap(), 0, obj->fmtetc_cnt*sizeof(FORMATETC)); InitFormatEtc(obj->fmtetc[0], CF_TEXT, TYMED_HGLOBAL); - *lplpdataobj = (LPDATAOBJECT)obj; + *lplpdataobj = &obj->IDataObject_iface; return S_OK; } @@ -457,7 +457,7 @@ InitFormatEtc(obj->fmtetc[7], cf_another, 0xfffff); obj->fmtetc[7].dwAspect = DVASPECT_ICON; - *lplpdataobj = (LPDATAOBJECT)obj; + *lplpdataobj = &obj->IDataObject_iface; return S_OK; } @@ -618,9 +618,7 @@ if(src) { hr = IEnumFORMATETC_Next(src_enum, 1, &src_fmt, NULL); - ok(hr == S_FALSE || - broken(hr == S_OK && count == 5), /* win9x and winme don't enumerate duplicated cf's */ - "%d: got %08x\n", count, hr); + ok(hr == S_FALSE, "%d: got %08x\n", count, hr); IEnumFORMATETC_Release(src_enum); } @@ -801,8 +799,7 @@ ok(DataObjectImpl_GetDataHere_calls == 1, "got %d\n", DataObjectImpl_GetDataHere_calls); ptr = GlobalLock(h); size = GlobalSize(h); - ok(size == strlen(cmpl_stm_data) || - broken(size > strlen(cmpl_stm_data)), /* win9x, winme */ + ok(size == strlen(cmpl_stm_data), "expected %d got %d\n", lstrlenA(cmpl_stm_data), size); ok(!memcmp(ptr, cmpl_stm_data, strlen(cmpl_stm_data)), "mismatch\n"); GlobalUnlock(h); @@ -818,8 +815,7 @@ ok(DataObjectImpl_GetDataHere_calls == 0, "got %d\n", DataObjectImpl_GetDataHere_calls); ptr = GlobalLock(h); size = GlobalSize(h); - ok(size == strlen(cmpl_text_data) + 1 || - broken(size > strlen(cmpl_text_data) + 1), /* win9x, winme */ + ok(size == strlen(cmpl_text_data) + 1, "expected %d got %d\n", lstrlenA(cmpl_text_data) + 1, size); ok(!memcmp(ptr, cmpl_text_data, strlen(cmpl_text_data) + 1), "mismatch\n"); GlobalUnlock(h); @@ -836,6 +832,7 @@ ULONG ref; LPDATAOBJECT data1, data2, data_cmpl; HGLOBAL hblob, h; + void *ptr; cf_stream = RegisterClipboardFormatA("stream format"); cf_storage = RegisterClipboardFormatA("storage format"); @@ -861,10 +858,7 @@ CoInitialize(NULL); hr = OleSetClipboard(data1); - ok(hr == CO_E_NOTINITIALIZED || - hr == CLIPBRD_E_CANT_SET, /* win9x */ - "OleSetClipboard should have failed with " - "CO_E_NOTINITIALIZED or CLIPBRD_E_CANT_SET instead of 0x%08x\n", hr); + ok(hr == CO_E_NOTINITIALIZED, "OleSetClipboard failed with 0x%08x\n", hr); CoUninitialize(); hr = OleInitialize(NULL); @@ -896,14 +890,18 @@ /* put a format directly onto the clipboard to show OleFlushClipboard doesn't empty the clipboard */ hblob = GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE|GMEM_ZEROINIT, 10); - OpenClipboard(NULL); + ptr = GlobalLock( hblob ); + ok( ptr && ptr != hblob, "got fixed block %p / %p\n", ptr, hblob ); + GlobalUnlock( hblob ); + ok( OpenClipboard(NULL), "OpenClipboard failed\n" ); h = SetClipboardData(cf_onemore, hblob); ok(h == hblob, "got %p\n", h); h = GetClipboardData(cf_onemore); - ok(h == hblob || - broken(h != NULL), /* win9x */ - "got %p\n", h); - CloseClipboard(); + ok(h == hblob, "got %p / %p\n", h, hblob); + ptr = GlobalLock( h ); + ok( ptr && ptr != h, "got fixed block %p / %p\n", ptr, h ); + GlobalUnlock( hblob ); + ok( CloseClipboard(), "CloseClipboard failed\n" ); hr = OleFlushClipboard(); ok(hr == S_OK, "failed to flush clipboard, hr = 0x%08x\n", hr); @@ -915,12 +913,13 @@ ok(hr == S_FALSE, "expect S_FALSE, hr = 0x%08x\n", hr); /* format should survive the flush */ - OpenClipboard(NULL); + ok( OpenClipboard(NULL), "OpenClipboard failed\n" ); h = GetClipboardData(cf_onemore); - ok(h == hblob || - broken(h != NULL), /* win9x */ - "got %p\n", h); - CloseClipboard(); + ok(h == hblob, "got %p\n", h); + ptr = GlobalLock( h ); + ok( ptr && ptr != h, "got fixed block %p / %p\n", ptr, h ); + GlobalUnlock( hblob ); + ok( CloseClipboard(), "CloseClipboard failed\n" ); test_cf_dataobject(NULL); @@ -952,6 +951,104 @@ OleUninitialize(); } +static LPDATAOBJECT clip_data; +static HWND next_wnd; +static UINT wm_drawclipboard; + +static LRESULT CALLBACK clipboard_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) +{ + LRESULT ret; + + switch (msg) + { + case WM_DRAWCLIPBOARD: + wm_drawclipboard++; + if (clip_data) + { + /* if this is the WM_DRAWCLIPBOARD of a previous change, the data isn't current yet */ + /* this demonstrates an issue in Qt where it will free the data while it's being set */ + HRESULT hr = OleIsCurrentClipboard( clip_data ); + ok( hr == (wm_drawclipboard > 1) ? S_OK : S_FALSE, + "OleIsCurrentClipboard returned %x\n", hr ); + } + break; + case WM_CHANGECBCHAIN: + if (next_wnd == (HWND)wp) next_wnd = (HWND)lp; + else if (next_wnd) SendMessageA( next_wnd, msg, wp, lp ); + break; + case WM_USER: + ret = wm_drawclipboard; + wm_drawclipboard = 0; + return ret; + } + + return DefWindowProcA(hwnd, msg, wp, lp); +} + +static DWORD CALLBACK set_clipboard_thread(void *arg) +{ + OpenClipboard( GetDesktopWindow() ); + EmptyClipboard(); + SetClipboardData( CF_WAVE, 0 ); + CloseClipboard(); + return 0; +} + +/* test that WM_DRAWCLIPBOARD can be delivered for a previous change during OleSetClipboard */ +static void test_set_clipboard_DRAWCLIPBOARD(void) +{ + LPDATAOBJECT data; + HRESULT hr; + WNDCLASSA cls; + HWND viewer; + int ret; + HANDLE thread; + + hr = DataObjectImpl_CreateText("data", &data); + ok(hr == S_OK, "Failed to create data object: 0x%08x\n", hr); + + memset(&cls, 0, sizeof(cls)); + cls.lpfnWndProc = clipboard_wnd_proc; + cls.hInstance = GetModuleHandleA(NULL); + cls.lpszClassName = "clipboard_test"; + RegisterClassA(&cls); + + viewer = CreateWindowA("clipboard_test", NULL, 0, 0, 0, 0, 0, NULL, 0, NULL, 0); + ok(viewer != NULL, "CreateWindow failed: %d\n", GetLastError()); + next_wnd = SetClipboardViewer( viewer ); + + ret = SendMessageA( viewer, WM_USER, 0, 0 ); + ok( ret == 1, "%u WM_DRAWCLIPBOARD received\n", ret ); + + hr = OleInitialize(NULL); + ok(hr == S_OK, "OleInitialize failed with error 0x%08x\n", hr); + + ret = SendMessageA( viewer, WM_USER, 0, 0 ); + ok( !ret, "%u WM_DRAWCLIPBOARD received\n", ret ); + + thread = CreateThread(NULL, 0, set_clipboard_thread, NULL, 0, NULL); + ok(thread != NULL, "CreateThread failed (%d)\n", GetLastError()); + ret = WaitForSingleObject(thread, 5000); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", ret); + + clip_data = data; + hr = OleSetClipboard(data); + ok(hr == S_OK, "failed to set clipboard to data, hr = 0x%08x\n", hr); + + ret = SendMessageA( viewer, WM_USER, 0, 0 ); + ok( ret == 2, "%u WM_DRAWCLIPBOARD received\n", ret ); + + clip_data = NULL; + hr = OleFlushClipboard(); + ok(hr == S_OK, "failed to flush clipboard, hr = 0x%08x\n", hr); + ret = IDataObject_Release(data); + ok(ret == 0, "got %d\n", ret); + + OleUninitialize(); + ChangeClipboardChain( viewer, next_wnd ); + DestroyWindow( viewer ); +} + static inline ULONG count_refs(IDataObject *d) { IDataObject_AddRef(d); @@ -987,9 +1084,7 @@ hr = OleGetClipboard(&get2); ok(hr == S_OK, "got %08x\n", hr); - ok(get1 == get2 || - broken(get1 != get2), /* win9x, winme & nt4 */ - "data objects differ\n"); + ok(get1 == get2, "data objects differ\n"); refs = IDataObject_Release(get2); ok(refs == (get1 == get2 ? 1 : 0), "got %d\n", refs); @@ -1345,17 +1440,14 @@ hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL); ok(hr == S_OK, "got %08x\n", hr); /* User32 adds some synthesised formats */ - todo_wine ok(fmt.cfFormat == CF_LOCALE, "cf %04x\n", fmt.cfFormat); - if(fmt.cfFormat == CF_LOCALE) - { - ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd); - ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect); - ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex); - ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %x\n", fmt.tymed); - - hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL); - ok(hr == S_OK, "got %08x\n", hr); - } + ok(fmt.cfFormat == CF_LOCALE, "cf %04x\n", fmt.cfFormat); + ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd); + ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect); + ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex); + todo_wine ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %x\n", fmt.tymed); + + hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL); + ok(hr == S_OK, "got %08x\n", hr); ok(fmt.cfFormat == CF_OEMTEXT, "cf %04x\n", fmt.cfFormat); ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd); @@ -1365,19 +1457,14 @@ hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL); ok(hr == S_OK, "got %08x\n", hr); - ok(fmt.cfFormat == CF_UNICODETEXT || - broken(fmt.cfFormat == CF_METAFILEPICT), /* win9x and winme don't have CF_UNICODETEXT */ - "cf %04x\n", fmt.cfFormat); - if(fmt.cfFormat == CF_UNICODETEXT) - { - ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd); - ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect); - ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex); - ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %x\n", fmt.tymed); - - hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL); - ok(hr == S_OK, "got %08x\n", hr); - } + ok(fmt.cfFormat == CF_UNICODETEXT, "cf %04x\n", fmt.cfFormat); + ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd); + ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect); + ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex); + ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %x\n", fmt.tymed); + + hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL); + ok(hr == S_OK, "got %08x\n", hr); ok(fmt.cfFormat == CF_METAFILEPICT, "cf %04x\n", fmt.cfFormat); ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd); ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect); @@ -1611,6 +1698,7 @@ { test_get_clipboard_uninitialized(); test_set_clipboard(); + test_set_clipboard_DRAWCLIPBOARD(); test_consumer_refs(); test_flushed_getdata(); test_nonole_clipboard(); Modified: trunk/rostests/winetests/ole32/compobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/compobj.c…
============================================================================== --- trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] Sun Mar 5 21:03:59 2017 @@ -626,6 +626,26 @@ return hr; } +#define test_apt_type(t, q, t_t, t_q) _test_apt_type(t, q, t_t, t_q, __LINE__) +static void _test_apt_type(APTTYPE expected_type, APTTYPEQUALIFIER expected_qualifier, BOOL todo_type, + BOOL todo_qualifier, int line) +{ + APTTYPEQUALIFIER qualifier = ~0u; + APTTYPE type = ~0u; + HRESULT hr; + + if (!pCoGetApartmentType) + return; + + hr = pCoGetApartmentType(&type, &qualifier); + ok_(__FILE__, line)(hr == S_OK || hr == CO_E_NOTINITIALIZED, "Unexpected return code: 0x%08x\n", hr); +todo_wine_if(todo_type) + ok_(__FILE__, line)(type == expected_type, "Wrong apartment type %d, expected %d\n", type, expected_type); +todo_wine_if(todo_qualifier) + ok_(__FILE__, line)(qualifier == expected_qualifier, "Wrong apartment qualifier %d, expected %d\n", qualifier, + expected_qualifier); +} + static void test_CoCreateInstance(void) { HRESULT hr; @@ -670,6 +690,8 @@ /* show that COM doesn't have to be initialized for multi-threaded apartments if another thread has already done so */ + test_apt_type(APTTYPE_CURRENT, APTTYPEQUALIFIER_NONE, FALSE, FALSE); + info.wait = CreateEventA(NULL, TRUE, FALSE, NULL); ok(info.wait != NULL, "CreateEvent failed with error %d\n", GetLastError()); @@ -680,6 +702,8 @@ ok(thread != NULL, "CreateThread failed with error %d\n", GetLastError()); ok( !WaitForSingleObject(info.wait, 10000 ), "wait timed out\n" ); + + test_apt_type(APTTYPE_MTA, APTTYPEQUALIFIER_IMPLICIT_MTA, TRUE, TRUE); pUnk = (IUnknown *)0xdeadbeef; hr = CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&pUnk); @@ -696,6 +720,8 @@ CloseHandle(thread); CloseHandle(info.wait); CloseHandle(info.stop); + + test_apt_type(APTTYPE_CURRENT, APTTYPEQUALIFIER_NONE, FALSE, FALSE); } static void test_CoGetClassObject(void) @@ -722,6 +748,8 @@ /* show that COM doesn't have to be initialized for multi-threaded apartments if another thread has already done so */ + test_apt_type(APTTYPE_CURRENT, APTTYPEQUALIFIER_NONE, FALSE, FALSE); + info.wait = CreateEventA(NULL, TRUE, FALSE, NULL); ok(info.wait != NULL, "CreateEvent failed with error %d\n", GetLastError()); @@ -732,6 +760,8 @@ ok(thread != NULL, "CreateThread failed with error %d\n", GetLastError()); ok( !WaitForSingleObject(info.wait, 10000), "wait timed out\n" ); + + test_apt_type(APTTYPE_MTA, APTTYPEQUALIFIER_IMPLICIT_MTA, TRUE, TRUE); pUnk = (IUnknown *)0xdeadbeef; hr = CoGetClassObject(rclsid, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void **)&pUnk); @@ -753,6 +783,8 @@ CloseHandle(thread); CloseHandle(info.wait); CloseHandle(info.stop); + + test_apt_type(APTTYPE_CURRENT, APTTYPEQUALIFIER_NONE, FALSE, FALSE); if (!pRegOverridePredefKey) { @@ -1807,6 +1839,8 @@ /* show that COM doesn't have to be initialized for multi-threaded apartments if another thread has already done so */ + test_apt_type(APTTYPE_CURRENT, APTTYPEQUALIFIER_NONE, FALSE, FALSE); + info.wait = CreateEventA(NULL, TRUE, FALSE, NULL); ok(info.wait != NULL, "CreateEvent failed with error %d\n", GetLastError()); @@ -1817,6 +1851,8 @@ ok(thread != NULL, "CreateThread failed with error %d\n", GetLastError()); ok( !WaitForSingleObject(info.wait, 10000), "wait timed out\n" ); + + test_apt_type(APTTYPE_MTA, APTTYPEQUALIFIER_IMPLICIT_MTA, TRUE, TRUE); pComThreadingInfo = NULL; hr = pCoGetObjectContext(&IID_IComThreadingInfo, (void **)&pComThreadingInfo); @@ -1851,7 +1887,11 @@ CloseHandle(info.wait); CloseHandle(info.stop); + test_apt_type(APTTYPE_CURRENT, APTTYPEQUALIFIER_NONE, FALSE, FALSE); + pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + test_apt_type(APTTYPE_MAINSTA, APTTYPEQUALIFIER_NONE, FALSE, FALSE); hr = pCoGetObjectContext(&IID_IComThreadingInfo, (void **)&pComThreadingInfo); ok_ole_success(hr, "CoGetObjectContext"); @@ -2037,6 +2077,8 @@ /* show that COM doesn't have to be initialized for multi-threaded apartments if another thread has already done so */ + test_apt_type(APTTYPE_CURRENT, APTTYPEQUALIFIER_NONE, FALSE, FALSE); + info.wait = CreateEventA(NULL, TRUE, FALSE, NULL); ok(info.wait != NULL, "CreateEvent failed with error %d\n", GetLastError()); @@ -2047,6 +2089,8 @@ ok(thread != NULL, "CreateThread failed with error %d\n", GetLastError()); ok( !WaitForSingleObject(info.wait, 10000), "wait timed out\n" ); + + test_apt_type(APTTYPE_MTA, APTTYPEQUALIFIER_IMPLICIT_MTA, TRUE, TRUE); token = 0; hr = pCoGetContextToken(&token); @@ -2068,7 +2112,11 @@ CloseHandle(info.wait); CloseHandle(info.stop); + test_apt_type(APTTYPE_CURRENT, APTTYPEQUALIFIER_NONE, FALSE, FALSE); + CoInitialize(NULL); + + test_apt_type(APTTYPE_MAINSTA, APTTYPEQUALIFIER_NONE, FALSE, FALSE); hr = pCoGetContextToken(NULL); ok(hr == E_POINTER, "Expected E_POINTER, got 0x%08x\n", hr); @@ -2888,10 +2936,8 @@ IMalloc *imalloc; HRESULT hr; -if (0) /* crashes on native */ -{ - hr = CoGetMalloc(0, NULL); -} + if (0) /* crashes on native */ + hr = CoGetMalloc(0, NULL); imalloc = (void*)0xdeadbeef; hr = CoGetMalloc(0, &imalloc); Modified: trunk/rostests/winetests/ole32/marshal.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/marshal.c…
============================================================================== --- trunk/rostests/winetests/ole32/marshal.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/marshal.c [iso-8859-1] Sun Mar 5 21:03:59 2017 @@ -3467,6 +3467,19 @@ return 1; } +static BOOL new_hook_struct; +static int method, server_tid; +static GUID causality; + +struct new_hook_info +{ + IID iid; + GUID causality; + DWORD server_pid; + DWORD server_tid; + WORD method; +}; + static void WINAPI TestChannelHook_ClientGetSize( IChannelHook *iface, REFGUID uExtent, @@ -3474,12 +3487,36 @@ ULONG *pDataSize ) { SChannelHookCallInfo *info = (SChannelHookCallInfo *)riid; - trace("TestChannelHook_ClientGetBuffer\n"); - trace("\t%s method %d\n", debugstr_iid(riid), info->iMethod); - trace("\tcid: %s\n", debugstr_iid(&info->uCausality)); - ok(info->cbSize == sizeof(*info), "info->cbSize was %d instead of %d\n", info->cbSize, (int)sizeof(*info)); - ok(info->dwServerPid == GetCurrentProcessId(), "info->dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId()); - ok(!info->pObject, "info->pObject should be NULL\n"); + trace("TestChannelHook_ClientGetSize\n"); + trace("\t%s\n", debugstr_iid(riid)); + if (info->cbSize != sizeof(*info)) + new_hook_struct = TRUE; + + if (!new_hook_struct) + { + ok(info->cbSize == sizeof(*info), "cbSize was %d instead of %d\n", info->cbSize, (int)sizeof(*info)); + ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId()); + ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method); + ok(!info->pObject, "pObject should be NULL\n"); + if (method == 3) + causality = info->uCausality; + else + ok(IsEqualGUID(&info->uCausality, &causality), "causality wasn't correct\n"); + } + else + { + struct new_hook_info *new_info = (struct new_hook_info *)riid; + ok(new_info->server_pid == GetCurrentProcessId(), "server pid was 0x%x instead of 0x%x\n", new_info->server_pid, + GetCurrentProcessId()); + ok(new_info->server_tid == server_tid, "server tid was 0x%x instead of 0x%x\n", new_info->server_tid, + server_tid); + ok(new_info->method == method, "method was %d instead of %d\n", new_info->method, method); + if (method == 3) + causality = new_info->causality; + else + ok(IsEqualGUID(&new_info->causality, &causality), "causality wasn't correct\n"); + } + ok(IsEqualGUID(uExtent, &EXTENTID_WineTest), "uExtent wasn't correct\n"); *pDataSize = 1; @@ -3494,9 +3531,26 @@ { SChannelHookCallInfo *info = (SChannelHookCallInfo *)riid; trace("TestChannelHook_ClientFillBuffer\n"); - ok(info->cbSize == sizeof(*info), "info->cbSize was %d instead of %d\n", info->cbSize, (int)sizeof(*info)); - ok(info->dwServerPid == GetCurrentProcessId(), "info->dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId()); - ok(!info->pObject, "info->pObject should be NULL\n"); + + if (!new_hook_struct) + { + ok(info->cbSize == sizeof(*info), "cbSize was %d instead of %d\n", info->cbSize, (int)sizeof(*info)); + ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId()); + ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method); + ok(!info->pObject, "pObject should be NULL\n"); + ok(IsEqualGUID(&info->uCausality, &causality), "causality wasn't correct\n"); + } + else + { + struct new_hook_info *new_info = (struct new_hook_info *)riid; + ok(new_info->server_pid == GetCurrentProcessId(), "server pid was 0x%x instead of 0x%x\n", new_info->server_pid, + GetCurrentProcessId()); + ok(new_info->server_tid == server_tid, "server tid was 0x%x instead of 0x%x\n", new_info->server_tid, + server_tid); + ok(new_info->method == method, "method was %d instead of %d\n", new_info->method, method); + ok(IsEqualGUID(&new_info->causality, &causality), "causality wasn't correct\n"); + } + ok(IsEqualGUID(uExtent, &EXTENTID_WineTest), "uExtent wasn't correct\n"); *(unsigned char *)pDataBuffer = 0xcc; @@ -3514,11 +3568,28 @@ { SChannelHookCallInfo *info = (SChannelHookCallInfo *)riid; trace("TestChannelHook_ClientNotify hrFault = 0x%08x\n", hrFault); - ok(info->cbSize == sizeof(*info), "info->cbSize was %d instead of %d\n", info->cbSize, (int)sizeof(*info)); - ok(info->dwServerPid == GetCurrentProcessId(), "info->dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId()); - todo_wine { - ok(info->pObject != NULL, "info->pObject shouldn't be NULL\n"); - } + + if (!new_hook_struct) + { + ok(info->cbSize == sizeof(*info), "cbSize was %d instead of %d\n", info->cbSize, (int)sizeof(*info)); + ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId()); + ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method); + todo_wine { + ok(info->pObject != NULL, "pObject shouldn't be NULL\n"); + } + ok(IsEqualGUID(&info->uCausality, &causality), "causality wasn't correct\n"); + } + else + { + struct new_hook_info *new_info = (struct new_hook_info *)riid; + ok(new_info->server_pid == GetCurrentProcessId(), "server pid was 0x%x instead of 0x%x\n", new_info->server_pid, + GetCurrentProcessId()); + ok(new_info->server_tid == server_tid, "server tid was 0x%x instead of 0x%x\n", new_info->server_tid, + server_tid); + ok(new_info->method == method, "method was %d instead of %d\n", new_info->method, method); + ok(IsEqualGUID(&new_info->causality, &causality), "causality wasn't correct\n"); + } + ok(IsEqualGUID(uExtent, &EXTENTID_WineTest), "uExtent wasn't correct\n"); } @@ -3532,9 +3603,26 @@ { SChannelHookCallInfo *info = (SChannelHookCallInfo *)riid; trace("TestChannelHook_ServerNotify\n"); - ok(info->cbSize == sizeof(*info), "info->cbSize was %d instead of %d\n", info->cbSize, (int)sizeof(*info)); - ok(info->dwServerPid == GetCurrentProcessId(), "info->dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId()); - ok(info->pObject != NULL, "info->pObject shouldn't be NULL\n"); + + if (!new_hook_struct) + { + ok(info->cbSize == sizeof(*info), "cbSize was %d instead of %d\n", info->cbSize, (int)sizeof(*info)); + ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId()); + ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method); + ok(info->pObject != NULL, "pObject shouldn't be NULL\n"); + ok(IsEqualGUID(&info->uCausality, &causality), "causality wasn't correct\n"); + } + else + { + struct new_hook_info *new_info = (struct new_hook_info *)riid; + ok(new_info->server_pid == GetCurrentProcessId(), "server pid was 0x%x instead of 0x%x\n", new_info->server_pid, + GetCurrentProcessId()); + ok(new_info->server_tid == server_tid, "server tid was 0x%x instead of 0x%x\n", new_info->server_tid, + server_tid); + ok(new_info->method == method, "method was %d instead of %d\n", new_info->method, method); + ok(IsEqualGUID(&new_info->causality, &causality), "causality wasn't correct\n"); + } + ok(cbDataSize == 1, "cbDataSize should have been 1 instead of %d\n", cbDataSize); ok(*(unsigned char *)pDataBuffer == 0xcc, "pDataBuffer should have contained 0xcc instead of 0x%x\n", *(unsigned char *)pDataBuffer); ok(IsEqualGUID(uExtent, &EXTENTID_WineTest), "uExtent wasn't correct\n"); @@ -3549,10 +3637,26 @@ { SChannelHookCallInfo *info = (SChannelHookCallInfo *)riid; trace("TestChannelHook_ServerGetSize\n"); - trace("\t%s method %d\n", debugstr_iid(riid), info->iMethod); - ok(info->cbSize == sizeof(*info), "info->cbSize was %d instead of %d\n", info->cbSize, (int)sizeof(*info)); - ok(info->dwServerPid == GetCurrentProcessId(), "info->dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId()); - ok(info->pObject != NULL, "info->pObject shouldn't be NULL\n"); + trace("\t%s\n", debugstr_iid(riid)); + if (!new_hook_struct) + { + ok(info->cbSize == sizeof(*info), "cbSize was %d instead of %d\n", info->cbSize, (int)sizeof(*info)); + ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId()); + ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method); + ok(info->pObject != NULL, "pObject shouldn't be NULL\n"); + ok(IsEqualGUID(&info->uCausality, &causality), "causality wasn't correct\n"); + } + else + { + struct new_hook_info *new_info = (struct new_hook_info *)riid; + ok(new_info->server_pid == GetCurrentProcessId(), "server pid was 0x%x instead of 0x%x\n", new_info->server_pid, + GetCurrentProcessId()); + ok(new_info->server_tid == server_tid, "server tid was 0x%x instead of 0x%x\n", new_info->server_tid, + server_tid); + ok(new_info->method == method, "method was %d instead of %d\n", new_info->method, method); + ok(IsEqualGUID(&new_info->causality, &causality), "causality wasn't correct\n"); + } + ok(IsEqualGUID(uExtent, &EXTENTID_WineTest), "uExtent wasn't correct\n"); if (hrFault != S_OK) trace("\thrFault = 0x%08x\n", hrFault); @@ -3607,6 +3711,7 @@ hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream); ok_ole_success(hr, CreateStreamOnHGlobal); tid = start_host_object2(pStream, &IID_IClassFactory, (IUnknown*)&Test_ClassFactory, MSHLFLAGS_NORMAL, &MessageFilter, &thread); + server_tid = tid; ok_more_than_one_lock(); @@ -3617,8 +3722,11 @@ ok_more_than_one_lock(); + method = 3; hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (LPVOID*)&proxy); ok_ole_success(hr, IClassFactory_CreateInstance); + + method = 5; IUnknown_Release(proxy); IClassFactory_Release(cf); Modified: trunk/rostests/winetests/ole32/propvariant.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/propvaria…
============================================================================== --- trunk/rostests/winetests/ole32/propvariant.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/propvariant.c [iso-8859-1] Sun Mar 5 21:03:59 2017 @@ -176,16 +176,7 @@ } else if(flags == PROP_V0) ok(hr == S_OK, "%s (%s): got %08x\n", wine_vtypes[idx], modifier, hr); - else if(flags & PROP_TODO) - { - todo_wine - { - if(hr != S_OK) - win_skip("%s (%s): unsupported\n", wine_vtypes[idx], modifier); - else ok(hr == S_OK, "%s (%s): got %08x\n", wine_vtypes[idx], modifier, hr); - } - } - else + else todo_wine_if(flags & PROP_TODO) { if(hr != S_OK) win_skip("%s (%s): unsupported\n", wine_vtypes[idx], modifier);
7 years, 9 months
1
0
0
0
[akhaldi] 74094: [OLE32] Sync with Wine Staging 2.2. CORE-12823 23607d0 ole32: Implement returning a name in IEnumSTATPROPSTG. 5cf1db5 ole32: Support reading VT_BOOL, VT_R8 and VT_I8 into propery s...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 5 21:03:00 2017 New Revision: 74094 URL:
http://svn.reactos.org/svn/reactos?rev=74094&view=rev
Log: [OLE32] Sync with Wine Staging 2.2. CORE-12823 23607d0 ole32: Implement returning a name in IEnumSTATPROPSTG. 5cf1db5 ole32: Support reading VT_BOOL, VT_R8 and VT_I8 into propery storage. 591c9c8 ole32: Correctly parse unicode property storage dictionaries. 93a8ede ole32: Add a __WINE_ALLOC_SIZE attribute to heap_alloc(). 182fad8 ole32: Call GetClipboardFormatName with the correct parameters. e31dd0f ole32: Use a HWND_MESSAGE window for the clipboard. c85eaae ole32: Only trace a clipboard format name if it has one. 77e566a ole32: Don't set zero-size clipboard data, this no longer works. Modified: trunk/reactos/dll/win32/ole32/clipboard.c trunk/reactos/dll/win32/ole32/compobj_private.h trunk/reactos/dll/win32/ole32/enumx.c trunk/reactos/dll/win32/ole32/enumx.h trunk/reactos/dll/win32/ole32/ole32.spec trunk/reactos/dll/win32/ole32/stg_prop.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/ole32/clipboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/clipboard.…
============================================================================== --- trunk/reactos/dll/win32/ole32/clipboard.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/clipboard.c [iso-8859-1] Sun Mar 5 21:03:00 2017 @@ -1094,7 +1094,7 @@ h = GetClipboardData(wine_marshal_clipboard_format); if(!h) return S_FALSE; - if(GlobalSize(h) == 0) return S_FALSE; + if(GlobalSize(h) <= 1) return S_FALSE; ptr = GlobalLock(h); if(!ptr) return S_FALSE; @@ -1182,9 +1182,11 @@ for(cf = 0; (cf = EnumClipboardFormats(cf)) != 0; count++) { - char buf[100]; - GetClipboardFormatNameA(cf, buf, sizeof(buf)); - TRACE("cf %04x %s\n", cf, buf); + WCHAR buf[256]; + if (GetClipboardFormatNameW(cf, buf, sizeof(buf) / sizeof(WCHAR))) + TRACE("cf %04x %s\n", cf, debugstr_w(buf)); + else + TRACE("cf %04x\n", cf); } TRACE("count %d\n", count); size += count * sizeof(ret->entries[0]); @@ -1941,7 +1943,7 @@ dup_global_mem(h_stm, GMEM_DDESHARE|GMEM_MOVEABLE, &h); } else /* flushed */ - h = GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE, 0); + h = GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE, 1); if(!h) return E_OUTOFMEMORY; @@ -2084,8 +2086,7 @@ RegisterClassExW(&class); return CreateWindowW(clipbrd_wndclass, title, WS_POPUP | WS_CLIPSIBLINGS | WS_OVERLAPPED, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - NULL, NULL, hinst, 0); + 0, 0, 0, 0, HWND_MESSAGE, NULL, hinst, 0); } /********************************************************************* Modified: trunk/reactos/dll/win32/ole32/compobj_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/compobj_pr…
============================================================================== --- trunk/reactos/dll/win32/ole32/compobj_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/compobj_private.h [iso-8859-1] Sun Mar 5 21:03:00 2017 @@ -309,7 +309,7 @@ extern const char *debugstr_formatetc(const FORMATETC *formatetc) DECLSPEC_HIDDEN; -static inline void *heap_alloc(size_t len) +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t len) { return HeapAlloc(GetProcessHeap(), 0, len); } Modified: trunk/reactos/dll/win32/ole32/enumx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/enumx.c?re…
============================================================================== --- trunk/reactos/dll/win32/ole32/enumx.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/enumx.c [iso-8859-1] Sun Mar 5 21:03:00 2017 @@ -30,6 +30,8 @@ struct list *current; ULONG elem_size; GUID riid; + IUnknown *parent; + enumx_copy_cb copy_cb; }; /************************************************************************ @@ -80,6 +82,7 @@ list_remove(x); HeapFree(GetProcessHeap(), 0, x); } + IUnknown_Release(This->parent); HeapFree(GetProcessHeap(), 0, This); } return ref; @@ -101,7 +104,10 @@ p = rgelt; while (count < celt && This->current && This->current != &This->elements) { - memcpy(p, &This->current[1], This->elem_size); + if (This->copy_cb) + This->copy_cb(This->parent, &This->current[1], p); + else + memcpy(p, &This->current[1], This->elem_size); p += This->elem_size; This->current = This->current->next; count++; @@ -158,7 +164,8 @@ * * Allocate a generic enumerator */ -enumx_impl *enumx_allocate(REFIID riid, const void *vtbl, ULONG elem_size) +enumx_impl *enumx_allocate(REFIID riid, const void *vtbl, ULONG elem_size, + IUnknown *parent, enumx_copy_cb copy_cb) { enumx_impl *enumx; @@ -170,6 +177,11 @@ enumx->current = NULL; enumx->elem_size = elem_size; enumx->riid = *riid; + enumx->parent = parent; + enumx->copy_cb = copy_cb; + + IUnknown_AddRef(parent); + list_init(&enumx->elements); } Modified: trunk/reactos/dll/win32/ole32/enumx.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/enumx.h?re…
============================================================================== --- trunk/reactos/dll/win32/ole32/enumx.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/enumx.h [iso-8859-1] Sun Mar 5 21:03:00 2017 @@ -21,6 +21,8 @@ typedef struct tagEnumSTATPROPSETSTG_impl enumx_impl; +typedef void (*enumx_copy_cb)(IUnknown *parent, void *orig, void *dest); + extern HRESULT WINAPI enumx_QueryInterface(enumx_impl *, REFIID, void**) DECLSPEC_HIDDEN; extern ULONG WINAPI enumx_AddRef(enumx_impl *) DECLSPEC_HIDDEN; extern ULONG WINAPI enumx_Release(enumx_impl *) DECLSPEC_HIDDEN; @@ -28,7 +30,8 @@ extern HRESULT WINAPI enumx_Skip(enumx_impl *, ULONG) DECLSPEC_HIDDEN; extern HRESULT WINAPI enumx_Reset(enumx_impl *) DECLSPEC_HIDDEN; extern HRESULT WINAPI enumx_Clone(enumx_impl *, enumx_impl **) DECLSPEC_HIDDEN; -extern enumx_impl *enumx_allocate(REFIID, const void *, ULONG) DECLSPEC_HIDDEN; +extern enumx_impl *enumx_allocate(REFIID, const void *, ULONG, + IUnknown *, enumx_copy_cb) DECLSPEC_HIDDEN; extern void *enumx_add_element(enumx_impl *, const void *) DECLSPEC_HIDDEN; #endif /* __OLE_ENUM_H__ */ Modified: trunk/reactos/dll/win32/ole32/ole32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole32.spec…
============================================================================== --- trunk/reactos/dll/win32/ole32/ole32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole32.spec [iso-8859-1] Sun Mar 5 21:03:00 2017 @@ -45,7 +45,7 @@ @ stdcall CoGetDefaultContext(long ptr ptr) @ stdcall CoGetInstanceFromFile(ptr ptr ptr long long wstr long ptr) @ stdcall CoGetInstanceFromIStorage(ptr ptr ptr long ptr long ptr) -# CoGetInterceptor +@ stdcall -stub CoGetInterceptor(ptr ptr ptr ptr) # CoGetInterceptorFromTypeInfo @ stdcall CoGetInterfaceAndReleaseStream(ptr ptr ptr) @ stdcall CoGetMalloc(long ptr) Modified: trunk/reactos/dll/win32/ole32/stg_prop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/stg_prop.c…
============================================================================== --- trunk/reactos/dll/win32/ole32/stg_prop.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/stg_prop.c [iso-8859-1] Sun Mar 5 21:03:00 2017 @@ -1004,15 +1004,18 @@ if (This->codePage != CP_UNICODE) ptr[cbEntry - 1] = '\0'; else - *((LPWSTR)ptr + cbEntry / sizeof(WCHAR)) = '\0'; + ((LPWSTR)ptr)[cbEntry - 1] = 0; hr = PropertyStorage_StoreNameWithId(This, (char*)ptr, This->codePage, propid); if (This->codePage == CP_UNICODE) { + /* cbEntry is the number of characters */ + cbEntry *= 2; + /* Unicode entries are padded to DWORD boundaries */ if (cbEntry % sizeof(DWORD)) ptr += sizeof(DWORD) - (cbEntry % sizeof(DWORD)); } - ptr += sizeof(DWORD) + cbEntry; + ptr += cbEntry; } return hr; } @@ -1052,6 +1055,10 @@ case VT_UI1: prop->u.bVal = *data; TRACE("Read byte 0x%x\n", prop->u.bVal); + break; + case VT_BOOL: + StorageUtl_ReadWord(data, 0, (WORD*)&prop->u.boolVal); + TRACE("Read bool %d\n", prop->u.boolVal); break; case VT_I2: StorageUtl_ReadWord(data, 0, (WORD*)&prop->u.iVal); @@ -1070,6 +1077,18 @@ case VT_UI4: StorageUtl_ReadDWord(data, 0, &prop->u.ulVal); TRACE("Read ulong %d\n", prop->u.ulVal); + break; + case VT_I8: + StorageUtl_ReadULargeInteger(data, 0, (ULARGE_INTEGER *)&prop->u.hVal); + TRACE("Read long long %s\n", wine_dbgstr_longlong(prop->u.hVal.QuadPart)); + break; + case VT_UI8: + StorageUtl_ReadULargeInteger(data, 0, &prop->u.uhVal); + TRACE("Read ulong long %s\n", wine_dbgstr_longlong(prop->u.uhVal.QuadPart)); + break; + case VT_R8: + memcpy(&prop->u.dblVal, data, sizeof(double)); + TRACE("Read double %f\n", prop->u.dblVal); break; case VT_LPSTR: { @@ -2364,7 +2383,9 @@ enumx = enumx_allocate(&IID_IEnumSTATPROPSETSTG, &IEnumSTATPROPSETSTG_Vtbl, - sizeof (STATPROPSETSTG)); + sizeof (STATPROPSETSTG), + (IUnknown*)&This->base.IStorage_iface, + NULL); /* add all the property set elements into a list */ r = IStorage_EnumElements(stg, 0, NULL, 0, &penum); @@ -2457,6 +2478,27 @@ return enumx_Clone((enumx_impl*)iface, (enumx_impl**)ppenum); } +static void prop_enum_copy_cb(IUnknown *parent, void *orig, void *dest) +{ + PropertyStorage_impl *storage = impl_from_IPropertyStorage((IPropertyStorage*)parent); + STATPROPSTG *src_prop = orig; + STATPROPSTG *dest_prop = dest; + LPWSTR name; + + dest_prop->propid = src_prop->propid; + dest_prop->vt = src_prop->vt; + dest_prop->lpwstrName = NULL; + + if (dictionary_find(storage->propid_to_name, UlongToPtr(src_prop->propid), (void**)&name)) + { + DWORD size = (strlenW(name) + 1) * sizeof(WCHAR); + + dest_prop->lpwstrName = CoTaskMemAlloc(size); + if (!dest_prop->lpwstrName) return; + memcpy(dest_prop->lpwstrName, name, size); + } +} + static BOOL prop_enum_stat(const void *k, const void *v, void *extra, void *arg) { enumx_impl *enumx = arg; @@ -2483,7 +2525,9 @@ enumx = enumx_allocate(&IID_IEnumSTATPROPSTG, &IEnumSTATPROPSTG_Vtbl, - sizeof (STATPROPSTG)); + sizeof (STATPROPSTG), + (IUnknown*)&This->IPropertyStorage_iface, + prop_enum_copy_cb); dictionary_enumerate(This->propid_to_prop, prop_enum_stat, enumx); 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] Sun Mar 5 21:03:00 2017 @@ -139,7 +139,7 @@ reactos/dll/win32/objsel # Synced to WineStaging-1.9.11 reactos/dll/win32/odbc32 # Synced to WineStaging-2.2. Depends on port of Linux ODBC. reactos/dll/win32/odbccp32 # Synced to WineStaging-1.9.11 -reactos/dll/win32/ole32 # Synced to WineStaging-1.9.23 +reactos/dll/win32/ole32 # Synced to WineStaging-2.2 reactos/dll/win32/oleacc # Synced to WineStaging-1.9.11 reactos/dll/win32/oleaut32 # Synced to WineStaging-1.9.23 reactos/dll/win32/olecli32 # Synced to WineStaging-1.9.11
7 years, 9 months
1
0
0
0
[akhaldi] 74093: [COMDLG32_WINETEST] Sync with Wine Staging 2.2. CORE-12823
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 5 20:57:57 2017 New Revision: 74093 URL:
http://svn.reactos.org/svn/reactos?rev=74093&view=rev
Log: [COMDLG32_WINETEST] Sync with Wine Staging 2.2. CORE-12823 Modified: trunk/rostests/winetests/comdlg32/filedlg.c Modified: trunk/rostests/winetests/comdlg32/filedlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comdlg32/filedl…
============================================================================== --- trunk/rostests/winetests/comdlg32/filedlg.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comdlg32/filedlg.c [iso-8859-1] Sun Mar 5 20:57:57 2017 @@ -36,6 +36,9 @@ #include <shlguid.h> #define COBJMACROS #include <shobjidl.h> + +#include <ole2.h> +#include <reactos/undocuser.h> /* ##### */ @@ -1274,6 +1277,73 @@ todo_wine ok(!ret, "GetOpenFileNameW returned %#x\n", ret); } +static UINT_PTR WINAPI test_ole_init_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + HRESULT hr; + + hr = OleInitialize(NULL); + ok(hr == S_FALSE, "OleInitialize() returned %#x\n", hr); + OleUninitialize(); + + if (msg == WM_NOTIFY) + PostMessageA(GetParent(dlg), WM_COMMAND, IDCANCEL, 0); + return FALSE; +} + +static LRESULT CALLBACK hook_proc(int code, WPARAM wp, LPARAM lp) +{ + static BOOL first_dlg = TRUE; + HRESULT hr; + + if (code == HCBT_CREATEWND) + { + CBT_CREATEWNDW *c = (CBT_CREATEWNDW *)lp; + + if (c->lpcs->lpszClass == (LPWSTR)WC_DIALOG) + { + /* OleInitialize() creates a window for the main apartment. Since + * Vista OleInitialize() is called before the file dialog is + * created. SimCity 2000 expects that the first window created + * after GetOpenFileA() is a file dialog window. Mark Vista+ + * behavior as broken. */ + hr = OleInitialize(NULL); + ok((first_dlg ? hr == S_OK : hr == S_FALSE) + || broken(first_dlg && hr == S_FALSE), + "OleInitialize() returned %#x (first dialog %#x)\n", hr, first_dlg); + OleUninitialize(); + first_dlg = FALSE; + } + } + + return CallNextHookEx(NULL, code, wp, lp); +} + +static void test_ole_initialization(void) +{ + char file[MAX_PATH] = {0}; + OPENFILENAMEA ofn = {0}; + HRESULT hr; + HHOOK hook; + BOOL ret; + + hook = SetWindowsHookExW(WH_CBT, hook_proc, NULL, GetCurrentThreadId()); + + ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400A; + ofn.lpstrFile = file; + ofn.nMaxFile = MAX_PATH; + ofn.lpfnHook = test_ole_init_wndproc; + ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER; + ofn.hInstance = GetModuleHandleA(NULL); + ret = GetOpenFileNameA(&ofn); + ok(!ret, "GetOpenFileNameA returned %#x\n", ret); + + hr = OleInitialize(NULL); + ok(hr == S_OK, "OleInitialize() returned %#x\n", hr); + OleUninitialize(); + + UnhookWindowsHookEx(hook); +} + START_TEST(filedlg) { test_DialogCancel(); @@ -1288,4 +1358,5 @@ test_extension(); test_null_filename(); test_directory_filename(); -} + test_ole_initialization(); +}
7 years, 9 months
1
0
0
0
[akhaldi] 74092: [COMDLG32] Sync with Wine Staging 2.2. CORE-12823 e07d20f comdlg32: Don't crash if an IShellFolder could not be created. bd1b3c1 comdlg32: Use localized "Path does not exist" strin...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 5 20:57:05 2017 New Revision: 74092 URL:
http://svn.reactos.org/svn/reactos?rev=74092&view=rev
Log: [COMDLG32] Sync with Wine Staging 2.2. CORE-12823 e07d20f comdlg32: Don't crash if an IShellFolder could not be created. bd1b3c1 comdlg32: Use localized "Path does not exist" string. 1707df3 comdlg32: Delay OleInitialize() until after file dialog window is created. 6c4aaf7 comdlg32: Always use original Open File dialog template. eff2ecc comdlg32: Avoid some superfluous pointer casts. Modified: trunk/reactos/dll/win32/comdlg32/filedlg.c trunk/reactos/dll/win32/comdlg32/filedlgbrowser.h trunk/reactos/dll/win32/comdlg32/itemdlg.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/comdlg32/filedlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/filedlg…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/filedlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/filedlg.c [iso-8859-1] Sun Mar 5 20:57:05 2017 @@ -219,14 +219,10 @@ */ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos) { - LRESULT lRes; - LPCVOID origTemplate; - DWORD dwSize; - LPDLGTEMPLATEW template; + void *template; HRSRC hRes; HANDLE hDlgTmpl = 0; - HRESULT hr; /* test for missing functionality */ if (fodInfos->ofnInfos->Flags & UNIMPLEMENTED_FLAGS) @@ -242,36 +238,25 @@ COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE); return FALSE; } - if (!(dwSize = SizeofResource(COMDLG32_hInstance, hRes)) || - !(hDlgTmpl = LoadResource(COMDLG32_hInstance, hRes)) || - !(origTemplate = LockResource(hDlgTmpl))) + if (!(hDlgTmpl = LoadResource(COMDLG32_hInstance, hRes )) || + !(template = LockResource( hDlgTmpl ))) { COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); return FALSE; } - if (!(template = HeapAlloc(GetProcessHeap(), 0, dwSize))) - { - COMDLG32_SetCommDlgExtendedError(CDERR_MEMALLOCFAILURE); - return FALSE; - } - memcpy(template, origTemplate, dwSize); /* msdn: explorer style dialogs permit sizing by default. * The OFN_ENABLESIZING flag is only needed when a hook or - * custom tmeplate is provided */ + * custom template is provided */ if( (fodInfos->ofnInfos->Flags & OFN_EXPLORER) && !(fodInfos->ofnInfos->Flags & ( OFN_ENABLEHOOK | OFN_ENABLETEMPLATE | OFN_ENABLETEMPLATEHANDLE))) fodInfos->ofnInfos->Flags |= OFN_ENABLESIZING; if (fodInfos->ofnInfos->Flags & OFN_ENABLESIZING) { - template->style |= WS_SIZEBOX; fodInfos->sizedlg.cx = fodInfos->sizedlg.cy = 0; fodInfos->initial_size.x = fodInfos->initial_size.y = 0; } - else - template->style &= ~WS_SIZEBOX; - /* old style hook messages */ if (IsHooked(fodInfos)) @@ -281,9 +266,6 @@ fodInfos->HookMsg.helpmsgstring = RegisterWindowMessageW(HELPMSGSTRINGW); fodInfos->HookMsg.sharevistring = RegisterWindowMessageW(SHAREVISTRINGW); } - - /* Some shell namespace extensions depend on COM being initialized. */ - hr = OleInitialize(NULL); if (fodInfos->unicode) lRes = DialogBoxIndirectParamW(COMDLG32_hInstance, @@ -297,10 +279,8 @@ fodInfos->ofnInfos->hwndOwner, FileOpenDlgProc95, (LPARAM) fodInfos); - if (SUCCEEDED(hr)) + if (fodInfos->ole_initialized) OleUninitialize(); - - HeapFree(GetProcessHeap(), 0, template); /* Unable to create the dialog */ if( lRes == -1) @@ -1263,7 +1243,11 @@ int gripx = GetSystemMetrics( SM_CYHSCROLL); int gripy = GetSystemMetrics( SM_CYVSCROLL); - /* Adds the FileOpenDlgInfos in the property list of the dialog + /* Some shell namespace extensions depend on COM being initialized. */ + if (SUCCEEDED(OleInitialize(NULL))) + fodInfos->ole_initialized = TRUE; + + /* Adds the FileOpenDlgInfos in the property list of the dialog so it will be easily accessible through a GetPropA(...) */ SetPropA(hwnd, FileOpenDlgInfosStr, fodInfos); @@ -1271,7 +1255,31 @@ if (fodInfos->ofnInfos->Flags & OFN_ENABLESIZING) { - GetWindowRect( hwnd, &rc); + DWORD style = GetWindowLongW(hwnd, GWL_STYLE); + DWORD ex_style = GetWindowLongW(hwnd, GWL_EXSTYLE); + RECT client, client_adjusted; + + if (fodInfos->ofnInfos->Flags & OFN_ENABLESIZING) + { + style |= WS_SIZEBOX; + ex_style |= WS_EX_WINDOWEDGE; + } + else + style &= ~WS_SIZEBOX; + SetWindowLongW(hwnd, GWL_STYLE, style); + SetWindowLongW(hwnd, GWL_EXSTYLE, ex_style); + + GetClientRect( hwnd, &client ); + GetClientRect( hwnd, &client_adjusted ); + AdjustWindowRectEx( &client_adjusted, style, FALSE, ex_style ); + + GetWindowRect( hwnd, &rc ); + rc.right += client_adjusted.right - client.right; + rc.bottom += client_adjusted.bottom - client.bottom; + SetWindowPos(hwnd, 0, 0, 0, rc.right - rc.left, rc.bottom - rc.top, SWP_FRAMECHANGED | SWP_NOACTIVATE | + SWP_NOZORDER | SWP_NOMOVE); + + GetWindowRect( hwnd, &rc ); fodInfos->DlgInfos.hwndGrip = CreateWindowExA( 0, "SCROLLBAR", NULL, WS_CHILD | WS_GROUP | WS_VISIBLE | WS_CLIPSIBLINGS | @@ -2911,7 +2919,8 @@ IShellView_DestroyViewWindow(fodInfos->Shell.FOIShellView); IShellView_Release(fodInfos->Shell.FOIShellView); } - IShellFolder_Release(fodInfos->Shell.FOIShellFolder); + if (fodInfos->Shell.FOIShellFolder) + IShellFolder_Release(fodInfos->Shell.FOIShellFolder); IShellBrowser_Release(fodInfos->Shell.FOIShellBrowser); if (fodInfos->Shell.FOIDataObject) IDataObject_Release(fodInfos->Shell.FOIDataObject); @@ -3987,9 +3996,9 @@ if ( FAILED( IShellBrowser_BrowseObject( fodInfos->Shell.FOIShellBrowser, pidlSelection, SBSP_RELATIVE ) ) ) { - static const WCHAR notexist[] = {'P','a','t','h',' ','d','o','e','s', - ' ','n','o','t',' ','e','x','i','s','t',0}; - MessageBoxW( hwnd, notexist, fodInfos->title, MB_OK | MB_ICONEXCLAMATION ); + WCHAR buf[64]; + LoadStringW( COMDLG32_hInstance, IDS_PATHNOTEXISTING, buf, sizeof(buf)/sizeof(WCHAR) ); + MessageBoxW( hwnd, buf, fodInfos->title, MB_OK | MB_ICONEXCLAMATION ); } bBrowseSelFolder = TRUE; if(fodInfos->ofnInfos->Flags & OFN_EXPLORER) Modified: trunk/reactos/dll/win32/comdlg32/filedlgbrowser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/filedlg…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/filedlgbrowser.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/filedlgbrowser.h [iso-8859-1] Sun Mar 5 20:57:05 2017 @@ -81,6 +81,7 @@ UINT sharevistring; } HookMsg; + BOOL ole_initialized; } FileOpenDlgInfos; /*********************************************************************** Modified: trunk/reactos/dll/win32/comdlg32/itemdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/itemdlg…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/itemdlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/itemdlg.c [iso-8859-1] Sun Mar 5 20:57:05 2017 @@ -1958,7 +1958,7 @@ if (umessage == WM_LBUTTONDOWN) { - FileDialogImpl *This = (FileDialogImpl*)GetPropW(hwnd, prop_this); + FileDialogImpl *This = GetPropW(hwnd, prop_this); SendMessageW(hwnd, BM_SETCHECK, BST_CHECKED, 0); show_opendropdown(This); @@ -2051,7 +2051,7 @@ SendMessageW(dropdown_hwnd, WM_SETFONT, (LPARAM)This->hfont_opendropdown, 0); /* Subclass button so we can handle LBUTTONDOWN */ - SetPropW(dropdown_hwnd, prop_this, (HANDLE)This); + SetPropW(dropdown_hwnd, prop_this, This); SetPropW(dropdown_hwnd, prop_oldwndproc, (HANDLE)SetWindowLongPtrW(dropdown_hwnd, GWLP_WNDPROC, (LONG_PTR)dropdown_subclass_proc)); } 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] Sun Mar 5 20:57:05 2017 @@ -55,7 +55,7 @@ reactos/dll/win32/clusapi # Synced to WineStaging-1.9.11 reactos/dll/win32/comcat # Synced to WineStaging-1.9.11 reactos/dll/win32/comctl32 # Synced to WineStaging-2.2 -reactos/dll/win32/comdlg32 # Synced to WineStaging-1.9.23 +reactos/dll/win32/comdlg32 # Synced to WineStaging-2.2 reactos/dll/win32/compstui # Synced to WineStaging-2.2 reactos/dll/win32/credui # Synced to WineStaging-2.2 reactos/dll/win32/crypt32 # Synced to WineStaging-1.9.23
7 years, 9 months
1
0
0
0
[akhaldi] 74091: [COMCTL32_WINETEST] Sync with Wine Staging 2.2. CORE-12823
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 5 20:53:49 2017 New Revision: 74091 URL:
http://svn.reactos.org/svn/reactos?rev=74091&view=rev
Log: [COMCTL32_WINETEST] Sync with Wine Staging 2.2. CORE-12823 Modified: trunk/rostests/winetests/comctl32/datetime.c trunk/rostests/winetests/comctl32/header.c trunk/rostests/winetests/comctl32/imagelist.c trunk/rostests/winetests/comctl32/listview.c trunk/rostests/winetests/comctl32/monthcal.c trunk/rostests/winetests/comctl32/mru.c trunk/rostests/winetests/comctl32/pager.c trunk/rostests/winetests/comctl32/propsheet.c trunk/rostests/winetests/comctl32/toolbar.c trunk/rostests/winetests/comctl32/tooltips.c trunk/rostests/winetests/comctl32/trackbar.c trunk/rostests/winetests/comctl32/treeview.c Modified: trunk/rostests/winetests/comctl32/datetime.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/dateti…
============================================================================== --- trunk/rostests/winetests/comctl32/datetime.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/datetime.c [iso-8859-1] Sun Mar 5 20:53:49 2017 @@ -532,23 +532,14 @@ { LRESULT r; SYSTEMTIME st, getSt, ref; - HWND hWnd, hWndDateTime_test_gdt_none; - - hWndDateTime_test_gdt_none = create_datetime_control(0); - - ok(hWndDateTime_test_gdt_none!=NULL, "Expected non NULL, got %p\n", hWndDateTime_test_gdt_none); - if(hWndDateTime_test_gdt_none) { - r = SendMessageA(hWndDateTime_test_gdt_none, DTM_SETSYSTEMTIME, GDT_NONE, (LPARAM)&st); - expect(0, r); - } - else { - skip("hWndDateTime_test_gdt_none is NULL\n"); - flush_sequences(sequences, NUM_MSG_SEQUENCES); - - return; - } - - DestroyWindow(hWndDateTime_test_gdt_none); + HWND hWnd; + + hWnd = create_datetime_control(0); + ok(hWnd !=NULL, "Expected non NULL, got %p\n", hWnd); + r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_NONE, (LPARAM)&st); + expect(0, r); + + DestroyWindow(hWnd); hWnd = create_datetime_control(DTS_SHOWNONE); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -802,7 +793,7 @@ pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); if (!pInitCommonControlsEx) { - skip("InitCommonControlsEx() is missing. Skipping the tests\n"); + win_skip("InitCommonControlsEx() is missing. Skipping the tests\n"); return; } iccex.dwSize = sizeof(iccex); Modified: trunk/rostests/winetests/comctl32/header.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/header…
============================================================================== --- trunk/rostests/winetests/comctl32/header.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/header.c [iso-8859-1] Sun Mar 5 20:53:49 2017 @@ -1673,7 +1673,7 @@ pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); if (!pInitCommonControlsEx) { - skip("InitCommonControlsEx() is missing. Skipping the tests\n"); + win_skip("InitCommonControlsEx() is missing. Skipping the tests\n"); return FALSE; } Modified: trunk/rostests/winetests/comctl32/imagelist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/imagel…
============================================================================== --- trunk/rostests/winetests/comctl32/imagelist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/imagelist.c [iso-8859-1] Sun Mar 5 20:53:49 2017 @@ -34,9 +34,9 @@ #include <windef.h> #include <winbase.h> #include <wingdi.h> -#include <winuser.h> #include <objbase.h> #include <commctrl.h> /* must be included after objbase.h to get ImageList_Write */ +#include <ole2.h> #include <initguid.h> #include <commoncontrols.h> #include <shellapi.h> @@ -70,6 +70,7 @@ static HRESULT (WINAPI *pImageList_CoCreateInstance)(REFCLSID,const IUnknown *, REFIID,void **); static HRESULT (WINAPI *pHIMAGELIST_QueryInterface)(HIMAGELIST,REFIID,void **); +static int (WINAPI *pImageList_SetColorTable)(HIMAGELIST,int,int,RGBQUAD*); static HINSTANCE hinst; @@ -678,16 +679,15 @@ #define BMP_CX 48 -struct my_IStream +struct memstream { IStream IStream_iface; - char *iml_data; /* written imagelist data */ - ULONG iml_data_size; + IStream *stream; }; -static struct my_IStream *impl_from_IStream(IStream *iface) -{ - return CONTAINING_RECORD(iface, struct my_IStream, IStream_iface); +static struct memstream *impl_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, struct memstream, IStream_iface); } static HRESULT STDMETHODCALLTYPE Test_Stream_QueryInterface(IStream *iface, REFIID riid, @@ -712,34 +712,15 @@ static HRESULT STDMETHODCALLTYPE Test_Stream_Read(IStream *iface, void *pv, ULONG cb, ULONG *pcbRead) { - ok(0, "unexpected call\n"); - return E_NOTIMPL; -} - -static BOOL allocate_storage(struct my_IStream *my_is, ULONG add) -{ - my_is->iml_data_size += add; - - if (!my_is->iml_data) - my_is->iml_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, my_is->iml_data_size); - else - my_is->iml_data = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, my_is->iml_data, my_is->iml_data_size); - - return my_is->iml_data != NULL; + struct memstream *stream = impl_from_IStream(iface); + return IStream_Read(stream->stream, pv, cb, pcbRead); } static HRESULT STDMETHODCALLTYPE Test_Stream_Write(IStream *iface, const void *pv, ULONG cb, ULONG *pcbWritten) { - struct my_IStream *my_is = impl_from_IStream(iface); - ULONG current_iml_data_size = my_is->iml_data_size; - - if (!allocate_storage(my_is, cb)) return E_FAIL; - - memcpy(my_is->iml_data + current_iml_data_size, pv, cb); - if (pcbWritten) *pcbWritten = cb; - - return S_OK; + struct memstream *stream = impl_from_IStream(iface); + return IStream_Write(stream->stream, pv, cb, pcbWritten); } static HRESULT STDMETHODCALLTYPE Test_Stream_Seek(IStream *iface, LARGE_INTEGER dlibMove, @@ -820,7 +801,17 @@ Test_Stream_Clone }; -static struct my_IStream Test_Stream = { { &Test_Stream_Vtbl }, 0, 0 }; +static void init_memstream(struct memstream *stream) +{ + stream->IStream_iface.lpVtbl = &Test_Stream_Vtbl; + CreateStreamOnHGlobal(NULL, TRUE, &stream->stream); +} + +static void cleanup_memstream(struct memstream *stream) +{ + IStream_Release(stream->stream); +} + static INT DIB_GetWidthBytes( int width, int bpp ) { @@ -919,15 +910,17 @@ return hbmp; } -#define iml_clear_stream_data() \ - HeapFree(GetProcessHeap(), 0, Test_Stream.iml_data); \ - Test_Stream.iml_data = NULL; \ - Test_Stream.iml_data_size = 0; - static void check_iml_data(HIMAGELIST himl, INT cx, INT cy, INT cur, INT max, INT grow, INT width, INT height, INT flags, const char *comment) { INT ret, cxx, cyy, size; + struct memstream stream; + LARGE_INTEGER mv; + HIMAGELIST himl2; + HGLOBAL hglobal; + STATSTG stat; + char *data; + HRESULT hr; trace("%s\n", comment); @@ -939,25 +932,39 @@ ok(cxx == cx, "wrong cx %d (expected %d)\n", cxx, cx); ok(cyy == cy, "wrong cy %d (expected %d)\n", cyy, cy); - iml_clear_stream_data(); - ret = ImageList_Write(himl, &Test_Stream.IStream_iface); + init_memstream(&stream); + ret = ImageList_Write(himl, &stream.IStream_iface); ok(ret, "ImageList_Write failed\n"); - ok(Test_Stream.iml_data != 0, "ImageList_Write didn't write any data\n"); - ok(Test_Stream.iml_data_size > sizeof(ILHEAD), "ImageList_Write wrote not enough data\n"); - - check_ilhead_data(Test_Stream.iml_data, cx, cy, cur, max, grow, flags); - size = check_bitmap_data(Test_Stream.iml_data + sizeof(ILHEAD), - Test_Stream.iml_data_size - sizeof(ILHEAD), - width, height, flags & 0xfe, comment); - if (size < Test_Stream.iml_data_size - sizeof(ILHEAD)) /* mask is present */ + hr = GetHGlobalFromStream(stream.stream, &hglobal); + ok(hr == S_OK, "Failed to get hglobal, %#x\n", hr); + + IStream_Stat(stream.stream, &stat, STATFLAG_NONAME); + + data = GlobalLock(hglobal); + + ok(data != 0, "ImageList_Write didn't write any data\n"); + ok(stat.cbSize.LowPart > sizeof(ILHEAD), "ImageList_Write wrote not enough data\n"); + + check_ilhead_data(data, cx, cy, cur, max, grow, flags); + size = check_bitmap_data(data + sizeof(ILHEAD), stat.cbSize.LowPart - sizeof(ILHEAD), + width, height, flags & 0xfe, comment); + if (size < stat.cbSize.LowPart - sizeof(ILHEAD)) /* mask is present */ { - ok( flags & ILC_MASK, "extra data %u/%u but mask not expected\n", - Test_Stream.iml_data_size, size ); - check_bitmap_data(Test_Stream.iml_data + sizeof(ILHEAD) + size, - Test_Stream.iml_data_size - sizeof(ILHEAD) - size, + ok( flags & ILC_MASK, "extra data %u/%u but mask not expected\n", stat.cbSize.LowPart, size ); + check_bitmap_data(data + sizeof(ILHEAD) + size, stat.cbSize.LowPart - sizeof(ILHEAD) - size, width, height, 1, comment); } + + /* rewind and reconstruct from stream */ + mv.QuadPart = 0; + IStream_Seek(stream.stream, mv, STREAM_SEEK_SET, NULL); + himl2 = ImageList_Read(&stream.IStream_iface); + ok(himl2 != NULL, "Failed to deserialize imagelist\n"); + ImageList_Destroy(himl2); + + GlobalUnlock(hglobal); + cleanup_memstream(&stream); } static void image_list_init(HIMAGELIST himl) @@ -1062,8 +1069,6 @@ ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); - /* test ImageList_Create storage allocation */ himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 0, 32); @@ -1076,7 +1081,6 @@ DeleteObject(hbm); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 4, 4); ok(himl != 0, "ImageList_Create failed\n"); @@ -1091,70 +1095,60 @@ DeleteObject(hbm); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 207, 209); ok(himl != 0, "ImageList_Create failed\n"); check_iml_data(himl, BMP_CX, BMP_CX, 0, 208, 212, BMP_CX * 4, BMP_CX * 52, ILC_COLOR24, "init 207 grow 209"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 209, 207); ok(himl != 0, "ImageList_Create failed\n"); check_iml_data(himl, BMP_CX, BMP_CX, 0, 210, 208, BMP_CX * 4, BMP_CX * 53, ILC_COLOR24, "init 209 grow 207"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 14, 4); ok(himl != 0, "ImageList_Create failed\n"); check_iml_data(himl, BMP_CX, BMP_CX, 0, 15, 4, BMP_CX * 4, BMP_CX * 4, ILC_COLOR24, "init 14 grow 4"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 5, 9); ok(himl != 0, "ImageList_Create failed\n"); check_iml_data(himl, BMP_CX, BMP_CX, 0, 6, 12, BMP_CX * 4, BMP_CX * 2, ILC_COLOR24, "init 5 grow 9"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 9, 5); ok(himl != 0, "ImageList_Create failed\n"); check_iml_data(himl, BMP_CX, BMP_CX, 0, 10, 8, BMP_CX * 4, BMP_CX * 3, ILC_COLOR24, "init 9 grow 5"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 2, 4); ok(himl != 0, "ImageList_Create failed\n"); check_iml_data(himl, BMP_CX, BMP_CX, 0, 3, 4, BMP_CX * 4, BMP_CX * 1, ILC_COLOR24, "init 2 grow 4"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24, 4, 2); ok(himl != 0, "ImageList_Create failed\n"); check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 4, BMP_CX * 4, BMP_CX * 2, ILC_COLOR24, "init 4 grow 2"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR8, 4, 2); ok(himl != 0, "ImageList_Create failed\n"); check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 4, BMP_CX * 4, BMP_CX * 2, ILC_COLOR8, "bpp 8"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4, 4, 2); ok(himl != 0, "ImageList_Create failed\n"); check_iml_data(himl, BMP_CX, BMP_CX, 0, 5, 4, BMP_CX * 4, BMP_CX * 2, ILC_COLOR4, "bpp 4"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, 0, 4, 2); ok(himl != 0, "ImageList_Create failed\n"); @@ -1166,7 +1160,6 @@ check_iml_data(himl, BMP_CX, BMP_CX, 2, 5, 4, BMP_CX * 4, BMP_CX * 2, ILC_COLOR4, "bpp default"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR24|ILC_MASK, 4, 2); ok(himl != 0, "ImageList_Create failed\n"); @@ -1180,7 +1173,6 @@ "bpp 24 + mask"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 4, 2); ok(himl != 0, "ImageList_Create failed\n"); @@ -1194,7 +1186,6 @@ "bpp 4 + mask"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 2, 99); ok(himl != 0, "ImageList_Create failed\n"); @@ -1223,7 +1214,6 @@ "init 2 grow 99 set count 42"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 2, 65536+12); ok(himl != 0, "ImageList_Create failed\n"); @@ -1231,7 +1221,6 @@ "init 2 grow 65536+12"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 2, 65535); ok(himl != 0, "ImageList_Create failed\n"); @@ -1239,7 +1228,6 @@ "init 2 grow 65535"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); himl = ImageList_Create(BMP_CX, BMP_CX, ILC_COLOR4|ILC_MASK, 2, -20); ok(himl != 0, "ImageList_Create failed\n"); @@ -1247,7 +1235,6 @@ "init 2 grow -20"); ret = ImageList_Destroy(himl); ok(ret, "ImageList_Destroy failed\n"); - iml_clear_stream_data(); } static void test_shell_imagelist(void) @@ -2034,6 +2021,205 @@ ok(himl == NULL, "got %p\n", himl); } +static void check_color_table(const char *name, HDC hdc, HIMAGELIST himl, UINT ilc, + RGBQUAD *expect, RGBQUAD *broken_expect) +{ + IMAGEINFO info; + INT ret; + char bmi_buffer[FIELD_OFFSET(BITMAPINFO, bmiColors) + 256 * sizeof(RGBQUAD)]; + BITMAPINFO *bmi = (BITMAPINFO *)bmi_buffer; + int i, depth = ilc & 0xfe; + + ret = ImageList_GetImageInfo(himl, 0, &info); + ok(ret, "got %d\n", ret); + ok(info.hbmImage != NULL, "got %p\n", info.hbmImage); + + memset(bmi_buffer, 0, sizeof(bmi_buffer)); + bmi->bmiHeader.biSize = sizeof(bmi->bmiHeader); + ret = GetDIBits(hdc, info.hbmImage, 0, 0, NULL, bmi, DIB_RGB_COLORS); + ok(ret, "got %d\n", ret); + ok(bmi->bmiHeader.biBitCount == depth, "got %d\n", bmi->bmiHeader.biBitCount); + + ret = GetDIBits(hdc, info.hbmImage, 0, 0, NULL, bmi, DIB_RGB_COLORS); + ok(ret, "got %d\n", ret); + ok(bmi->bmiHeader.biBitCount == depth, "got %d\n", bmi->bmiHeader.biBitCount); + + for (i = 0; i < (1 << depth); i++) + ok((bmi->bmiColors[i].rgbRed == expect[i].rgbRed && + bmi->bmiColors[i].rgbGreen == expect[i].rgbGreen && + bmi->bmiColors[i].rgbBlue == expect[i].rgbBlue) || + broken(bmi->bmiColors[i].rgbRed == broken_expect[i].rgbRed && + bmi->bmiColors[i].rgbGreen == broken_expect[i].rgbGreen && + bmi->bmiColors[i].rgbBlue == broken_expect[i].rgbBlue), + "%d: %s: got color[%d] %02x %02x %02x expect %02x %02x %02x\n", depth, name, i, + bmi->bmiColors[i].rgbRed, bmi->bmiColors[i].rgbGreen, bmi->bmiColors[i].rgbBlue, + expect[i].rgbRed, expect[i].rgbGreen, expect[i].rgbBlue); +} + +static void get_default_color_table(HDC hdc, int bpp, RGBQUAD *table) +{ + char bmi_buffer[FIELD_OFFSET(BITMAPINFO, bmiColors) + 256 * sizeof(RGBQUAD)]; + BITMAPINFO *bmi = (BITMAPINFO *)bmi_buffer; + HBITMAP tmp; + int i; + HPALETTE pal; + PALETTEENTRY entries[256]; + + switch (bpp) + { + case 4: + tmp = CreateBitmap( 1, 1, 1, 1, NULL ); + memset(bmi_buffer, 0, sizeof(bmi_buffer)); + bmi->bmiHeader.biSize = sizeof(bmi->bmiHeader); + bmi->bmiHeader.biHeight = 1; + bmi->bmiHeader.biWidth = 1; + bmi->bmiHeader.biBitCount = bpp; + bmi->bmiHeader.biPlanes = 1; + bmi->bmiHeader.biCompression = BI_RGB; + GetDIBits( hdc, tmp, 0, 0, NULL, bmi, DIB_RGB_COLORS ); + + memcpy(table, bmi->bmiColors, (1 << bpp) * sizeof(RGBQUAD)); + table[7] = bmi->bmiColors[8]; + table[8] = bmi->bmiColors[7]; + DeleteObject( tmp ); + break; + + case 8: + pal = CreateHalftonePalette(hdc); + GetPaletteEntries(pal, 0, 256, entries); + for (i = 0; i < 256; i++) + { + table[i].rgbRed = entries[i].peRed; + table[i].rgbGreen = entries[i].peGreen; + table[i].rgbBlue = entries[i].peBlue; + table[i].rgbReserved = 0; + } + DeleteObject(pal); + break; + + default: + ok(0, "unhandled depth %d\n", bpp); + } +} + +static void test_color_table(UINT ilc) +{ + HIMAGELIST himl; + INT ret; + char bmi_buffer[FIELD_OFFSET(BITMAPINFO, bmiColors) + 256 * sizeof(RGBQUAD)]; + BITMAPINFO *bmi = (BITMAPINFO *)bmi_buffer; + HDC hdc = CreateCompatibleDC(0); + HBITMAP dib4, dib8, dib32; + RGBQUAD rgb[256], default_table[256]; + + get_default_color_table(hdc, ilc & 0xfe, default_table); + + himl = ImageList_Create(16, 16, ilc, 0, 3); + ok(himl != NULL, "got %p\n", himl); + + memset(bmi_buffer, 0, sizeof(bmi_buffer)); + bmi->bmiHeader.biSize = sizeof(bmi->bmiHeader); + bmi->bmiHeader.biHeight = 16; + bmi->bmiHeader.biWidth = 16; + bmi->bmiHeader.biBitCount = 8; + bmi->bmiHeader.biPlanes = 1; + bmi->bmiHeader.biCompression = BI_RGB; + bmi->bmiColors[0].rgbRed = 0xff; + bmi->bmiColors[1].rgbGreen = 0xff; + bmi->bmiColors[2].rgbBlue = 0xff; + + dib8 = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, NULL, NULL, 0); + + bmi->bmiHeader.biBitCount = 4; + bmi->bmiColors[0].rgbRed = 0xff; + bmi->bmiColors[0].rgbGreen = 0x00; + bmi->bmiColors[0].rgbBlue = 0xff; + bmi->bmiColors[1].rgbRed = 0xff; + bmi->bmiColors[1].rgbGreen = 0xff; + bmi->bmiColors[1].rgbBlue = 0x00; + bmi->bmiColors[2].rgbRed = 0x00; + bmi->bmiColors[2].rgbGreen = 0xff; + bmi->bmiColors[2].rgbBlue = 0xff; + + dib4 = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, NULL, NULL, 0); + + bmi->bmiHeader.biBitCount = 32; + + dib32 = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, NULL, NULL, 0); + + /* add 32 first then 8. This won't set the color table */ + ret = ImageList_Add(himl, dib32, NULL); + ok(ret == 0, "got %d\n", ret); + ret = ImageList_Add(himl, dib8, NULL); + ok(ret == 1, "got %d\n", ret); + + check_color_table("add 32, 8", hdc, himl, ilc, default_table, NULL); + + /* since the previous _Adds didn't set the color table, this one will */ + ret = ImageList_Remove(himl, -1); + ok(ret, "got %d\n", ret); + ret = ImageList_Add(himl, dib8, NULL); + ok(ret == 0, "got %d\n", ret); + + memset(rgb, 0, sizeof(rgb)); + rgb[0].rgbRed = 0xff; + rgb[1].rgbGreen = 0xff; + rgb[2].rgbBlue = 0xff; + check_color_table("remove all, add 8", hdc, himl, ilc, rgb, default_table); + + /* remove all, add 4. Color table remains the same since it's inplicitly + been set by the previous _Add */ + ret = ImageList_Remove(himl, -1); + ok(ret, "got %d\n", ret); + ret = ImageList_Add(himl, dib4, NULL); + ok(ret == 0, "got %d\n", ret); + check_color_table("remove all, add 4", hdc, himl, ilc, rgb, default_table); + + ImageList_Destroy(himl); + himl = ImageList_Create(16, 16, ilc, 0, 3); + ok(himl != NULL, "got %p\n", himl); + + /* add 4 */ + ret = ImageList_Add(himl, dib4, NULL); + ok(ret == 0, "got %d\n", ret); + + memset(rgb, 0, 16 * sizeof(rgb[0])); + rgb[0].rgbRed = 0xff; + rgb[0].rgbBlue = 0xff; + rgb[1].rgbRed = 0xff; + rgb[1].rgbGreen = 0xff; + rgb[2].rgbGreen = 0xff; + rgb[2].rgbBlue = 0xff; + memcpy(rgb + 16, default_table + 16, 240 * sizeof(rgb[0])); + + check_color_table("add 4", hdc, himl, ilc, rgb, default_table); + + ImageList_Destroy(himl); + himl = ImageList_Create(16, 16, ilc, 0, 3); + ok(himl != NULL, "got %p\n", himl); + + /* set color table, add 8 */ + ret = ImageList_Remove(himl, -1); + ok(ret, "got %d\n", ret); + memset(rgb, 0, sizeof(rgb)); + rgb[0].rgbRed = 0xcc; + rgb[1].rgbBlue = 0xcc; + ret = pImageList_SetColorTable(himl, 0, 2, rgb); + ok(ret == 2, "got %d\n", ret); + /* the table is set, so this doesn't change it */ + ret = ImageList_Add(himl, dib8, NULL); + ok(ret == 0, "got %d\n", ret); + + memcpy(rgb + 2, default_table + 2, 254 * sizeof(rgb[0])); + check_color_table("SetColorTable", hdc, himl, ilc, rgb, NULL); + + DeleteObject(dib32); + DeleteObject(dib8); + DeleteObject(dib4); + DeleteDC(hdc); + ImageList_Destroy(himl); +} + static void test_IImageList_Clone(void) { IImageList *imgl, *imgl2; @@ -2166,6 +2352,7 @@ pImageList_Add = NULL; pImageList_DrawIndirect = (void*)GetProcAddress(hComCtl32, "ImageList_DrawIndirect"); pImageList_SetImageCount = (void*)GetProcAddress(hComCtl32, "ImageList_SetImageCount"); + pImageList_SetColorTable = (void*)GetProcAddress(hComCtl32, (const char*)390); hinst = GetModuleHandleA(NULL); @@ -2181,6 +2368,8 @@ test_merge_colors(); test_imagelist_storage(); test_iconsize(); + test_color_table(ILC_COLOR4); + test_color_table(ILC_COLOR8); FreeLibrary(hComCtl32); Modified: trunk/rostests/winetests/comctl32/listview.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/listvi…
============================================================================== --- trunk/rostests/winetests/comctl32/listview.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/listview.c [iso-8859-1] Sun Mar 5 20:53:49 2017 @@ -558,7 +558,10 @@ } defwndproc_counter++; - ret = DefWindowProcA(hwnd, message, wParam, lParam); + if (IsWindowUnicode(hwnd)) + ret = DefWindowProcW(hwnd, message, wParam, lParam); + else + ret = DefWindowProcA(hwnd, message, wParam, lParam); defwndproc_counter--; return ret; Modified: trunk/rostests/winetests/comctl32/monthcal.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/monthc…
============================================================================== --- trunk/rostests/winetests/comctl32/monthcal.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/monthcal.c [iso-8859-1] Sun Mar 5 20:53:49 2017 @@ -2056,7 +2056,7 @@ pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); if (!pInitCommonControlsEx) { - skip("InitCommonControlsEx() is missing. Skipping the tests\n"); + win_skip("InitCommonControlsEx() is missing. Skipping the tests\n"); return; } iccex.dwSize = sizeof(iccex); Modified: trunk/rostests/winetests/comctl32/mru.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/mru.c?…
============================================================================== --- trunk/rostests/winetests/comctl32/mru.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/mru.c [iso-8859-1] Sun Mar 5 20:53:49 2017 @@ -236,7 +236,7 @@ if (!pCreateMRUListA || !pFreeMRUList || !pAddMRUStringA || !pEnumMRUListA) { - skip("MRU entry points not found\n"); + win_skip("MRU entry points not found\n"); return; } Modified: trunk/rostests/winetests/comctl32/pager.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/pager.…
============================================================================== --- trunk/rostests/winetests/comctl32/pager.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/pager.c [iso-8859-1] Sun Mar 5 20:53:49 2017 @@ -86,6 +86,28 @@ add_message(sequences, PAGER_SEQ_INDEX, &msg); } + if (message == WM_NOTIFY) + { + NMHDR *nmhdr = (NMHDR *)lParam; + + switch (nmhdr->code) + { + case PGN_CALCSIZE: + { + NMPGCALCSIZE *nmpgcs = (NMPGCALCSIZE *)lParam; + DWORD style = GetWindowLongA(nmpgcs->hdr.hwndFrom, GWL_STYLE); + + if (style & PGS_HORZ) + ok(nmpgcs->dwFlag == PGF_CALCWIDTH, "Unexpected flags %#x.\n", nmpgcs->dwFlag); + else + ok(nmpgcs->dwFlag == PGF_CALCHEIGHT, "Unexpected flags %#x.\n", nmpgcs->dwFlag); + break; + } + default: + ; + } + } + defwndproc_counter++; ret = DefWindowProcA(hwnd, message, wParam, lParam); defwndproc_counter--; @@ -151,7 +173,7 @@ static void test_pager(void) { HWND pager, child; - RECT rect; + RECT rect, rect2; pager = create_pager_control( PGS_HORZ ); if (!pager) @@ -185,6 +207,29 @@ ok_sequence(sequences, PAGER_SEQ_INDEX, set_pos_seq, "set pos", TRUE); DestroyWindow( pager ); + + /* Test if resizing works */ + pager = create_pager_control( CCS_NORESIZE ); + ok(pager != NULL, "failed to create pager control\n"); + + GetWindowRect( pager, &rect ); + MoveWindow( pager, 0, 0, 200, 100, TRUE ); + GetWindowRect( pager, &rect2 ); + ok(rect2.right - rect2.left > rect.right - rect.left, "expected pager window to resize, %s\n", + wine_dbgstr_rect( &rect2 )); + + DestroyWindow( pager ); + + pager = create_pager_control( CCS_NORESIZE | PGS_HORZ ); + ok(pager != NULL, "failed to create pager control\n"); + + GetWindowRect( pager, &rect ); + MoveWindow( pager, 0, 0, 100, 200, TRUE ); + GetWindowRect( pager, &rect2 ); + ok(rect2.bottom - rect2.top > rect.bottom - rect.top, "expected pager window to resize, %s\n", + wine_dbgstr_rect( &rect2 )); + + DestroyWindow( pager ); } START_TEST(pager) Modified: trunk/rostests/winetests/comctl32/propsheet.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/propsh…
============================================================================== --- trunk/rostests/winetests/comctl32/propsheet.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/propsheet.c [iso-8859-1] Sun Mar 5 20:53:49 2017 @@ -58,6 +58,21 @@ { switch(msg) { + case PSCB_PRECREATE: + { + HMODULE module = GetModuleHandleA("comctl32.dll"); + DWORD size, buffer_size; + HRSRC hrsrc; + + hrsrc = FindResourceA(module, MAKEINTRESOURCEA(1006 /* IDD_PROPSHEET */), + (LPSTR)RT_DIALOG); + size = SizeofResource(module, hrsrc); + ok(size != 0, "Failed to get size of propsheet dialog resource\n"); + buffer_size = HeapSize(GetProcessHeap(), 0, (void *)lparam); + ok(buffer_size == 2 * size, "Unexpected template buffer size %u, resource size %u\n", + buffer_size, size); + break; + } case PSCB_INITIALIZED: { char caption[256]; Modified: trunk/rostests/winetests/comctl32/toolbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/toolba…
============================================================================== --- trunk/rostests/winetests/comctl32/toolbar.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/toolbar.c [iso-8859-1] Sun Mar 5 20:53:49 2017 @@ -1710,12 +1710,13 @@ static void test_getbuttoninfo(void) { HWND hToolbar = NULL; + TBBUTTONINFOW tbiW; + TBBUTTONINFOA tbi; int i; rebuild_toolbar_with_buttons(&hToolbar); for (i = 0; i < 128; i++) { - TBBUTTONINFOA tbi; int ret; tbi.cbSize = i; @@ -1727,6 +1728,14 @@ compare(ret, -1, "%d"); } } + + /* TBIF_TEXT with NULL pszText */ + memset(&tbiW, 0, sizeof(tbiW)); + tbiW.cbSize = sizeof(tbiW); + tbiW.dwMask = TBIF_BYINDEX | TBIF_STYLE | TBIF_COMMAND | TBIF_TEXT; + i = SendMessageA(hToolbar, TB_GETBUTTONINFOW, 1, (LPARAM)&tbiW); + ok(i == 1, "Got index %d\n", i); + DestroyWindow(hToolbar); } @@ -2358,6 +2367,47 @@ RegCloseKey( key ); } +static void test_drawtext_flags(void) +{ + HWND hwnd = NULL; + UINT flags; + + rebuild_toolbar(&hwnd); + + flags = SendMessageA(hwnd, TB_SETDRAWTEXTFLAGS, 0, 0); +todo_wine + ok(flags == 0, "Unexpected draw text flags %#x\n", flags); + + /* zero mask, flags are retained */ + flags = SendMessageA(hwnd, TB_SETDRAWTEXTFLAGS, 0, DT_BOTTOM); +todo_wine + ok(flags == 0, "Unexpected draw text flags %#x\n", flags); + ok(!(flags & DT_BOTTOM), "Unexpected DT_BOTTOM style\n"); + + flags = SendMessageA(hwnd, TB_SETDRAWTEXTFLAGS, 0, 0); +todo_wine + ok(flags == 0, "Unexpected draw text flags %#x\n", flags); + ok(!(flags & DT_BOTTOM), "Unexpected DT_BOTTOM style\n"); + + /* set/remove */ + flags = SendMessageA(hwnd, TB_SETDRAWTEXTFLAGS, DT_BOTTOM, DT_BOTTOM); +todo_wine + ok(flags == 0, "Unexpected draw text flags %#x\n", flags); + ok(!(flags & DT_BOTTOM), "Unexpected DT_BOTTOM style\n"); + + flags = SendMessageA(hwnd, TB_SETDRAWTEXTFLAGS, DT_BOTTOM, 0); +todo_wine + ok(flags == DT_BOTTOM, "Unexpected draw text flags %#x\n", flags); + ok(flags & DT_BOTTOM, "Expected DT_BOTTOM style, %#x\n", flags); + + flags = SendMessageA(hwnd, TB_SETDRAWTEXTFLAGS, DT_BOTTOM, 0); +todo_wine + ok(flags == 0, "Unexpected draw text flags %#x\n", flags); + ok(!(flags & DT_BOTTOM), "Unexpected DT_BOTTOM style\n"); + + DestroyWindow(hwnd); +} + START_TEST(toolbar) { WNDCLASSA wc; @@ -2402,6 +2452,7 @@ test_TB_GET_SET_EXTENDEDSTYLE(); test_noresize(); test_save(); + test_drawtext_flags(); PostQuitMessage(0); while(GetMessageA(&msg,0,0,0)) { Modified: trunk/rostests/winetests/comctl32/tooltips.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/toolti…
============================================================================== --- trunk/rostests/winetests/comctl32/tooltips.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/tooltips.c [iso-8859-1] Sun Mar 5 20:53:49 2017 @@ -301,7 +301,7 @@ TTTOOLINFOA toolinfoA; TTTOOLINFOW toolinfoW; LRESULT r; - CHAR bufA[10] = ""; + CHAR bufA[16] = ""; WCHAR bufW[10] = { 0 }; DWORD length, style; Modified: trunk/rostests/winetests/comctl32/trackbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/trackb…
============================================================================== --- trunk/rostests/winetests/comctl32/trackbar.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/trackbar.c [iso-8859-1] Sun Mar 5 20:53:49 2017 @@ -778,6 +778,32 @@ SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect1); ok(EqualRect(&rect1, &rect2), "thumb rectangle not updated\n"); + /* test position update on range change */ + + /* set to [20, 50], position at 30, reduce range to [20,25] */ + SendMessageA(hWndTrackbar, TBM_SETRANGEMIN, FALSE, 20); + SendMessageA(hWndTrackbar, TBM_SETRANGEMAX, FALSE, 50); + SendMessageA(hWndTrackbar, TBM_SETPOS, FALSE, 30); + SendMessageA(hWndTrackbar, TBM_SETRANGEMAX, FALSE, 25); + r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0, 0); + ok(r == 25, "Unexpected position %d\n", r); + + /* set to [20, 50], position at 30, flip max to 10 */ + SendMessageA(hWndTrackbar, TBM_SETRANGEMIN, FALSE, 20); + SendMessageA(hWndTrackbar, TBM_SETRANGEMAX, FALSE, 50); + SendMessageA(hWndTrackbar, TBM_SETPOS, FALSE, 30); + SendMessageA(hWndTrackbar, TBM_SETRANGEMAX, FALSE, 10); + r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0, 0); + ok(r == 20, "Unexpected position %d\n", r); + + /* set to [20, 50], position at 30, flip min to 70 */ + SendMessageA(hWndTrackbar, TBM_SETRANGEMIN, FALSE, 20); + SendMessageA(hWndTrackbar, TBM_SETRANGEMAX, FALSE, 50); + SendMessageA(hWndTrackbar, TBM_SETPOS, FALSE, 30); + SendMessageA(hWndTrackbar, TBM_SETRANGEMIN, FALSE, 70); + r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0, 0); + ok(r == 70, "Unexpected position %d\n", r); + DestroyWindow(hWndTrackbar); } @@ -893,7 +919,7 @@ static void test_tic_settings(void) { HWND hWndTrackbar; - int r; + int r, i; hWndTrackbar = create_trackbar(defaultstyle, hWndParent); ok(hWndTrackbar != NULL, "Expected non NULL value\n"); @@ -958,6 +984,50 @@ SendMessageA(hWndTrackbar, TBM_SETTICFREQ, 1, 0); r = SendMessageA(hWndTrackbar, TBM_GETNUMTICS, 0, 0); expect(3, r); + + DestroyWindow(hWndTrackbar); + + /* Test to show that TBM_SETTICFREQ updates thumb */ + for (i = 0; i < 2; i++) + { + DWORD style = i ? defaultstyle : defaultstyle & ~TBS_AUTOTICKS; + RECT rect, rect1; + WNDPROC oldproc; + + hWndTrackbar = create_trackbar2(style, hWndParent); + ok(hWndTrackbar != NULL, "Expected non NULL value\n"); + + oldproc = (WNDPROC)SetWindowLongPtrA(hWndTrackbar, GWLP_WNDPROC, (LONG_PTR)trackbar_no_wmpaint_proc); + SetWindowLongPtrA(hWndTrackbar, GWLP_USERDATA, (LONG_PTR)oldproc); + + SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect); + SendMessageA(hWndTrackbar, TBM_SETPOS, FALSE, 0); + SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect1); + ok(EqualRect(&rect, &rect1), "Unexpected thumb rectangle %s, previous %s\n", + wine_dbgstr_rect(&rect1), wine_dbgstr_rect(&rect)); + + SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect); + SendMessageA(hWndTrackbar, TBM_SETRANGE, FALSE, MAKELONG(-100, 100)); + SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect1); + ok(EqualRect(&rect, &rect1), "Unexpected thumb rectangle %s, previous %s\n", + wine_dbgstr_rect(&rect1), wine_dbgstr_rect(&rect)); + /* Old position is also 0, but thumb position will be different after range change */ + SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect); + SendMessageA(hWndTrackbar, TBM_SETPOS, TRUE, 0); + SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect1); + ok(EqualRect(&rect, &rect1), "Unexpected thumb rectangle %s, previous %s\n", + wine_dbgstr_rect(&rect1), wine_dbgstr_rect(&rect)); + /* Previous frequency is also 1, yet thumb is updated */ + SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect); + SendMessageA(hWndTrackbar, TBM_SETTICFREQ, 1, 0); + SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect1); + ok(!EqualRect(&rect, &rect1), "Unexpected thumb rectangle %s, previous %s\n", + wine_dbgstr_rect(&rect1), wine_dbgstr_rect(&rect)); + + SetWindowLongPtrA(hWndTrackbar, GWLP_WNDPROC, (LONG_PTR)oldproc); + + DestroyWindow(hWndTrackbar); + } } static void test_tic_placement(void) Modified: trunk/rostests/winetests/comctl32/treeview.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/treevi…
============================================================================== --- trunk/rostests/winetests/comctl32/treeview.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/treeview.c [iso-8859-1] Sun Mar 5 20:53:49 2017 @@ -42,6 +42,7 @@ static BOOL g_disp_set_stateimage; static BOOL g_beginedit_alter_text; static HFONT g_customdraw_font; +static BOOL g_v6; #define NUM_MSG_SEQUENCES 3 #define TREEVIEW_SEQ_INDEX 0 @@ -328,6 +329,8 @@ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_PREPAINT }, { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPREPAINT }, { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPOSTPAINT }, + { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPREPAINT }, + { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPOSTPAINT }, { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_POSTPAINT }, { 0 } }; @@ -1259,6 +1262,7 @@ { NMTVCUSTOMDRAW *nmcd = (NMTVCUSTOMDRAW*)lParam; COLORREF c0ffee = RGB(0xc0,0xff,0xee), cafe = RGB(0xca,0xfe,0x00); + COLORREF text = GetTextColor(nmcd->nmcd.hdc), bkgnd = GetBkColor(nmcd->nmcd.hdc); msg.flags |= custdraw; msg.stage = nmcd->nmcd.dwDrawStage; @@ -1269,15 +1273,23 @@ case CDDS_PREPAINT: return CDRF_NOTIFYITEMDRAW|CDRF_NOTIFYITEMERASE|CDRF_NOTIFYPOSTPAINT; case CDDS_ITEMPREPAINT: + ok(text == nmcd->clrText || (g_v6 && nmcd->clrText == 0xffffffff), + "got %08x vs %08x\n", text, nmcd->clrText); + ok(bkgnd == nmcd->clrTextBk || (g_v6 && nmcd->clrTextBk == 0xffffffff), + "got %08x vs %08x\n", bkgnd, nmcd->clrTextBk); + nmcd->clrText = cafe; nmcd->clrTextBk = c0ffee; - nmcd->clrText = cafe; + SetTextColor(nmcd->nmcd.hdc, c0ffee); + SetBkColor(nmcd->nmcd.hdc, cafe); if (g_customdraw_font) SelectObject(nmcd->nmcd.hdc, g_customdraw_font); return CDRF_NOTIFYPOSTPAINT|CDRF_NEWFONT; case CDDS_ITEMPOSTPAINT: /* at the point of post paint notification colors are already restored */ - ok(GetTextColor(nmcd->nmcd.hdc) != cafe, "got 0%x\n", GetTextColor(nmcd->nmcd.hdc)); - ok(GetBkColor(nmcd->nmcd.hdc) != c0ffee, "got 0%x\n", GetBkColor(nmcd->nmcd.hdc)); + ok(nmcd->clrText == cafe, "got 0%x\n", nmcd->clrText); + ok(nmcd->clrTextBk == c0ffee, "got 0%x\n", nmcd->clrTextBk); + ok(text != cafe, "got 0%x\n", text); + ok(bkgnd != c0ffee, "got 0%x\n", bkgnd); if (g_customdraw_font) ok(GetCurrentObject(nmcd->nmcd.hdc, OBJ_FONT) != g_customdraw_font, "got %p\n", GetCurrentObject(nmcd->nmcd.hdc, OBJ_FONT)); @@ -2317,20 +2329,12 @@ static void test_customdraw(void) { - static const char *rootA = "root"; - TVINSERTSTRUCTA ins; - HTREEITEM hRoot; LOGFONTA lf; HWND hwnd; hwnd = create_treeview_control(0); - - ins.hParent = TVI_ROOT; - ins.hInsertAfter = TVI_ROOT; - U(ins).item.mask = TVIF_TEXT; - U(ins).item.pszText = (char*)rootA; - hRoot = TreeView_InsertItemA(hwnd, &ins); - ok(hRoot != NULL, "got %p\n", hRoot); + fill_tree(hwnd); + SendMessageA(hwnd, TVM_EXPAND, TVE_EXPAND, (WPARAM)hRoot); /* create additional font, custom draw handler will select it */ SystemParametersInfoA(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, 0); @@ -2477,6 +2481,7 @@ } /* comctl32 version 6 tests start here */ + g_v6 = TRUE; test_expandedimage(); test_htreeitem_layout(); test_WM_GETDLGCODE();
7 years, 9 months
1
0
0
0
[akhaldi] 74090: [COMCTL32] Sync with Wine Staging 2.2. CORE-12823 cc055c4 comctl32: Add support for PSPCB_ADDREF/PSPCB_RELEASE callback notifications. (v2) 83cde06 comctl32/propsheet: Implement PS...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 5 20:52:24 2017 New Revision: 74090 URL:
http://svn.reactos.org/svn/reactos?rev=74090&view=rev
Log: [COMCTL32] Sync with Wine Staging 2.2. CORE-12823 cc055c4 comctl32: Add support for PSPCB_ADDREF/PSPCB_RELEASE callback notifications. (v2) 83cde06 comctl32/propsheet: Implement PSM_SETHEADERSUBTITLE. ce9c06b comctl32/propsheet: Implement PSM_SETHEADERTITLE. 1a750f7 comctl32/propsheet: Add helpers to do string duplication. 14a6c98 comctl32/pager: Don't block window size changes. a6661ba comctl32/propsheet: Added PSM_INSERTPAGE implementation. 34dd326 comctl32/propsheet: Only use header bitmap when asked for it. 6eafebe comctl32/propsheet: Force wizard header if any of pages has title/subtitle. 70c9a96 comctl32: Fix some more spec file entries. 2dd0fb8 comctl32: Correctly set the colour table for ILC_COLOR4 and ILC_COLOR8 imagelists. a0e73a1 comctl32/syslink: Don't use exported StrCmpNIW(). 970029b comctl32/toolbar: Fix TB_SETDRAWTEXTFLAGS handler. 99913e8 comctl32: Fix some spec file entries. 9d404dd comctl32/propsheet: Double size of a template buffer passed to PSCB_PRECREATE. bb1d68e comctl32/trackbar: Fix TBM_SETRANGEMAX handling when new limit is less than current min boundary. 26067cc comctl32/toolbar: Protect from NULL pointer access in TB_GETBUTTONINFOW handler. a6aabe0 comctl32/trackbar: Update thumb unconditionally on TBM_SETTICFREQ. c7c8994 comctl32: Recompute the text width if necessary. 3ed6ba5 comctl32: Set the text and bkgnd colours to the default before the item pre-paint notification. 8915404 comctl32: Use wine_dbgstr_point in TRACES. Modified: trunk/reactos/dll/win32/comctl32/comctl32.spec trunk/reactos/dll/win32/comctl32/datetime.c trunk/reactos/dll/win32/comctl32/imagelist.c trunk/reactos/dll/win32/comctl32/monthcal.c trunk/reactos/dll/win32/comctl32/pager.c trunk/reactos/dll/win32/comctl32/propsheet.c trunk/reactos/dll/win32/comctl32/rebar.c trunk/reactos/dll/win32/comctl32/syslink.c trunk/reactos/dll/win32/comctl32/toolbar.c trunk/reactos/dll/win32/comctl32/tooltips.c trunk/reactos/dll/win32/comctl32/trackbar.c trunk/reactos/dll/win32/comctl32/treeview.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/comctl32/comctl32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl3…
============================================================================== --- trunk/reactos/dll/win32/comctl32/comctl32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/comctl32.spec [iso-8859-1] Sun Mar 5 20:52:24 2017 @@ -1,12 +1,12 @@ 2 stdcall MenuHelp(long long long long long long ptr) 3 stdcall ShowHideMenuCtl(long long ptr) -4 stdcall GetEffectiveClientRect(long long long) +4 stdcall GetEffectiveClientRect(long ptr ptr) 5 stdcall DrawStatusTextA(long ptr str long) 6 stdcall CreateStatusWindowA(long str long long) 7 stdcall CreateToolbar(long long long long long long ptr long) 8 stdcall CreateMappedBitmap(long long long ptr long) -9 stdcall -noname DPA_LoadStream(ptr ptr ptr long) -10 stdcall -noname DPA_SaveStream(ptr ptr ptr long) +9 stdcall -noname DPA_LoadStream(ptr ptr ptr ptr) +10 stdcall -noname DPA_SaveStream(ptr ptr ptr ptr) 11 stdcall -noname DPA_Merge(ptr ptr long ptr ptr long) 12 stdcall CreatePropertySheetPage(ptr) CreatePropertySheetPageA 13 stdcall MakeDragList(long) @@ -105,10 +105,10 @@ 236 stdcall -ordinal Str_SetPtrW(wstr wstr) 320 stdcall -ordinal DSA_Create(long long) 321 stdcall -ordinal DSA_Destroy(ptr) -322 stdcall -noname DSA_GetItem(ptr long long) +322 stdcall -noname DSA_GetItem(ptr long ptr) 323 stdcall -ordinal DSA_GetItemPtr(ptr long) -324 stdcall -ordinal DSA_InsertItem(ptr long long) -325 stdcall -noname DSA_SetItem (ptr long long) +324 stdcall -ordinal DSA_InsertItem(ptr long ptr) +325 stdcall -noname DSA_SetItem (ptr long ptr) 326 stdcall -noname DSA_DeleteItem(ptr long) 327 stdcall -ordinal DSA_DeleteAllItems(ptr) 328 stdcall -ordinal DPA_Create(long) @@ -126,7 +126,7 @@ 340 stdcall -noname DPA_CreateEx(long long) 341 stdcall -noname SendNotify(long long long ptr) 342 stdcall -noname SendNotifyEx(long long long ptr long) -350 stdcall -noname -private StrChrA(str str) +350 stdcall -noname -private StrChrA(str long) 351 stdcall -noname -private StrRChrA(str str long) 352 stdcall -noname -private StrCmpNA(str str long) 353 stdcall -noname -private StrCmpNIA(str str long) @@ -155,10 +155,10 @@ 382 stdcall -noname SmoothScrollWindow(ptr) 383 stdcall -noname DoReaderMode(ptr) 384 stdcall -noname SetPathWordBreakProc(ptr long) -385 stdcall -ordinal DPA_EnumCallback(long long long) -386 stdcall -ordinal DPA_DestroyCallback(ptr ptr long) -387 stdcall -noname DSA_EnumCallback(ptr ptr long) -388 stdcall -ordinal DSA_DestroyCallback(ptr ptr long) +385 stdcall -ordinal DPA_EnumCallback(ptr ptr ptr) +386 stdcall -ordinal DPA_DestroyCallback(ptr ptr ptr) +387 stdcall -noname DSA_EnumCallback(ptr ptr ptr) +388 stdcall -ordinal DSA_DestroyCallback(ptr ptr ptr) #389 CControl::v_OnNotify 390 stdcall -noname ImageList_SetColorTable(ptr long long ptr) 400 stdcall -ordinal CreateMRUListW(ptr) Modified: trunk/reactos/dll/win32/comctl32/datetime.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/datetim…
============================================================================== --- trunk/reactos/dll/win32/comctl32/datetime.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/datetime.c [iso-8859-1] Sun Mar 5 20:52:24 2017 @@ -804,7 +804,7 @@ { int i; - TRACE ("%d, %d\n", pt.x, pt.y); + TRACE ("%s\n", wine_dbgstr_point(&pt)); if (PtInRect (&infoPtr->calbutton, pt)) return DTHT_MCPOPUP; if (PtInRect (&infoPtr->checkbox, pt)) return DTHT_CHECKBOX; Modified: trunk/reactos/dll/win32/comctl32/imagelist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/imageli…
============================================================================== --- trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] Sun Mar 5 20:52:24 2017 @@ -72,6 +72,7 @@ INT cInitial; UINT uBitsPixel; char *has_alpha; + BOOL color_table_set; LONG ref; /* reference count */ }; @@ -298,6 +299,9 @@ return ret; } +UINT WINAPI +ImageList_SetColorTable(HIMAGELIST himl, UINT uStartIndex, UINT cEntries, const RGBQUAD *prgb); + /************************************************************************* * IMAGELIST_InternalExpandBitmaps [Internal] * @@ -420,7 +424,8 @@ nImageCount = bmp.bmWidth / himl->cx; - TRACE("%p has %d images (%d x %d)\n", hbmImage, nImageCount, bmp.bmWidth, bmp.bmHeight); + TRACE("%p has %d images (%d x %d) bpp %d\n", hbmImage, nImageCount, bmp.bmWidth, bmp.bmHeight, + bmp.bmBitsPixel); IMAGELIST_InternalExpandBitmaps(himl, nImageCount); @@ -436,6 +441,14 @@ { hdcTemp = CreateCompatibleDC(0); SelectObject(hdcTemp, hbmMask); + } + + if (himl->uBitsPixel <= 8 && bmp.bmBitsPixel <= 8 && + !himl->color_table_set && himl->cCurImage == 0) + { + RGBQUAD colors[256]; + UINT num = GetDIBColorTable( hdcBitmap, 0, 1 << bmp.bmBitsPixel, colors ); + if (num) ImageList_SetColorTable( himl, 0, num, colors ); } for (i=0; i<nImageCount; i++) @@ -787,6 +800,7 @@ himl->cGrow = cGrow; himl->clrFg = CLR_DEFAULT; himl->clrBk = CLR_NONE; + himl->color_table_set = FALSE; /* initialize overlay mask indices */ for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++) @@ -3219,11 +3233,25 @@ if (himl->uBitsPixel <= ILC_COLOR8) { - /* retrieve the default color map */ - HBITMAP tmp = CreateBitmap( 1, 1, 1, 1, NULL ); - GetDIBits( hdc, tmp, 0, 0, NULL, bmi, DIB_RGB_COLORS ); - DeleteObject( tmp ); - } + if (!himl->color_table_set) + { + /* retrieve the default color map */ + HBITMAP tmp = CreateBitmap( 1, 1, 1, 1, NULL ); + GetDIBits( hdc, tmp, 0, 0, NULL, bmi, DIB_RGB_COLORS ); + DeleteObject( tmp ); + if (ilc == ILC_COLOR4) + { + RGBQUAD tmp; + tmp = bmi->bmiColors[7]; + bmi->bmiColors[7] = bmi->bmiColors[8]; + bmi->bmiColors[8] = tmp; + } + } + else + { + GetDIBColorTable(himl->hdcImage, 0, 1 << himl->uBitsPixel, bmi->bmiColors); + } + } hbmNewBitmap = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, NULL, 0, 0); } else /*if (ilc == ILC_COLORDDB)*/ @@ -3258,6 +3286,8 @@ UINT WINAPI ImageList_SetColorTable(HIMAGELIST himl, UINT uStartIndex, UINT cEntries, const RGBQUAD *prgb) { + TRACE("(%p, %d, %d, %p)\n", himl, uStartIndex, cEntries, prgb); + himl->color_table_set = TRUE; return SetDIBColorTable(himl->hdcImage, uStartIndex, cEntries, prgb); } Modified: trunk/reactos/dll/win32/comctl32/monthcal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/monthca…
============================================================================== --- trunk/reactos/dll/win32/comctl32/monthcal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/monthcal.c [iso-8859-1] Sun Mar 5 20:52:24 2017 @@ -2157,7 +2157,7 @@ hit = MONTHCAL_HitTest(infoPtr, &ht); - TRACE("%x at (%d, %d)\n", hit, ht.pt.x, ht.pt.y); + TRACE("%x at %s\n", hit, wine_dbgstr_point(&ht.pt)); switch(hit) { Modified: trunk/reactos/dll/win32/comctl32/pager.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/pager.c…
============================================================================== --- trunk/reactos/dll/win32/comctl32/pager.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/pager.c [iso-8859-1] Sun Mar 5 20:52:24 2017 @@ -379,34 +379,6 @@ return 0; } -static LRESULT -PAGER_WindowPosChanging(PAGER_INFO* infoPtr, WINDOWPOS *winpos) -{ - if ((infoPtr->dwStyle & CCS_NORESIZE) && !(winpos->flags & SWP_NOSIZE)) - { - /* don't let the app resize the nonscrollable dimension of a control - * that was created with CCS_NORESIZE style - * (i.e. height for a horizontal pager, or width for a vertical one) */ - - /* except if the current dimension is 0 and app is setting for - * first time, then save amount as dimension. - GA 8/01 */ - - if (infoPtr->dwStyle & PGS_HORZ) - if (!infoPtr->nHeight && winpos->cy) - infoPtr->nHeight = winpos->cy; - else - winpos->cy = infoPtr->nHeight; - else - if (!infoPtr->nWidth && winpos->cx) - infoPtr->nWidth = winpos->cx; - else - winpos->cx = infoPtr->nWidth; - return 0; - } - - return DefWindowProcW (infoPtr->hwndSelf, WM_WINDOWPOSCHANGING, 0, (LPARAM)winpos); -} - /****************************************************************** * For the PGM_RECALCSIZE message (but not the other uses in * * this module), the native control does only the following: * @@ -1027,6 +999,8 @@ { PAGER_INFO *infoPtr = (PAGER_INFO *)GetWindowLongPtrW(hwnd, 0); + TRACE("(%p, %#x, %#lx, %#lx)\n", hwnd, uMsg, wParam, lParam); + if (!infoPtr && (uMsg != WM_CREATE)) return DefWindowProcW (hwnd, uMsg, wParam, lParam); @@ -1084,9 +1058,6 @@ case WM_NCPAINT: return PAGER_NCPaint (infoPtr, (HRGN)wParam); - - case WM_WINDOWPOSCHANGING: - return PAGER_WindowPosChanging (infoPtr, (WINDOWPOS*)lParam); case WM_STYLECHANGED: return PAGER_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam); Modified: trunk/reactos/dll/win32/comctl32/propsheet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/propshe…
============================================================================== --- trunk/reactos/dll/win32/comctl32/propsheet.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/propsheet.c [iso-8859-1] Sun Mar 5 20:52:24 2017 @@ -32,10 +32,7 @@ * - Wizard 97 header resizing * - Enforcing of minimal wizard size * - Messages: - * o PSM_INSERTPAGE * o PSM_RECALCPAGESIZES - * o PSM_SETHEADERSUBTITLE - * o PSM_SETHEADERTITLE * o WM_HELP * o WM_CONTEXTMENU * - Notifications: @@ -156,12 +153,31 @@ static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheetInfo* psInfo); static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID); static BOOL PROPSHEET_RemovePage(HWND hwndDlg, int index, HPROPSHEETPAGE hpage); -static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter, HPROPSHEETPAGE hpage); static INT_PTR CALLBACK PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); WINE_DEFAULT_DEBUG_CHANNEL(propsheet); + +static WCHAR *heap_strdupW(const WCHAR *str) +{ + int len = strlenW(str) + 1; + WCHAR *ret = Alloc(len * sizeof(WCHAR)); + strcpyW(ret, str); + return ret; +} + +static WCHAR *heap_strdupAtoW(const char *str) +{ + WCHAR *ret; + INT len; + + len = MultiByteToWideChar(CP_ACP, 0, str, -1, 0, 0); + ret = Alloc(len * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); + + return ret; +} #define add_flag(a) if (dwFlags & a) {strcat(string, #a );strcat(string," ");} /****************************************************************************** @@ -256,23 +272,6 @@ } /****************************************************************************** - * PROPSHEET_AtoW - * - * Convert ASCII to Unicode since all data is saved as Unicode. - */ -static void PROPSHEET_AtoW(LPCWSTR *tostr, LPCSTR frstr) -{ - INT len; - WCHAR *to; - - TRACE("<%s>\n", frstr); - len = MultiByteToWideChar(CP_ACP, 0, frstr, -1, 0, 0); - to = Alloc(len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, frstr, -1, to, len); - *tostr = to; -} - -/****************************************************************************** * PROPSHEET_CollectSheetInfoCommon * * Common code for PROPSHEET_CollectSheetInfoA/W @@ -360,12 +359,7 @@ else { if (!IS_INTRESOURCE(lppsh->pszCaption)) - { - int len = strlenW(lppsh->pszCaption); - WCHAR *caption = Alloc( (len+1)*sizeof(WCHAR) ); - - psInfo->ppshheader.pszCaption = strcpyW( caption, lppsh->pszCaption ); - } + psInfo->ppshheader.pszCaption = heap_strdupW( lppsh->pszCaption ); } psInfo->nPages = lppsh->nPages; @@ -470,6 +464,9 @@ p++; /* y */ width = (WORD)*p; p++; height = (WORD)*p; p++; + + if (lppsp->dwFlags & (PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE)) + psInfo->ppshheader.dwFlags |= PSH_HEADER; /* Special calculation for interior wizard pages so the largest page is * calculated correctly. We need to add all the padding and space occupied @@ -535,8 +532,6 @@ WCHAR szTitle[256]; const WCHAR *pTitle; static const WCHAR pszNull[] = { '(','n','u','l','l',')',0 }; - WCHAR *text; - int len; if (IS_INTRESOURCE( lppsp->pszTitle )) { @@ -550,9 +545,7 @@ else pTitle = lppsp->pszTitle; - len = strlenW(pTitle); - text = Alloc( (len+1)*sizeof (WCHAR) ); - psInfo->proppage[index].pszText = strcpyW( text, pTitle); + psInfo->proppage[index].pszText = heap_strdupW( pTitle ); } /* @@ -624,7 +617,7 @@ */ resSize = SizeofResource(COMCTL32_hModule, hRes); - temp = Alloc(resSize); + temp = Alloc(2 * resSize); if (!temp) return -1; @@ -2226,16 +2219,108 @@ return msgResult; } +/****************************************************************************** + * PROPSHEET_InsertPage + */ +static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter, HPROPSHEETPAGE hpage) +{ + PropSheetInfo *psInfo = GetPropW(hwndDlg, PropSheetInfoStr); + PropPageInfo *ppi, *prev_ppi = psInfo->proppage; + HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL); + LPCPROPSHEETPAGEW ppsp = (LPCPROPSHEETPAGEW)hpage; + TCITEMW item; + int index; + + TRACE("hwndDlg %p, hpageInsertAfter %p, hpage %p\n", hwndDlg, hpageInsertAfter, hpage); + + if (IS_INTRESOURCE(hpageInsertAfter)) + index = LOWORD(hpageInsertAfter); + else + { + index = PROPSHEET_GetPageIndex(hpageInsertAfter, psInfo, -1); + if (index < 0) + { + TRACE("Could not find page to insert after!\n"); + return FALSE; + } + index++; + } + + if (index > psInfo->nPages) + index = psInfo->nPages; + + ppi = Alloc(sizeof(PropPageInfo) * (psInfo->nPages + 1)); + if (!ppi) + return FALSE; + + /* + * Fill in a new PropPageInfo entry. + */ + if (index > 0) + memcpy(ppi, prev_ppi, index * sizeof(PropPageInfo)); + memset(&ppi[index], 0, sizeof(PropPageInfo)); + if (index < psInfo->nPages) + memcpy(&ppi[index + 1], &prev_ppi[index], (psInfo->nPages - index) * sizeof(PropPageInfo)); + psInfo->proppage = ppi; + + if (!PROPSHEET_CollectPageInfo(ppsp, psInfo, index, FALSE)) + { + psInfo->proppage = prev_ppi; + Free(ppi); + return FALSE; + } + + psInfo->proppage[index].hpage = hpage; + + if (ppsp->dwFlags & PSP_PREMATURE) + { + /* Create the page but don't show it */ + if (!PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppsp)) + { + psInfo->proppage = prev_ppi; + Free(ppi); + return FALSE; + } + } + + Free(prev_ppi); + psInfo->nPages++; + if (index <= psInfo->active_page) + psInfo->active_page++; + + /* + * Add a new tab to the tab control. + */ + item.mask = TCIF_TEXT; + item.pszText = (LPWSTR) psInfo->proppage[index].pszText; + item.cchTextMax = MAX_TABTEXT_LENGTH; + + if (psInfo->hImageList) + SendMessageW(hwndTabControl, TCM_SETIMAGELIST, 0, (LPARAM)psInfo->hImageList); + + if (psInfo->proppage[index].hasIcon) + { + item.mask |= TCIF_IMAGE; + item.iImage = index; + } + + SendMessageW(hwndTabControl, TCM_INSERTITEMW, index, (LPARAM)&item); + + /* If it is the only page - show it */ + if (psInfo->nPages == 1) + PROPSHEET_SetCurSel(hwndDlg, 0, 1, 0); + + return TRUE; +} /****************************************************************************** * PROPSHEET_AddPage */ -static BOOL PROPSHEET_AddPage(HWND hwndDlg, - HPROPSHEETPAGE hpage) +static BOOL PROPSHEET_AddPage(HWND hwndDlg, HPROPSHEETPAGE hpage) { PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr); - TRACE("hpage %p\n", hpage); - return PROPSHEET_InsertPage(hwndDlg, (HPROPSHEETPAGE)(ULONG_PTR)psInfo->nPages, hpage); + TRACE("hwndDlg %p, hpage %p\n", hwndDlg, hpage); + return PROPSHEET_InsertPage(hwndDlg, UlongToPtr(psInfo->nPages), hpage); } /****************************************************************************** @@ -2419,135 +2504,75 @@ } /****************************************************************************** - * PROPSHEET_InsertPage - */ -static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter, HPROPSHEETPAGE hpage) -{ - PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr); - PropPageInfo * ppi, * prev_ppi = psInfo->proppage; - HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL); - LPCPROPSHEETPAGEW ppsp = (LPCPROPSHEETPAGEW)hpage; - TCITEMW item; - int index; - - TRACE("hwndDlg %p, hpageInsertAfter %p, hpage %p\n", hwndDlg, hpageInsertAfter, hpage); - - if (IS_INTRESOURCE(hpageInsertAfter)) - index = LOWORD(hpageInsertAfter); - else - { - index = PROPSHEET_GetPageIndex(hpageInsertAfter, psInfo, -1); - if (index < 0) - { - TRACE("Could not find page to insert after!\n"); - return FALSE; - } - index++; - } - - if (index > psInfo->nPages) - index = psInfo->nPages; - - /* - * Allocate a new PropPageInfo entry. - */ - ppi = Alloc(sizeof(PropPageInfo) * (psInfo->nPages + 1)); - if (!ppi) - return FALSE; - - /* - * Fill in a new PropPageInfo entry. - */ - if (index > 0) - memcpy(ppi, prev_ppi, index * sizeof(PropPageInfo)); - memset(&ppi[index], 0, sizeof(PropPageInfo)); - if (index < psInfo->nPages) - memcpy(&ppi[index + 1], &prev_ppi[index], (psInfo->nPages - index) * sizeof(PropPageInfo)); - psInfo->proppage = ppi; - - if (!PROPSHEET_CollectPageInfo(ppsp, psInfo, index, FALSE)) - { - psInfo->proppage = prev_ppi; - Free(ppi); - return FALSE; - } - - psInfo->proppage[index].hpage = hpage; - - if (ppsp->dwFlags & PSP_PREMATURE) - { - /* Create the page but don't show it */ - if(!PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppsp)) - { - psInfo->proppage = prev_ppi; - Free(ppi); - return FALSE; - } - } - - Free(prev_ppi); - psInfo->nPages++; - if (index <= psInfo->active_page) - psInfo->active_page++; - - /* - * Add a new tab to the tab control. - */ - item.mask = TCIF_TEXT; - item.pszText = (LPWSTR) psInfo->proppage[index].pszText; - item.cchTextMax = MAX_TABTEXT_LENGTH; - - if (psInfo->hImageList) - { - SendMessageW(hwndTabControl, TCM_SETIMAGELIST, 0, (LPARAM)psInfo->hImageList); - } - - if (psInfo->proppage[index].hasIcon) - { - item.mask |= TCIF_IMAGE; - item.iImage = index; - } - - SendMessageW(hwndTabControl, TCM_INSERTITEMW, index, - (LPARAM)&item); - - /* If it is the only page - show it */ - if (psInfo->nPages == 1) - PROPSHEET_SetCurSel(hwndDlg, 0, 1, 0); - - return TRUE; -} - -/****************************************************************************** * PROPSHEET_SetHeaderTitleW */ -static void PROPSHEET_SetHeaderTitleW(HWND hwndDlg, int iPageIndex, LPCWSTR pszHeaderTitle) -{ - FIXME("(%p, %d, %s): stub\n", hwndDlg, iPageIndex, debugstr_w(pszHeaderTitle)); +static void PROPSHEET_SetHeaderTitleW(HWND hwndDlg, UINT page_index, const WCHAR *title) +{ + PropSheetInfo *psInfo = GetPropW(hwndDlg, PropSheetInfoStr); + PROPSHEETPAGEW *page; + + TRACE("(%p, %u, %s)\n", hwndDlg, page_index, debugstr_w(title)); + + if (page_index >= psInfo->nPages) + return; + + page = (PROPSHEETPAGEW *)psInfo->proppage[page_index].hpage; + + if (!IS_INTRESOURCE(page->pszHeaderTitle)) + Free((void *)page->pszHeaderTitle); + + page->pszHeaderTitle = heap_strdupW(title); + page->dwFlags |= PSP_USEHEADERTITLE; } /****************************************************************************** * PROPSHEET_SetHeaderTitleA */ -static void PROPSHEET_SetHeaderTitleA(HWND hwndDlg, int iPageIndex, LPCSTR pszHeaderTitle) -{ - FIXME("(%p, %d, %s): stub\n", hwndDlg, iPageIndex, debugstr_a(pszHeaderTitle)); +static void PROPSHEET_SetHeaderTitleA(HWND hwndDlg, UINT page_index, const char *title) +{ + WCHAR *titleW; + + TRACE("(%p, %u, %s)\n", hwndDlg, page_index, debugstr_a(title)); + + titleW = heap_strdupAtoW(title); + PROPSHEET_SetHeaderTitleW(hwndDlg, page_index, titleW); + Free(titleW); } /****************************************************************************** * PROPSHEET_SetHeaderSubTitleW */ -static void PROPSHEET_SetHeaderSubTitleW(HWND hwndDlg, int iPageIndex, LPCWSTR pszHeaderSubTitle) -{ - FIXME("(%p, %d, %s): stub\n", hwndDlg, iPageIndex, debugstr_w(pszHeaderSubTitle)); +static void PROPSHEET_SetHeaderSubTitleW(HWND hwndDlg, UINT page_index, const WCHAR *subtitle) +{ + PropSheetInfo *psInfo = GetPropW(hwndDlg, PropSheetInfoStr); + PROPSHEETPAGEW *page; + + TRACE("(%p, %u, %s)\n", hwndDlg, page_index, debugstr_w(subtitle)); + + if (page_index >= psInfo->nPages) + return; + + page = (PROPSHEETPAGEW *)psInfo->proppage[page_index].hpage; + + if (!IS_INTRESOURCE(page->pszHeaderSubTitle)) + Free((void *)page->pszHeaderSubTitle); + + page->pszHeaderSubTitle = heap_strdupW(subtitle); + page->dwFlags |= PSP_USEHEADERSUBTITLE; } /****************************************************************************** * PROPSHEET_SetHeaderSubTitleA */ -static void PROPSHEET_SetHeaderSubTitleA(HWND hwndDlg, int iPageIndex, LPCSTR pszHeaderSubTitle) -{ - FIXME("(%p, %d, %s): stub\n", hwndDlg, iPageIndex, debugstr_a(pszHeaderSubTitle)); +static void PROPSHEET_SetHeaderSubTitleA(HWND hwndDlg, UINT page_index, const char *subtitle) +{ + WCHAR *subtitleW; + + TRACE("(%p, %u, %s)\n", hwndDlg, page_index, debugstr_a(subtitle)); + + subtitleW = heap_strdupAtoW(subtitle); + PROPSHEET_SetHeaderSubTitleW(hwndDlg, page_index, subtitleW); + Free(subtitleW); } /****************************************************************************** @@ -2963,15 +2988,15 @@ if (ppsp->dwFlags & PSP_USEICONID) { if (!IS_INTRESOURCE( ppsp->u2.pszIcon )) - PROPSHEET_AtoW(&ppsp->u2.pszIcon, lpPropSheetPage->u2.pszIcon); + ppsp->u2.pszIcon = heap_strdupAtoW( lpPropSheetPage->u2.pszIcon ); } if (ppsp->dwFlags & PSP_USETITLE) { - if (!IS_INTRESOURCE( ppsp->pszTitle )) - PROPSHEET_AtoW( &ppsp->pszTitle, lpPropSheetPage->pszTitle ); + if (IS_INTRESOURCE( ppsp->pszTitle )) + ppsp->pszTitle = load_string( ppsp->hInstance, ppsp->pszTitle ); else - ppsp->pszTitle = load_string( ppsp->hInstance, ppsp->pszTitle ); + ppsp->pszTitle = heap_strdupAtoW( lpPropSheetPage->pszTitle ); } else ppsp->pszTitle = NULL; @@ -2981,24 +3006,27 @@ if (ppsp->dwFlags & PSP_USEHEADERTITLE) { - if (!IS_INTRESOURCE( ppsp->pszHeaderTitle )) - PROPSHEET_AtoW(&ppsp->pszHeaderTitle, lpPropSheetPage->pszHeaderTitle); + if (IS_INTRESOURCE( ppsp->pszHeaderTitle )) + ppsp->pszHeaderTitle = load_string( ppsp->hInstance, ppsp->pszHeaderTitle ); else - ppsp->pszHeaderTitle = load_string( ppsp->hInstance, ppsp->pszHeaderTitle ); + ppsp->pszHeaderTitle = heap_strdupAtoW( lpPropSheetPage->pszHeaderTitle ); } else ppsp->pszHeaderTitle = NULL; if (ppsp->dwFlags & PSP_USEHEADERSUBTITLE) { - if (!IS_INTRESOURCE( ppsp->pszHeaderSubTitle )) - PROPSHEET_AtoW(&ppsp->pszHeaderSubTitle, lpPropSheetPage->pszHeaderSubTitle); + if (IS_INTRESOURCE( ppsp->pszHeaderSubTitle )) + ppsp->pszHeaderSubTitle = load_string( ppsp->hInstance, ppsp->pszHeaderSubTitle ); else - ppsp->pszHeaderSubTitle = load_string( ppsp->hInstance, ppsp->pszHeaderSubTitle ); + ppsp->pszHeaderSubTitle = heap_strdupAtoW( lpPropSheetPage->pszHeaderSubTitle ); } else ppsp->pszHeaderSubTitle = NULL; + if ((ppsp->dwFlags & PSH_USECALLBACK) && ppsp->pfnCallback) + ppsp->pfnCallback(0, PSPCB_ADDREF, ppsp); + return (HPROPSHEETPAGE)ppsp; } @@ -3018,23 +3046,13 @@ if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) ) { if (!IS_INTRESOURCE( ppsp->u.pszTemplate )) - { - int len = strlenW(lpPropSheetPage->u.pszTemplate) + 1; - WCHAR *template = Alloc( len * sizeof (WCHAR) ); - - ppsp->u.pszTemplate = strcpyW( template, lpPropSheetPage->u.pszTemplate ); - } + ppsp->u.pszTemplate = heap_strdupW( lpPropSheetPage->u.pszTemplate ); } if ( ppsp->dwFlags & PSP_USEICONID ) { if (!IS_INTRESOURCE( ppsp->u2.pszIcon )) - { - int len = strlenW(lpPropSheetPage->u2.pszIcon) + 1; - WCHAR *icon = Alloc( len * sizeof (WCHAR) ); - - ppsp->u2.pszIcon = strcpyW( icon, lpPropSheetPage->u2.pszIcon ); - } + ppsp->u2.pszIcon = heap_strdupW( lpPropSheetPage->u2.pszIcon ); } if (ppsp->dwFlags & PSP_USETITLE) @@ -3055,6 +3073,9 @@ else ppsp->pszHeaderSubTitle = NULL; + if ((ppsp->dwFlags & PSH_USECALLBACK) && ppsp->pfnCallback) + ppsp->pfnCallback(0, PSPCB_ADDREF, ppsp); + return (HPROPSHEETPAGE)ppsp; } @@ -3075,6 +3096,9 @@ if (!psp) return FALSE; + + if ((psp->dwFlags & PSH_USECALLBACK) && psp->pfnCallback) + psp->pfnCallback(0, PSPCB_RELEASE, psp); if (!(psp->dwFlags & PSP_DLGINDIRECT) && !IS_INTRESOURCE( psp->u.pszTemplate )) Free ((LPVOID)psp->u.pszTemplate); @@ -3251,61 +3275,65 @@ COLORREF clrOld = 0; int oldBkMode = 0; - hbmp = SelectObject(hdcSrc, psInfo->ppshheader.u5.hbmHeader); - hOldFont = SelectObject(hdc, psInfo->hFontBold); - - GetClientRect(hwndLineHeader, &r); - MapWindowPoints(hwndLineHeader, hwnd, (LPPOINT) &r, 2); - SetRect(&rzone, 0, 0, r.right + 1, r.top - 1); - - GetObjectW(psInfo->ppshheader.u5.hbmHeader, sizeof(BITMAP), &bm); - - if (psInfo->ppshheader.dwFlags & PSH_WIZARD97_OLD) - { - /* Fill the unoccupied part of the header with color of the - * left-top pixel, but do it only when needed. - */ - if (bm.bmWidth < r.right || bm.bmHeight < r.bottom) - { - hbr = CreateSolidBrush(GetPixel(hdcSrc, 0, 0)); - r = rzone; - if (bm.bmWidth < r.right) - { - r.left = bm.bmWidth; - FillRect(hdc, &r, hbr); - } - if (bm.bmHeight < r.bottom) - { - r.left = 0; - r.top = bm.bmHeight; - FillRect(hdc, &r, hbr); - } - DeleteObject(hbr); - } - - /* Draw the header itself. */ - BitBlt(hdc, 0, 0, - bm.bmWidth, min(bm.bmHeight, rzone.bottom), - hdcSrc, 0, 0, SRCCOPY); - } - else - { - int margin; - hbr = GetSysColorBrush(COLOR_WINDOW); - FillRect(hdc, &rzone, hbr); - - /* Draw the header bitmap. It's always centered like a - * common 49 x 49 bitmap. */ - margin = (rzone.bottom - 49) / 2; - BitBlt(hdc, rzone.right - 49 - margin, margin, - min(bm.bmWidth, 49), min(bm.bmHeight, 49), - hdcSrc, 0, 0, SRCCOPY); - - /* NOTE: Native COMCTL32 draws a white stripe over the bitmap - * if its height is smaller than 49 pixels. Because the reason - * for this bug is unknown the current code doesn't try to - * replicate it. */ - } + GetClientRect(hwndLineHeader, &r); + MapWindowPoints(hwndLineHeader, hwnd, (LPPOINT) &r, 2); + SetRect(&rzone, 0, 0, r.right + 1, r.top - 1); + + hOldFont = SelectObject(hdc, psInfo->hFontBold); + + if (psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER) + { + hbmp = SelectObject(hdcSrc, psInfo->ppshheader.u5.hbmHeader); + + GetObjectW(psInfo->ppshheader.u5.hbmHeader, sizeof(BITMAP), &bm); + if (psInfo->ppshheader.dwFlags & PSH_WIZARD97_OLD) + { + /* Fill the unoccupied part of the header with color of the + * left-top pixel, but do it only when needed. + */ + if (bm.bmWidth < r.right || bm.bmHeight < r.bottom) + { + hbr = CreateSolidBrush(GetPixel(hdcSrc, 0, 0)); + r = rzone; + if (bm.bmWidth < r.right) + { + r.left = bm.bmWidth; + FillRect(hdc, &r, hbr); + } + if (bm.bmHeight < r.bottom) + { + r.left = 0; + r.top = bm.bmHeight; + FillRect(hdc, &r, hbr); + } + DeleteObject(hbr); + } + + /* Draw the header itself. */ + BitBlt(hdc, 0, 0, bm.bmWidth, min(bm.bmHeight, rzone.bottom), + hdcSrc, 0, 0, SRCCOPY); + } + else + { + int margin; + hbr = GetSysColorBrush(COLOR_WINDOW); + FillRect(hdc, &rzone, hbr); + + /* Draw the header bitmap. It's always centered like a + * common 49 x 49 bitmap. */ + margin = (rzone.bottom - 49) / 2; + BitBlt(hdc, rzone.right - 49 - margin, margin, + min(bm.bmWidth, 49), min(bm.bmHeight, 49), + hdcSrc, 0, 0, SRCCOPY); + + /* NOTE: Native COMCTL32 draws a white stripe over the bitmap + * if its height is smaller than 49 pixels. Because the reason + * for this bug is unknown the current code doesn't try to + * replicate it. */ + } + + SelectObject(hdcSrc, hbmp); + } clrOld = SetTextColor (hdc, 0x00000000); oldBkMode = SetBkMode (hdc, TRANSPARENT); @@ -3346,7 +3374,6 @@ SetTextColor(hdc, clrOld); SetBkMode(hdc, oldBkMode); SelectObject(hdc, hOldFont); - SelectObject(hdcSrc, hbmp); } if ( (ppshpage && (ppshpage->dwFlags & PSP_HIDEHEADER)) && @@ -3754,19 +3781,19 @@ } case PSM_SETHEADERTITLEW: - PROPSHEET_SetHeaderTitleW(hwnd, (int)wParam, (LPCWSTR)lParam); + PROPSHEET_SetHeaderTitleW(hwnd, wParam, (LPCWSTR)lParam); return TRUE; case PSM_SETHEADERTITLEA: - PROPSHEET_SetHeaderTitleA(hwnd, (int)wParam, (LPCSTR)lParam); + PROPSHEET_SetHeaderTitleA(hwnd, wParam, (LPCSTR)lParam); return TRUE; case PSM_SETHEADERSUBTITLEW: - PROPSHEET_SetHeaderSubTitleW(hwnd, (int)wParam, (LPCWSTR)lParam); + PROPSHEET_SetHeaderSubTitleW(hwnd, wParam, (LPCWSTR)lParam); return TRUE; case PSM_SETHEADERSUBTITLEA: - PROPSHEET_SetHeaderSubTitleA(hwnd, (int)wParam, (LPCSTR)lParam); + PROPSHEET_SetHeaderSubTitleA(hwnd, wParam, (LPCSTR)lParam); return TRUE; case PSM_HWNDTOINDEX: Modified: trunk/reactos/dll/win32/comctl32/rebar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/rebar.c…
============================================================================== --- trunk/reactos/dll/win32/comctl32/rebar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/rebar.c [iso-8859-1] Sun Mar 5 20:52:24 2017 @@ -3386,7 +3386,7 @@ ret, i); ret = (LRESULT) i; } - TRACE("returning %ld, client point (%d,%d)\n", ret, clpt.x, clpt.y); + TRACE("returning %ld, client point %s\n", ret, wine_dbgstr_point(&clpt)); return ret; } Modified: trunk/reactos/dll/win32/comctl32/syslink.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/syslink…
============================================================================== --- trunk/reactos/dll/win32/comctl32/syslink.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/syslink.c [iso-8859-1] Sun Mar 5 20:52:24 2017 @@ -33,8 +33,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(syslink); -INT WINAPI StrCmpNIW(LPCWSTR,LPCWSTR,INT); - typedef struct { int nChars; @@ -90,11 +88,6 @@ BOOL IgnoreReturn; /* (infoPtr->Style & LWS_IGNORERETURN) on creation */ } SYSLINK_INFO; -static const WCHAR SL_LINKOPEN[] = { '<','a', 0 }; -static const WCHAR SL_HREF[] = { 'h','r','e','f','=','\"',0 }; -static const WCHAR SL_ID[] = { 'i','d','=','\"',0 }; -static const WCHAR SL_LINKCLOSE[] = { '<','/','a','>',0 }; - /* Control configuration constants */ #define SL_LEFTMARGIN (0) @@ -167,32 +160,16 @@ } /*********************************************************************** - * SYSLINK_StrCmpNIW - * Wrapper for StrCmpNIW to ensure 'len' is not too big. - */ -static INT SYSLINK_StrCmpNIW (LPCWSTR str, LPCWSTR comp, INT len) -{ - INT i; - - for(i = 0; i < len; i++) - { - if(!str[i]) - { - len = i + 1; - break; - } - } - - return StrCmpNIW(str, comp, len); -} - -/*********************************************************************** * SYSLINK_ParseText * Parses the window text string and creates a document. Returns the * number of document items created. */ static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text) { + static const WCHAR SL_LINKOPEN[] = { '<','a' }; + static const WCHAR SL_HREF[] = { 'h','r','e','f','=','\"' }; + static const WCHAR SL_ID[] = { 'i','d','=','\"' }; + static const WCHAR SL_LINKCLOSE[] = { '<','/','a','>' }; LPCWSTR current, textstart = NULL, linktext = NULL, firsttag = NULL; int taglen = 0, textlen = 0, linklen = 0, docitems = 0; PDOC_ITEM Last = NULL; @@ -206,7 +183,7 @@ { if(*current == '<') { - if(!SYSLINK_StrCmpNIW(current, SL_LINKOPEN, 2) && (CurrentType == slText)) + if(!strncmpiW(current, SL_LINKOPEN, sizeof(SL_LINKOPEN)/sizeof(SL_LINKOPEN[0])) && (CurrentType == slText)) { BOOL ValidParam = FALSE, ValidLink = FALSE; @@ -234,14 +211,14 @@ CheckParameter: /* compare the current position with all known parameters */ - if(!SYSLINK_StrCmpNIW(tmp, SL_HREF, 6)) + if(!strncmpiW(tmp, SL_HREF, sizeof(SL_HREF)/sizeof(SL_HREF[0]))) { taglen += 6; ValidParam = TRUE; CurrentParameter = &lpUrl; CurrentParameterLen = &lenUrl; } - else if(!SYSLINK_StrCmpNIW(tmp, SL_ID, 4)) + else if(!strncmpiW(tmp, SL_ID, sizeof(SL_ID)/sizeof(SL_ID[0]))) { taglen += 4; ValidParam = TRUE; @@ -315,7 +292,7 @@ } } } - else if(!SYSLINK_StrCmpNIW(current, SL_LINKCLOSE, 4) && (CurrentType == slLink) && firsttag) + else if(!strncmpiW(current, SL_LINKCLOSE, sizeof(SL_LINKCLOSE)/sizeof(SL_LINKCLOSE[0])) && (CurrentType == slLink) && firsttag) { /* there's a <a...> tag opened, first add the previous text, if present */ if(textstart != NULL && textlen > 0 && firsttag > textstart) Modified: trunk/reactos/dll/win32/comctl32/toolbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/toolbar…
============================================================================== --- trunk/reactos/dll/win32/comctl32/toolbar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/toolbar.c [iso-8859-1] Sun Mar 5 20:52:24 2017 @@ -3484,7 +3484,7 @@ Str_GetPtrW(lpText, lpTbInfo->pszText, lpTbInfo->cchText); else Str_GetPtrWtoA(lpText, (LPSTR)lpTbInfo->pszText, lpTbInfo->cchText); - } else + } else if (!bUnicode || lpTbInfo->pszText) lpTbInfo->pszText[0] = '\0'; } return nIndex; @@ -4663,17 +4663,16 @@ static LRESULT -TOOLBAR_SetDrawTextFlags (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) -{ - DWORD dwTemp; - - TRACE("hwnd = %p, dwMask = 0x%08x, dwDTFlags = 0x%08x\n", infoPtr->hwndSelf, (DWORD)wParam, (DWORD)lParam); - - dwTemp = infoPtr->dwDTFlags; - infoPtr->dwDTFlags = - (infoPtr->dwDTFlags & (DWORD)wParam) | (DWORD)lParam; - - return (LRESULT)dwTemp; +TOOLBAR_SetDrawTextFlags (TOOLBAR_INFO *infoPtr, DWORD mask, DWORD flags) +{ + DWORD old_flags; + + TRACE("hwnd = %p, mask = 0x%08x, flags = 0x%08x\n", infoPtr->hwndSelf, mask, flags); + + old_flags = infoPtr->dwDTFlags; + infoPtr->dwDTFlags = (old_flags & ~mask) | (flags & mask); + + return (LRESULT)old_flags; } /* This function differs a bit from what MSDN says it does: Modified: trunk/reactos/dll/win32/comctl32/tooltips.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/tooltip…
============================================================================== --- trunk/reactos/dll/win32/comctl32/tooltips.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/tooltips.c [iso-8859-1] Sun Mar 5 20:52:24 2017 @@ -1521,7 +1521,7 @@ &pt); TRACE("tool (%p) %d %d %d\n", infoPtr->hwndSelf, nOldTool, infoPtr->nTool, infoPtr->nCurrentTool); - TRACE("WM_MOUSEMOVE (%p %d %d)\n", infoPtr->hwndSelf, pt.x, pt.y); + TRACE("WM_MOUSEMOVE (%p %s)\n", infoPtr->hwndSelf, wine_dbgstr_point(&pt)); if (infoPtr->nTool != nOldTool) { if(infoPtr->nTool == -1) { /* Moved out of all tools */ Modified: trunk/reactos/dll/win32/comctl32/trackbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/trackba…
============================================================================== --- trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] Sun Mar 5 20:52:24 2017 @@ -436,7 +436,7 @@ LONG dir = TRACKBAR_GetAutoPageDirection(infoPtr, clickPoint); LONG prevPos = infoPtr->lPos; - TRACE("x=%d, y=%d, dir=%d\n", clickPoint.x, clickPoint.y, dir); + TRACE("clickPoint=%s, dir=%d\n", wine_dbgstr_point(&clickPoint), dir); if (dir > 0 && (infoPtr->flags & TB_AUTO_PAGE_RIGHT)) TRACKBAR_PageDown(infoPtr); @@ -1261,10 +1261,11 @@ TRACKBAR_SetRangeMax (TRACKBAR_INFO *infoPtr, BOOL redraw, LONG lMax) { BOOL changed = infoPtr->lRangeMax != lMax; + LONG rightmost = max(lMax, infoPtr->lRangeMin); infoPtr->lRangeMax = lMax; - if (infoPtr->lPos > infoPtr->lRangeMax) { - infoPtr->lPos = infoPtr->lRangeMax; + if (infoPtr->lPos > rightmost) { + infoPtr->lPos = rightmost; infoPtr->flags |= TB_THUMBPOSCHANGED; } @@ -1415,6 +1416,7 @@ TRACKBAR_InvalidateAll(infoPtr); } + TRACKBAR_UpdateThumb (infoPtr); return 0; } Modified: trunk/reactos/dll/win32/comctl32/treeview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/treevie…
============================================================================== --- trunk/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] Sun Mar 5 20:52:24 2017 @@ -2531,6 +2531,8 @@ } hOldFont = SelectObject(hdc, TREEVIEW_FontForItem(infoPtr, item)); + oldTextColor = SetTextColor(hdc, nmcdhdr.clrText); + oldTextBkColor = SetBkColor(hdc, nmcdhdr.clrTextBk); /* The custom draw handler can query the text rectangle, * so get ready. */ @@ -2565,9 +2567,9 @@ TREEVIEW_DrawItemLines(infoPtr, hdc, item); - /* Set colors. Custom draw handler can change these so we do this after it. */ - oldTextColor = SetTextColor(hdc, nmcdhdr.clrText); - oldTextBkColor = SetBkColor(hdc, nmcdhdr.clrTextBk); + /* reset colors. Custom draw handler can change them */ + SetTextColor(hdc, nmcdhdr.clrText); + SetBkColor(hdc, nmcdhdr.clrTextBk); centery = (item->rect.top + item->rect.bottom) / 2; @@ -3686,6 +3688,9 @@ lpht->flags = TVHT_NOWHERE; return NULL; } + + if (!item->textWidth) + TREEVIEW_ComputeTextWidth(infoPtr, item, 0); if (x >= item->textOffset + item->textWidth) { 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] Sun Mar 5 20:52:24 2017 @@ -54,7 +54,7 @@ reactos/dll/win32/cabinet # Synced to WineStaging-2.2 reactos/dll/win32/clusapi # Synced to WineStaging-1.9.11 reactos/dll/win32/comcat # Synced to WineStaging-1.9.11 -reactos/dll/win32/comctl32 # Synced to WineStaging-1.9.23 +reactos/dll/win32/comctl32 # Synced to WineStaging-2.2 reactos/dll/win32/comdlg32 # Synced to WineStaging-1.9.23 reactos/dll/win32/compstui # Synced to WineStaging-2.2 reactos/dll/win32/credui # Synced to WineStaging-2.2
7 years, 9 months
1
0
0
0
[akhaldi] 74089: [PSDK] Add missing PSPCB_ADDREF. CORE-12823
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 5 20:49:12 2017 New Revision: 74089 URL:
http://svn.reactos.org/svn/reactos?rev=74089&view=rev
Log: [PSDK] Add missing PSPCB_ADDREF. CORE-12823 Modified: trunk/reactos/sdk/include/psdk/prsht.h Modified: trunk/reactos/sdk/include/psdk/prsht.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/prsht.h?r…
============================================================================== --- trunk/reactos/sdk/include/psdk/prsht.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/psdk/prsht.h [iso-8859-1] Sun Mar 5 20:49:12 2017 @@ -168,6 +168,8 @@ #define PSM_SETTITLEA (WM_USER+111) #define PSM_SETTITLEW (WM_USER+120) +#define PSPCB_ADDREF 0 + #ifndef RC_INVOKED #pragma pack(push,8)
7 years, 9 months
1
0
0
0
[akhaldi] 74088: [MSI_WINETEST] Sync with Wine Staging 2.2. CORE-12823
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 5 20:45:43 2017 New Revision: 74088 URL:
http://svn.reactos.org/svn/reactos?rev=74088&view=rev
Log: [MSI_WINETEST] Sync with Wine Staging 2.2. CORE-12823 Modified: trunk/rostests/winetests/msi/package.c Modified: trunk/rostests/winetests/msi/package.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/package.c?r…
============================================================================== --- trunk/rostests/winetests/msi/package.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/package.c [iso-8859-1] Sun Mar 5 20:45:43 2017 @@ -8293,13 +8293,21 @@ static void test_MsiGetProductProperty(void) { + static const WCHAR prodcode_propW[] = {'P','r','o','d','u','c','t','C','o','d','e',0}; + static const WCHAR nonexistentW[] = {'I','D','o','n','t','E','x','i','s','t',0}; + static const WCHAR newpropW[] = {'N','e','w','P','r','o','p','e','r','t','y',0}; + static const WCHAR appleW[] = {'a','p','p','l','e',0}; + static const WCHAR emptyW[] = {0}; + WCHAR valW[MAX_PATH]; MSIHANDLE hprod, hdb; CHAR val[MAX_PATH]; CHAR path[MAX_PATH]; CHAR query[MAX_PATH]; CHAR keypath[MAX_PATH*2]; CHAR prodcode[MAX_PATH]; + WCHAR prodcodeW[MAX_PATH]; CHAR prod_squashed[MAX_PATH]; + WCHAR prod_squashedW[MAX_PATH]; HKEY prodkey, userkey, props; DWORD size; LONG res; @@ -8310,6 +8318,8 @@ lstrcatA(path, "\\"); create_test_guid(prodcode, prod_squashed); + MultiByteToWideChar(CP_ACP, 0, prodcode, -1, prodcodeW, MAX_PATH); + squash_guid(prodcodeW, prod_squashedW); if (is_wow64) access |= KEY_WOW64_64KEY; @@ -8400,6 +8410,15 @@ "Expected val to be unchanged, got \"%s\"\n", val); ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size); + size = MAX_PATH; + lstrcpyW(valW, appleW); + r = MsiGetProductPropertyW(0xdeadbeef, prodcode_propW, valW, &size); + ok(r == ERROR_INVALID_HANDLE, + "Expected ERROR_INVALID_HANDLE, got %d\n", r); + ok(!lstrcmpW(valW, appleW), + "Expected val to be unchanged, got %s\n", wine_dbgstr_w(valW)); + ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size); + /* szProperty is NULL */ size = MAX_PATH; lstrcpyA(val, "apple"); @@ -8410,12 +8429,28 @@ "Expected val to be unchanged, got \"%s\"\n", val); ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size); + size = MAX_PATH; + lstrcpyW(valW, appleW); + r = MsiGetProductPropertyW(hprod, NULL, valW, &size); + ok(r == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", r); + ok(!lstrcmpW(valW, appleW), + "Expected val to be unchanged, got %s\n", wine_dbgstr_w(valW)); + ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size); + /* szProperty is empty */ size = MAX_PATH; lstrcpyA(val, "apple"); r = MsiGetProductPropertyA(hprod, "", val, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val); + ok(size == 0, "Expected 0, got %d\n", size); + + size = MAX_PATH; + lstrcpyW(valW, appleW); + r = MsiGetProductPropertyW(hprod, emptyW, valW, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(*valW == 0, "Expected \"\", got %s\n", wine_dbgstr_w(valW)); ok(size == 0, "Expected 0, got %d\n", size); /* get the property */ @@ -8428,12 +8463,27 @@ ok(size == lstrlenA(prodcode), "Expected %d, got %d\n", lstrlenA(prodcode), size); + size = MAX_PATH; + lstrcpyW(valW, appleW); + r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpW(valW, prodcodeW), + "Expected %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW)); + ok(size == lstrlenW(prodcodeW), + "Expected %d, got %d\n", lstrlenW(prodcodeW), size); + /* lpValueBuf is NULL */ size = MAX_PATH; r = MsiGetProductPropertyA(hprod, "ProductCode", NULL, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(size == lstrlenA(prodcode), "Expected %d, got %d\n", lstrlenA(prodcode), size); + + size = MAX_PATH; + r = MsiGetProductPropertyW(hprod, prodcode_propW, NULL, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(size == lstrlenW(prodcodeW), + "Expected %d, got %d\n", lstrlenW(prodcodeW), size); /* pcchValueBuf is NULL */ lstrcpyA(val, "apple"); @@ -8445,6 +8495,15 @@ ok(size == lstrlenA(prodcode), "Expected %d, got %d\n", lstrlenA(prodcode), size); + lstrcpyW(valW, appleW); + r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, NULL); + ok(r == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", r); + ok(!lstrcmpW(valW, appleW), + "Expected val to be unchanged, got %s\n", wine_dbgstr_w(valW)); + ok(size == lstrlenW(prodcodeW), + "Expected %d, got %d\n", lstrlenW(prodcodeW), size); + /* pcchValueBuf is too small */ size = 4; lstrcpyA(val, "apple"); @@ -8455,6 +8514,15 @@ ok(size == lstrlenA(prodcode), "Expected %d, got %d\n", lstrlenA(prodcode), size); + size = 4; + lstrcpyW(valW, appleW); + r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size); + ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r); + ok(!memcmp(valW, prodcodeW, 3 * sizeof(WCHAR)), + "Expected first 3 chars of %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW)); + ok(size == lstrlenW(prodcodeW), + "Expected %d, got %d\n", lstrlenW(prodcodeW), size); + /* pcchValueBuf does not leave room for NULL terminator */ size = lstrlenA(prodcode); lstrcpyA(val, "apple"); @@ -8465,6 +8533,15 @@ ok(size == lstrlenA(prodcode), "Expected %d, got %d\n", lstrlenA(prodcode), size); + size = lstrlenW(prodcodeW); + lstrcpyW(valW, appleW); + r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size); + ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r); + ok(!memcmp(valW, prodcodeW, lstrlenW(prodcodeW) - 1), + "Expected first 37 chars of %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW)); + ok(size == lstrlenW(prodcodeW), + "Expected %d, got %d\n", lstrlenW(prodcodeW), size); + /* pcchValueBuf has enough room for NULL terminator */ size = lstrlenA(prodcode) + 1; lstrcpyA(val, "apple"); @@ -8475,6 +8552,15 @@ ok(size == lstrlenA(prodcode), "Expected %d, got %d\n", lstrlenA(prodcode), size); + size = lstrlenW(prodcodeW) + 1; + lstrcpyW(valW, appleW); + r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpW(valW, prodcodeW), + "Expected %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW)); + ok(size == lstrlenW(prodcodeW), + "Expected %d, got %d\n", lstrlenW(prodcodeW), size); + /* nonexistent property */ size = MAX_PATH; lstrcpyA(val, "apple"); @@ -8483,6 +8569,13 @@ ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val); ok(size == 0, "Expected 0, got %d\n", size); + size = MAX_PATH; + lstrcpyW(valW, appleW); + r = MsiGetProductPropertyW(hprod, nonexistentW, valW, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpW(valW, emptyW), "Expected \"\", got %s\n", wine_dbgstr_w(valW)); + ok(size == 0, "Expected 0, got %d\n", size); + r = MsiSetPropertyA(hprod, "NewProperty", "value"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -8492,6 +8585,13 @@ r = MsiGetProductPropertyA(hprod, "NewProperty", val, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val); + ok(size == 0, "Expected 0, got %d\n", size); + + size = MAX_PATH; + lstrcpyW(valW, appleW); + r = MsiGetProductPropertyW(hprod, newpropW, valW, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpW(valW, emptyW), "Expected \"\", got %s\n", wine_dbgstr_w(valW)); ok(size == 0, "Expected 0, got %d\n", size); r = MsiSetPropertyA(hprod, "ProductCode", "value"); @@ -8506,6 +8606,15 @@ "Expected \"%s\", got \"%s\"\n", prodcode, val); ok(size == lstrlenA(prodcode), "Expected %d, got %d\n", lstrlenA(prodcode), size); + + size = MAX_PATH; + lstrcpyW(valW, appleW); + r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpW(valW, prodcodeW), + "Expected %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW)); + ok(size == lstrlenW(prodcodeW), + "Expected %d, got %d\n", lstrlenW(prodcodeW), size); MsiCloseHandle(hprod);
7 years, 9 months
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
20
...
26
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
Results per page:
10
25
50
100
200