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
June
May
April
March
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
January 2024
----- 2025 -----
June 2025
May 2025
April 2025
March 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
1 participants
711 discussions
Start a n
N
ew thread
Gabriel Ivăncescu : mshtml: Implement document.lastModified.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: wine Branch: master Commit: 1571c12129756e2fd35c80a7452d791e7edc8b65 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1571c12129756e2fd35c80a7452d79…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Jan 23 17:54:26 2024 +0200 mshtml: Implement document.lastModified. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmldoc.c | 10 ++++++++-- dlls/mshtml/tests/dom.js | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index e7eca058c23..4267b13ffab 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1086,8 +1086,14 @@ static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLoca static HRESULT WINAPI HTMLDocument_get_lastModified(IHTMLDocument2 *iface, BSTR *p) { HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString nsstr; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&nsstr, NULL); + nsres = nsIDOMDocument_GetLastModified(This->dom_document, &nsstr); + return return_nsstr(nsres, &nsstr, p); } static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v) diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index 0cbcb95e578..325cacf4823 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -339,6 +339,12 @@ sync_test("rects", function() { ok(rects.length === 0, "rect.length = " + rects.length); }); +sync_test("document_lastModified", function() { + // actually it seems to be rounded up from about ~250ms above a sec, but be more conservative with the check + var diff = Date.parse(document.lastModified) - performance.timing.navigationStart; + ok(diff > -1000 && diff < 1000, "lastModified too far from navigationStart: " + diff); +}); + sync_test("document_owner", function() { var node;
1
0
0
0
Alexandre Julliard : ntdll/tests: Update todos in context tests for new wow64 mode.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: wine Branch: master Commit: 5113e551396049d574bd3d246887dd4229188b88 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5113e551396049d574bd3d246887dd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 23 22:44:33 2024 +0100 ntdll/tests: Update todos in context tests for new wow64 mode. --- dlls/ntdll/tests/exception.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 5917196a0cf..a183980895a 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -1270,7 +1270,7 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) __asm__( "movw %%ss,%0" : "=r" (ss) ); ok( ctx.SegSs == ss, "wrong ss %04lx / %04x\n", ctx.SegSs, ss ); ok( ctx.SegFs != ctx.SegSs, "wrong fs %04lx / %04lx\n", ctx.SegFs, ctx.SegSs ); - if (is_wow64) todo_wine + if (is_wow64) todo_wine_if( !ctx.SegDs ) /* old wow64 */ { ok( ctx.SegDs == ctx.SegSs, "wrong ds %04lx / %04lx\n", ctx.SegDs, ctx.SegSs ); ok( ctx.SegEs == ctx.SegSs, "wrong es %04lx / %04lx\n", ctx.SegEs, ctx.SegSs ); @@ -4547,10 +4547,6 @@ static void test_wow64_context(void) ret = pNtGetContextThread( pi.hThread, &context ); ok(ret == STATUS_SUCCESS, "got %#lx\n", ret); ok( context.ContextFlags == CONTEXT_ALL, "got context flags %#lx\n", context.ContextFlags ); - todo_wine - ok( !context.Rax, "rax is not zero %Ix\n", context.Rax ); - todo_wine - ok( !context.Rbx, "rbx is not zero %Ix\n", context.Rbx ); ok( !context.Rsi, "rsi is not zero %Ix\n", context.Rsi ); ok( !context.Rdi, "rdi is not zero %Ix\n", context.Rdi ); ok( !context.Rbp, "rbp is not zero %Ix\n", context.Rbp ); @@ -4562,15 +4558,8 @@ static void test_wow64_context(void) ok( !context.R13, "r13 is not zero %Ix\n", context.R13 ); ok( !context.R14, "r14 is not zero %Ix\n", context.R14 ); ok( !context.R15, "r15 is not zero %Ix\n", context.R15 ); - todo_wine - ok( ((ULONG_PTR)context.Rsp & ~0xfff) == ((ULONG_PTR)teb.Tib.StackBase & ~0xfff), - "rsp is not at top of stack %p / %p\n", (void *)context.Rsp, teb.Tib.StackBase ); - todo_wine - ok( context.EFlags == 0x200, "wrong flags %08lx\n", context.EFlags ); ok( context.MxCsr == 0x1f80, "wrong mxcsr %08lx\n", context.MxCsr ); ok( context.FltSave.ControlWord == 0x27f, "wrong control %08x\n", context.FltSave.ControlWord ); - todo_wine - ok( context.SegCs != ctx.SegCs, "wrong cs %04x\n", context.SegCs ); ok( context.SegDs == ctx.SegDs, "wrong ds %04x / %04lx\n", context.SegDs, ctx.SegDs ); ok( context.SegEs == ctx.SegEs, "wrong es %04x / %04lx\n", context.SegEs, ctx.SegEs ); ok( context.SegFs == ctx.SegFs, "wrong fs %04x / %04lx\n", context.SegFs, ctx.SegFs ); @@ -4585,6 +4574,12 @@ static void test_wow64_context(void) goto done; } + ok( !context.Rax, "rax is not zero %Ix\n", context.Rax ); + ok( !context.Rbx, "rbx is not zero %Ix\n", context.Rbx ); + ok( ((ULONG_PTR)context.Rsp & ~0xfff) == ((ULONG_PTR)teb.Tib.StackBase & ~0xfff), + "rsp is not at top of stack %p / %p\n", (void *)context.Rsp, teb.Tib.StackBase ); + ok( context.EFlags == 0x200, "wrong flags %08lx\n", context.EFlags ); + for (i = 0, got32 = got64 = FALSE; i < 10000 && !(got32 && got64); i++) { ResumeThread( pi.hThread ); @@ -4661,21 +4656,23 @@ static void test_wow64_context(void) memset( &ctx, 0x55, sizeof(ctx) ); ctx.ContextFlags = WOW64_CONTEXT_ALL; pRtlWow64GetThreadContext( pi.hThread, &ctx ); - ok( ctx.Ecx == 0x87654321, "cs64: ecx set to %08lx\n", ctx.Ecx ); + todo_wine + ok( ctx.Ecx == 0x87654321, "cs32: ecx set to %08lx\n", ctx.Ecx ); ReadProcessMemory( pi.hProcess, teb.TlsSlots[WOW64_TLS_CPURESERVED], cpu, cpu_size, &res ); - ok( ctx_ptr->Ecx == ecx, "cs64: ecx set to %08lx\n", ctx_ptr->Ecx ); + ok( ctx_ptr->Ecx == ecx, "cs32: ecx set to %08lx\n", ctx_ptr->Ecx ); ctx.Ecx = 0x33334444; pRtlWow64SetThreadContext( pi.hThread, &ctx ); memset( &ctx, 0x55, sizeof(ctx) ); ctx.ContextFlags = WOW64_CONTEXT_ALL; pRtlWow64GetThreadContext( pi.hThread, &ctx ); - ok( ctx.Ecx == 0x33334444, "cs64: ecx set to %08lx\n", ctx.Ecx ); + ok( ctx.Ecx == 0x33334444, "cs32: ecx set to %08lx\n", ctx.Ecx ); ReadProcessMemory( pi.hProcess, teb.TlsSlots[WOW64_TLS_CPURESERVED], cpu, cpu_size, &res ); - ok( ctx_ptr->Ecx == ecx, "cs64: ecx set to %08lx\n", ctx_ptr->Ecx ); + ok( ctx_ptr->Ecx == ecx, "cs32: ecx set to %08lx\n", ctx_ptr->Ecx ); memset( &context, 0x55, sizeof(context) ); context.ContextFlags = CONTEXT_ALL; pNtGetContextThread( pi.hThread, &context ); - ok( context.Rcx == 0x33334444, "cs64: rcx set to %p\n", (void *)context.Rcx ); + todo_wine + ok( context.Rcx == 0x33334444, "cs32: rcx set to %p\n", (void *)context.Rcx ); /* restore everything */ context.Rcx = rcx; pNtSetContextThread( pi.hThread, &context ); @@ -4738,6 +4735,7 @@ static void test_wow64_context(void) pRtlWow64GetThreadContext( pi.hThread, &ctx ); ok( ctx.Ecx == 0x22223333, "cs64: ecx set to %08lx\n", ctx.Ecx ); ReadProcessMemory( pi.hProcess, teb.TlsSlots[WOW64_TLS_CPURESERVED], cpu, cpu_size, &res ); + todo_wine ok( ctx_ptr->Ecx == 0x22223333, "cs64: ecx set to %08lx\n", ctx_ptr->Ecx ); memset( &context, 0x55, sizeof(context) ); context.ContextFlags = CONTEXT_ALL;
1
0
0
0
Alexandre Julliard : ntdll: Use a .seh handler for the process breakpoint.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: wine Branch: master Commit: 6085ab882240fe210d5749eff1d289a44e9245ff URL:
https://gitlab.winehq.org/wine/wine/-/commit/6085ab882240fe210d5749eff1d289…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 23 15:55:47 2024 +0100 ntdll: Use a .seh handler for the process breakpoint. --- dlls/ntdll/signal_arm.c | 14 ++++++++++++++ dlls/ntdll/signal_arm64.c | 24 +++++++++++------------- dlls/ntdll/signal_arm64ec.c | 24 +++++++++++------------- dlls/ntdll/signal_x86_64.c | 12 ++++++++++++ 4 files changed, 48 insertions(+), 26 deletions(-) diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 0ce63932919..17a2b8caa08 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -1619,6 +1619,19 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unk2, ULONG_PTR unk3 /*********************************************************************** * process_breakpoint */ +#ifdef __WINE_PE_BUILD +__ASM_GLOBAL_FUNC( process_breakpoint, + ".seh_endprologue\n\t" + ".seh_handler process_breakpoint_handler, %except\n\t" + "udf #0xfe\n\t" + "bx lr\n" + "process_breakpoint_handler:\n\t" + "ldr r0, [r2, #0x40]\n\t" /* context->Pc */ + "add r0, r0, #2\n\t" + "str r0, [r2, #0x40]\n\t" + "mov r0, #0\n\t" /* ExceptionContinueExecution */ + "bx lr" ) +#else void WINAPI process_breakpoint(void) { __TRY @@ -1631,6 +1644,7 @@ void WINAPI process_breakpoint(void) } __ENDTRY } +#endif /********************************************************************** * DbgBreakPoint (NTDLL.@) diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 34cbffbd3cc..2cf7e5fd855 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -1589,19 +1589,17 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unk2, ULONG_PTR unk3 /*********************************************************************** * process_breakpoint */ -void WINAPI process_breakpoint(void) -{ - __TRY - { - DbgBreakPoint(); - } - __EXCEPT_ALL - { - /* do nothing */ - } - __ENDTRY -} - +__ASM_GLOBAL_FUNC( process_breakpoint, + ".seh_endprologue\n\t" + ".seh_handler process_breakpoint_handler, @except\n\t" + "brk #0xf000\n\t" + "ret\n" + "process_breakpoint_handler:\n\t" + "ldr x4, [x2, #0x108]\n\t" /* context->Pc */ + "add x4, x4, #4\n\t" + "str x4, [x2, #0x108]\n\t" + "mov w0, #0\n\t" /* ExceptionContinueExecution */ + "ret" ) /********************************************************************** * DbgBreakPoint (NTDLL.@) diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index f45381c89c0..97507d34c4f 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -2004,19 +2004,17 @@ void WINAPI LdrInitializeThunk( CONTEXT *arm_context, ULONG_PTR unk2, ULONG_PTR /*********************************************************************** * process_breakpoint */ -void WINAPI process_breakpoint(void) -{ - __TRY - { - DbgBreakPoint(); - } - __EXCEPT_ALL - { - /* do nothing */ - } - __ENDTRY -} - +__ASM_GLOBAL_FUNC( "#process_breakpoint", + ".seh_endprologue\n\t" + ".seh_handler process_breakpoint_handler, @except\n\t" + "brk #0xf000\n\t" + "ret\n" + "process_breakpoint_handler:\n\t" + "ldr x4, [x2, #0x108]\n\t" /* context->Pc */ + "add x4, x4, #4\n\t" + "str x4, [x2, #0x108]\n\t" + "mov w0, #0\n\t" /* ExceptionContinueExecution */ + "ret" ) /********************************************************************** * DbgBreakPoint (NTDLL.@) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index fbab26a7bf4..1344b89a9ca 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -1728,6 +1728,17 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unk2, ULONG_PTR unk3 /*********************************************************************** * process_breakpoint */ +#ifdef __WINE_PE_BUILD +__ASM_GLOBAL_FUNC( process_breakpoint, + ".seh_endprologue\n\t" + ".seh_handler process_breakpoint_handler, @except\n\t" + "int $3\n\t" + "ret\n" + "process_breakpoint_handler:\n\t" + "incq 0xf8(%r8)\n\t" /* context->Rip */ + "xorl %eax,%eax\n\t" /* ExceptionContinueExecution */ + "ret" ) +#else void WINAPI process_breakpoint(void) { __TRY @@ -1740,6 +1751,7 @@ void WINAPI process_breakpoint(void) } __ENDTRY } +#endif /**********************************************************************
1
0
0
0
Alexandre Julliard : ntdll: Move the process breakpoint to the CPU backends.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: wine Branch: master Commit: 1414adfa4644f2cb3b0754aa6a4a54274a9c0310 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1414adfa4644f2cb3b0754aa6a4a54…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 23 15:53:58 2024 +0100 ntdll: Move the process breakpoint to the CPU backends. --- dlls/ntdll/loader.c | 30 ++++-------------------------- dlls/ntdll/ntdll_misc.h | 1 + dlls/ntdll/process.c | 13 +------------ dlls/ntdll/signal_arm.c | 16 ++++++++++++++++ dlls/ntdll/signal_arm64.c | 18 ++++++++++++++++++ dlls/ntdll/signal_arm64ec.c | 17 +++++++++++++++++ dlls/ntdll/signal_i386.c | 17 +++++++++++++++++ dlls/ntdll/signal_x86_64.c | 17 +++++++++++++++++ 8 files changed, 91 insertions(+), 38 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 59624bc70f8..021f7941969 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -4076,30 +4076,6 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) return ret; } -/*********************************************************************** - * process_breakpoint - * - * Trigger a debug breakpoint if the process is being debugged. - */ -static void process_breakpoint(void) -{ - DWORD_PTR port = 0; - - NtQueryInformationProcess( GetCurrentProcess(), ProcessDebugPort, &port, sizeof(port), NULL ); - if (!port) return; - - __TRY - { - DbgBreakPoint(); - } - __EXCEPT_ALL - { - /* do nothing */ - } - __ENDTRY -} - - /*********************************************************************** * load_global_options */ @@ -4270,7 +4246,7 @@ void loader_init( CONTEXT *context, void **entry ) { static int attach_done; NTSTATUS status; - ULONG_PTR cookie; + ULONG_PTR cookie, port = 0; WINE_MODREF *wm; if (process_detaching) NtTerminateThread( GetCurrentThread(), 0 ); @@ -4380,7 +4356,9 @@ void loader_init( CONTEXT *context, void **entry ) release_address_space(); if (wm->ldr.TlsIndex == -1) call_tls_callbacks( wm->ldr.DllBase, DLL_PROCESS_ATTACH ); if (wm->ldr.ActivationContext) RtlDeactivateActivationContext( 0, cookie ); - process_breakpoint(); + + NtQueryInformationProcess( GetCurrentProcess(), ProcessDebugPort, &port, sizeof(port), NULL ); + if (port) process_breakpoint(); } else { diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index da49c14e682..299363d7363 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -54,6 +54,7 @@ extern EXCEPTION_DISPOSITION WINAPI user_callback_handler( EXCEPTION_RECORD *rec CONTEXT *context, void *dispatch ); extern void DECLSPEC_NORETURN raise_status( NTSTATUS status, EXCEPTION_RECORD *rec ); extern LONG WINAPI call_unhandled_exception_filter( PEXCEPTION_POINTERS eptr ); +extern void WINAPI process_breakpoint(void); extern void WINAPI LdrInitializeThunk(CONTEXT*,ULONG_PTR,ULONG_PTR,ULONG_PTR); extern NTSTATUS WINAPI KiUserExceptionDispatcher(EXCEPTION_RECORD*,CONTEXT*); diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index 02e31ea7f4b..87090781bbd 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -708,18 +708,7 @@ NTSTATUS WINAPI DbgUiConvertStateChangeStructure( DBGUI_WAIT_STATE_CHANGE *state void WINAPI DbgUiRemoteBreakin( void *arg ) { TRACE( "\n" ); - if (NtCurrentTeb()->Peb->BeingDebugged) - { - __TRY - { - DbgBreakPoint(); - } - __EXCEPT_ALL - { - /* do nothing */ - } - __ENDTRY - } + if (NtCurrentTeb()->Peb->BeingDebugged) process_breakpoint(); RtlExitUserThread( STATUS_SUCCESS ); } diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 428742b116b..0ce63932919 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -1616,6 +1616,22 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unk2, ULONG_PTR unk3 NtContinue( context, TRUE ); } +/*********************************************************************** + * process_breakpoint + */ +void WINAPI process_breakpoint(void) +{ + __TRY + { + DbgBreakPoint(); + } + __EXCEPT_ALL + { + /* do nothing */ + } + __ENDTRY +} + /********************************************************************** * DbgBreakPoint (NTDLL.@) */ diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 2d150528610..34cbffbd3cc 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -1585,6 +1585,24 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unk2, ULONG_PTR unk3 NtContinue( context, TRUE ); } + +/*********************************************************************** + * process_breakpoint + */ +void WINAPI process_breakpoint(void) +{ + __TRY + { + DbgBreakPoint(); + } + __EXCEPT_ALL + { + /* do nothing */ + } + __ENDTRY +} + + /********************************************************************** * DbgBreakPoint (NTDLL.@) */ diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index a54a5eeaceb..f45381c89c0 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -2001,6 +2001,23 @@ void WINAPI LdrInitializeThunk( CONTEXT *arm_context, ULONG_PTR unk2, ULONG_PTR } +/*********************************************************************** + * process_breakpoint + */ +void WINAPI process_breakpoint(void) +{ + __TRY + { + DbgBreakPoint(); + } + __EXCEPT_ALL + { + /* do nothing */ + } + __ENDTRY +} + + /********************************************************************** * DbgBreakPoint (NTDLL.@) */ diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 865faa93ea9..95efec5122c 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -629,6 +629,23 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unk2, ULONG_PTR unk3 } +/*********************************************************************** + * process_breakpoint + */ +void WINAPI process_breakpoint(void) +{ + __TRY + { + DbgBreakPoint(); + } + __EXCEPT_ALL + { + /* do nothing */ + } + __ENDTRY +} + + /********************************************************************** * DbgBreakPoint (NTDLL.@) */ diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index b253c0b4f17..fbab26a7bf4 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -1725,6 +1725,23 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unk2, ULONG_PTR unk3 } +/*********************************************************************** + * process_breakpoint + */ +void WINAPI process_breakpoint(void) +{ + __TRY + { + DbgBreakPoint(); + } + __EXCEPT_ALL + { + /* do nothing */ + } + __ENDTRY +} + + /********************************************************************** * DbgBreakPoint (NTDLL.@) */
1
0
0
0
Brendan McGrath : gdi32: Ignore Datatype when StartDoc is called.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: wine Branch: master Commit: 9b02ac6d42d4aea5300e228c799b329d505088fb URL:
https://gitlab.winehq.org/wine/wine/-/commit/9b02ac6d42d4aea5300e228c799b32…
Author: Brendan McGrath <bmcgrath(a)codeweavers.com> Date: Thu Jan 18 12:43:28 2024 +1100 gdi32: Ignore Datatype when StartDoc is called. --- dlls/gdi32/dc.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index 5f79150cb93..87335469b9b 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -2444,8 +2444,8 @@ INT WINAPI StartDocW( HDC hdc, const DOCINFOW *doc ) info.cbSize = sizeof(info); } - TRACE("DocName %s, Output %s, Datatype %s, fwType %#lx\n", - debugstr_w(info.lpszDocName), debugstr_w(info.lpszOutput), + TRACE("Size: %d, DocName %s, Output %s, Datatype %s, fwType %#lx\n", + info.cbSize, debugstr_w(info.lpszDocName), debugstr_w(info.lpszOutput), debugstr_w(info.lpszDatatype), info.fwType); if (!(dc_attr = get_dc_attr( hdc ))) return SP_ERROR; @@ -2461,22 +2461,22 @@ INT WINAPI StartDocW( HDC hdc, const DOCINFOW *doc ) output = StartDocDlgW( print->printer, &info ); if (output) info.lpszOutput = output; - if (!info.lpszDatatype || !wcsicmp(info.lpszDatatype, L"EMF")) + if (info.lpszDatatype && wcsicmp(info.lpszDatatype, L"EMF")) + FIXME("Ignoring DataType %s and forcing EMF\n", debugstr_w(info.lpszDatatype)); + + spool_info.pDocName = (WCHAR *)info.lpszDocName; + spool_info.pOutputFile = (WCHAR *)info.lpszOutput; + spool_info.pDatatype = (WCHAR *)L"NT EMF 1.003"; + if ((ret = StartDocPrinterW( print->printer, 1, (BYTE *)&spool_info ))) { - spool_info.pDocName = (WCHAR *)info.lpszDocName; - spool_info.pOutputFile = (WCHAR *)info.lpszOutput; - spool_info.pDatatype = (WCHAR *)L"NT EMF 1.003"; - if ((ret = StartDocPrinterW( print->printer, 1, (BYTE *)&spool_info ))) + if (!spool_start_doc( dc_attr, print->printer, &info )) { - if (!spool_start_doc( dc_attr, print->printer, &info )) - { - AbortDoc( hdc ); - ret = 0; - } - HeapFree( GetProcessHeap(), 0, output ); - print->flags |= CALL_START_PAGE; - return ret; + AbortDoc( hdc ); + ret = 0; } + HeapFree( GetProcessHeap(), 0, output ); + print->flags |= CALL_START_PAGE; + return ret; } }
1
0
0
0
Martin Storsjö : ntdll: Fix KiUserCallbackDispatcher on arm.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: wine Branch: master Commit: f6b66e4f87649740f91805f11277fb3c4d172e94 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f6b66e4f87649740f91805f11277fb…
Author: Martin Storsjö <martin(a)martin.st> Date: Tue Jan 23 15:21:20 2024 +0200 ntdll: Fix KiUserCallbackDispatcher on arm. This was broken in 78c2b7dfe2f2d5d76400564be547fd8287d62d67. Signed-off-by: Martin Storsjö <martin(a)martin.st> --- dlls/ntdll/signal_arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 78db61fc764..428742b116b 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -592,7 +592,7 @@ __ASM_GLOBAL_FUNC( KiUserCallbackDispatcher, "mrc p15, 0, r3, c13, c0, 2\n\t" /* NtCurrentTeb() */ "ldr r3, [r3, 0x30]\n\t" /* peb */ "ldr r3, [r3, 0x2c]\n\t" /* peb->KernelCallbackTable */ - "ldr ip, [r3, r2, lsl #3]\n\t" + "ldr ip, [r3, r2, lsl #2]\n\t" "blx ip\n\t" ".seh_handler " __ASM_NAME("user_callback_handler") ", %except\n\t" #else
1
0
0
0
Rémi Bernon : dinput/tests: Add a test with a virtual HID touch screen.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: wine Branch: master Commit: 4f95ad1ad13062452bac2423e0840c0d2ab1844d URL:
https://gitlab.winehq.org/wine/wine/-/commit/4f95ad1ad13062452bac2423e0840c…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jan 16 18:01:32 2023 +0100 dinput/tests: Add a test with a virtual HID touch screen. --- dlls/dinput/tests/device8.c | 270 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 270 insertions(+)
1
0
0
0
Rémi Bernon : include: Add more HID digitizer usage definitions.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: wine Branch: master Commit: aaf34e3f7e34be54e5645de97f8318071a620ded URL:
https://gitlab.winehq.org/wine/wine/-/commit/aaf34e3f7e34be54e5645de97f8318…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue May 31 22:07:02 2022 +0200 include: Add more HID digitizer usage definitions. --- include/hidusage.h | 2 ++ include/wine/hid.h | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/hidusage.h b/include/hidusage.h index 2ea3784d626..58ae5aab3e6 100644 --- a/include/hidusage.h +++ b/include/hidusage.h @@ -31,6 +31,7 @@ typedef USHORT USAGE, *PUSAGE; #define HID_USAGE_DIGITIZER_PEN ((USAGE) 0x02) #define HID_USAGE_DIGITIZER_TOUCH_SCREEN ((USAGE) 0x04) #define HID_USAGE_DIGITIZER_TOUCH_PAD ((USAGE) 0x05) +#define HID_USAGE_DIGITIZER_FINGER ((USAGE) 0x22) #define HID_USAGE_DIGITIZER_TIP_PRESSURE ((USAGE) 0x30) #define HID_USAGE_DIGITIZER_IN_RANGE ((USAGE) 0x32) #define HID_USAGE_DIGITIZER_X_TILT ((USAGE) 0x3D) @@ -38,6 +39,7 @@ typedef USHORT USAGE, *PUSAGE; #define HID_USAGE_DIGITIZER_AZIMUTH ((USAGE) 0x3F) #define HID_USAGE_DIGITIZER_TIP_SWITCH ((USAGE) 0x42) #define HID_USAGE_DIGITIZER_BARREL_SWITCH ((USAGE) 0x44) +#define HID_USAGE_DIGITIZER_CONFIDENCE ((USAGE) 0x47) #define HID_USAGE_GENERIC_POINTER ((USAGE) 0x01) #define HID_USAGE_GENERIC_MOUSE ((USAGE) 0x02) diff --git a/include/wine/hid.h b/include/wine/hid.h index 6a92317551f..8200ca9beec 100644 --- a/include/wine/hid.h +++ b/include/wine/hid.h @@ -117,6 +117,18 @@ struct hid_preparsed_data #define HID_FEATURE_VALUE_CAPS(d) ((d)->value_caps + (d)->feature_caps_start) #define HID_COLLECTION_NODES(d) (struct hid_collection_node *)((char *)(d)->value_caps + (d)->caps_size) + +/* Wine-specific Digitizer page usages, not declared in hidusage.h */ +/* From HID Usage Tables */ +/*
https://usb.org/sites/default/files/hut1_22.pdf
*/ +#define HID_USAGE_DIGITIZER_WIDTH ((USAGE) 0x48) +#define HID_USAGE_DIGITIZER_HEIGHT ((USAGE) 0x49) +#define HID_USAGE_DIGITIZER_CONTACT_ID ((USAGE) 0x51) +#define HID_USAGE_DIGITIZER_CONTACT_COUNT ((USAGE) 0x54) +#define HID_USAGE_DIGITIZER_CONTACT_COUNT_MAX ((USAGE) 0x55) +#define HID_USAGE_DIGITIZER_SCAN_TIME ((USAGE) 0x56) + + /* Wine-specific Physical Interface Device usages */ /* From USB Device Class Definition for Physical Interface Devices */ /*
https://www.usb.org/sites/default/files/documents/pid1_01.pdf
*/
1
0
0
0
Rémi Bernon : dinput/tests: Add a test with a virtual HID keyboard.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: wine Branch: master Commit: abee0d45021f1be3626c1c2d91fb48284b0ea272 URL:
https://gitlab.winehq.org/wine/wine/-/commit/abee0d45021f1be3626c1c2d91fb48…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri May 19 17:37:41 2023 +0200 dinput/tests: Add a test with a virtual HID keyboard. --- dlls/dinput/tests/device8.c | 148 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) diff --git a/dlls/dinput/tests/device8.c b/dlls/dinput/tests/device8.c index e3cd75f7c08..594a34222ce 100644 --- a/dlls/dinput/tests/device8.c +++ b/dlls/dinput/tests/device8.c @@ -2488,6 +2488,153 @@ static void test_sys_keyboard_action_format(void) ok( ref == 0, "Release returned %ld\n", ref ); } +static UINT key_down_count; +static UINT key_up_count; + +static LRESULT CALLBACK keyboard_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) +{ + BOOL us_kbd = (GetKeyboardLayout(0) == (HKL)(ULONG_PTR)0x04090409); + + if (msg == WM_KEYDOWN) + { + key_down_count++; + if (us_kbd) ok( wparam == 'A', "got wparam %#Ix\n", wparam ); + ok( lparam == 0x1e0001, "got lparam %#Ix\n", lparam ); + } + if (msg == WM_KEYUP) + { + key_up_count++; + if (us_kbd) ok( wparam == 'A', "got wparam %#Ix\n", wparam ); + ok( lparam == 0xc01e0001, "got lparam %#Ix\n", lparam ); + } + return DefWindowProcA( hwnd, msg, wparam, lparam ); +} + +static void test_hid_keyboard(void) +{ +#include "psh_hid_macros.h" + const unsigned char report_desc[] = + { + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_KEYBOARD), + COLLECTION(1, Application), + USAGE(1, HID_USAGE_GENERIC_KEYBOARD), + COLLECTION(1, Physical), + REPORT_ID(1, 1), + + USAGE_PAGE(1, HID_USAGE_PAGE_KEYBOARD), + USAGE_MINIMUM(1, HID_USAGE_KEYBOARD_aA), + USAGE_MAXIMUM(1, HID_USAGE_KEYBOARD_zZ), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(1, 1), + REPORT_SIZE(1, 1), + REPORT_COUNT(1, 32), + INPUT(1, Data|Var|Abs), + END_COLLECTION, + END_COLLECTION, + }; + C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN); +#include "pop_hid_macros.h" + + const HID_DEVICE_ATTRIBUTES attributes = + { + .Size = sizeof(HID_DEVICE_ATTRIBUTES), + .VendorID = LOWORD(EXPECT_VIDPID), + .ProductID = 0x0003, + .VersionNumber = 0x0100, + }; + struct hid_device_desc desc = + { + .caps = { .InputReportByteLength = 5 }, + .attributes = attributes, + .use_report_id = 1, + }; + struct hid_expect key_press_release[] = + { + { + .code = IOCTL_HID_READ_REPORT, + .report_buf = {1,0x01,0x00,0x00,0x00}, + }, + { + .code = IOCTL_HID_READ_REPORT, + .report_buf = {1,0x00,0x00,0x00,0x00}, + }, + }; + + WCHAR device_path[MAX_PATH]; + HANDLE file; + DWORD res; + HWND hwnd; + BOOL ret; + + winetest_push_context( "keyboard" ); + + desc.report_descriptor_len = sizeof(report_desc); + memcpy( desc.report_descriptor_buf, report_desc, sizeof(report_desc) ); + fill_context( desc.context, ARRAY_SIZE(desc.context) ); + + if (!hid_device_start_( &desc, 1, 5000 /* needs a long timeout on Win7 */ )) goto done; + + swprintf( device_path, MAX_PATH, L"\\\\?\\hid#vid_%04x&pid_%04x", desc.attributes.VendorID, + desc.attributes.ProductID ); + ret = find_hid_device_path( device_path ); + ok( ret, "Failed to find HID device matching %s\n", debugstr_w( device_path ) ); + + + /* windows doesn't let us open HID keyboard devices */ + + file = CreateFileW( device_path, FILE_READ_ACCESS | FILE_WRITE_ACCESS, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL ); + todo_wine + ok( file == INVALID_HANDLE_VALUE, "CreateFileW succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_ACCESS_DENIED, "got error %lu\n", GetLastError() ); + CloseHandle( file ); + + file = CreateFileW( L"\\\\?\\root#winetest#0#{deadbeef-29ef-4538-a5fd-b69573a362c0}", 0, 0, + NULL, OPEN_EXISTING, 0, NULL ); + ok( file != INVALID_HANDLE_VALUE, "CreateFile failed, error %lu\n", GetLastError() ); + + + /* check basic keyboard input injection to window message */ + + hwnd = create_foreground_window( FALSE ); + SetWindowLongPtrW( hwnd, GWLP_WNDPROC, (LONG_PTR)keyboard_wndproc ); + + key_down_count = 0; + key_up_count = 0; + bus_send_hid_input( file, &desc, &key_press_release[0], sizeof(key_press_release[0]) ); + + res = MsgWaitForMultipleObjects( 0, NULL, FALSE, 500, QS_KEY ); + todo_wine + ok( !res, "MsgWaitForMultipleObjects returned %#lx\n", res ); + msg_wait_for_events( 0, NULL, 5 ); /* process pending messages */ + todo_wine + ok( key_down_count == 1, "got key_down_count %u\n", key_down_count ); + ok( key_up_count == 0, "got key_up_count %u\n", key_up_count ); + + bus_send_hid_input( file, &desc, &key_press_release[1], sizeof(key_press_release[1]) ); + + res = MsgWaitForMultipleObjects( 0, NULL, FALSE, 500, QS_KEY ); + todo_wine + ok( !res, "MsgWaitForMultipleObjects returned %#lx\n", res ); + msg_wait_for_events( 0, NULL, 5 ); /* process pending messages */ + todo_wine + ok( key_down_count == 1, "got key_down_count %u\n", key_down_count ); + todo_wine + ok( key_up_count == 1, "got key_up_count %u\n", key_up_count ); + + DestroyWindow( hwnd ); + + + CloseHandle( file ); + +done: + hid_device_stop( &desc, 1 ); + + winetest_pop_context(); +} + START_TEST(device8) { dinput_test_init(); @@ -2517,6 +2664,7 @@ START_TEST(device8) if (!bus_device_start()) goto done; test_hid_mouse(); + test_hid_keyboard(); done: bus_device_stop();
1
0
0
0
Rémi Bernon : dinput/tests: Add a test with a virtual HID mouse.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: wine Branch: master Commit: e2f2f680d464a7d7d48b3c3be1d32e3ea1b2d541 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e2f2f680d464a7d7d48b3c3be1d32e…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Jun 2 13:30:25 2022 +0200 dinput/tests: Add a test with a virtual HID mouse. --- dlls/dinput/tests/device8.c | 149 ++++++++++++++++++++++++++++++++++++++++ dlls/dinput/tests/dinput_test.h | 4 +- dlls/dinput/tests/hid.c | 6 +- 3 files changed, 155 insertions(+), 4 deletions(-) diff --git a/dlls/dinput/tests/device8.c b/dlls/dinput/tests/device8.c index 7423d6c6ae7..e3cd75f7c08 100644 --- a/dlls/dinput/tests/device8.c +++ b/dlls/dinput/tests/device8.c @@ -1618,6 +1618,149 @@ cleanup: localized = old_localized; } +static UINT mouse_move_count; + +static LRESULT CALLBACK mouse_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) +{ + if (msg == WM_MOUSEMOVE) + { + ok( wparam == 0, "got wparam %#Ix\n", wparam ); + ok( LOWORD(lparam) - 107 <= 2, "got LOWORD(lparam) %u\n", LOWORD(lparam) ); + ok( HIWORD(lparam) - 107 <= 2, "got HIWORD(lparam) %u\n", HIWORD(lparam) ); + mouse_move_count++; + } + return DefWindowProcA( hwnd, msg, wparam, lparam ); +} + +static void test_hid_mouse(void) +{ +#include "psh_hid_macros.h" + const unsigned char report_desc[] = + { + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_MOUSE), + COLLECTION(1, Application), + USAGE(1, HID_USAGE_GENERIC_POINTER), + COLLECTION(1, Physical), + REPORT_ID(1, 1), + + USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON), + USAGE_MINIMUM(1, 1), + USAGE_MAXIMUM(1, 2), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(1, 1), + REPORT_SIZE(1, 1), + REPORT_COUNT(1, 8), + INPUT(1, Data|Var|Abs), + + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_X), + USAGE(1, HID_USAGE_GENERIC_Y), + REPORT_SIZE(1, 16), + REPORT_COUNT(1, 2), + LOGICAL_MINIMUM(2, -10), + LOGICAL_MAXIMUM(2, +10), + INPUT(1, Data|Var|Rel), + END_COLLECTION, + END_COLLECTION, + }; + C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN); +#include "pop_hid_macros.h" + + const HID_DEVICE_ATTRIBUTES attributes = + { + .Size = sizeof(HID_DEVICE_ATTRIBUTES), + .VendorID = LOWORD(EXPECT_VIDPID), + .ProductID = 0x0002, + .VersionNumber = 0x0100, + }; + struct hid_device_desc desc = + { + .caps = { .InputReportByteLength = 6 }, + .attributes = attributes, + .use_report_id = 1, + }; + struct hid_expect single_move[] = + { + { + .code = IOCTL_HID_READ_REPORT, + .report_buf = {1,0x00,0x08,0x00,0x08,0x00}, + }, + }; + + WCHAR device_path[MAX_PATH]; + HANDLE file; + POINT pos; + DWORD res; + HWND hwnd; + BOOL ret; + + winetest_push_context( "mouse "); + + desc.report_descriptor_len = sizeof(report_desc); + memcpy( desc.report_descriptor_buf, report_desc, sizeof(report_desc) ); + fill_context( desc.context, ARRAY_SIZE(desc.context) ); + + if (!hid_device_start_( &desc, 1, 5000 /* needs a long timeout on Win7 */ )) goto done; + + swprintf( device_path, MAX_PATH, L"\\\\?\\hid#vid_%04x&pid_%04x", desc.attributes.VendorID, + desc.attributes.ProductID ); + ret = find_hid_device_path( device_path ); + ok( ret, "Failed to find HID device matching %s\n", debugstr_w( device_path ) ); + + + /* windows doesn't let us open HID mouse devices */ + + file = CreateFileW( device_path, FILE_READ_ACCESS | FILE_WRITE_ACCESS, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL ); + todo_wine + ok( file == INVALID_HANDLE_VALUE, "CreateFileW succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_ACCESS_DENIED, "got error %lu\n", GetLastError() ); + CloseHandle( file ); + + file = CreateFileW( L"\\\\?\\root#winetest#0#{deadbeef-29ef-4538-a5fd-b69573a362c0}", 0, 0, + NULL, OPEN_EXISTING, 0, NULL ); + ok( file != INVALID_HANDLE_VALUE, "CreateFile failed, error %lu\n", GetLastError() ); + + + /* check basic mouse input injection to window message */ + + SetCursorPos( 100, 100 ); + hwnd = create_foreground_window( TRUE ); + SetWindowLongPtrW( hwnd, GWLP_WNDPROC, (LONG_PTR)mouse_wndproc ); + + GetCursorPos( &pos ); + ok( pos.x == 100, "got x %lu\n", pos.x ); + ok( pos.y == 100, "got y %lu\n", pos.y ); + + mouse_move_count = 0; + bus_send_hid_input( file, &desc, single_move, sizeof(single_move) ); + + res = MsgWaitForMultipleObjects( 0, NULL, FALSE, 500, QS_MOUSEMOVE ); + todo_wine + ok( !res, "MsgWaitForMultipleObjects returned %#lx\n", res ); + msg_wait_for_events( 0, NULL, 5 ); /* process pending messages */ + todo_wine + ok( mouse_move_count == 1, "got mouse_move_count %u\n", mouse_move_count ); + + GetCursorPos( &pos ); + todo_wine + ok( (ULONG)pos.x - 107 <= 2, "got x %lu\n", pos.x ); + todo_wine + ok( (ULONG)pos.y - 107 <= 2, "got y %lu\n", pos.y ); + + DestroyWindow( hwnd ); + + + CloseHandle( file ); + +done: + hid_device_stop( &desc, 1 ); + + winetest_pop_context(); +} + static void test_dik_codes( IDirectInputDevice8W *device, HANDLE event, HWND hwnd, DWORD version ) { static const struct key2dik @@ -2371,5 +2514,11 @@ START_TEST(device8) test_keyboard_events(); test_appdata_property(); + if (!bus_device_start()) goto done; + + test_hid_mouse(); + +done: + bus_device_stop(); dinput_test_exit(); } diff --git a/dlls/dinput/tests/dinput_test.h b/dlls/dinput/tests/dinput_test.h index b53978bbe97..e13ba2421d2 100644 --- a/dlls/dinput/tests/dinput_test.h +++ b/dlls/dinput/tests/dinput_test.h @@ -51,11 +51,13 @@ extern const WCHAR expect_path_end[]; extern HINSTANCE instance; extern BOOL localized; /* object names get translated */ -BOOL hid_device_start( struct hid_device_desc *desc, UINT count ); +#define hid_device_start( a, b ) hid_device_start_( a, b, 1000 ) +BOOL hid_device_start_( struct hid_device_desc *desc, UINT count, DWORD timeout ); void hid_device_stop( struct hid_device_desc *desc, UINT count ); BOOL bus_device_start(void); void bus_device_stop(void); +BOOL find_hid_device_path( WCHAR *device_path ); void cleanup_registry_keys(void); #define dinput_test_init() dinput_test_init_( __FILE__, __LINE__ ) diff --git a/dlls/dinput/tests/hid.c b/dlls/dinput/tests/hid.c index 0a28fda6f99..e5f6ea4640d 100644 --- a/dlls/dinput/tests/hid.c +++ b/dlls/dinput/tests/hid.c @@ -553,7 +553,7 @@ void bus_device_stop(void) ok( ret || GetLastError() == ERROR_FILE_NOT_FOUND, "Failed to delete file, error %lu\n", GetLastError() ); } -static BOOL find_hid_device_path( WCHAR *device_path ) +BOOL find_hid_device_path( WCHAR *device_path ) { char buffer[FIELD_OFFSET( SP_DEVICE_INTERFACE_DETAIL_DATA_W, DevicePath[MAX_PATH] )] = {0}; SP_DEVICE_INTERFACE_DATA iface = {sizeof(SP_DEVICE_INTERFACE_DATA)}; @@ -735,7 +735,7 @@ void hid_device_stop( struct hid_device_desc *desc, UINT count ) } } -BOOL hid_device_start( struct hid_device_desc *desc, UINT count ) +BOOL hid_device_start_( struct hid_device_desc *desc, UINT count, DWORD timeout ) { HANDLE control; DWORD ret, i; @@ -754,7 +754,7 @@ BOOL hid_device_start( struct hid_device_desc *desc, UINT count ) for (i = 0; i < count; ++i) { - ret = WaitForSingleObject( device_added, 1000 ); + ret = WaitForSingleObject( device_added, timeout ); todo_wine_if(i > 0) ok( !ret, "WaitForSingleObject returned %#lx\n", ret ); }
1
0
0
0
← Newer
1
...
23
24
25
26
27
28
29
...
72
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
Results per page:
10
25
50
100
200