winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2017
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
640 discussions
Start a n
N
ew thread
Hugh McMaster : comctl32/tests: Add tests for mouse right-click in a treeview control.
by Alexandre Julliard
18 May '17
18 May '17
Module: wine Branch: master Commit: febdb101e6baca0bc6110c40963056563febf6f1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=febdb101e6baca0bc6110c409…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Thu May 18 03:02:10 2017 +0000 comctl32/tests: Add tests for mouse right-click in a treeview control. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/treeview.c | 79 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c index 43de61c..e7ce92c 100644 --- a/dlls/comctl32/tests/treeview.c +++ b/dlls/comctl32/tests/treeview.c @@ -54,6 +54,21 @@ static BOOL g_v6; static struct msg_sequence *sequences[NUM_MSG_SEQUENCES]; static struct msg_sequence *item_sequence[1]; +static void flush_events(void) +{ + MSG msg; + int diff = 200; + int min_timeout = 100; + DWORD time = GetTickCount() + diff; + + while (diff > 0) + { + if (MsgWaitForMultipleObjects(0, NULL, FALSE, min_timeout, QS_ALLINPUT) == WAIT_TIMEOUT) break; + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + diff = time - GetTickCount(); + } +} + static const struct message FillRootSeq[] = { { TVM_INSERTITEMA, sent }, { TVM_INSERTITEMA, sent }, @@ -201,6 +216,13 @@ static const struct message test_get_set_unicodeformat_seq[] = { { 0 } }; +static const struct message test_right_click_seq[] = { + { WM_RBUTTONDOWN, sent|wparam, MK_RBUTTON }, + { WM_CAPTURECHANGED, sent|defwinproc }, + { TVM_GETNEXTITEM, sent|wparam|lparam|defwinproc, TVGN_CARET, 0 }, + { 0 } +}; + static const struct message parent_expand_seq[] = { { WM_NOTIFY, sent|id, 0, 0, TVN_ITEMEXPANDINGA }, { WM_NOTIFY, sent|id, 0, 0, TVN_ITEMEXPANDEDA }, @@ -342,6 +364,12 @@ static const struct message parent_vk_return_seq[] = { { 0 } }; +static const struct message parent_right_click_seq[] = { + { WM_NOTIFY, sent|id, 0, 0, NM_RCLICK }, + { WM_CONTEXTMENU, sent }, + { 0 } +}; + static HWND hMainWnd; static HTREEITEM hRoot, hChild; @@ -1296,6 +1324,13 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam, } break; } + case NM_RCLICK: + { + HTREEITEM selected = (HTREEITEM)SendMessageA(((NMHDR *)lParam)->hwndFrom, + TVM_GETNEXTITEM, TVGN_CARET, 0); + ok(selected == hChild, "child item should still be selected\n"); + break; + } } } break; @@ -2583,6 +2618,49 @@ todo_wine DestroyWindow(hwnd); } +static void test_right_click(void) +{ + HWND hTree; + HTREEITEM selected; + RECT rc; + LRESULT result; + POINT pt; + + hTree = create_treeview_control(0); + fill_tree(hTree); + + SendMessageA(hTree, TVM_ENSUREVISIBLE, 0, (LPARAM)hChild); + SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hChild); + selected = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_CARET, 0); + ok(selected == hChild, "child item not selected\n"); + + *(HTREEITEM *)&rc = hRoot; + result = SendMessageA(hTree, TVM_GETITEMRECT, TRUE, (LPARAM)&rc); + ok(result, "TVM_GETITEMRECT failed\n"); + + flush_events(); + + pt.x = (rc.left + rc.right) / 2; + pt.y = (rc.top + rc.bottom) / 2; + ClientToScreen(hMainWnd, &pt); + + flush_events(); + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + PostMessageA(hTree, WM_RBUTTONDOWN, MK_RBUTTON, MAKELPARAM(pt.x, pt.y)); + PostMessageA(hTree, WM_RBUTTONUP, 0, MAKELPARAM(pt.x, pt.y)); + + flush_events(); + + ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_right_click_seq, "right click sequence", FALSE); + ok_sequence(sequences, PARENT_SEQ_INDEX, parent_right_click_seq, "parent right click sequence", FALSE); + + selected = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_CARET, 0); + ok(selected == hChild, "child item should still be selected\n"); + + DestroyWindow(hTree); +} + START_TEST(treeview) { HMODULE hComctl32; @@ -2660,6 +2738,7 @@ START_TEST(treeview) test_WM_KEYDOWN(); test_TVS_FULLROWSELECT(); test_TVM_SORTCHILDREN(); + test_right_click(); if (!load_v6_module(&ctx_cookie, &hCtx)) {
1
0
0
0
Alex Henrie : comctl32/listview: When adding a scrollbar, update the other one.
by Alexandre Julliard
18 May '17
18 May '17
Module: wine Branch: master Commit: 5fe449307f6604a781bcb9fe1b81185e3ea1cf51 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5fe449307f6604a781bcb9fe1…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu May 18 13:11:04 2017 +0300 comctl32/listview: When adding a scrollbar, update the other one. Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/listview.c | 78 +++++++++++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 28 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 70a6e6d..c681451 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -2015,23 +2015,10 @@ static void LISTVIEW_UpdateHeaderSize(const LISTVIEW_INFO *infoPtr, INT nNewScro SWP_NOZORDER | SWP_NOACTIVATE); } -/*** - * DESCRIPTION: - * Update the scrollbars. This functions should be called whenever - * the content, size or view changes. - * - * PARAMETER(S): - * [I] infoPtr : valid pointer to the listview structure - * - * RETURN: - * None - */ -static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr) +static INT LISTVIEW_UpdateHScroll(LISTVIEW_INFO *infoPtr) { - SCROLLINFO horzInfo, vertInfo; - INT dx, dy; - - if ((infoPtr->dwStyle & LVS_NOSCROLL) || !is_redrawing(infoPtr)) return; + SCROLLINFO horzInfo; + INT dx; ZeroMemory(&horzInfo, sizeof(SCROLLINFO)); horzInfo.cbSize = sizeof(SCROLLINFO); @@ -2083,10 +2070,22 @@ static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr) dx -= SetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &horzInfo, TRUE); TRACE("horzInfo=%s\n", debugscrollinfo(&horzInfo)); - /* Setting the horizontal scroll can change the listview size - * (and potentially everything else) so we need to recompute - * everything again for the vertical scroll - */ + /* Update the Header Control */ + if (infoPtr->hwndHeader) + { + horzInfo.fMask = SIF_POS; + GetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &horzInfo); + LISTVIEW_UpdateHeaderSize(infoPtr, horzInfo.nPos); + } + + LISTVIEW_UpdateSize(infoPtr); + return dx; +} + +static INT LISTVIEW_UpdateVScroll(LISTVIEW_INFO *infoPtr) +{ + SCROLLINFO vertInfo; + INT dy; ZeroMemory(&vertInfo, sizeof(SCROLLINFO)); vertInfo.cbSize = sizeof(SCROLLINFO); @@ -2116,6 +2115,37 @@ static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr) dy -= SetScrollInfo(infoPtr->hwndSelf, SB_VERT, &vertInfo, TRUE); TRACE("vertInfo=%s\n", debugscrollinfo(&vertInfo)); + LISTVIEW_UpdateSize(infoPtr); + return dy; +} + +/*** + * DESCRIPTION: + * Update the scrollbars. This function should be called whenever + * the content, size or view changes. + * + * PARAMETER(S): + * [I] infoPtr : valid pointer to the listview structure + * + * RETURN: + * None + */ +static void LISTVIEW_UpdateScroll(LISTVIEW_INFO *infoPtr) +{ + INT dx, dy, pass; + + if ((infoPtr->dwStyle & LVS_NOSCROLL) || !is_redrawing(infoPtr)) return; + + /* Setting the horizontal scroll can change the listview size + * (and potentially everything else) so we need to recompute + * everything again for the vertical scroll and vice-versa + */ + for (dx = 0, dy = 0, pass = 0; pass <= 1; pass++) + { + dx += LISTVIEW_UpdateHScroll(infoPtr); + dy += LISTVIEW_UpdateVScroll(infoPtr); + } + /* Change of the range may have changed the scroll pos. If so move the content */ if (dx != 0 || dy != 0) { @@ -2124,14 +2154,6 @@ static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr) ScrollWindowEx(infoPtr->hwndSelf, dx, dy, &listRect, &listRect, 0, 0, SW_ERASE | SW_INVALIDATE); } - - /* Update the Header Control */ - if (infoPtr->hwndHeader) - { - horzInfo.fMask = SIF_POS; - GetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &horzInfo); - LISTVIEW_UpdateHeaderSize(infoPtr, horzInfo.nPos); - } }
1
0
0
0
Huw Davies : ole32: Fix up the dib's resolution on loading.
by Alexandre Julliard
18 May '17
18 May '17
Module: wine Branch: master Commit: 1d2860e54c26592e44f3f3c463f692aa3882f497 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1d2860e54c26592e44f3f3c46…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 18 11:07:07 2017 +0100 ole32: Fix up the dib's resolution on loading. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/datacache.c | 13 +++++++++++++ dlls/ole32/tests/ole2.c | 21 ++++++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index 0db5551..40d4ab8 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -635,6 +635,7 @@ static HRESULT load_dib( DataCacheEntry *cache_entry, IStream *stm ) HGLOBAL hglobal; ULONG read, info_size, bi_size; BITMAPFILEHEADER file; + BITMAPINFOHEADER *info; if (cache_entry->stream_type != contents_stream) { @@ -685,6 +686,18 @@ static HRESULT load_dib( DataCacheEntry *cache_entry, IStream *stm ) hr = IStream_Read( stm, (char *)dib + info_size, stat.cbSize.u.LowPart, &read ); if (hr != S_OK || read != stat.cbSize.QuadPart) goto fail; + if (bi_size >= sizeof(*info)) + { + info = (BITMAPINFOHEADER *)dib; + if (info->biXPelsPerMeter == 0 || info->biYPelsPerMeter == 0) + { + HDC hdc = GetDC( 0 ); + info->biXPelsPerMeter = MulDiv( GetDeviceCaps( hdc, LOGPIXELSX ), 10000, 254 ); + info->biYPelsPerMeter = MulDiv( GetDeviceCaps( hdc, LOGPIXELSY ), 10000, 254 ); + ReleaseDC( 0, hdc ); + } + } + GlobalUnlock( hglobal ); cache_entry->data_cf = cache_entry->fmtetc.cfFormat; diff --git a/dlls/ole32/tests/ole2.c b/dlls/ole32/tests/ole2.c index afff6ba..65abb3e 100644 --- a/dlls/ole32/tests/ole2.c +++ b/dlls/ole32/tests/ole2.c @@ -1972,6 +1972,8 @@ static void test_data_cache_dib_contents_stream(int num) STGMEDIUM med; CLSID cls; SIZEL sz; + BYTE *ptr; + BITMAPINFOHEADER expect_info; hr = CreateDataCache( NULL, &CLSID_Picture_Metafile, &IID_IUnknown, (void **)&unk ); ok( SUCCEEDED(hr), "got %08x\n", hr ); @@ -1994,11 +1996,24 @@ static void test_data_cache_dib_contents_stream(int num) hr = IDataObject_GetData( data, &fmt, &med ); ok( SUCCEEDED(hr), "got %08x\n", hr ); - if (SUCCEEDED(hr)) + ok( med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed ); + ok( GlobalSize( U(med).hGlobal ) >= sizeof(dib) - sizeof(BITMAPFILEHEADER), + "got %lu\n", GlobalSize( U(med).hGlobal ) ); + ptr = GlobalLock( U(med).hGlobal ); + + expect_info = *(BITMAPINFOHEADER *)(dib + sizeof(BITMAPFILEHEADER)); + if (expect_info.biXPelsPerMeter == 0 || expect_info.biYPelsPerMeter == 0) { - ok( med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed ); - ReleaseStgMedium( &med ); + HDC hdc = GetDC( 0 ); + expect_info.biXPelsPerMeter = MulDiv( GetDeviceCaps( hdc, LOGPIXELSX ), 10000, 254 ); + expect_info.biYPelsPerMeter = MulDiv( GetDeviceCaps( hdc, LOGPIXELSY ), 10000, 254 ); + ReleaseDC( 0, hdc ); } + ok( !memcmp( ptr, &expect_info, sizeof(expect_info) ), "mismatch\n" ); + ok( !memcmp( ptr + sizeof(expect_info), dib + sizeof(BITMAPFILEHEADER) + sizeof(expect_info), + sizeof(dib) - sizeof(BITMAPFILEHEADER) - sizeof(expect_info) ), "mismatch\n" ); + GlobalUnlock( U(med).hGlobal ); + ReleaseStgMedium( &med ); hr = IViewObject2_GetExtent( view, DVASPECT_CONTENT, -1, NULL, &sz ); ok( SUCCEEDED(hr), "got %08x\n", hr );
1
0
0
0
Huw Davies : ole32: Don't cache the BITMAPFILEHEADER.
by Alexandre Julliard
18 May '17
18 May '17
Module: wine Branch: master Commit: e7bb4ba2697d5dfdf29387ac01f5f9f89487a38a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e7bb4ba2697d5dfdf29387ac0…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 18 11:07:06 2017 +0100 ole32: Don't cache the BITMAPFILEHEADER. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/datacache.c | 88 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 74 insertions(+), 14 deletions(-) diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index 0d3c2a9..0db5551 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -224,6 +224,35 @@ const char *debugstr_formatetc(const FORMATETC *formatetc) formatetc->lindex, formatetc->tymed); } +/*********************************************************************** + * bitmap_info_size + * + * Return the size of the bitmap info structure including color table. + */ +int bitmap_info_size( const BITMAPINFO * info, WORD coloruse ) +{ + unsigned int colors, size, masks = 0; + + if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) + { + const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)info; + colors = (core->bcBitCount <= 8) ? 1 << core->bcBitCount : 0; + return sizeof(BITMAPCOREHEADER) + colors * + ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD)); + } + else /* assume BITMAPINFOHEADER */ + { + colors = info->bmiHeader.biClrUsed; + if (colors > 256) /* buffer overflow otherwise */ + colors = 256; + if (!colors && (info->bmiHeader.biBitCount <= 8)) + colors = 1 << info->bmiHeader.biBitCount; + if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3; + size = max( info->bmiHeader.biSize, sizeof(BITMAPINFOHEADER) + masks * sizeof(DWORD) ); + return size + colors * ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) : sizeof(WORD)); + } +} + static void DataCacheEntry_Destroy(DataCache *cache, DataCacheEntry *cache_entry) { list_remove(&cache_entry->entry); @@ -604,7 +633,8 @@ static HRESULT load_dib( DataCacheEntry *cache_entry, IStream *stm ) STATSTG stat; void *dib; HGLOBAL hglobal; - ULONG read; + ULONG read, info_size, bi_size; + BITMAPFILEHEADER file; if (cache_entry->stream_type != contents_stream) { @@ -615,24 +645,59 @@ static HRESULT load_dib( DataCacheEntry *cache_entry, IStream *stm ) hr = IStream_Stat( stm, &stat, STATFLAG_NONAME ); if (FAILED( hr )) return hr; + if (stat.cbSize.QuadPart < sizeof(file) + sizeof(DWORD)) return E_FAIL; + hr = IStream_Read( stm, &file, sizeof(file), &read ); + if (hr != S_OK || read != sizeof(file)) return E_FAIL; + stat.cbSize.QuadPart -= sizeof(file); + hglobal = GlobalAlloc( GMEM_MOVEABLE, stat.cbSize.u.LowPart ); if (!hglobal) return E_OUTOFMEMORY; dib = GlobalLock( hglobal ); - hr = IStream_Read( stm, dib, stat.cbSize.u.LowPart, &read ); - GlobalUnlock( hglobal ); + hr = IStream_Read( stm, dib, sizeof(DWORD), &read ); + if (hr != S_OK || read != sizeof(DWORD)) goto fail; + bi_size = *(DWORD *)dib; + if (stat.cbSize.QuadPart < bi_size) goto fail; + + hr = IStream_Read( stm, (char *)dib + sizeof(DWORD), bi_size - sizeof(DWORD), &read ); + if (hr != S_OK || read != bi_size - sizeof(DWORD)) goto fail; - if (hr != S_OK || read != stat.cbSize.u.LowPart) + info_size = bitmap_info_size( dib, DIB_RGB_COLORS ); + if (stat.cbSize.QuadPart < info_size) goto fail; + if (info_size > bi_size) { - GlobalFree( hglobal ); - return E_FAIL; + hr = IStream_Read( stm, (char *)dib + bi_size, info_size - bi_size, &read ); + if (hr != S_OK || read != info_size - bi_size) goto fail; } + stat.cbSize.QuadPart -= info_size; + + if (file.bfOffBits) + { + LARGE_INTEGER skip; + + skip.QuadPart = file.bfOffBits - sizeof(file) - info_size; + if (stat.cbSize.QuadPart < skip.QuadPart) goto fail; + hr = IStream_Seek( stm, skip, STREAM_SEEK_CUR, NULL ); + if (hr != S_OK) goto fail; + stat.cbSize.QuadPart -= skip.QuadPart; + } + + hr = IStream_Read( stm, (char *)dib + info_size, stat.cbSize.u.LowPart, &read ); + if (hr != S_OK || read != stat.cbSize.QuadPart) goto fail; + + GlobalUnlock( hglobal ); cache_entry->data_cf = cache_entry->fmtetc.cfFormat; cache_entry->stgmedium.tymed = TYMED_HGLOBAL; cache_entry->stgmedium.u.hGlobal = hglobal; return S_OK; + +fail: + GlobalUnlock( hglobal ); + GlobalFree( hglobal ); + return E_FAIL; + } /************************************************************************ @@ -1672,16 +1737,14 @@ static HRESULT WINAPI DataCache_Draw( } case CF_DIB: { - BITMAPFILEHEADER *file_head; BITMAPINFO *info; BYTE *bits; if ((cache_entry->stgmedium.tymed != TYMED_HGLOBAL) || - !((file_head = GlobalLock( cache_entry->stgmedium.u.hGlobal )))) + !((info = GlobalLock( cache_entry->stgmedium.u.hGlobal )))) continue; - info = (BITMAPINFO *)(file_head + 1); - bits = (BYTE *) file_head + file_head->bfOffBits; + bits = (BYTE *) info + bitmap_info_size( info, DIB_RGB_COLORS ); StretchDIBits( hdcDraw, lprcBounds->left, lprcBounds->top, lprcBounds->right - lprcBounds->left, lprcBounds->bottom - lprcBounds->top, 0, 0, info->bmiHeader.biWidth, info->bmiHeader.biHeight, @@ -1892,17 +1955,14 @@ static HRESULT WINAPI DataCache_GetExtent( } case CF_DIB: { - BITMAPFILEHEADER *file_head; BITMAPINFOHEADER *info; LONG x_pels_m, y_pels_m; if ((cache_entry->stgmedium.tymed != TYMED_HGLOBAL) || - !((file_head = GlobalLock( cache_entry->stgmedium.u.hGlobal )))) + !((info = GlobalLock( cache_entry->stgmedium.u.hGlobal )))) continue; - info = (BITMAPINFOHEADER *)(file_head + 1); - x_pels_m = info->biXPelsPerMeter; y_pels_m = info->biYPelsPerMeter;
1
0
0
0
Huw Davies : ole32: Set the advise flags in CreateEntry().
by Alexandre Julliard
18 May '17
18 May '17
Module: wine Branch: master Commit: fc49d98f6ae60c8202aead072e699473f679854c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fc49d98f6ae60c8202aead072…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 18 11:07:05 2017 +0100 ole32: Set the advise flags in CreateEntry(). Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/datacache.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index 3abb16f..0d3c2a9 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -322,7 +322,8 @@ static BOOL init_cache_entry(DataCacheEntry *entry, const FORMATETC *fmt, DWORD return TRUE; } -static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc, DataCacheEntry **cache_entry, BOOL load) +static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc, DWORD advf, + DataCacheEntry **cache_entry, BOOL load) { HRESULT hr; @@ -336,7 +337,7 @@ static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc if (!*cache_entry) return E_OUTOFMEMORY; - if (!init_cache_entry(*cache_entry, formatetc, 0, This->last_cache_id)) + if (!init_cache_entry(*cache_entry, formatetc, advf, This->last_cache_id)) goto fail; list_add_tail(&This->cache_list, &(*cache_entry)->entry); @@ -1275,7 +1276,7 @@ static HRESULT add_cache_entry( DataCache *This, const FORMATETC *fmt, IStream * cache_entry = DataCache_GetEntryForFormatEtc( This, fmt ); if (!cache_entry) - hr = DataCache_CreateEntry( This, fmt, &cache_entry, TRUE ); + hr = DataCache_CreateEntry( This, fmt, 0, &cache_entry, TRUE ); if (SUCCEEDED( hr )) { DataCacheEntry_DiscardData( cache_entry ); @@ -2023,12 +2024,11 @@ static HRESULT WINAPI DataCache_Cache( return CACHE_S_SAMECACHE; } - hr = DataCache_CreateEntry(This, pformatetc, &cache_entry, FALSE); + hr = DataCache_CreateEntry(This, pformatetc, advf, &cache_entry, FALSE); if (SUCCEEDED(hr)) { *pdwConnection = cache_entry->id; - cache_entry->advise_flags = advf; setup_sink(This, cache_entry); }
1
0
0
0
Huw Davies : ole32: Use the helper function to copy the clipboard' s FORMATETC.
by Alexandre Julliard
18 May '17
18 May '17
Module: wine Branch: master Commit: 77d1eba7fa6a39ce391f136247da53beb4a0eb28 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=77d1eba7fa6a39ce391f13624…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 18 11:07:04 2017 +0100 ole32: Use the helper function to copy the clipboard's FORMATETC. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/clipboard.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index d48ea79..b3c7665 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -330,14 +330,8 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Next for(i = 0; i < cfetch; i++) { - rgelt[i] = This->data->entries[This->pos++].fmtetc; - if(rgelt[i].ptd) - { - DVTARGETDEVICE *target = rgelt[i].ptd; - rgelt[i].ptd = CoTaskMemAlloc(target->tdSize); - if(!rgelt[i].ptd) return E_OUTOFMEMORY; - memcpy(rgelt[i].ptd, target, target->tdSize); - } + hres = copy_formatetc(rgelt + i, &This->data->entries[This->pos++].fmtetc); + if(FAILED(hres)) return hres; } } else
1
0
0
0
Huw Davies : ole32: Use the helper function to copy the datacache' s FORMATETC.
by Alexandre Julliard
18 May '17
18 May '17
Module: wine Branch: master Commit: 9ee30d7915e6fb16a5e2bad7920ae322ae964f64 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9ee30d7915e6fb16a5e2bad79…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 18 11:07:03 2017 +0100 ole32: Use the helper function to copy the datacache's FORMATETC. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/datacache.c | 52 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index 441a874..3abb16f 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -55,8 +55,9 @@ #include "wingdi.h" #include "winuser.h" #include "winerror.h" -#include "wine/unicode.h" #include "ole2.h" +#include "compobj_private.h" +#include "wine/unicode.h" #include "wine/list.h" #include "wine/debug.h" @@ -228,7 +229,7 @@ static void DataCacheEntry_Destroy(DataCache *cache, DataCacheEntry *cache_entry list_remove(&cache_entry->entry); if (cache_entry->stream) IStream_Release(cache_entry->stream); - HeapFree(GetProcessHeap(), 0, cache_entry->fmtetc.ptd); + CoTaskMemFree(cache_entry->fmtetc.ptd); ReleaseStgMedium(&cache_entry->stgmedium); if(cache_entry->sink_id) IDataObject_DUnadvise(cache->running_object, cache_entry->sink_id); @@ -299,6 +300,28 @@ static HRESULT check_valid_clipformat_and_tymed(CLIPFORMAT cfFormat, DWORD tymed } } +static BOOL init_cache_entry(DataCacheEntry *entry, const FORMATETC *fmt, DWORD advf, + DWORD id) +{ + HRESULT hr; + + hr = copy_formatetc(&entry->fmtetc, fmt); + if (FAILED(hr)) return FALSE; + + entry->data_cf = 0; + entry->stgmedium.tymed = TYMED_NULL; + entry->stgmedium.pUnkForRelease = NULL; + entry->stream = NULL; + entry->stream_type = no_stream; + entry->id = id; + entry->dirty = TRUE; + entry->stream_number = -1; + entry->sink_id = 0; + entry->advise_flags = advf; + + return TRUE; +} + static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc, DataCacheEntry **cache_entry, BOOL load) { HRESULT hr; @@ -313,24 +336,17 @@ static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc if (!*cache_entry) return E_OUTOFMEMORY; - (*cache_entry)->fmtetc = *formatetc; - if (formatetc->ptd) - { - (*cache_entry)->fmtetc.ptd = HeapAlloc(GetProcessHeap(), 0, formatetc->ptd->tdSize); - memcpy((*cache_entry)->fmtetc.ptd, formatetc->ptd, formatetc->ptd->tdSize); - } - (*cache_entry)->data_cf = 0; - (*cache_entry)->stgmedium.tymed = TYMED_NULL; - (*cache_entry)->stgmedium.pUnkForRelease = NULL; - (*cache_entry)->stream = NULL; - (*cache_entry)->stream_type = no_stream; - (*cache_entry)->id = This->last_cache_id++; - (*cache_entry)->dirty = TRUE; - (*cache_entry)->stream_number = -1; - (*cache_entry)->sink_id = 0; - (*cache_entry)->advise_flags = 0; + if (!init_cache_entry(*cache_entry, formatetc, 0, This->last_cache_id)) + goto fail; + list_add_tail(&This->cache_list, &(*cache_entry)->entry); + This->last_cache_id++; + return hr; + +fail: + HeapFree(GetProcessHeap(), 0, *cache_entry); + return E_OUTOFMEMORY; } /************************************************************************
1
0
0
0
Huw Davies : ole32: Add a helper to copy FORMATETC structures.
by Alexandre Julliard
18 May '17
18 May '17
Module: wine Branch: master Commit: 11db49190bb531796ac3e8e86c2f67b5f60d39dc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=11db49190bb531796ac3e8e86…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 18 11:07:02 2017 +0100 ole32: Add a helper to copy FORMATETC structures. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/compobj_private.h | 12 ++++++++++++ dlls/ole32/oleobj.c | 16 ++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h index 6488287..8bab819 100644 --- a/dlls/ole32/compobj_private.h +++ b/dlls/ole32/compobj_private.h @@ -334,4 +334,16 @@ static inline BOOL heap_free(void *mem) return HeapFree(GetProcessHeap(), 0, mem); } +static inline HRESULT copy_formatetc(FORMATETC *dst, const FORMATETC *src) +{ + *dst = *src; + if (src->ptd) + { + dst->ptd = CoTaskMemAlloc( src->ptd->tdSize ); + if (!dst->ptd) return E_OUTOFMEMORY; + memcpy( dst->ptd, src->ptd, src->ptd->tdSize ); + } + return S_OK; +} + #endif /* __WINE_OLE_COMPOBJ_H */ diff --git a/dlls/ole32/oleobj.c b/dlls/ole32/oleobj.c index edbef55..17ab8d0 100644 --- a/dlls/ole32/oleobj.c +++ b/dlls/ole32/oleobj.c @@ -56,14 +56,14 @@ static void release_statdata(STATDATA *data) static HRESULT copy_statdata(STATDATA *dst, const STATDATA *src) { - *dst = *src; - if(src->formatetc.ptd) - { - dst->formatetc.ptd = CoTaskMemAlloc(src->formatetc.ptd->tdSize); - if(!dst->formatetc.ptd) return E_OUTOFMEMORY; - memcpy(dst->formatetc.ptd, src->formatetc.ptd, src->formatetc.ptd->tdSize); - } - if(dst->pAdvSink) IAdviseSink_AddRef(dst->pAdvSink); + HRESULT hr; + + hr = copy_formatetc( &dst->formatetc, &src->formatetc ); + if (FAILED(hr)) return hr; + dst->advf = src->advf; + dst->pAdvSink = src->pAdvSink; + if (dst->pAdvSink) IAdviseSink_AddRef( dst->pAdvSink ); + dst->dwConnection = src->dwConnection; return S_OK; }
1
0
0
0
Akihiro Sagawa : msi: Avoid using isspace()/isdigit() for WCHARs.
by Alexandre Julliard
18 May '17
18 May '17
Module: wine Branch: master Commit: f6ced24999ffb287bacb8300d0e7c55d89568a79 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f6ced24999ffb287bacb8300d…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu May 18 10:16:14 2017 +0200 msi: Avoid using isspace()/isdigit() for WCHARs. Found with Coccinelle. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/tokenize.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/dlls/msi/tokenize.c b/dlls/msi/tokenize.c index 441a54a..1656fd8 100644 --- a/dlls/msi/tokenize.c +++ b/dlls/msi/tokenize.c @@ -187,6 +187,21 @@ static const char isIdChar[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* Fx */ }; +/* +** WCHAR safe version of isdigit() +*/ +static inline int isDigit(WCHAR c) +{ + return c >= '0' && c <= '9'; +} + +/* +** WCHAR safe version of isspace(), except '\r' +*/ +static inline int isSpace(WCHAR c) +{ + return c == ' ' || c == '\t' || c == '\n' || c == '\f'; +} /* ** Return the length of the token that begins at z[0]. Return @@ -199,7 +214,7 @@ int sqliteGetToken(const WCHAR *z, int *tokenType, int *skip){ *skip = 0; switch( *z ){ case ' ': case '\t': case '\n': case '\f': - for(i=1; isspace(z[i]) && z[i] != '\r'; i++){} + for(i=1; isSpace(z[i]); i++){} *tokenType = TK_SPACE; return i; case '-': @@ -265,7 +280,7 @@ int sqliteGetToken(const WCHAR *z, int *tokenType, int *skip){ return i; } case '.': - if( !isdigit(z[1]) ){ + if( !isDigit(z[1]) ){ *tokenType = TK_DOT; return 1; } @@ -273,7 +288,7 @@ int sqliteGetToken(const WCHAR *z, int *tokenType, int *skip){ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': *tokenType = TK_INTEGER; - for(i=1; isdigit(z[i]); i++){} + for(i=1; isDigit(z[i]); i++){} return i; case '[': for(i=1; z[i] && z[i-1]!=']'; i++){}
1
0
0
0
Alexandre Julliard : winex11: Fall back to the null driver for common device capabilities.
by Alexandre Julliard
18 May '17
18 May '17
Module: wine Branch: master Commit: bb6a65e0ca884809fc6077604bdc1d6f1e348197 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bb6a65e0ca884809fc6077604…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 18 13:35:02 2017 +0200 winex11: Fall back to the null driver for common device capabilities. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/init.c | 139 +----------------------------------------------- 1 file changed, 2 insertions(+), 137 deletions(-) diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 3929b55..e1eb3f8 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -33,62 +33,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv); Display *gdi_display; /* display to use for all GDI functions */ -/* a few dynamic device caps */ -static int log_pixels_x; /* pixels per logical inch in x direction */ -static int log_pixels_y; /* pixels per logical inch in y direction */ static int palette_size; static Pixmap stock_bitmap_pixmap; /* phys bitmap for the default stock bitmap */ static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; -static const WCHAR dpi_key_name[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\0'}; -static const WCHAR def_dpi_key_name[] = {'S','o','f','t','w','a','r','e','\\','F','o','n','t','s','\0'}; -static const WCHAR dpi_value_name[] = {'L','o','g','P','i','x','e','l','s','\0'}; - static const struct gdi_dc_funcs x11drv_funcs; static const struct gdi_dc_funcs *xrender_funcs; -/****************************************************************************** - * get_reg_dword - * - * Read a DWORD value from the registry - */ -static BOOL get_reg_dword(HKEY base, const WCHAR *key_name, const WCHAR *value_name, DWORD *value) -{ - HKEY key; - DWORD type, data, size = sizeof(data); - BOOL ret = FALSE; - - if (RegOpenKeyW(base, key_name, &key) == ERROR_SUCCESS) - { - if (RegQueryValueExW(key, value_name, NULL, &type, (void *)&data, &size) == ERROR_SUCCESS && - type == REG_DWORD) - { - *value = data; - ret = TRUE; - } - RegCloseKey(key); - } - return ret; -} - -/****************************************************************************** - * get_dpi - * - * get the dpi from the registry - */ -static DWORD get_dpi(void) -{ - DWORD dpi; - - if (get_reg_dword(HKEY_CURRENT_USER, dpi_key_name, dpi_value_name, &dpi)) - return dpi; - if (get_reg_dword(HKEY_CURRENT_CONFIG, def_dpi_key_name, dpi_value_name, &dpi)) - return dpi; - return 0; -} - /********************************************************************** * device_init * @@ -106,11 +59,6 @@ static BOOL WINAPI device_init( INIT_ONCE *once, void *param, void **context ) stock_bitmap_pixmap = XCreatePixmap( gdi_display, root_window, 1, 1, 1 ); - /* Initialize device caps */ - log_pixels_x = log_pixels_y = get_dpi(); - if (!log_pixels_x) - log_pixels_x = log_pixels_y = USER_DEFAULT_SCREEN_DPI; - return TRUE; } @@ -214,20 +162,6 @@ static INT X11DRV_GetDeviceCaps( PHYSDEV dev, INT cap ) { switch(cap) { - case DRIVERVERSION: - return 0x300; - case TECHNOLOGY: - return DT_RASDISPLAY; - case HORZSIZE: - { - RECT primary_rect = get_primary_monitor_rect(); - return MulDiv( primary_rect.right - primary_rect.left, 254, log_pixels_x * 10 ); - } - case VERTSIZE: - { - RECT primary_rect = get_primary_monitor_rect(); - return MulDiv( primary_rect.bottom - primary_rect.top, 254, log_pixels_y * 10 ); - } case HORZRES: { RECT primary_rect = get_primary_monitor_rect(); @@ -250,80 +184,11 @@ static INT X11DRV_GetDeviceCaps( PHYSDEV dev, INT cap ) } case BITSPIXEL: return screen_bpp; - case PLANES: - return 1; - case NUMBRUSHES: - return -1; - case NUMPENS: - return -1; - case NUMMARKERS: - return 0; - case NUMFONTS: - return 0; - case NUMCOLORS: - /* MSDN: Number of entries in the device's color table, if the device has - * a color depth of no more than 8 bits per pixel.For devices with greater - * color depths, -1 is returned. */ - return (default_visual.depth > 8) ? -1 : (1 << default_visual.depth); - case PDEVICESIZE: - return sizeof(X11DRV_PDEVICE); - case CURVECAPS: - return (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE | - CC_STYLED | CC_WIDESTYLED | CC_INTERIORS | CC_ROUNDRECT); - case LINECAPS: - return (LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE | - LC_STYLED | LC_WIDESTYLED | LC_INTERIORS); - case POLYGONALCAPS: - return (PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON | PC_SCANLINE | - PC_WIDE | PC_STYLED | PC_WIDESTYLED | PC_INTERIORS); - case TEXTCAPS: - return (TC_OP_CHARACTER | TC_OP_STROKE | TC_CP_STROKE | - TC_CR_ANY | TC_SF_X_YINDEP | TC_SA_DOUBLE | TC_SA_INTEGER | - TC_SA_CONTIN | TC_UA_ABLE | TC_SO_ABLE | TC_RA_ABLE | TC_VA_ABLE); - case CLIPCAPS: - return CP_REGION; - case COLORRES: - /* The observed correspondence between BITSPIXEL and COLORRES is: - * BITSPIXEL: 8 -> COLORRES: 18 - * BITSPIXEL: 16 -> COLORRES: 16 - * BITSPIXEL: 24 -> COLORRES: 24 - * BITSPIXEL: 32 -> COLORRES: 24 */ - return (screen_bpp <= 8) ? 18 : min( 24, screen_bpp ); - case RASTERCAPS: - return (RC_BITBLT | RC_BANDING | RC_SCALING | RC_BITMAP64 | RC_DI_BITMAP | - RC_DIBTODEV | RC_BIGFONT | RC_STRETCHBLT | RC_STRETCHDIB | RC_DEVBITS | - (palette_size ? RC_PALETTE : 0)); - case SHADEBLENDCAPS: - return (SB_GRAD_RECT | SB_GRAD_TRI | SB_CONST_ALPHA | SB_PIXEL_ALPHA); - case ASPECTX: - case ASPECTY: - return 36; - case ASPECTXY: - return 51; - case LOGPIXELSX: - return log_pixels_x; - case LOGPIXELSY: - return log_pixels_y; - case CAPS1: - FIXME("(%p): CAPS1 is unimplemented, will return 0\n", dev->hdc ); - /* please see wingdi.h for the possible bit-flag values that need - to be returned. */ - return 0; case SIZEPALETTE: return palette_size; - case NUMRESERVED: - case PHYSICALWIDTH: - case PHYSICALHEIGHT: - case PHYSICALOFFSETX: - case PHYSICALOFFSETY: - case SCALINGFACTORX: - case SCALINGFACTORY: - case VREFRESH: - case BLTALIGNMENT: - return 0; default: - FIXME("(%p): unsupported capability %d, will return 0\n", dev->hdc, cap ); - return 0; + dev = GET_NEXT_PHYSDEV( dev, pGetDeviceCaps ); + return dev->funcs->pGetDeviceCaps( dev, cap ); } }
1
0
0
0
← Newer
1
...
28
29
30
31
32
33
34
...
64
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Results per page:
10
25
50
100
200