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
April 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
757 discussions
Start a n
N
ew thread
Nikolay Sivov : user32: Partially protect WM_SETTEXT handlers from invalid input.
by Alexandre Julliard
20 Apr '17
20 Apr '17
Module: wine Branch: master Commit: 3c7fee39d3567cd3815083a060f46ecee526afad URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3c7fee39d3567cd3815083a06…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Apr 20 13:49:20 2017 +0300 user32: Partially protect WM_SETTEXT handlers from invalid input. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/defwnd.c | 40 ++++++++++++++++++++++++++-------------- dlls/user32/tests/msg.c | 18 ++++++++++++++++++ 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/dlls/user32/defwnd.c b/dlls/user32/defwnd.c index 6fbaf1e..235c139 100644 --- a/dlls/user32/defwnd.c +++ b/dlls/user32/defwnd.c @@ -83,16 +83,21 @@ static void DEFWND_HandleWindowPosChanged( HWND hwnd, const WINDOWPOS *winpos ) * * Set the window text. */ -static void DEFWND_SetTextA( HWND hwnd, LPCSTR text ) +static LRESULT DEFWND_SetTextA( HWND hwnd, LPCSTR text ) { int count; WCHAR *textW; WND *wndPtr; + /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP) + * may have child window IDs instead of window name */ + if (text && IS_INTRESOURCE(text)) + return 0; + if (!text) text = ""; count = MultiByteToWideChar( CP_ACP, 0, text, -1, NULL, 0 ); - if (!(wndPtr = WIN_GetPtr( hwnd ))) return; + if (!(wndPtr = WIN_GetPtr( hwnd ))) return 0; if ((textW = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WCHAR)))) { HeapFree(GetProcessHeap(), 0, wndPtr->text); @@ -111,6 +116,8 @@ static void DEFWND_SetTextA( HWND hwnd, LPCSTR text ) WIN_ReleasePtr( wndPtr ); USER_Driver->pSetWindowText( hwnd, textW ); + + return 1; } /*********************************************************************** @@ -118,16 +125,21 @@ static void DEFWND_SetTextA( HWND hwnd, LPCSTR text ) * * Set the window text. */ -static void DEFWND_SetTextW( HWND hwnd, LPCWSTR text ) +static LRESULT DEFWND_SetTextW( HWND hwnd, LPCWSTR text ) { static const WCHAR empty_string[] = {0}; WND *wndPtr; int count; + /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP) + * may have child window IDs instead of window name */ + if (text && IS_INTRESOURCE(text)) + return 0; + if (!text) text = empty_string; count = strlenW(text) + 1; - if (!(wndPtr = WIN_GetPtr( hwnd ))) return; + if (!(wndPtr = WIN_GetPtr( hwnd ))) return 0; HeapFree(GetProcessHeap(), 0, wndPtr->text); if ((wndPtr->text = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WCHAR)))) { @@ -146,6 +158,8 @@ static void DEFWND_SetTextW( HWND hwnd, LPCWSTR text ) WIN_ReleasePtr( wndPtr ); USER_Driver->pSetWindowText( hwnd, text ); + + return 1; } /*********************************************************************** @@ -783,10 +797,8 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam if (lParam) { CREATESTRUCTA *cs = (CREATESTRUCTA *)lParam; - /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP) - * may have child window IDs instead of window name */ - if (!IS_INTRESOURCE(cs->lpszName)) - DEFWND_SetTextA( hwnd, cs->lpszName ); + + DEFWND_SetTextA( hwnd, cs->lpszName ); result = 1; if(cs->style & (WS_HSCROLL | WS_VSCROLL)) @@ -822,7 +834,8 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam break; case WM_SETTEXT: - DEFWND_SetTextA( hwnd, (LPCSTR)lParam ); + if (!DEFWND_SetTextA( hwnd, (LPCSTR)lParam )) + break; if( (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CAPTION) == WS_CAPTION ) NC_HandleNCPaint( hwnd , (HRGN)1 ); /* Repaint caption */ result = 1; /* success. FIXME: check text length */ @@ -933,10 +946,8 @@ LRESULT WINAPI DefWindowProcW( if (lParam) { CREATESTRUCTW *cs = (CREATESTRUCTW *)lParam; - /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP) - * may have child window IDs instead of window name */ - if (!IS_INTRESOURCE(cs->lpszName)) - DEFWND_SetTextW( hwnd, cs->lpszName ); + + DEFWND_SetTextW( hwnd, cs->lpszName ); result = 1; if(cs->style & (WS_HSCROLL | WS_VSCROLL)) @@ -969,7 +980,8 @@ LRESULT WINAPI DefWindowProcW( break; case WM_SETTEXT: - DEFWND_SetTextW( hwnd, (LPCWSTR)lParam ); + if (!DEFWND_SetTextW( hwnd, (LPCWSTR)lParam )) + break; if( (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CAPTION) == WS_CAPTION ) NC_HandleNCPaint( hwnd , (HRGN)1 ); /* Repaint caption */ result = 1; /* success. FIXME: check text length */ diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index fbadf7d..760a9ea 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -14438,6 +14438,7 @@ static void test_defwinproc(void) INT x, y; LRESULT res; struct rbuttonup_thread_data data; + char buffA[64]; HANDLE thread; hwnd = CreateWindowExA(0, "TestWindowClass", "test_defwndproc", @@ -14445,6 +14446,23 @@ static void test_defwinproc(void) assert(hwnd); flush_events(); + buffA[0] = 0; + GetWindowTextA(hwnd, buffA, sizeof(buffA)/sizeof(*buffA)); + ok(!strcmp(buffA, "test_defwndproc"), "unexpected window text, %s\n", buffA); + + /* Zero high word of the lParam */ + res = DefWindowProcA(hwnd, WM_SETTEXT, 0, 0x1234); + ok(res == 0, "WM_SETTEXT was expected to fail, %ld\n", res); + + GetWindowTextA(hwnd, buffA, sizeof(buffA)/sizeof(*buffA)); + ok(!strcmp(buffA, "test_defwndproc"), "unexpected window text, %s\n", buffA); + + res = DefWindowProcW(hwnd, WM_SETTEXT, 0, 0x1234); + ok(res == 0, "WM_SETTEXT was expected to fail, %ld\n", res); + + GetWindowTextA(hwnd, buffA, sizeof(buffA)/sizeof(*buffA)); + ok(!strcmp(buffA, "test_defwndproc"), "unexpected window text, %s\n", buffA); + GetCursorPos(&pos); GetWindowRect(hwnd, &rect); x = (rect.left+rect.right) / 2;
1
0
0
0
Nikolay Sivov : oledb32: Support textual representation of Mode property values.
by Alexandre Julliard
20 Apr '17
20 Apr '17
Module: wine Branch: master Commit: ffd3e8543cadc98b167d016eb2c1ca9c0a413e9b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ffd3e8543cadc98b167d016eb…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Apr 20 13:05:32 2017 +0300 oledb32: Support textual representation of Mode property values. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oledb32/datainit.c | 58 +++++++++++++++++++++++++++++++++++++++++-- dlls/oledb32/tests/database.c | 26 +++++++++++++++++++ 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/dlls/oledb32/datainit.c b/dlls/oledb32/datainit.c index 7ed4099..650c220 100644 --- a/dlls/oledb32/datainit.c +++ b/dlls/oledb32/datainit.c @@ -289,8 +289,56 @@ struct dbproperty { DBPROPID id; DBPROPOPTIONS options; VARTYPE type; + HRESULT (*convert_dbproperty)(const WCHAR *src, VARIANT *dest); }; +struct mode_propval +{ + const WCHAR *name; + DWORD value; +}; + +static int dbmodeprop_compare(const void *a, const void *b) +{ + const WCHAR *src = a; + const struct mode_propval *propval = b; + return strcmpiW(src, propval->name); +} + +static HRESULT convert_dbproperty_mode(const WCHAR *src, VARIANT *dest) +{ + static const WCHAR readW[] = {'R','e','a','d',0}; + static const WCHAR readwriteW[] = {'R','e','a','d','W','r','i','t','e',0}; + static const WCHAR sharedenynoneW[] = {'S','h','a','r','e',' ','D','e','n','y',' ','N','o','n','e',0}; + static const WCHAR sharedenyreadW[] = {'S','h','a','r','e',' ','D','e','n','y',' ','R','e','a','d',0}; + static const WCHAR sharedenywriteW[] = {'S','h','a','r','e',' ','D','e','n','y',' ','W','r','i','t','e',0}; + static const WCHAR shareexclusiveW[] = {'S','h','a','r','e',' ','E','x','c','l','u','s','i','v','e',0}; + static const WCHAR writeW[] = {'W','r','i','t','e',0}; + + struct mode_propval mode_propvals[] = + { + { readW, DB_MODE_READ }, + { readwriteW, DB_MODE_READWRITE }, + { sharedenynoneW, DB_MODE_SHARE_DENY_NONE }, + { sharedenyreadW, DB_MODE_SHARE_DENY_READ }, + { sharedenywriteW, DB_MODE_SHARE_DENY_WRITE }, + { shareexclusiveW, DB_MODE_SHARE_EXCLUSIVE }, + { writeW, DB_MODE_WRITE }, + }; + struct mode_propval *prop; + + if ((prop = bsearch(src, mode_propvals, sizeof(mode_propvals) / sizeof(*mode_propvals), + sizeof(struct mode_propval), dbmodeprop_compare))) + { + V_VT(dest) = VT_I4; + V_I4(dest) = prop->value; + TRACE("%s = %#x\n", debugstr_w(src), prop->value); + return S_OK; + } + + return E_FAIL; +} + static const WCHAR asyncW[] = {'A','s','y','n','c','h','r','o','n','o','u','s',' ','P','r','o','c','e','s','s','i','n','g',0}; static const WCHAR bindW[] = {'B','i','n','d',' ','F','l','a','g','s',0}; static const WCHAR cacheW[] = {'C','a','c','h','e',' ','A','u','t','h','e','n','i','c','a','t','i','o','n',0}; @@ -332,7 +380,7 @@ static const struct dbproperty dbproperties[] = { { locationW, DBPROP_INIT_LOCATION, DBPROPOPTIONS_OPTIONAL, VT_BSTR }, { lockownerW, DBPROP_INIT_LOCKOWNER, DBPROPOPTIONS_OPTIONAL, VT_BSTR }, { maskpassW, DBPROP_AUTH_MASK_PASSWORD, DBPROPOPTIONS_OPTIONAL, VT_BOOL }, - { modeW, DBPROP_INIT_MODE, DBPROPOPTIONS_OPTIONAL, VT_I4 }, + { modeW, DBPROP_INIT_MODE, DBPROPOPTIONS_OPTIONAL, VT_I4, convert_dbproperty_mode }, { oledbservW, DBPROP_INIT_OLEDBSERVICES, DBPROPOPTIONS_OPTIONAL, VT_I4 }, { passwordW, DBPROP_AUTH_PASSWORD, DBPROPOPTIONS_OPTIONAL, VT_BSTR }, { persistEncW, DBPROP_AUTH_PERSIST_ENCRYPTED, DBPROPOPTIONS_OPTIONAL, VT_BOOL }, @@ -418,7 +466,10 @@ static HRESULT parse_init_string(const WCHAR *initstring, struct dbprops *props) else delim = strchrW(eq, ';'); - value = SysAllocStringLen(eq, delim ? delim - eq : -1); + if (delim) + value = SysAllocStringLen(eq, delim - eq); + else + value = SysAllocString(eq); /* skip semicolon if present */ if (delim) @@ -534,6 +585,9 @@ static HRESULT get_dbpropset_from_proplist(struct dbprops *props, DBPROPSET **pr VariantInit(&dest); hr = VariantChangeType(&dest, &src, 0, descr->type); + if (FAILED(hr) && descr->convert_dbproperty) + hr = descr->convert_dbproperty(pair->value, &dest); + if (FAILED(hr)) { ERR("failed to init property %s value as type %d\n", debugstr_w(pair->name), descr->type); diff --git a/dlls/oledb32/tests/database.c b/dlls/oledb32/tests/database.c index f39c2f5..b8c0e61 100644 --- a/dlls/oledb32/tests/database.c +++ b/dlls/oledb32/tests/database.c @@ -500,6 +500,15 @@ static void test_initializationstring(void) 'D','a','t','a',' ','S','o','u','r','c','e','=','d','u','m','m','y', 0}; static const WCHAR initstring_sqloledb[] = {'P','r','o','v','i','d','e','r','=','S','Q','L','O','L','E','D','B','.','1',';', 'D','a','t','a',' ','S','o','u','r','c','e','=','d','u','m','m','y', 0}; + static const WCHAR initstring_mode[] = {'P','r','o','v','i','d','e','r','=','M','S','D','A','S','Q','L','.','1',';', + 'D','a','t','a',' ','S','o','u','r','c','e','=','d','u','m','m','y',';', + 'M','o','d','e','=','i','n','v','a','l','i','d',0}; + static const WCHAR initstring_mode2[] = {'P','r','o','v','i','d','e','r','=','M','S','D','A','S','Q','L','.','1',';', + 'D','a','t','a',' ','S','o','u','r','c','e','=','d','u','m','m','y',';', + 'M','o','d','e','=','W','r','i','t','e','R','e','a','d',0}; + static const WCHAR initstring_mode3[] = {'P','r','o','v','i','d','e','r','=','M','S','D','A','S','Q','L','.','1',';', + 'D','a','t','a',' ','S','o','u','r','c','e','=','d','u','m','m','y',';', + 'M','o','d','e','=','R','e','a','d','W','R','I','T','E',0}; IDataInitialize *datainit = NULL; IDBInitialize *dbinit; HRESULT hr; @@ -537,6 +546,23 @@ static void test_initializationstring(void) &IID_IDBInitialize, (IUnknown**)&dbinit); ok(hr == S_OK, "got 0x%08x\n", hr); IDBInitialize_Release(dbinit); + + /* Invalid Mode value */ + dbinit = NULL; + hr = IDataInitialize_GetDataSource(datainit, NULL, CLSCTX_INPROC_SERVER, (WCHAR *)initstring_mode, + &IID_IDBInitialize, (IUnknown **)&dbinit); + ok(FAILED(hr), "got 0x%08x\n", hr); + + dbinit = NULL; + hr = IDataInitialize_GetDataSource(datainit, NULL, CLSCTX_INPROC_SERVER, (WCHAR *)initstring_mode2, + &IID_IDBInitialize, (IUnknown **)&dbinit); + ok(FAILED(hr), "got 0x%08x\n", hr); + + dbinit = NULL; + hr = IDataInitialize_GetDataSource(datainit, NULL, CLSCTX_INPROC_SERVER, (WCHAR *)initstring_mode3, + &IID_IDBInitialize, (IUnknown **)&dbinit); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDBInitialize_Release(dbinit); } else ok(dbinit == NULL, "got %p\n", dbinit);
1
0
0
0
Nikolay Sivov : include: Added DB_MODE_* constants.
by Alexandre Julliard
20 Apr '17
20 Apr '17
Module: wine Branch: master Commit: 479811169272e2805f30cc4400d6ccb8c026f965 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=479811169272e2805f30cc440…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Apr 20 13:05:31 2017 +0300 include: Added DB_MODE_* constants. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/dbs.idl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/dbs.idl b/include/dbs.idl index 00e16f9..53caded 100644 --- a/include/dbs.idl +++ b/include/dbs.idl @@ -519,6 +519,13 @@ cpp_quote("#define DBPROPVAL_OS_CLIENTCURSOR __MSABI_LONG(0x00000004)" cpp_quote("#define DBPROPVAL_OS_ENABLEALL __MSABI_LONG(0xffffffff)") cpp_quote("#define DBPROPVAL_BI_CROSSROWSET __MSABI_LONG(0x00000001)") +cpp_quote("#define DB_MODE_READ 0x01") +cpp_quote("#define DB_MODE_WRITE 0x02") +cpp_quote("#define DB_MODE_READWRITE 0x03") +cpp_quote("#define DB_MODE_SHARE_DENY_READ 0x04") +cpp_quote("#define DB_MODE_SHARE_DENY_WRITE 0x08") +cpp_quote("#define DB_MODE_SHARE_EXCLUSIVE 0x0c") +cpp_quote("#define DB_MODE_SHARE_DENY_NONE 0x10") typedef struct tagDBCOLUMNACCESS {
1
0
0
0
Nikolay Sivov : dwrite: Added a helper to avoid extra traces from one method calling another.
by Alexandre Julliard
20 Apr '17
20 Apr '17
Module: wine Branch: master Commit: 9bf9a9590a2f35ac3fd98d1f1b9f88d9792bc127 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9bf9a9590a2f35ac3fd98d1f1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Apr 20 12:50:08 2017 +0300 dwrite: Added a helper to avoid extra traces from one method calling another. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/font.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 3b265cb..c74b2bb 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -605,25 +605,31 @@ static HRESULT WINAPI dwritefontface_GetDesignGlyphMetrics(IDWriteFontFace4 *ifa return S_OK; } -static HRESULT WINAPI dwritefontface_GetGlyphIndices(IDWriteFontFace4 *iface, UINT32 const *codepoints, - UINT32 count, UINT16 *glyph_indices) +static HRESULT fontface_get_glyphs(struct dwrite_fontface *fontface, UINT32 const *codepoints, + UINT32 count, UINT16 *glyphs) { - struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface); - - TRACE("(%p)->(%p %u %p)\n", This, codepoints, count, glyph_indices); - - if (!glyph_indices) + if (!glyphs) return E_INVALIDARG; if (!codepoints) { - memset(glyph_indices, 0, count*sizeof(UINT16)); + memset(glyphs, 0, count * sizeof(*glyphs)); return E_INVALIDARG; } - freetype_get_glyphs(iface, This->charmap, codepoints, count, glyph_indices); + freetype_get_glyphs(&fontface->IDWriteFontFace4_iface, fontface->charmap, codepoints, count, glyphs); return S_OK; } +static HRESULT WINAPI dwritefontface_GetGlyphIndices(IDWriteFontFace4 *iface, UINT32 const *codepoints, + UINT32 count, UINT16 *glyphs) +{ + struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface); + + TRACE("(%p)->(%p %u %p)\n", This, codepoints, count, glyphs); + + return fontface_get_glyphs(This, codepoints, count, glyphs); +} + static HRESULT WINAPI dwritefontface_TryGetFontTable(IDWriteFontFace4 *iface, UINT32 table_tag, const void **table_data, UINT32 *table_size, void **context, BOOL *exists) { @@ -1161,13 +1167,11 @@ static BOOL WINAPI dwritefontface3_HasCharacter(IDWriteFontFace4 *iface, UINT32 { struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface); UINT16 index; - HRESULT hr; TRACE("(%p)->(0x%08x)\n", This, ch); index = 0; - hr = IDWriteFontFace4_GetGlyphIndices(iface, &ch, 1, &index); - if (FAILED(hr)) + if (FAILED(fontface_get_glyphs(This, &ch, 1, &index))) return FALSE; return index != 0;
1
0
0
0
Nikolay Sivov : dwrite: Handle allocation failure when duplicating reference key.
by Alexandre Julliard
20 Apr '17
20 Apr '17
Module: wine Branch: master Commit: 5b07cfc13ec3ddbb3092e2e5fd1a613a97fb2b00 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5b07cfc13ec3ddbb3092e2e5f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Apr 20 12:50:07 2017 +0300 dwrite: Handle allocation failure when duplicating reference key. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/font.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index c1b2286..3b265cb 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -2,7 +2,7 @@ * Font and collections * * Copyright 2011 Huw Davies - * Copyright 2012, 2014-2016 Nikolay Sivov for CodeWeavers + * Copyright 2012, 2014-2017 Nikolay Sivov for CodeWeavers * Copyright 2014 Aric Stewart for CodeWeavers * * This library is free software; you can redistribute it and/or @@ -4212,23 +4212,32 @@ static const IDWriteFontFileVtbl dwritefontfilevtbl = { dwritefontfile_Analyze, }; -HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *reference_key, UINT32 key_size, IDWriteFontFile **font_file) +HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *reference_key, UINT32 key_size, + IDWriteFontFile **ret) { - struct dwrite_fontfile *This; + struct dwrite_fontfile *file; + void *key; - This = heap_alloc(sizeof(struct dwrite_fontfile)); - if (!This) return E_OUTOFMEMORY; + *ret = NULL; - This->IDWriteFontFile_iface.lpVtbl = &dwritefontfilevtbl; - This->ref = 1; + file = heap_alloc(sizeof(*file)); + key = heap_alloc(key_size); + if (!file || !key) { + heap_free(file); + heap_free(key); + return E_OUTOFMEMORY; + } + + file->IDWriteFontFile_iface.lpVtbl = &dwritefontfilevtbl; + file->ref = 1; IDWriteFontFileLoader_AddRef(loader); - This->loader = loader; - This->stream = NULL; - This->reference_key = heap_alloc(key_size); - memcpy(This->reference_key, reference_key, key_size); - This->key_size = key_size; + file->loader = loader; + file->stream = NULL; + file->reference_key = key; + memcpy(file->reference_key, reference_key, key_size); + file->key_size = key_size; - *font_file = &This->IDWriteFontFile_iface; + *ret = &file->IDWriteFontFile_iface; return S_OK; }
1
0
0
0
Hugh McMaster : regedit: Only show the context menu if the mouse is over a treeitem.
by Alexandre Julliard
20 Apr '17
20 Apr '17
Module: wine Branch: master Commit: 6f667d1c428bf2589eab4b177d6b1a798cc4a102 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6f667d1c428bf2589eab4b177…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Apr 17 09:15:46 2017 +0000 regedit: Only show the context menu if the mouse is over a treeitem. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/regedit/childwnd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c index df7c640..6ee0cdb 100644 --- a/programs/regedit/childwnd.c +++ b/programs/regedit/childwnd.c @@ -376,10 +376,11 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa TVHITTESTINFO ht; ht.pt = pt; ScreenToClient(g_pChildWnd->hTreeWnd, &ht.pt); - if (SendMessageW(g_pChildWnd->hTreeWnd, TVM_HITTEST, 0, (LPARAM)&ht)) + if (SendMessageW(g_pChildWnd->hTreeWnd, TVM_HITTEST, 0, (LPARAM)&ht)) { SendMessageW(g_pChildWnd->hTreeWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM)ht.hItem); - TrackPopupMenu(GetSubMenu(hPopupMenus, PM_NEW), TPM_RIGHTBUTTON, - pt.x, pt.y, 0, hFrameWnd, NULL); + TrackPopupMenu(GetSubMenu(hPopupMenus, PM_NEW), TPM_RIGHTBUTTON, + pt.x, pt.y, 0, hFrameWnd, NULL); + } } case WM_KEYDOWN:
1
0
0
0
Hugh McMaster : regedit: Select the targeted treeview item on right mouse click.
by Alexandre Julliard
20 Apr '17
20 Apr '17
Module: wine Branch: master Commit: ab0d0c6ee4325670f66a68af4f06fbd9acbb6151 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ab0d0c6ee4325670f66a68af4…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Apr 17 09:15:36 2017 +0000 regedit: Select the targeted treeview item on right mouse click. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/regedit/childwnd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c index 4d184c3..df7c640 100644 --- a/programs/regedit/childwnd.c +++ b/programs/regedit/childwnd.c @@ -372,9 +372,14 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa break; case WM_CONTEXTMENU: { - int x = GET_X_LPARAM(lParam); - int y = GET_Y_LPARAM(lParam); - TrackPopupMenu(GetSubMenu(hPopupMenus, PM_NEW), TPM_RIGHTBUTTON, x, y, 0, hFrameWnd, NULL); + POINT pt = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)}; + TVHITTESTINFO ht; + ht.pt = pt; + ScreenToClient(g_pChildWnd->hTreeWnd, &ht.pt); + if (SendMessageW(g_pChildWnd->hTreeWnd, TVM_HITTEST, 0, (LPARAM)&ht)) + SendMessageW(g_pChildWnd->hTreeWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM)ht.hItem); + TrackPopupMenu(GetSubMenu(hPopupMenus, PM_NEW), TPM_RIGHTBUTTON, + pt.x, pt.y, 0, hFrameWnd, NULL); } case WM_KEYDOWN:
1
0
0
0
Hugh McMaster : regedit: Call TrackPopupMenu() from WM_CONTEXTMENU.
by Alexandre Julliard
20 Apr '17
20 Apr '17
Module: wine Branch: master Commit: 4dc5a764c781fa50530fcec7baf6a1e53256368c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4dc5a764c781fa50530fcec7b…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Apr 17 09:15:25 2017 +0000 regedit: Call TrackPopupMenu() from WM_CONTEXTMENU. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/regedit/childwnd.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c index 2211d68..4d184c3 100644 --- a/programs/regedit/childwnd.c +++ b/programs/regedit/childwnd.c @@ -292,6 +292,9 @@ static void set_last_key(HWND hwndTV) } } +#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) +#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) + /******************************************************************************* * * FUNCTION: ChildWndProc(HWND, unsigned, WORD, LONG) @@ -368,6 +371,12 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa draw_splitbar(hWnd, last_split); break; + case WM_CONTEXTMENU: { + int x = GET_X_LPARAM(lParam); + int y = GET_Y_LPARAM(lParam); + TrackPopupMenu(GetSubMenu(hPopupMenus, PM_NEW), TPM_RIGHTBUTTON, x, y, 0, hFrameWnd, NULL); + } + case WM_KEYDOWN: if (wParam == VK_ESCAPE) if (GetCapture() == hWnd) { @@ -419,13 +428,6 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa case NM_SETFOCUS: g_pChildWnd->nFocusPanel = 0; break; - case NM_RCLICK: { - POINT pt; - GetCursorPos(&pt); - TrackPopupMenu(GetSubMenu(hPopupMenus, PM_NEW), - TPM_RIGHTBUTTON, pt.x, pt.y, 0, hFrameWnd, NULL); - break; - } case TVN_BEGINLABELEDITW: { HKEY hRootKey; LPWSTR path;
1
0
0
0
Józef Kucia : wined3d: Use correct layer count for 3D textures.
by Alexandre Julliard
20 Apr '17
20 Apr '17
Module: wine Branch: master Commit: 583255f2b2ff97e26348b3db4d00a9fe80b28688 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=583255f2b2ff97e26348b3db4…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Apr 20 12:26:59 2017 +0200 wined3d: Use correct layer count for 3D textures. Fixes a regression introduced by commit 9ffacc434e90d80dbdfb107b10f02a759f2266f3. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/view.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index cb3578a..3abd85b 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -422,7 +422,7 @@ void wined3d_rendertarget_view_prepare_location(struct wined3d_rendertarget_view struct wined3d_context *context, DWORD location) { struct wined3d_resource *resource = view->resource; - unsigned int i, sub_resource_idx; + unsigned int i, sub_resource_idx, layer_count; struct wined3d_texture *texture; if (resource->type == WINED3D_RTYPE_BUFFER) @@ -433,7 +433,8 @@ void wined3d_rendertarget_view_prepare_location(struct wined3d_rendertarget_view texture = texture_from_resource(resource); sub_resource_idx = view->sub_resource_idx; - for (i = 0; i < view->layer_count; ++i, sub_resource_idx += texture->level_count) + layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1; + for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count) wined3d_texture_prepare_location(texture, sub_resource_idx, context, location); } @@ -441,7 +442,7 @@ void wined3d_rendertarget_view_load_location(struct wined3d_rendertarget_view *v struct wined3d_context *context, DWORD location) { struct wined3d_resource *resource = view->resource; - unsigned int i, sub_resource_idx; + unsigned int i, sub_resource_idx, layer_count; struct wined3d_texture *texture; if (resource->type == WINED3D_RTYPE_BUFFER) @@ -452,14 +453,15 @@ void wined3d_rendertarget_view_load_location(struct wined3d_rendertarget_view *v texture = texture_from_resource(resource); sub_resource_idx = view->sub_resource_idx; - for (i = 0; i < view->layer_count; ++i, sub_resource_idx += texture->level_count) + layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1; + for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count) wined3d_texture_load_location(texture, sub_resource_idx, context, location); } void wined3d_rendertarget_view_validate_location(struct wined3d_rendertarget_view *view, DWORD location) { struct wined3d_resource *resource = view->resource; - unsigned int i, sub_resource_idx; + unsigned int i, sub_resource_idx, layer_count; struct wined3d_texture *texture; if (resource->type == WINED3D_RTYPE_BUFFER) @@ -470,7 +472,8 @@ void wined3d_rendertarget_view_validate_location(struct wined3d_rendertarget_vie texture = texture_from_resource(resource); sub_resource_idx = view->sub_resource_idx; - for (i = 0; i < view->layer_count; ++i, sub_resource_idx += texture->level_count) + layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1; + for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count) wined3d_texture_validate_location(texture, sub_resource_idx, location); }
1
0
0
0
Józef Kucia : d3d11: Implement d3d11_immediate_context_DSGetShader().
by Alexandre Julliard
20 Apr '17
20 Apr '17
Module: wine Branch: master Commit: c08da43ddd37196cb94484fccc967fb819031570 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c08da43ddd37196cb94484fcc…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Apr 20 11:04:20 2017 +0200 d3d11: Implement d3d11_immediate_context_DSGetShader(). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index d6881de..175e271 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1989,8 +1989,27 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetShaderResources(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetShader(ID3D11DeviceContext *iface, ID3D11DomainShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) { - FIXME("iface %p, shader %p, class_instances %p, class_instance_count %p stub!\n", + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d11_domain_shader *shader_impl; + struct wined3d_shader *wined3d_shader; + + TRACE("iface %p, shader %p, class_instances %p, class_instance_count %p.\n", iface, shader, class_instances, class_instance_count); + + if (class_instances || class_instance_count) + FIXME("Dynamic linking not implemented yet.\n"); + + wined3d_mutex_lock(); + if (!(wined3d_shader = wined3d_device_get_domain_shader(device->wined3d_device))) + { + wined3d_mutex_unlock(); + *shader = NULL; + return; + } + + shader_impl = wined3d_shader_get_parent(wined3d_shader); + wined3d_mutex_unlock(); + ID3D11DomainShader_AddRef(*shader = &shader_impl->ID3D11DomainShader_iface); } static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetSamplers(ID3D11DeviceContext *iface,
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
76
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Results per page:
10
25
50
100
200