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
March 2022
----- 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
1138 discussions
Start a n
N
ew thread
Jeremy Newman : fix typos in news
by Jeremy Newman
04 Mar '22
04 Mar '22
Module: website Branch: master Commit: dc7081c8037c5f8f48b53726997e3cfd94ed9748 URL:
https://source.winehq.org/git/website.git/?a=commit;h=dc7081c8037c5f8f48b53…
Author: Jeremy Newman <jnewman(a)codeweavers.com> Date: Fri Mar 4 15:18:52 2022 -0600 fix typos in news --- news/en/2022030402.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/news/en/2022030402.xml b/news/en/2022030402.xml index 8252a84f..c8735698 100644 --- a/news/en/2022030402.xml +++ b/news/en/2022030402.xml @@ -1,11 +1,11 @@ <news> - <date>Month DD, YYYY</date> + <date>March 4, 2022</date> <title>World Wine News Issue 413</title> <body> <a href="{$root}/wwn/413">WWN Issue 413</a> was released today. <ul> - <li><a href="{$root}/wwn/413#A WineD3D">???</a>WineD3D</li> - <li><a href="{$root}/wwn/413#A Vkd3D">???</a>Vkd3D</li> + <li><a href="{$root}/wwn/413#WineD3D">WineD3D</a></li> + <li><a href="{$root}/wwn/413#Vkd3D">Vkd3D</a></li> </ul> </body> </news>
1
0
0
0
Cressida Silver : wwn 413
by Jeremy Newman
04 Mar '22
04 Mar '22
Module: website Branch: master Commit: ed369faf46e4147529277b1e2f600cb7991671bb URL:
https://source.winehq.org/git/website.git/?a=commit;h=ed369faf46e4147529277…
Author: Cressida Silver <cjsilver(a)codeweavers.com> Date: Fri Mar 4 12:42:36 2022 -0600 wwn 413 --- news/en/2022030402.xml | 11 +++ wwn/en/wn20220304_413.xml | 219 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 230 insertions(+) diff --git a/news/en/2022030402.xml b/news/en/2022030402.xml new file mode 100644 index 00000000..8252a84f --- /dev/null +++ b/news/en/2022030402.xml @@ -0,0 +1,11 @@ +<news> + <date>Month DD, YYYY</date> + <title>World Wine News Issue 413</title> + <body> + <a href="{$root}/wwn/413">WWN Issue 413</a> was released today. + <ul> + <li><a href="{$root}/wwn/413#A WineD3D">???</a>WineD3D</li> + <li><a href="{$root}/wwn/413#A Vkd3D">???</a>Vkd3D</li> + </ul> + </body> +</news> diff --git a/wwn/en/wn20220304_413.xml b/wwn/en/wn20220304_413.xml new file mode 100644 index 00000000..cbd4052c --- /dev/null +++ b/wwn/en/wn20220304_413.xml @@ -0,0 +1,219 @@ +<kc> + <title>Wine Traffic</title> + <author contact="mailto:wwn@winehq.org">Cressida Silver</author> + <issue num="413" date="03/04/2022"/> + <intro> + <p> + This is the 413th issue of the World Wine News publication. Its main goal is to inform you of what's going on around Wine. + Wine is an open source implementation of the Windows API on top of X and Unix. Think of it as a Windows compatibility layer. + Wine does not require Microsoft Windows, as it is a completely alternative implementation consisting of 100% Microsoft-free code. + </p> + </intro> + + <section title="WineD3D" subject="" archive="" posts=""> + <p> + A while back (circa 2013), a Direct3D command stream was implemented in Wine. Many applications benefited from the command stream, but not all. In the early implementation, applications + trying to replace part or all of a resource with new data had to wait until existing rendering commands using that resource were finished. + </p> + + <p> + This is a problem that's been known for years, and there have been attempts to fix it. One such attempt was part of the initial command stream patches in 2013 and lived in wine-staging for a time. Another fix was distributed under the name <i>wine-pba.</i> There were a few other attempts to fix limited subsets of the problem, many of fixes were never submitted upstream. + </p> + + <p> + Over the last year Zeb, Matteo, and Henri have been chipping away at the problem, and the release of Wine 7.3 resolves almost all issues around asynchronous resource updates. That's not to say the work is completely done. There are still performance gains to be had, but a big bottleneck is removed. As a result, the application of all D3D versions should perform better though most notably for D3D9 and later). + </p> + + </section> + + <section title="Vkd3D" subject="" archive="" posts=""> + + <p> + Vkd3D 1.3 was released 3/2/22, bringing improved support for Direct3D 12 applications in Wine, and the foundations for various features implemented by the d3dcompiler DLLs. + </p> + + <p> + Games are major users of the Direct3D APIs — perhaps the most prominent — they are not the only users of these APIs. + </p> + </section> + + <section title="Bugs: In Memoriam"> + <p> + <center> + <table cellspacing="0" cellpadding="3" bordercolor="#222222" border="1"> + <tr> + <td width="100" align="center"> + <b>Bug ID</b> + </td> + <td width="100" align="center"> + <b>Open Date</b> + </td> + <td width="100" align="center"> + <b>Days Open</b> + </td> + <td width="100" align="center"> + <b>Weeks Open</b> + </td> + <td width="100" align="center"> + <b>Months Open</b> + </td> + <td width="100" align="center"> + <b>Years Open</b> + </td> + </tr> + <tr> + <td align="center"> + <a href ="
https://bugs.winehq.org/show_bug.cgi?id=38210
">38210</a> + </td> + <td align="center">3/10/15</td> + <td align="center">2544</td> + <td align="center">363</td> + <td align="center">83</td> + <td align="center">7</td> + </tr> + <tr> + <td align="center"> + <a href ="
https://bugs.winehq.org/show_bug.cgi?id=41386
">41386</a> + </td> + <td align="center">6/24/16</td> + <td align="center">2072</td> + <td align="center">296</td> + <td align="center">68</td> + <td align="center">6</td> + </tr> + <tr> + <td align="center"> + <a href="
https://bugs.winehq.org/show_bug.cgi?id=44635
">44635</a> + </td> + <td align="center">2/28/18</td> + <td align="center">1458</td> + <td align="center">208</td> + <td align="center">47</td> + <td align="center">4</td> + </tr> + <tr> + <td align="center"> + <a href="
https://bugs.winehq.org/show_bug.cgi?id=44658
">44658</a> + </td> + <td align="center">3/4/18</td> + <td align="center">1454</td> + <td align="center">208</td> + <td align="center">47</td> + <td align="center">4</td> + </tr> + <tr> + <td align="center"> + <a href="
https://bugs.winehq.org/show_bug.cgi?id=48096
">48096</a> + </td> + <td align="center">11/13/19</td> + <td align="center">835</td> + <td align="center">119</td> + <td align="center">27</td> + <td align="center">2</td> + </tr> + <tr> + <td align="center"> + <a href="
https://bugs.winehq.org/show_bug.cgi?id=48201
">48201</a> + </td> + <td align="center">11/30/19</td> + <td align="center">818</td> + <td align="center">117</td> + <td align="center">26</td> + <td align="center">2</td> + </tr> + <tr> + <td align="center"> + <a href="
https://bugs.winehq.org/show_bug.cgi?id=48733
">48733</a> + </td> + <td align="center">3/9/20</td> + <td align="center">718</td> + <td align="center">103</td> + <td align="center">23</td> + <td align="center">2</td> + </tr> + <tr> + <td align="center"> + <a href="
https://bugs.winehq.org/show_bug.cgi?id=48760
">48760</a> + </td> + <td align="center">3/16/20</td> + <td align="center">711</td> + <td align="center">102</td> + <td align="center">23</td> + <td align="center">2</td> + </tr> + <tr> + <td align="center"> + <a href="
https://bugs.winehq.org/show_bug.cgi?id=51103
">51103</a> + </td> + <td align="center">5/7/21</td> + <td align="center">294</td> + <td align="center">42</td> + <td align="center">9</td> + <td align="center">0</td> + </tr> + <tr> + <td align="center"> + <a href="
https://bugs.winehq.org/show_bug.cgi?id=52155
">52155</a> + </td> + <td align="center">12/3/21</td> + <td align="center">84</td> + <td align="center">12</td> + <td align="center">2</td> + <td align="center">0</td> + </tr> + <tr> + <td align="center"> + <a href="
https://bugs.winehq.org/show_bug.cgi?id=48815
">48815</a> + </td> + <td align="center">12/27/21</td> + <td align="center">60</td> + <td align="center">9</td> + <td align="center">1</td> + <td align="center">0</td> + </tr> + <tr> + <td align="center"> + <a href="
https://bugs.winehq.org/show_bug.cgi?id=52434
">52434</a> + </td> + <td align="center">1/21/22</td> + <td align="center">35</td> + <td align="center">5</td> + <td align="center">1</td> + <td align="center">0</td> + </tr> + <tr> + <td align="center"> + <a href="
https://bugs.winehq.org/show_bug.cgi?id=52526
">52526</a> + </td> + <td align="center">2/6/22</td> + <td align="center">19</td> + <td align="center">3</td> + <td align="center">0</td> + <td align="center">0</td> + </tr> + <tr> + <td align="center"> + <a href="
https://bugs.winehq.org/show_bug.cgi?id=52561
">52561</a> + </td> + <td align="center">2/17/22</td> + <td align="center">8</td> + <td align="center">1</td> + <td align="center">0</td> + <td align="center">0</td> + </tr> + <tr> + <td align="center"> + <a href="
https://bugs.winehq.org/show_bug.cgi?id=52583
">52583</a> + </td> + <td align="center">2/23/22</td> + <td align="center">2</td> + <td align="center">0</td> + <td align="center">0</td> + <td align="center">0</td> + </tr> + </table> + </center> + </p> + </section> + +</kc>
1
0
0
0
Brendan Shanks : ntdll: Don't require equal Length and MaximumLength when setting ThreadNameInformation.
by Alexandre Julliard
03 Mar '22
03 Mar '22
Module: wine Branch: master Commit: 1b9d48a7b01e2b715af46bc1f8d5fe6f1529782c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1b9d48a7b01e2b715af46bc1…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Thu Mar 3 11:50:56 2022 -0800 ntdll: Don't require equal Length and MaximumLength when setting ThreadNameInformation. Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/thread.c | 2 -- dlls/ntdll/unix/thread.c | 1 - 2 files changed, 3 deletions(-) diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c index bcdda77c553..3cf58d928ae 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -2493,13 +2493,11 @@ static void test_thread_description(void) RtlInitUnicodeString(&thread_desc->ThreadName, (WCHAR *)(thread_desc + 1)); status = pNtSetInformationThread(GetCurrentThread(), ThreadNameInformation, thread_desc, sizeof(*thread_desc)); - todo_wine ok(status == STATUS_SUCCESS, "Failed to set thread description, status %#x.\n", status); ptr = NULL; hr = pGetThreadDescription(GetCurrentThread(), &ptr); ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#x.\n", hr); - todo_wine ok(!lstrcmpW(ptr, L"desc"), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); LocalFree(ptr); diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 0488129aa4c..b8546edde87 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -2237,7 +2237,6 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class, if (length != sizeof(*info)) return STATUS_INFO_LENGTH_MISMATCH; if (!info) return STATUS_ACCESS_VIOLATION; - if (info->ThreadName.Length != info->ThreadName.MaximumLength) return STATUS_INVALID_PARAMETER; if (info->ThreadName.Length && !info->ThreadName.Buffer) return STATUS_ACCESS_VIOLATION; SERVER_START_REQ( set_thread_info )
1
0
0
0
Brendan Shanks : kernel32/tests: Add additional Get/SetThreadDescription() tests.
by Alexandre Julliard
03 Mar '22
03 Mar '22
Module: wine Branch: master Commit: a9a294d2862528e595ecacaaa157fc7f414cde4c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a9a294d2862528e595ecacaa…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Thu Mar 3 11:50:55 2022 -0800 kernel32/tests: Add additional Get/SetThreadDescription() tests. Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/thread.c | 95 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c index 6ccf7af85f8..bcdda77c553 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -100,6 +100,8 @@ static BOOL (WINAPI *pSetThreadGroupAffinity)(HANDLE,const GROUP_AFFINITY*,GROUP static NTSTATUS (WINAPI *pNtSetInformationThread)(HANDLE,THREADINFOCLASS,LPCVOID,ULONG); static HRESULT (WINAPI *pSetThreadDescription)(HANDLE,const WCHAR *); static HRESULT (WINAPI *pGetThreadDescription)(HANDLE,WCHAR **); +static PVOID (WINAPI *pRtlAddVectoredExceptionHandler)(ULONG,PVECTORED_EXCEPTION_HANDLER); +static ULONG (WINAPI *pRtlRemoveVectoredExceptionHandler)(PVOID); static HANDLE create_target_process(const char *arg) { @@ -2351,6 +2353,23 @@ static void test_thread_info(void) CloseHandle(thread); } +typedef struct tagTHREADNAME_INFO +{ + DWORD dwType; /* Must be 0x1000. */ + LPCSTR szName; /* Pointer to name (in user addr space). */ + DWORD dwThreadID; /* Thread ID (-1 = caller thread). */ + DWORD dwFlags; /* Reserved for future use, must be zero. */ +} THREADNAME_INFO; + +static LONG CALLBACK msvc_threadname_vec_handler(EXCEPTION_POINTERS *ExceptionInfo) +{ + if (ExceptionInfo->ExceptionRecord != NULL && + ExceptionInfo->ExceptionRecord->ExceptionCode == EXCEPTION_WINE_NAME_THREAD) + return EXCEPTION_CONTINUE_EXECUTION; + + return EXCEPTION_CONTINUE_SEARCH; +} + static void test_thread_description(void) { THREAD_NAME_INFORMATION *thread_desc; @@ -2360,6 +2379,9 @@ static void test_thread_description(void) char buff[128]; WCHAR *ptr; HRESULT hr; + HANDLE thread; + PVOID vectored_handler; + THREADNAME_INFO info; if (!pGetThreadDescription) { @@ -2463,6 +2485,24 @@ static void test_thread_description(void) ok(!lstrcmpW(ptr, L""), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); LocalFree(ptr); + /* Set with a string from RtlInitUnicodeString. */ + hr = pSetThreadDescription(GetCurrentThread(), L"123"); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#x.\n", hr); + + lstrcpyW((WCHAR *)(thread_desc + 1), L"desc"); + RtlInitUnicodeString(&thread_desc->ThreadName, (WCHAR *)(thread_desc + 1)); + + status = pNtSetInformationThread(GetCurrentThread(), ThreadNameInformation, thread_desc, sizeof(*thread_desc)); + todo_wine + ok(status == STATUS_SUCCESS, "Failed to set thread description, status %#x.\n", status); + + ptr = NULL; + hr = pGetThreadDescription(GetCurrentThread(), &ptr); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#x.\n", hr); + todo_wine + ok(!lstrcmpW(ptr, L"desc"), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); + LocalFree(ptr); + /* Set with 0 length/NULL pointer. */ hr = pSetThreadDescription(GetCurrentThread(), L"123"); ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#x.\n", hr); @@ -2476,6 +2516,59 @@ static void test_thread_description(void) ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#x.\n", hr); ok(!lstrcmpW(ptr, L""), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); LocalFree(ptr); + + /* Get with only THREAD_QUERY_LIMITED_INFORMATION access. */ + thread = OpenThread(THREAD_QUERY_LIMITED_INFORMATION, FALSE, GetCurrentThreadId()); + + ptr = NULL; + hr = pGetThreadDescription(thread, &ptr); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#x.\n", hr); + ok(!lstrcmpW(ptr, L""), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); + LocalFree(ptr); + + len = 0; + status = pNtQueryInformationThread(thread, ThreadNameInformation, NULL, 0, &len); + ok(status == STATUS_BUFFER_TOO_SMALL, "Unexpected status %#x.\n", status); + ok(len == sizeof(*thread_desc), "Unexpected structure length %u.\n", len); + + CloseHandle(thread); + + /* Set with only THREAD_SET_LIMITED_INFORMATION access. */ + thread = OpenThread(THREAD_SET_LIMITED_INFORMATION, FALSE, GetCurrentThreadId()); + + hr = pSetThreadDescription(thread, desc); + todo_wine + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#x.\n", hr); + + ptr = NULL; + hr = pGetThreadDescription(GetCurrentThread(), &ptr); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#x.\n", hr); + todo_wine + ok(!lstrcmpW(ptr, desc), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); + LocalFree(ptr); + + CloseHandle(thread); + + /* The old exception-based thread name method should not affect GetThreadDescription. */ + hr = pSetThreadDescription(GetCurrentThread(), desc); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#x.\n", hr); + + vectored_handler = pRtlAddVectoredExceptionHandler(FALSE, &msvc_threadname_vec_handler); + ok(vectored_handler != 0, "RtlAddVectoredExceptionHandler failed\n"); + + info.dwType = 0x1000; + info.szName = "123"; + info.dwThreadID = -1; + info.dwFlags = 0; + RaiseException(EXCEPTION_WINE_NAME_THREAD, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info); + + pRtlRemoveVectoredExceptionHandler(vectored_handler); + + ptr = NULL; + hr = pGetThreadDescription(GetCurrentThread(), &ptr); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#x.\n", hr); + ok(!lstrcmpW(ptr, desc), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); + LocalFree(ptr); } static void init_funcs(void) @@ -2524,6 +2617,8 @@ static void init_funcs(void) X(NtQueryInformationThread); X(RtlGetThreadErrorMode); X(NtSetInformationThread); + X(RtlAddVectoredExceptionHandler); + X(RtlRemoveVectoredExceptionHandler); } #undef X }
1
0
0
0
Rémi Bernon : dinput: Check collection nodes to find HID simulation device usages.
by Alexandre Julliard
03 Mar '22
03 Mar '22
Module: wine Branch: master Commit: 42c8860b23a024a1e0bbb6ad6445d7182698603e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=42c8860b23a024a1e0bbb6ad…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Mar 3 12:02:04 2022 +0100 dinput: Check collection nodes to find HID simulation device usages. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 1a39dfd6cab..4f1c8444e43 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1418,10 +1418,12 @@ static BOOL hid_joystick_device_try_open( UINT32 handle, const WCHAR *path, HAND { BOOL has_accelerator, has_brake, has_clutch, has_z, has_pov; PHIDP_PREPARSED_DATA preparsed_data = NULL; + HIDP_LINK_COLLECTION_NODE nodes[256]; DWORD type, button_count = 0; HIDP_BUTTON_CAPS buttons[10]; HIDP_VALUE_CAPS value; HANDLE device_file; + ULONG node_count; NTSTATUS status; USHORT count; @@ -1453,6 +1455,16 @@ static BOOL hid_joystick_device_try_open( UINT32 handle, const WCHAR *path, HAND instance->wUsagePage = caps->UsagePage; instance->wUsage = caps->Usage; + node_count = ARRAY_SIZE(nodes); + status = HidP_GetLinkCollectionNodes( nodes, &node_count, preparsed_data ); + if (status != HIDP_STATUS_SUCCESS) node_count = 0; + while (node_count--) + { + if (nodes[node_count].LinkUsagePage != HID_USAGE_PAGE_SIMULATION) continue; + if (nodes[node_count].LinkUsage == HID_USAGE_SIMULATION_AUTOMOBILE_SIMULATION_DEVICE) type = DI8DEVTYPE_DRIVING; + if (nodes[node_count].LinkUsage == HID_USAGE_SIMULATION_FLIGHT_SIMULATION_DEVICE) type = DI8DEVTYPE_FLIGHT; + } + count = ARRAY_SIZE(buttons); status = HidP_GetSpecificButtonCaps( HidP_Output, HID_USAGE_PAGE_PID, 0, PID_USAGE_DC_DEVICE_RESET, buttons, &count, preparsed_data ); @@ -1533,6 +1545,9 @@ static BOOL hid_joystick_device_try_open( UINT32 handle, const WCHAR *path, HAND else type |= (DI8DEVTYPEDRIVING_LIMITED << 8); break; + case DI8DEVTYPE_FLIGHT: + type |= (DI8DEVTYPEFLIGHT_STICK << 8); + break; } instance->dwDevType = device_type_for_version( type, version ) | DIDEVTYPE_HID;
1
0
0
0
Rémi Bernon : winebus.sys: Use SDL_JoystickGetType to set physical HID usage.
by Alexandre Julliard
03 Mar '22
03 Mar '22
Module: wine Branch: master Commit: 6efb40718be445111a4b757f0acd8a6c66161b25 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6efb40718be445111a4b757f…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Mar 3 12:02:03 2022 +0100 winebus.sys: Use SDL_JoystickGetType to set physical HID usage. And pass through driving wheel and flight stick information to DInput. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/bus_sdl.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 3d9935f0714..aedef50d3f7 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -117,6 +117,7 @@ static int (*pSDL_JoystickRumble)(SDL_Joystick *joystick, Uint16 low_frequency_r static Uint16 (*pSDL_JoystickGetProduct)(SDL_Joystick * joystick); static Uint16 (*pSDL_JoystickGetProductVersion)(SDL_Joystick * joystick); static Uint16 (*pSDL_JoystickGetVendor)(SDL_Joystick * joystick); +static SDL_JoystickType (*pSDL_JoystickGetType)(SDL_Joystick * joystick); /* internal bits for extended rumble support, SDL_Haptic types are 16-bits */ #define WINE_SDL_JOYSTICK_RUMBLE 0x40000000 /* using SDL_JoystickRumble API */ @@ -258,6 +259,7 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) }; struct sdl_device *impl = impl_from_unix_device(iface); int i, button_count, axis_count, ball_count, hat_count; + USAGE_AND_PAGE physical_usage; axis_count = pSDL_JoystickNumAxes(impl->sdl_joystick); if (axis_count > ARRAY_SIZE(absolute_usages)) @@ -276,10 +278,37 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) hat_count = pSDL_JoystickNumHats(impl->sdl_joystick); button_count = pSDL_JoystickNumButtons(impl->sdl_joystick); + if (!pSDL_JoystickGetType) physical_usage = device_usage; + else switch (pSDL_JoystickGetType(impl->sdl_joystick)) + { + case SDL_JOYSTICK_TYPE_ARCADE_PAD: + case SDL_JOYSTICK_TYPE_ARCADE_STICK: + case SDL_JOYSTICK_TYPE_DANCE_PAD: + case SDL_JOYSTICK_TYPE_DRUM_KIT: + case SDL_JOYSTICK_TYPE_GUITAR: + case SDL_JOYSTICK_TYPE_UNKNOWN: + physical_usage.UsagePage = HID_USAGE_PAGE_GENERIC; + physical_usage.Usage = HID_USAGE_GENERIC_JOYSTICK; + break; + case SDL_JOYSTICK_TYPE_GAMECONTROLLER: + physical_usage.UsagePage = HID_USAGE_PAGE_GENERIC; + physical_usage.Usage = HID_USAGE_GENERIC_GAMEPAD; + break; + case SDL_JOYSTICK_TYPE_WHEEL: + physical_usage.UsagePage = HID_USAGE_PAGE_SIMULATION; + physical_usage.Usage = HID_USAGE_SIMULATION_AUTOMOBILE_SIMULATION_DEVICE; + break; + case SDL_JOYSTICK_TYPE_FLIGHT_STICK: + case SDL_JOYSTICK_TYPE_THROTTLE: + physical_usage.UsagePage = HID_USAGE_PAGE_SIMULATION; + physical_usage.Usage = HID_USAGE_SIMULATION_FLIGHT_SIMULATION_DEVICE; + break; + } + if (!hid_device_begin_report_descriptor(iface, &device_usage)) return STATUS_NO_MEMORY; - if (!hid_device_begin_input_report(iface, &device_usage)) + if (!hid_device_begin_input_report(iface, &physical_usage)) return STATUS_NO_MEMORY; for (i = 0; i < axis_count; i++) @@ -1026,6 +1055,7 @@ NTSTATUS sdl_bus_init(void *args) pSDL_JoystickGetProduct = dlsym(sdl_handle, "SDL_JoystickGetProduct"); pSDL_JoystickGetProductVersion = dlsym(sdl_handle, "SDL_JoystickGetProductVersion"); pSDL_JoystickGetVendor = dlsym(sdl_handle, "SDL_JoystickGetVendor"); + pSDL_JoystickGetType = dlsym(sdl_handle, "SDL_JoystickGetType"); if (pSDL_Init(SDL_INIT_GAMECONTROLLER | SDL_INIT_HAPTIC) < 0) {
1
0
0
0
Rémi Bernon : include: Define some HID simulation device usages.
by Alexandre Julliard
03 Mar '22
03 Mar '22
Module: wine Branch: master Commit: f8f843a85a780be9da8eaacbb3efb995a16c5ba6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f8f843a85a780be9da8eaacb…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Mar 3 12:02:02 2022 +0100 include: Define some HID simulation device usages. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/hidusage.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/hidusage.h b/include/hidusage.h index 3e2ee77f8c8..2ea3784d626 100644 --- a/include/hidusage.h +++ b/include/hidusage.h @@ -203,6 +203,8 @@ typedef USHORT USAGE, *PUSAGE; #define HID_USAGE_PAGE_VENDOR_DEFINED_BEGIN ((USAGE) 0xff00) #define HID_USAGE_PAGE_VENDOR_DEFINED_END ((USAGE) 0xffff) +#define HID_USAGE_SIMULATION_FLIGHT_SIMULATION_DEVICE ((USAGE) 0x01) +#define HID_USAGE_SIMULATION_AUTOMOBILE_SIMULATION_DEVICE ((USAGE) 0x02) #define HID_USAGE_SIMULATION_RUDDER ((USAGE) 0xBA) #define HID_USAGE_SIMULATION_THROTTLE ((USAGE) 0xBB) #define HID_USAGE_SIMULATION_ACCELERATOR ((USAGE) 0xC4)
1
0
0
0
Rémi Bernon : winebus.sys: Use a physical collection for the HID input report.
by Alexandre Julliard
03 Mar '22
03 Mar '22
Module: wine Branch: master Commit: 1200e9d472deaa99e80d8fd80821008e3c9021bc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1200e9d472deaa99e80d8fd8…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Mar 3 12:02:01 2022 +0100 winebus.sys: Use a physical collection for the HID input report. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/bus_sdl.c | 4 ++-- dlls/winebus.sys/bus_udev.c | 2 +- dlls/winebus.sys/hid.c | 40 +++++++++++++++++++++++++--------------- dlls/winebus.sys/unix_private.h | 2 +- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 9efd8e2d00e..3d9935f0714 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -279,7 +279,7 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) if (!hid_device_begin_report_descriptor(iface, &device_usage)) return STATUS_NO_MEMORY; - if (!hid_device_begin_input_report(iface)) + if (!hid_device_begin_input_report(iface, &device_usage)) return STATUS_NO_MEMORY; for (i = 0; i < axis_count; i++) @@ -333,7 +333,7 @@ static NTSTATUS build_controller_report_descriptor(struct unix_device *iface) if (!hid_device_begin_report_descriptor(iface, &device_usage)) return STATUS_NO_MEMORY; - if (!hid_device_begin_input_report(iface)) + if (!hid_device_begin_input_report(iface, &device_usage)) return STATUS_NO_MEMORY; if (!hid_device_add_axes(iface, 2, HID_USAGE_PAGE_GENERIC, left_axis_usages, diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 7a0a9587af0..db173b63fb5 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -665,7 +665,7 @@ static NTSTATUS build_report_descriptor(struct unix_device *iface, struct udev_d if (!hid_device_begin_report_descriptor(iface, &device_usage)) return STATUS_NO_MEMORY; - if (!hid_device_begin_input_report(iface)) + if (!hid_device_begin_input_report(iface, &device_usage)) return STATUS_NO_MEMORY; abs_count = 0; diff --git a/dlls/winebus.sys/hid.c b/dlls/winebus.sys/hid.c index ba0fa77ee11..d5637c0353b 100644 --- a/dlls/winebus.sys/hid.c +++ b/dlls/winebus.sys/hid.c @@ -74,23 +74,21 @@ static BOOL hid_report_descriptor_append_usage(struct hid_report_descriptor *des return hid_report_descriptor_append(desc, template, sizeof(template)); } -BOOL hid_device_begin_report_descriptor(struct unix_device *iface, const USAGE_AND_PAGE *device_usage) +static BOOL hid_device_begin_collection(struct hid_report_descriptor *desc, const USAGE_AND_PAGE *usage, BYTE type) { - struct hid_report_descriptor *desc = &iface->hid_report_descriptor; const BYTE template[] = { - USAGE_PAGE(2, device_usage->UsagePage), - USAGE(2, device_usage->Usage), - COLLECTION(1, Application), + USAGE_PAGE(2, usage->UsagePage), + USAGE(2, usage->Usage), + COLLECTION(1, type), }; memset(desc, 0, sizeof(*desc)); return hid_report_descriptor_append(desc, template, sizeof(template)); } -BOOL hid_device_end_report_descriptor(struct unix_device *iface) +static BOOL hid_device_end_collection(struct hid_report_descriptor *desc) { - struct hid_report_descriptor *desc = &iface->hid_report_descriptor; static const BYTE template[] = { END_COLLECTION, @@ -99,15 +97,27 @@ BOOL hid_device_end_report_descriptor(struct unix_device *iface) return hid_report_descriptor_append(desc, template, sizeof(template)); } -BOOL hid_device_begin_input_report(struct unix_device *iface) +BOOL hid_device_begin_report_descriptor(struct unix_device *iface, const USAGE_AND_PAGE *device_usage) +{ + struct hid_report_descriptor *desc = &iface->hid_report_descriptor; + memset(desc, 0, sizeof(*desc)); + return hid_device_begin_collection(desc, device_usage, Application); +} + +BOOL hid_device_end_report_descriptor(struct unix_device *iface) +{ + struct hid_report_descriptor *desc = &iface->hid_report_descriptor; + return hid_device_end_collection(desc); +} + +BOOL hid_device_begin_input_report(struct unix_device *iface, const USAGE_AND_PAGE *physical_usage) { struct hid_report_descriptor *desc = &iface->hid_report_descriptor; struct hid_device_state *state = &iface->hid_device_state; const BYTE report_id = ++desc->next_report_id[HidP_Input]; const BYTE template[] = { - COLLECTION(1, Report), - REPORT_ID(1, report_id), + REPORT_ID(1, report_id), }; if (state->report_len) @@ -118,6 +128,10 @@ BOOL hid_device_begin_input_report(struct unix_device *iface) state->id = report_id; state->bit_size += 8; + + if (!hid_device_begin_collection(desc, physical_usage, Physical)) + return FALSE; + return hid_report_descriptor_append(desc, template, sizeof(template)); } @@ -125,10 +139,6 @@ BOOL hid_device_end_input_report(struct unix_device *iface) { struct hid_report_descriptor *desc = &iface->hid_report_descriptor; struct hid_device_state *state = &iface->hid_device_state; - static const BYTE template[] = - { - END_COLLECTION, - }; state->report_len = (state->bit_size + 7) / 8; if (!(state->report_buf = calloc(1, state->report_len))) return FALSE; @@ -136,7 +146,7 @@ BOOL hid_device_end_input_report(struct unix_device *iface) state->report_buf[0] = state->id; state->last_report_buf[0] = state->id; - return hid_report_descriptor_append(desc, template, sizeof(template)); + return hid_device_end_collection(desc); } static BOOL hid_device_add_button_count(struct unix_device *iface, BYTE count) diff --git a/dlls/winebus.sys/unix_private.h b/dlls/winebus.sys/unix_private.h index 2cf6d382759..553631e40fb 100644 --- a/dlls/winebus.sys/unix_private.h +++ b/dlls/winebus.sys/unix_private.h @@ -245,7 +245,7 @@ extern BOOL bus_event_queue_pop(struct list *queue, struct bus_event *event) DEC extern BOOL hid_device_begin_report_descriptor(struct unix_device *iface, const USAGE_AND_PAGE *device_usage) DECLSPEC_HIDDEN; extern BOOL hid_device_end_report_descriptor(struct unix_device *iface) DECLSPEC_HIDDEN; -extern BOOL hid_device_begin_input_report(struct unix_device *iface) DECLSPEC_HIDDEN; +extern BOOL hid_device_begin_input_report(struct unix_device *iface, const USAGE_AND_PAGE *physical_usage) DECLSPEC_HIDDEN; extern BOOL hid_device_end_input_report(struct unix_device *iface) DECLSPEC_HIDDEN; extern BOOL hid_device_add_buttons(struct unix_device *iface, USAGE usage_page, USAGE usage_min, USAGE usage_max) DECLSPEC_HIDDEN;
1
0
0
0
Rémi Bernon : winebus.sys: Pass USAGE_AND_PAGE to hid_device_begin_report_descriptor.
by Alexandre Julliard
03 Mar '22
03 Mar '22
Module: wine Branch: master Commit: e4105a71d1449355563e1bf23349826d416d53f1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e4105a71d1449355563e1bf2…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Mar 3 12:02:00 2022 +0100 winebus.sys: Pass USAGE_AND_PAGE to hid_device_begin_report_descriptor. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/bus_sdl.c | 6 ++++-- dlls/winebus.sys/bus_udev.c | 39 ++++++++++++++++++++------------------- dlls/winebus.sys/hid.c | 7 +++---- dlls/winebus.sys/unix_private.h | 2 +- dlls/winebus.sys/unixlib.c | 6 ++++-- 5 files changed, 32 insertions(+), 28 deletions(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index c80b7ce324a..9efd8e2d00e 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -229,6 +229,7 @@ static BOOL descriptor_add_haptic(struct sdl_device *impl) static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) { + const USAGE_AND_PAGE device_usage = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_JOYSTICK}; static const USAGE_AND_PAGE absolute_usages[] = { {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_X}, @@ -275,7 +276,7 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) hat_count = pSDL_JoystickNumHats(impl->sdl_joystick); button_count = pSDL_JoystickNumButtons(impl->sdl_joystick); - if (!hid_device_begin_report_descriptor(iface, HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_JOYSTICK)) + if (!hid_device_begin_report_descriptor(iface, &device_usage)) return STATUS_NO_MEMORY; if (!hid_device_begin_input_report(iface)) @@ -321,6 +322,7 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) static NTSTATUS build_controller_report_descriptor(struct unix_device *iface) { + const USAGE_AND_PAGE device_usage = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_GAMEPAD}; static const USAGE left_axis_usages[] = {HID_USAGE_GENERIC_X, HID_USAGE_GENERIC_Y}; static const USAGE right_axis_usages[] = {HID_USAGE_GENERIC_RX, HID_USAGE_GENERIC_RY}; static const USAGE trigger_axis_usages[] = {HID_USAGE_GENERIC_Z, HID_USAGE_GENERIC_RZ}; @@ -328,7 +330,7 @@ static NTSTATUS build_controller_report_descriptor(struct unix_device *iface) ULONG i, button_count = SDL_CONTROLLER_BUTTON_MAX - 1; C_ASSERT(SDL_CONTROLLER_AXIS_MAX == 6); - if (!hid_device_begin_report_descriptor(iface, HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_GAMEPAD)) + if (!hid_device_begin_report_descriptor(iface, &device_usage)) return STATUS_NO_MEMORY; if (!hid_device_begin_input_report(iface)) diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 08034c8a07e..7a0a9587af0 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -555,16 +555,16 @@ static struct base_device *find_device_from_syspath(const char *path) #define test_bit(arr,bit) (((BYTE*)(arr))[(bit)>>3]&(1<<((bit)&7))) -static const BYTE* what_am_I(struct udev_device *dev) +static const USAGE_AND_PAGE *what_am_I(struct udev_device *dev, int fd) { - static const BYTE Unknown[2] = {HID_USAGE_PAGE_GENERIC, 0}; - static const BYTE Mouse[2] = {HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_MOUSE}; - static const BYTE Keyboard[2] = {HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_KEYBOARD}; - static const BYTE Gamepad[2] = {HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_GAMEPAD}; - static const BYTE Keypad[2] = {HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_KEYPAD}; - static const BYTE Tablet[2] = {HID_USAGE_PAGE_DIGITIZER, HID_USAGE_DIGITIZER_PEN}; - static const BYTE Touchscreen[2] = {HID_USAGE_PAGE_DIGITIZER, HID_USAGE_DIGITIZER_TOUCH_SCREEN}; - static const BYTE Touchpad[2] = {HID_USAGE_PAGE_DIGITIZER, HID_USAGE_DIGITIZER_TOUCH_PAD}; + static const USAGE_AND_PAGE Unknown = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = 0}; + static const USAGE_AND_PAGE Mouse = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_MOUSE}; + static const USAGE_AND_PAGE Keyboard = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_KEYBOARD}; + static const USAGE_AND_PAGE Gamepad = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_GAMEPAD}; + static const USAGE_AND_PAGE Keypad = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_KEYPAD}; + static const USAGE_AND_PAGE Tablet = {.UsagePage = HID_USAGE_PAGE_DIGITIZER, .Usage = HID_USAGE_DIGITIZER_PEN}; + static const USAGE_AND_PAGE Touchscreen = {.UsagePage = HID_USAGE_PAGE_DIGITIZER, .Usage = HID_USAGE_DIGITIZER_TOUCH_SCREEN}; + static const USAGE_AND_PAGE Touchpad = {.UsagePage = HID_USAGE_PAGE_DIGITIZER, .Usage = HID_USAGE_DIGITIZER_TOUCH_PAD}; struct udev_device *parent = dev; @@ -572,23 +572,24 @@ static const BYTE* what_am_I(struct udev_device *dev) while (parent) { if (udev_device_get_property_value(parent, "ID_INPUT_MOUSE")) - return Mouse; + return &Mouse; else if (udev_device_get_property_value(parent, "ID_INPUT_KEYBOARD")) - return Keyboard; + return &Keyboard; else if (udev_device_get_property_value(parent, "ID_INPUT_JOYSTICK")) - return Gamepad; + return &Gamepad; else if (udev_device_get_property_value(parent, "ID_INPUT_KEY")) - return Keypad; + return &Keypad; else if (udev_device_get_property_value(parent, "ID_INPUT_TOUCHPAD")) - return Touchpad; + return &Touchpad; else if (udev_device_get_property_value(parent, "ID_INPUT_TOUCHSCREEN")) - return Touchscreen; + return &Touchscreen; else if (udev_device_get_property_value(parent, "ID_INPUT_TABLET")) - return Tablet; + return &Tablet; parent = udev_device_get_parent_with_subsystem_devtype(parent, "input", NULL); } - return Unknown; + + return &Unknown; } static INT count_buttons(int device_fd, BYTE *map) @@ -642,8 +643,8 @@ static NTSTATUS build_report_descriptor(struct unix_device *iface, struct udev_d USHORT count = 0; USAGE usages[16]; INT i, button_count, abs_count, rel_count, hat_count; - const BYTE *device_usage = what_am_I(dev); struct lnxev_device *impl = lnxev_impl_from_unix_device(iface); + const USAGE_AND_PAGE device_usage = *what_am_I(dev, impl->base.device_fd); if (ioctl(impl->base.device_fd, EVIOCGBIT(EV_REL, sizeof(relbits)), relbits) == -1) { @@ -661,7 +662,7 @@ static NTSTATUS build_report_descriptor(struct unix_device *iface, struct udev_d memset(ffbits, 0, sizeof(ffbits)); } - if (!hid_device_begin_report_descriptor(iface, device_usage[0], device_usage[1])) + if (!hid_device_begin_report_descriptor(iface, &device_usage)) return STATUS_NO_MEMORY; if (!hid_device_begin_input_report(iface)) diff --git a/dlls/winebus.sys/hid.c b/dlls/winebus.sys/hid.c index 8d34fc86e63..ba0fa77ee11 100644 --- a/dlls/winebus.sys/hid.c +++ b/dlls/winebus.sys/hid.c @@ -74,15 +74,14 @@ static BOOL hid_report_descriptor_append_usage(struct hid_report_descriptor *des return hid_report_descriptor_append(desc, template, sizeof(template)); } -BOOL hid_device_begin_report_descriptor(struct unix_device *iface, USAGE usage_page, USAGE usage) +BOOL hid_device_begin_report_descriptor(struct unix_device *iface, const USAGE_AND_PAGE *device_usage) { struct hid_report_descriptor *desc = &iface->hid_report_descriptor; const BYTE template[] = { - USAGE_PAGE(2, usage_page), - USAGE(2, usage), + USAGE_PAGE(2, device_usage->UsagePage), + USAGE(2, device_usage->Usage), COLLECTION(1, Application), - USAGE(1, 0), }; memset(desc, 0, sizeof(*desc)); diff --git a/dlls/winebus.sys/unix_private.h b/dlls/winebus.sys/unix_private.h index 3c37f219a4b..2cf6d382759 100644 --- a/dlls/winebus.sys/unix_private.h +++ b/dlls/winebus.sys/unix_private.h @@ -242,7 +242,7 @@ extern BOOL bus_event_queue_input_report(struct list *queue, struct unix_device BYTE *report, USHORT length) DECLSPEC_HIDDEN; extern BOOL bus_event_queue_pop(struct list *queue, struct bus_event *event) DECLSPEC_HIDDEN; -extern BOOL hid_device_begin_report_descriptor(struct unix_device *iface, USAGE usage_page, USAGE usage) DECLSPEC_HIDDEN; +extern BOOL hid_device_begin_report_descriptor(struct unix_device *iface, const USAGE_AND_PAGE *device_usage) DECLSPEC_HIDDEN; extern BOOL hid_device_end_report_descriptor(struct unix_device *iface) DECLSPEC_HIDDEN; extern BOOL hid_device_begin_input_report(struct unix_device *iface) DECLSPEC_HIDDEN; diff --git a/dlls/winebus.sys/unixlib.c b/dlls/winebus.sys/unixlib.c index f251e8e6af7..88cc513125a 100644 --- a/dlls/winebus.sys/unixlib.c +++ b/dlls/winebus.sys/unixlib.c @@ -87,7 +87,8 @@ static void mouse_destroy(struct unix_device *iface) static NTSTATUS mouse_start(struct unix_device *iface) { - if (!hid_device_begin_report_descriptor(iface, HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_MOUSE)) + const USAGE_AND_PAGE device_usage = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_MOUSE}; + if (!hid_device_begin_report_descriptor(iface, &device_usage)) return STATUS_NO_MEMORY; if (!hid_device_add_buttons(iface, HID_USAGE_PAGE_BUTTON, 1, 3)) return STATUS_NO_MEMORY; @@ -176,7 +177,8 @@ static void keyboard_destroy(struct unix_device *iface) static NTSTATUS keyboard_start(struct unix_device *iface) { - if (!hid_device_begin_report_descriptor(iface, HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_KEYBOARD)) + const USAGE_AND_PAGE device_usage = {.UsagePage = HID_USAGE_PAGE_GENERIC, .Usage = HID_USAGE_GENERIC_KEYBOARD}; + if (!hid_device_begin_report_descriptor(iface, &device_usage)) return STATUS_NO_MEMORY; if (!hid_device_add_buttons(iface, HID_USAGE_PAGE_KEYBOARD, 0, 101)) return STATUS_NO_MEMORY;
1
0
0
0
Rémi Bernon : dinput: Refactor HID joystick device type detection logic.
by Alexandre Julliard
03 Mar '22
03 Mar '22
Module: wine Branch: master Commit: 9d2c868db3a893ffc5567ad89f9ec83dcbf55920 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9d2c868db3a893ffc5567ad8…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Mar 3 12:01:59 2022 +0100 dinput: Refactor HID joystick device type detection logic. Detecting main type first, then subtype. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 85 ++++++++++++++++++++++--------------------- dlls/dinput/tests/joystick8.c | 2 - 2 files changed, 44 insertions(+), 43 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 87e343bb47b..1a39dfd6cab 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1416,9 +1416,9 @@ static BOOL hid_joystick_device_try_open( UINT32 handle, const WCHAR *path, HAND PHIDP_PREPARSED_DATA *preparsed, HIDD_ATTRIBUTES *attrs, HIDP_CAPS *caps, DIDEVICEINSTANCEW *instance, DWORD version ) { - BOOL has_accelerator, has_brake, has_clutch; + BOOL has_accelerator, has_brake, has_clutch, has_z, has_pov; PHIDP_PREPARSED_DATA preparsed_data = NULL; - DWORD type = 0, button_count = 0; + DWORD type, button_count = 0; HIDP_BUTTON_CAPS buttons[10]; HIDP_VALUE_CAPS value; HANDLE device_file; @@ -1433,10 +1433,14 @@ static BOOL hid_joystick_device_try_open( UINT32 handle, const WCHAR *path, HAND if (!HidD_GetAttributes( device_file, attrs )) goto failed; if (HidP_GetCaps( preparsed_data, caps ) != HIDP_STATUS_SUCCESS) goto failed; - if (caps->UsagePage == HID_USAGE_PAGE_GAME) FIXME( "game usage page not implemented!\n" ); - if (caps->UsagePage == HID_USAGE_PAGE_SIMULATION) FIXME( "simulation usage page not implemented!\n" ); - if (caps->UsagePage != HID_USAGE_PAGE_GENERIC) goto failed; - if (caps->Usage != HID_USAGE_GENERIC_GAMEPAD && caps->Usage != HID_USAGE_GENERIC_JOYSTICK) goto failed; + switch (MAKELONG( caps->Usage, caps->UsagePage )) + { + case MAKELONG( HID_USAGE_GENERIC_MOUSE, HID_USAGE_PAGE_GENERIC ): goto failed; + case MAKELONG( HID_USAGE_GENERIC_KEYBOARD, HID_USAGE_PAGE_GENERIC ): goto failed; + case MAKELONG( HID_USAGE_GENERIC_GAMEPAD, HID_USAGE_PAGE_GENERIC ): type = DI8DEVTYPE_GAMEPAD; break; + case MAKELONG( HID_USAGE_GENERIC_JOYSTICK, HID_USAGE_PAGE_GENERIC ): type = DI8DEVTYPE_JOYSTICK; break; + default: FIXME( "device usage %04x:%04x not implemented!\n", caps->UsagePage, caps->Usage); goto failed; + } if (!HidD_GetProductString( device_file, instance->tszInstanceName, MAX_PATH * sizeof(WCHAR) )) goto failed; if (!HidD_GetProductString( device_file, instance->tszProductName, MAX_PATH * sizeof(WCHAR) )) goto failed; @@ -1464,52 +1468,47 @@ static BOOL hid_joystick_device_try_open( UINT32 handle, const WCHAR *path, HAND else button_count += buttons[count].Range.UsageMax - buttons[count].Range.UsageMin + 1; } - switch (caps->Usage) - { - case HID_USAGE_GENERIC_GAMEPAD: - type = DI8DEVTYPE_GAMEPAD | DIDEVTYPE_HID; - if (button_count < 6) type |= DI8DEVTYPEGAMEPAD_LIMITED << 8; - else type |= DI8DEVTYPEGAMEPAD_STANDARD << 8; - break; - case HID_USAGE_GENERIC_JOYSTICK: - type = DI8DEVTYPE_JOYSTICK | DIDEVTYPE_HID; - if (button_count < 5) type |= DI8DEVTYPEJOYSTICK_LIMITED << 8; - else type |= DI8DEVTYPEJOYSTICK_STANDARD << 8; - - count = 1; - status = HidP_GetSpecificValueCaps( HidP_Input, HID_USAGE_PAGE_GENERIC, 0, - HID_USAGE_GENERIC_Z, &value, &count, preparsed_data ); - if (status != HIDP_STATUS_SUCCESS || !count) - type = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_LIMITED << 8) | DIDEVTYPE_HID; - - count = 1; - status = HidP_GetSpecificValueCaps( HidP_Input, HID_USAGE_PAGE_GENERIC, 0, - HID_USAGE_GENERIC_HATSWITCH, &value, &count, preparsed_data ); - if (status != HIDP_STATUS_SUCCESS || !count) - type = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_LIMITED << 8) | DIDEVTYPE_HID; - - break; - } - count = 1; status = HidP_GetSpecificValueCaps( HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_X, &value, &count, preparsed_data ); - if (status != HIDP_STATUS_SUCCESS || !count) - type = DI8DEVTYPE_SUPPLEMENTAL | (DI8DEVTYPESUPPLEMENTAL_UNKNOWN << 8) | DIDEVTYPE_HID; + if (status != HIDP_STATUS_SUCCESS || !count) type = DI8DEVTYPE_SUPPLEMENTAL; count = 1; status = HidP_GetSpecificValueCaps( HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_Y, &value, &count, preparsed_data ); - if (status != HIDP_STATUS_SUCCESS || !count) - type = DI8DEVTYPE_SUPPLEMENTAL | (DI8DEVTYPESUPPLEMENTAL_UNKNOWN << 8) | DIDEVTYPE_HID; + if (status != HIDP_STATUS_SUCCESS || !count) type = DI8DEVTYPE_SUPPLEMENTAL; count = 1; status = HidP_GetSpecificValueCaps( HidP_Input, HID_USAGE_PAGE_SIMULATION, 0, HID_USAGE_SIMULATION_STEERING, &value, &count, preparsed_data ); - if (status == HIDP_STATUS_SUCCESS && count) + if (status == HIDP_STATUS_SUCCESS && count) type = DI8DEVTYPE_DRIVING; + + switch (GET_DIDEVICE_TYPE(type)) { - type = DI8DEVTYPE_DRIVING | DIDEVTYPE_HID; + case DI8DEVTYPE_SUPPLEMENTAL: + type |= (DI8DEVTYPESUPPLEMENTAL_UNKNOWN << 8); + break; + case DI8DEVTYPE_GAMEPAD: + if (button_count < 6) type |= (DI8DEVTYPEGAMEPAD_LIMITED << 8); + else type |= (DI8DEVTYPEGAMEPAD_STANDARD << 8); + break; + case DI8DEVTYPE_JOYSTICK: + count = 1; + status = HidP_GetSpecificValueCaps( HidP_Input, HID_USAGE_PAGE_GENERIC, 0, + HID_USAGE_GENERIC_Z, &value, &count, preparsed_data ); + has_z = (status == HIDP_STATUS_SUCCESS && count); + count = 1; + status = HidP_GetSpecificValueCaps( HidP_Input, HID_USAGE_PAGE_GENERIC, 0, + HID_USAGE_GENERIC_HATSWITCH, &value, &count, preparsed_data ); + has_pov = (status == HIDP_STATUS_SUCCESS && count); + + if (button_count < 5 || !has_z || !has_pov) + type |= (DI8DEVTYPEJOYSTICK_LIMITED << 8); + else + type |= (DI8DEVTYPEJOYSTICK_STANDARD << 8); + break; + case DI8DEVTYPE_DRIVING: count = 1; status = HidP_GetSpecificValueCaps( HidP_Input, HID_USAGE_PAGE_SIMULATION, 0, HID_USAGE_SIMULATION_ACCELERATOR, &value, &count, preparsed_data ); @@ -1525,15 +1524,19 @@ static BOOL hid_joystick_device_try_open( UINT32 handle, const WCHAR *path, HAND &value, &count, preparsed_data ); has_clutch = (status == HIDP_STATUS_SUCCESS && count); - if (has_accelerator && has_brake && has_clutch) + if (button_count < 4) + type |= (DI8DEVTYPEDRIVING_LIMITED << 8); + else if (has_accelerator && has_brake && has_clutch) type |= (DI8DEVTYPEDRIVING_THREEPEDALS << 8); else if (has_accelerator && has_brake) type |= (DI8DEVTYPEDRIVING_DUALPEDALS << 8); else type |= (DI8DEVTYPEDRIVING_LIMITED << 8); + break; } - instance->dwDevType = device_type_for_version( type, version ); + instance->dwDevType = device_type_for_version( type, version ) | DIDEVTYPE_HID; + TRACE("detected device type %#lx\n", instance->dwDevType); *device = device_file; *preparsed = preparsed_data; diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c index 8899cbdfecf..2d801aacda2 100644 --- a/dlls/dinput/tests/joystick8.c +++ b/dlls/dinput/tests/joystick8.c @@ -2805,7 +2805,6 @@ static void test_driving_wheel_axes(void) todo_wine check_member_guid( devinst, expect_devinst, guidInstance ); check_member_guid( devinst, expect_devinst, guidProduct ); - todo_wine check_member( devinst, expect_devinst, "%#lx", dwDevType ); todo_wine check_member_wstr( devinst, expect_devinst, tszInstanceName ); @@ -2824,7 +2823,6 @@ static void test_driving_wheel_axes(void) ok( hr == DI_OK, "GetCapabilities returned %#lx\n", hr ); check_member( caps, expect_caps, "%lu", dwSize ); check_member( caps, expect_caps, "%#lx", dwFlags ); - todo_wine check_member( caps, expect_caps, "%#lx", dwDevType ); check_member( caps, expect_caps, "%lu", dwAxes ); check_member( caps, expect_caps, "%lu", dwButtons );
1
0
0
0
← Newer
1
...
92
93
94
95
96
97
98
...
114
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
Results per page:
10
25
50
100
200