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
December 2015
----- 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
327 discussions
Start a n
N
ew thread
Sebastian Lackner : oleaut32: Align terminating null character in SysAllocStringByteLen.
by Alexandre Julliard
29 Dec '15
29 Dec '15
Module: wine Branch: master Commit: e559ec2ad3ca41b7e169ab157e0d73c39b4c75b3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e559ec2ad3ca41b7e169ab157…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Fri Dec 25 06:38:10 2015 +0100 oleaut32: Align terminating null character in SysAllocStringByteLen. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/oleaut.c | 14 ++++++-------- dlls/oleaut32/tests/vartype.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c index 75f9cb4..78cb083 100644 --- a/dlls/oleaut32/oleaut.c +++ b/dlls/oleaut32/oleaut.c @@ -149,12 +149,9 @@ static bstr_t *alloc_bstr(size_t size) if(cache_entry) { if(WARN_ON(heap)) { - size_t tail; - - memset(ret, ARENA_INUSE_FILLER, FIELD_OFFSET(bstr_t, u.ptr[size+sizeof(WCHAR)])); - tail = bstr_alloc_size(size) - FIELD_OFFSET(bstr_t, u.ptr[size+sizeof(WCHAR)]); - if(tail) - memset(ret->u.ptr+size+sizeof(WCHAR), ARENA_TAIL_FILLER, tail); + size_t fill_size = (FIELD_OFFSET(bstr_t, u.ptr[size])+2*sizeof(WCHAR)-1) & ~(sizeof(WCHAR)-1); + memset(ret, ARENA_INUSE_FILLER, fill_size); + memset((char *)ret+fill_size, ARENA_TAIL_FILLER, bstr_alloc_size(size)-fill_size); } ret->size = size; return ret; @@ -418,10 +415,11 @@ BSTR WINAPI SysAllocStringByteLen(LPCSTR str, UINT len) if(str) { memcpy(bstr->u.ptr, str, len); - bstr->u.ptr[len] = bstr->u.ptr[len+1] = 0; + bstr->u.ptr[len] = 0; }else { - memset(bstr->u.ptr, 0, len+sizeof(WCHAR)); + memset(bstr->u.ptr, 0, len+1); } + bstr->u.str[(len+sizeof(WCHAR)-1)/sizeof(WCHAR)] = 0; return bstr->u.str; } diff --git a/dlls/oleaut32/tests/vartype.c b/dlls/oleaut32/tests/vartype.c index 7cbb059..d905d37 100644 --- a/dlls/oleaut32/tests/vartype.c +++ b/dlls/oleaut32/tests/vartype.c @@ -5444,7 +5444,9 @@ static void test_SysAllocStringByteLen(void) { const OLECHAR szTest[10] = { 'T','e','s','t','\0' }; const CHAR szTestA[6] = { 'T','e','s','t','\0','?' }; + char *buf; BSTR str; + int i; if (sizeof(void *) == 4) /* not limited to 0x80000000 on Win64 */ { @@ -5487,6 +5489,7 @@ static void test_SysAllocStringByteLen(void) ok (bstr->dwLen == 3, "Expected 3, got %d\n", bstr->dwLen); ok (!lstrcmpA((LPCSTR)bstr->szString, szTestTruncA), "String different\n"); + ok (!bstr->szString[2], "String not terminated\n"); SysFreeString(str); } @@ -5500,6 +5503,32 @@ static void test_SysAllocStringByteLen(void) ok (!lstrcmpW(bstr->szString, szTest), "String different\n"); SysFreeString(str); } + + /* Make sure terminating null is aligned properly */ + buf = HeapAlloc(GetProcessHeap(), 0, 1025); + ok (buf != NULL, "Expected non-NULL\n"); + for (i = 0; i < 1024; i++) + { + LPINTERNAL_BSTR bstr; + + str = SysAllocStringByteLen(NULL, i); + ok (str != NULL, "Expected non-NULL\n"); + bstr = Get(str); + ok (bstr->dwLen == i, "Expected %d, got %d\n", i, bstr->dwLen); + ok (!bstr->szString[(i+sizeof(WCHAR)-1)/sizeof(WCHAR)], "String not terminated\n"); + SysFreeString(str); + + memset(buf, 0xaa, 1025); + str = SysAllocStringByteLen(buf, i); + ok (str != NULL, "Expected non-NULL\n"); + bstr = Get(str); + ok (bstr->dwLen == i, "Expected %d, got %d\n", i, bstr->dwLen); + buf[i] = 0; + ok (!lstrcmpA((LPCSTR)bstr->szString, buf), "String different\n"); + ok (!bstr->szString[(i+sizeof(WCHAR)-1)/sizeof(WCHAR)], "String not terminated\n"); + SysFreeString(str); + } + HeapFree(GetProcessHeap(), 0, buf); } static void test_SysReAllocString(void)
1
0
0
0
Sebastian Lackner : oleaut32: Pass size without terminating null to get_cache_entry.
by Alexandre Julliard
29 Dec '15
29 Dec '15
Module: wine Branch: master Commit: 4bfc49a773d594ae9de934b6506fa90579fa9459 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4bfc49a773d594ae9de934b65…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Fri Dec 25 06:37:44 2015 +0100 oleaut32: Pass size without terminating null to get_cache_entry. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/oleaut.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c index 0352215..75f9cb4 100644 --- a/dlls/oleaut32/oleaut.c +++ b/dlls/oleaut32/oleaut.c @@ -119,7 +119,7 @@ static inline bstr_t *bstr_from_str(BSTR str) static inline bstr_cache_entry_t *get_cache_entry(size_t size) { - unsigned cache_idx = FIELD_OFFSET(bstr_t, u.ptr[size-1])/BUCKET_SIZE; + unsigned cache_idx = FIELD_OFFSET(bstr_t, u.ptr[size+sizeof(WCHAR)-1])/BUCKET_SIZE; return bstr_cache_enabled && cache_idx < sizeof(bstr_cache)/sizeof(*bstr_cache) ? bstr_cache + cache_idx : NULL; @@ -127,14 +127,14 @@ static inline bstr_cache_entry_t *get_cache_entry(size_t size) static bstr_t *alloc_bstr(size_t size) { - bstr_cache_entry_t *cache_entry = get_cache_entry(size+sizeof(WCHAR)); + bstr_cache_entry_t *cache_entry = get_cache_entry(size); bstr_t *ret; if(cache_entry) { EnterCriticalSection(&cs_bstr_cache); if(!cache_entry->cnt) { - cache_entry = get_cache_entry(size+sizeof(WCHAR)+BUCKET_SIZE); + cache_entry = get_cache_entry(size+BUCKET_SIZE); if(cache_entry && !cache_entry->cnt) cache_entry = NULL; } @@ -258,7 +258,7 @@ void WINAPI SysFreeString(BSTR str) return; bstr = bstr_from_str(str); - cache_entry = get_cache_entry(bstr->size+sizeof(WCHAR)); + cache_entry = get_cache_entry(bstr->size); if(cache_entry) { unsigned i;
1
0
0
0
Sebastian Lackner : server: Implement wineserver call for SystemHandleInformation.
by Alexandre Julliard
29 Dec '15
29 Dec '15
Module: wine Branch: master Commit: 08706ef357e7feb8d12f89e1b9c44fdc31cd4da3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=08706ef357e7feb8d12f89e1b…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Thu Dec 24 13:08:50 2015 +0100 server: Implement wineserver call for SystemHandleInformation. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/nt.c | 49 ++++++++++++++++++++++++++++++------ dlls/ntdll/tests/info.c | 10 ++++---- include/wine/server_protocol.h | 28 ++++++++++++++++++++- server/handle.c | 56 ++++++++++++++++++++++++++++++++++++++++++ server/protocol.def | 16 ++++++++++++ server/request.h | 5 ++++ server/trace.c | 30 ++++++++++++++++++++++ 7 files changed, 180 insertions(+), 14 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=08706ef357e7feb8d12f8…
1
0
0
0
Piotr Caban : ole32: Make clipboard latest_snapshot access thread safe.
by Alexandre Julliard
29 Dec '15
29 Dec '15
Module: wine Branch: master Commit: d90ec79be2104acb3e2f59e31d3309591cd4f50d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d90ec79be2104acb3e2f59e31…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Dec 29 14:39:01 2015 +0100 ole32: Make clipboard latest_snapshot access thread safe. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/clipboard.c | 31 +++++++++++++++++++++++++------ dlls/ole32/tests/clipboard.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index db1e4a8..ca9520f 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -174,6 +174,15 @@ typedef struct PresentationDataHeader */ static ole_clipbrd* theOleClipboard; +static CRITICAL_SECTION latest_snapshot_cs; +static CRITICAL_SECTION_DEBUG latest_snapshot_cs_debug = +{ + 0, 0, &latest_snapshot_cs, + { &latest_snapshot_cs_debug.ProcessLocksList, &latest_snapshot_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": clipboard last snapshot") } +}; +static CRITICAL_SECTION latest_snapshot_cs = { &latest_snapshot_cs_debug, -1, 0, 0, 0, 0 }; + static inline HRESULT get_ole_clipbrd(ole_clipbrd **clipbrd) { struct oletls *info = COM_CurrentInfo(); @@ -1042,13 +1051,17 @@ static ULONG WINAPI snapshot_Release(IDataObject *iface) if (ref == 0) { - ole_clipbrd *clipbrd; - HRESULT hr = get_ole_clipbrd(&clipbrd); + EnterCriticalSection(&latest_snapshot_cs); + if (This->ref) + { + LeaveCriticalSection(&latest_snapshot_cs); + return ref; + } + if (theOleClipboard->latest_snapshot == This) + theOleClipboard->latest_snapshot = NULL; + LeaveCriticalSection(&latest_snapshot_cs); if(This->data) IDataObject_Release(This->data); - - if(SUCCEEDED(hr) && clipbrd->latest_snapshot == This) - clipbrd->latest_snapshot = NULL; HeapFree(GetProcessHeap(), 0, This); } @@ -2192,17 +2205,23 @@ HRESULT WINAPI OleGetClipboard(IDataObject **obj) if(FAILED(hr = get_ole_clipbrd(&clipbrd))) return hr; seq_no = GetClipboardSequenceNumber(); + EnterCriticalSection(&latest_snapshot_cs); if(clipbrd->latest_snapshot && clipbrd->latest_snapshot->seq_no != seq_no) clipbrd->latest_snapshot = NULL; if(!clipbrd->latest_snapshot) { clipbrd->latest_snapshot = snapshot_construct(seq_no); - if(!clipbrd->latest_snapshot) return E_OUTOFMEMORY; + if(!clipbrd->latest_snapshot) + { + LeaveCriticalSection(&latest_snapshot_cs); + return E_OUTOFMEMORY; + } } *obj = &clipbrd->latest_snapshot->IDataObject_iface; IDataObject_AddRef(*obj); + LeaveCriticalSection(&latest_snapshot_cs); return S_OK; } diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index 81b3a1c..02097ea 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -1539,6 +1539,38 @@ static void test_getdatahere(void) } +static DWORD CALLBACK test_data_obj(void *arg) +{ + IDataObject *data_obj = arg; + + IDataObject_Release(data_obj); + return 0; +} + +static void test_multithreaded_clipboard(void) +{ + IDataObject *data_obj; + HANDLE thread; + HRESULT hr; + DWORD ret; + + OleInitialize(NULL); + + hr = OleGetClipboard(&data_obj); + ok(hr == S_OK, "OleGetClipboard returned %x\n", hr); + + thread = CreateThread(NULL, 0, test_data_obj, data_obj, 0, NULL); + ok(thread != NULL, "CreateThread failed (%d)\n", GetLastError()); + ret = WaitForSingleObject(thread, 5000); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", ret); + + hr = OleGetClipboard(&data_obj); + ok(hr == S_OK, "OleGetClipboard returned %x\n", hr); + IDataObject_Release(data_obj); + + OleUninitialize(); +} + START_TEST(clipboard) { test_set_clipboard(); @@ -1546,4 +1578,5 @@ START_TEST(clipboard) test_flushed_getdata(); test_nonole_clipboard(); test_getdatahere(); + test_multithreaded_clipboard(); }
1
0
0
0
Qian Hong : user32/tests: Add tests for WM_DEVICECHANGE message.
by Alexandre Julliard
29 Dec '15
29 Dec '15
Module: wine Branch: master Commit: 81bd72640ba98728abe678b66161d48762caea6f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=81bd72640ba98728abe678b66…
Author: Qian Hong <qhong(a)codeweavers.com> Date: Tue Dec 29 10:18:47 2015 +0800 user32/tests: Add tests for WM_DEVICECHANGE message. Signed-off-by: Qian Hong <qhong(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/msg.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index c2a0557..7204d19 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -32,6 +32,7 @@ #include "wingdi.h" #include "winuser.h" #include "winnls.h" +#include "dbt.h" #include "wine/test.h" @@ -4520,6 +4521,49 @@ static void test_MsgWaitForMultipleObjects(HWND hwnd) ok(ret == WAIT_IO_COMPLETION, "MsgWaitForMultipleObjectsEx returned %x\n", ret); } +static void test_WM_DEVICECHANGE(HWND hwnd) +{ + DWORD ret; + MSG msg; + int i; + static const WPARAM wparams[] = {0, + DBT_DEVNODES_CHANGED, + DBT_QUERYCHANGECONFIG, + DBT_CONFIGCHANGED, + DBT_CONFIGCHANGECANCELED, + DBT_NO_DISK_SPACE, + DBT_LOW_DISK_SPACE, + DBT_CONFIGMGPRIVATE, /* 0x7fff */ + DBT_DEVICEARRIVAL, /* 0x8000 */ + DBT_DEVICEQUERYREMOVE, + DBT_DEVICEQUERYREMOVEFAILED, + DBT_DEVICEREMOVEPENDING, + DBT_DEVICEREMOVECOMPLETE, + DBT_DEVICETYPESPECIFIC, + DBT_CUSTOMEVENT}; + + for (i = 0; i < sizeof(wparams)/sizeof(wparams[0]); i++) + { + SetLastError(0xdeadbeef); + ret = PostMessageA(hwnd, WM_DEVICECHANGE, wparams[i], 0); + if (wparams[i] & 0x8000) + { + ok(ret == FALSE, "PostMessage should returned %d\n", ret); + ok(GetLastError() == ERROR_MESSAGE_SYNC_ONLY, "PostMessage error %08x\n", GetLastError()); + } + else + { + todo_wine { + ret = MsgWaitForMultipleObjects(0, NULL, FALSE, 0, QS_POSTMESSAGE); + ok(ret == WAIT_OBJECT_0, "MsgWaitForMultipleObjects returned %x\n", ret); + memset(&msg, 0, sizeof(msg)); + ok(PeekMessageA(&msg, 0, 0, 0, PM_REMOVE), "PeekMessage should succeed\n"); + ok(msg.message == WM_DEVICECHANGE, "got %04x instead of WM_DEVICECHANGE\n", msg.message); + } + } + } +} + static DWORD CALLBACK show_window_thread(LPVOID arg) { HWND hwnd = arg; @@ -4911,6 +4955,7 @@ static void test_messages(void) flush_sequence(); test_MsgWaitForMultipleObjects(hparent); + test_WM_DEVICECHANGE(hparent); /* the following test causes an exception in user.exe under win9x */ if (!PostMessageW( hparent, WM_USER, 0, 0 ))
1
0
0
0
Qian Hong : include: Add defines for some more device change event.
by Alexandre Julliard
29 Dec '15
29 Dec '15
Module: wine Branch: master Commit: 27ac4d887a08a666db986561f19a2cf3e3538bc6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=27ac4d887a08a666db986561f…
Author: Qian Hong <qhong(a)codeweavers.com> Date: Tue Dec 29 10:18:27 2015 +0800 include: Add defines for some more device change event. Signed-off-by: Qian Hong <qhong(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/dbt.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/dbt.h b/include/dbt.h index b326dc2..ec8c084 100644 --- a/include/dbt.h +++ b/include/dbt.h @@ -30,6 +30,10 @@ # define DECL_WINELIB_DBT_TYPE_AW(type) typedef WINELIB_NAME_AW(type##_) type; #endif +#define DBT_DEVNODES_CHANGED 0x0007 +#define DBT_QUERYCHANGECONFIG 0x0017 +#define DBT_CONFIGCHANGED 0x0018 +#define DBT_CONFIGCHANGECANCELED 0x0019 #define DBT_NO_DISK_SPACE 0x0047 #define DBT_LOW_DISK_SPACE 0x0048 #define DBT_CONFIGMGPRIVATE 0x7FFF
1
0
0
0
Nikolay Sivov : shlwapi: Handle NULL pointer in DllGetVersion() (Coverity) .
by Alexandre Julliard
29 Dec '15
29 Dec '15
Module: wine Branch: master Commit: 0e4be06cd6d350dad230168434f02d3a86910180 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0e4be06cd6d350dad23016843…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Dec 29 01:04:44 2015 +0300 shlwapi: Handle NULL pointer in DllGetVersion() (Coverity). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shlwapi/shlwapi_main.c | 7 +++++-- dlls/shlwapi/tests/ordinal.c | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/shlwapi/shlwapi_main.c b/dlls/shlwapi/shlwapi_main.c index 38439b7..f466bb4 100644 --- a/dlls/shlwapi/shlwapi_main.c +++ b/dlls/shlwapi/shlwapi_main.c @@ -94,6 +94,9 @@ HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi) TRACE("(%p)\n",pdvi); + if (!pdvi) + return E_INVALIDARG; + switch (pdvi2->info1.cbSize) { case sizeof(DLLVERSIONINFO2): @@ -107,7 +110,7 @@ HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi) pdvi2->info1.dwPlatformID = DLLVER_PLATFORM_WINDOWS; return S_OK; } - if (pdvi) - WARN("pdvi->cbSize = %d, unhandled\n", pdvi2->info1.cbSize); + + WARN("pdvi->cbSize = %d, unhandled\n", pdvi2->info1.cbSize); return E_INVALIDARG; } diff --git a/dlls/shlwapi/tests/ordinal.c b/dlls/shlwapi/tests/ordinal.c index bd3d46a..afccd3a 100644 --- a/dlls/shlwapi/tests/ordinal.c +++ b/dlls/shlwapi/tests/ordinal.c @@ -70,6 +70,7 @@ static HRESULT (WINAPI *pSKDeleteValueW)(DWORD, LPCWSTR, LPCWSTR); static HRESULT (WINAPI *pSKAllocValueW)(DWORD, LPCWSTR, LPCWSTR, DWORD*, void**, DWORD*); static HWND (WINAPI *pSHSetParentHwnd)(HWND, HWND); static HRESULT (WINAPI *pIUnknown_GetClassID)(IUnknown*, CLSID*); +static HRESULT (WINAPI *pDllGetVersion)(DLLVERSIONINFO2*); static HMODULE hmlang; static HRESULT (WINAPI *pLcidToRfc1766A)(LCID, LPSTR, INT); @@ -3073,6 +3074,8 @@ static void init_pointers(void) MAKEFUNC(SKDeleteValueW, 518); MAKEFUNC(SKAllocValueW, 519); #undef MAKEFUNC + + pDllGetVersion = (void*)GetProcAddress(hShlwapi, "DllGetVersion"); } static void test_SHSetParentHwnd(void) @@ -3246,6 +3249,14 @@ if (0) /* crashes on native systems */ "got wrong clsid %s\n", wine_dbgstr_guid(&clsid)); } +static void test_DllGetVersion(void) +{ + HRESULT hr; + + hr = pDllGetVersion(NULL); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); +} + START_TEST(ordinal) { char **argv; @@ -3301,6 +3312,7 @@ START_TEST(ordinal) test_SHGetShellKey(); test_SHSetParentHwnd(); test_IUnknown_GetClassID(); + test_DllGetVersion(); FreeLibrary(hshell32); FreeLibrary(hmlang);
1
0
0
0
Nikolay Sivov : dwrite: Implement EUDC font collection.
by Alexandre Julliard
29 Dec '15
29 Dec '15
Module: wine Branch: master Commit: 57bfebfc806d8e700e23898cff30bbaadeaeca52 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=57bfebfc806d8e700e23898cf…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Dec 28 07:35:12 2015 +0300 dwrite: Implement EUDC font collection. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/font.c | 198 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 148 insertions(+), 50 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 9244978..89d50b3 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -3234,6 +3234,27 @@ static ULONG WINAPI systemfontfileenumerator_Release(IDWriteFontFileEnumerator * return ref; } +static HRESULT create_local_file_reference(IDWriteFactory2 *factory, const WCHAR *filename, IDWriteFontFile **file) +{ + HRESULT hr; + + /* Fonts installed in 'Fonts' system dir don't get full path in registry font files cache */ + if (!strchrW(filename, '\\')) { + static const WCHAR fontsW[] = {'\\','f','o','n','t','s','\\',0}; + WCHAR fullpathW[MAX_PATH]; + + GetWindowsDirectoryW(fullpathW, sizeof(fullpathW)/sizeof(WCHAR)); + strcatW(fullpathW, fontsW); + strcatW(fullpathW, filename); + + hr = IDWriteFactory2_CreateFontFileReference(factory, fullpathW, NULL, file); + } + else + hr = IDWriteFactory2_CreateFontFileReference(factory, filename, NULL, file); + + return hr; +} + static HRESULT WINAPI systemfontfileenumerator_GetCurrentFontFile(IDWriteFontFileEnumerator *iface, IDWriteFontFile **file) { struct system_fontfile_enumerator *enumerator = impl_from_IDWriteFontFileEnumerator(iface); @@ -3266,19 +3287,7 @@ static HRESULT WINAPI systemfontfileenumerator_GetCurrentFontFile(IDWriteFontFil return E_FAIL; } - /* Fonts installed in 'Fonts' system dir don't get full path in registry font files cache */ - if (!strchrW(filename, '\\')) { - static const WCHAR fontsW[] = {'\\','f','o','n','t','s','\\',0}; - WCHAR fullpathW[MAX_PATH]; - - GetWindowsDirectoryW(fullpathW, sizeof(fullpathW)/sizeof(WCHAR)); - strcatW(fullpathW, fontsW); - strcatW(fullpathW, filename); - - hr = IDWriteFactory2_CreateFontFileReference(enumerator->factory, fullpathW, NULL, file); - } - else - hr = IDWriteFactory2_CreateFontFileReference(enumerator->factory, filename, NULL, file); + hr = create_local_file_reference(enumerator->factory, filename, file); heap_free(value); heap_free(filename); @@ -3379,56 +3388,145 @@ HRESULT get_system_fontcollection(IDWriteFactory2 *factory, IDWriteFontCollectio return hr; } -static HRESULT WINAPI eudcfontfileenumerator_QueryInterface(IDWriteFontFileEnumerator *iface, REFIID riid, void **obj) +static HRESULT eudc_collection_add_family(IDWriteFactory2 *factory, struct dwrite_fontcollection *collection, + const WCHAR *keynameW, const WCHAR *pathW) { - *obj = NULL; + static const WCHAR defaultfontW[] = {'S','y','s','t','e','m','D','e','f','a','u','l','t','E','U','D','C','F','o','n','t',0}; + static const WCHAR emptyW[] = {0}; + IDWriteLocalizedStrings *names; + DWRITE_FONT_FACE_TYPE face_type; + DWRITE_FONT_FILE_TYPE file_type; + BOOL supported; + UINT32 face_count, i; + IDWriteFontFile *file; + HRESULT hr; + struct dwrite_fontfamily_data *family_data; - if (IsEqualIID(riid, &IID_IDWriteFontFileEnumerator) || IsEqualIID(riid, &IID_IUnknown)) { - IDWriteFontFileEnumerator_AddRef(iface); - *obj = iface; - return S_OK; + /* create font file from this path */ + hr = create_local_file_reference(factory, pathW, &file); + if (FAILED(hr)) + return S_FALSE; + + /* failed font files are skipped */ + hr = IDWriteFontFile_Analyze(file, &supported, &file_type, &face_type, &face_count); + if (FAILED(hr) || !supported || face_count == 0) { + TRACE("unsupported font (%p, 0x%08x, %d, %u)\n", file, hr, supported, face_count); + IDWriteFontFile_Release(file); + return S_FALSE; } - return E_NOINTERFACE; -} + /* create and init new family */ -static ULONG WINAPI eudcfontfileenumerator_AddRef(IDWriteFontFileEnumerator *iface) -{ - return 2; -} + /* Family names are added for non-specific locale, represented with empty string. + Default family appears with empty family name. */ + create_localizedstrings(&names); + if (!strcmpiW(keynameW, defaultfontW)) + add_localizedstring(names, emptyW, emptyW); + else + add_localizedstring(names, emptyW, keynameW); -static ULONG WINAPI eudcfontfileenumerator_Release(IDWriteFontFileEnumerator *iface) -{ - return 1; -} + hr = init_fontfamily_data(names, &family_data); + IDWriteLocalizedStrings_Release(names); + if (hr != S_OK) { + IDWriteFontFile_Release(file); + return hr; + } -static HRESULT WINAPI eudcfontfileenumerator_GetCurrentFontFile(IDWriteFontFileEnumerator *iface, IDWriteFontFile **file) -{ - *file = NULL; - return E_FAIL; -} + /* fill with faces */ + for (i = 0; i < face_count; i++) { + struct dwrite_font_data *font_data; -static HRESULT WINAPI eudcfontfileenumerator_MoveNext(IDWriteFontFileEnumerator *iface, BOOL *current) -{ - *current = FALSE; - return S_OK; + /* alloc and init new font data structure */ + hr = init_font_data(factory, file, face_type, i, &names, &font_data); + if (FAILED(hr)) + continue; + + IDWriteLocalizedStrings_Release(names); + + /* add font to family */ + hr = fontfamily_add_font(family_data, font_data); + if (hr != S_OK) + release_font_data(font_data); + } + + /* add family to collection */ + hr = fontcollection_add_family(collection, family_data); + if (FAILED(hr)) + release_fontfamily_data(family_data); + IDWriteFontFile_Release(file); + + return hr; } -static const struct IDWriteFontFileEnumeratorVtbl eudcfontfileenumeratorvtbl = +HRESULT get_eudc_fontcollection(IDWriteFactory2 *factory, IDWriteFontCollection **ret) { - eudcfontfileenumerator_QueryInterface, - eudcfontfileenumerator_AddRef, - eudcfontfileenumerator_Release, - eudcfontfileenumerator_MoveNext, - eudcfontfileenumerator_GetCurrentFontFile -}; + static const WCHAR eudckeyfmtW[] = {'E','U','D','C','\\','%','u',0}; + struct dwrite_fontcollection *collection; + static const WCHAR emptyW[] = {0}; + WCHAR eudckeypathW[16]; + HKEY eudckey; + DWORD index; + BOOL exists; + LONG retval; + HRESULT hr; + UINT32 i; -static IDWriteFontFileEnumerator eudc_fontfile_enumerator = { &eudcfontfileenumeratorvtbl }; + TRACE("building EUDC font collection for factory %p, ACP %u\n", factory, GetACP()); -HRESULT get_eudc_fontcollection(IDWriteFactory2 *factory, IDWriteFontCollection **collection) -{ - TRACE("building EUDC font collection for factory %p\n", factory); - return create_font_collection(factory, &eudc_fontfile_enumerator, FALSE, collection); + *ret = NULL; + + collection = heap_alloc(sizeof(struct dwrite_fontcollection)); + if (!collection) return E_OUTOFMEMORY; + + hr = init_font_collection(collection, FALSE); + if (FAILED(hr)) { + heap_free(collection); + return hr; + } + + *ret = &collection->IDWriteFontCollection_iface; + + /* return empty collection if EUDC fonts are not configured */ + sprintfW(eudckeypathW, eudckeyfmtW, GetACP()); + if (RegOpenKeyExW(HKEY_CURRENT_USER, eudckeypathW, 0, GENERIC_READ, &eudckey)) + return S_OK; + + retval = ERROR_SUCCESS; + index = 0; + while (retval != ERROR_NO_MORE_ITEMS) { + WCHAR keynameW[64], pathW[MAX_PATH]; + DWORD type, path_len, name_len; + + path_len = sizeof(pathW)/sizeof(*pathW); + name_len = sizeof(keynameW)/sizeof(*keynameW); + retval = RegEnumValueW(eudckey, index++, keynameW, &name_len, NULL, &type, (BYTE*)pathW, &path_len); + if (retval || type != REG_SZ) + continue; + + hr = eudc_collection_add_family(factory, collection, keynameW, pathW); + if (hr != S_OK) + WARN("failed to add family %s, path %s\n", debugstr_w(keynameW), debugstr_w(pathW)); + } + RegCloseKey(eudckey); + + /* try to add global default if not defined for specific codepage */ + exists = FALSE; + hr = IDWriteFontCollection_FindFamilyName(&collection->IDWriteFontCollection_iface, emptyW, + &index, &exists); + if (FAILED(hr) || !exists) { + const WCHAR globaldefaultW[] = {'E','U','D','C','.','T','T','E',0}; + hr = eudc_collection_add_family(factory, collection, emptyW, globaldefaultW); + if (hr != S_OK) + WARN("failed to add global default EUDC font, 0x%08x\n", hr); + } + + /* EUDC collection offers simulated faces too */ + for (i = 0; i < collection->family_count; i++) { + fontfamily_add_bold_simulated_face(collection->family_data[i]); + fontfamily_add_oblique_simulated_face(collection->family_data[i]); + } + + return S_OK; } static HRESULT WINAPI dwritefontfile_QueryInterface(IDWriteFontFile *iface, REFIID riid, void **obj)
1
0
0
0
Nikolay Sivov : dwrite/tests: Some tests for SetUnderline().
by Alexandre Julliard
29 Dec '15
29 Dec '15
Module: wine Branch: master Commit: ead6905ddb94d9d8a6dadade27f8cfa19d171a78 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ead6905ddb94d9d8a6dadade2…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Dec 28 07:35:11 2015 +0300 dwrite/tests: Some tests for SetUnderline(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/tests/layout.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 13ce6f8..f1534bf 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -4273,6 +4273,60 @@ static void test_SetOpticalAlignment(void) IDWriteFactory_Release(factory); } +static const struct drawcall_entry drawunderline_seq[] = { + { DRAW_GLYPHRUN, {'a','e',0x0300,0} }, /* reported runs can't mix different underline values */ + { DRAW_GLYPHRUN, {'d',0} }, + { DRAW_UNDERLINE }, + { DRAW_LAST_KIND } +}; + +static void test_SetUnderline(void) +{ + static const WCHAR strW[] = {'a','e',0x0300,'d',0}; /* accent grave */ + DWRITE_CLUSTER_METRICS clusters[4]; + IDWriteTextFormat *format; + IDWriteTextLayout *layout; + DWRITE_TEXT_RANGE range; + IDWriteFactory *factory; + UINT32 count; + HRESULT hr; + + factory = create_factory(); + + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 10.0, enusW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 1000.0, 1000.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteTextFormat_Release(format); + + count = 0; + hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, sizeof(clusters)/sizeof(clusters[0]), &count); + ok(hr == S_OK, "got 0x%08x\n", hr); +todo_wine + ok(count == 3, "got %u\n", count); + + range.startPosition = 0; + range.length = 2; + hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = 0; + hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, sizeof(clusters)/sizeof(clusters[0]), &count); + ok(hr == S_OK, "got 0x%08x\n", hr); +todo_wine + ok(count == 3, "got %u\n", count); + + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, drawunderline_seq, "draw underline test", TRUE); + + IDWriteTextLayout_Release(layout); + IDWriteFactory_Release(factory); +} + START_TEST(layout) { static const WCHAR ctrlstrW[] = {0x202a,0}; @@ -4323,6 +4377,7 @@ START_TEST(layout) test_SetTypography(); test_SetLastLineWrapping(); test_SetOpticalAlignment(); + test_SetUnderline(); IDWriteFactory_Release(factory); }
1
0
0
0
Nikolay Sivov : dwrite/tests: Fix test failures on older versions.
by Alexandre Julliard
29 Dec '15
29 Dec '15
Module: wine Branch: master Commit: 8165cba0f8c774c29ef794ac49e667250d122505 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8165cba0f8c774c29ef794ac4…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Dec 28 07:35:10 2015 +0300 dwrite/tests: Fix test failures on older versions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/tests/layout.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 637a8ea..13ce6f8 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -2058,7 +2058,8 @@ if (0) /* crashes on native */ ok(hr == S_OK, "got 0x%08x\n", hr); todo_wine ok(!lstrcmpW(buffW, enusW), "got %s\n", wine_dbgstr_w(buffW)); - ok(range.startPosition == 0 && range.length == ~0u, "got %u,%u\n", range.startPosition, range.length); + ok((range.startPosition == 0 && range.length == ~0u) || + broken(range.startPosition == 0 && range.length == 4) /* vista/win7 */, "got %u,%u\n", range.startPosition, range.length); /* check what's returned for positions after the text */ buffW[0] = 0; @@ -2067,7 +2068,8 @@ todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); todo_wine ok(!lstrcmpW(buffW, enusW), "got %s\n", wine_dbgstr_w(buffW)); - ok(range.startPosition == 0 && range.length == ~0u, "got %u,%u\n", range.startPosition, range.length); + ok((range.startPosition == 0 && range.length == ~0u) || + broken(range.startPosition == 4 && range.length == ~0u-4) /* vista/win7 */, "got %u,%u\n", range.startPosition, range.length); IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format);
1
0
0
0
← Newer
1
2
3
4
5
6
...
33
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
Results per page:
10
25
50
100
200