winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2023
----- 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
817 discussions
Start a n
N
ew thread
Jinoh Kang : ntdll: Store current activation context stack pointer into a local variable.
by Alexandre Julliard
19 Apr '23
19 Apr '23
Module: wine Branch: master Commit: 68e354f3e457600351f2b847bad2ebf57a840134 URL:
https://gitlab.winehq.org/wine/wine/-/commit/68e354f3e457600351f2b847bad2eb…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Sat Mar 18 19:01:49 2023 +0900 ntdll: Store current activation context stack pointer into a local variable. This refactoring makes it easier to change the algorithm of obtaining the current activation context stack. --- dlls/ntdll/actctx.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index ab4ef378330..432648d129d 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -3386,8 +3386,10 @@ static NTSTATUS parse_depend_manifests(struct actctx_loader* acl) static HANDLE get_current_actctx_no_addref(void) { - if (NtCurrentTeb()->ActivationContextStack.ActiveFrame) - return NtCurrentTeb()->ActivationContextStack.ActiveFrame->ActivationContext; + ACTIVATION_CONTEXT_STACK *actctx_stack = &NtCurrentTeb()->ActivationContextStack; + + if (actctx_stack->ActiveFrame) + return actctx_stack->ActiveFrame->ActivationContext; return NULL; } @@ -5395,15 +5397,16 @@ NTSTATUS WINAPI RtlActivateActivationContext( ULONG unknown, HANDLE handle, PULO */ NTSTATUS WINAPI RtlActivateActivationContextEx( ULONG flags, TEB *teb, HANDLE handle, ULONG_PTR *cookie ) { + ACTIVATION_CONTEXT_STACK *actctx_stack = &teb->ActivationContextStack; RTL_ACTIVATION_CONTEXT_STACK_FRAME *frame; if (!(frame = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*frame) ))) return STATUS_NO_MEMORY; - frame->Previous = teb->ActivationContextStack.ActiveFrame; + frame->Previous = actctx_stack->ActiveFrame; frame->ActivationContext = handle; frame->Flags = 0; - teb->ActivationContextStack.ActiveFrame = frame; + actctx_stack->ActiveFrame = frame; RtlAddRefActivationContext( handle ); *cookie = (ULONG_PTR)frame; @@ -5417,12 +5420,13 @@ NTSTATUS WINAPI RtlActivateActivationContextEx( ULONG flags, TEB *teb, HANDLE ha */ void WINAPI RtlDeactivateActivationContext( ULONG flags, ULONG_PTR cookie ) { + ACTIVATION_CONTEXT_STACK *actctx_stack = &NtCurrentTeb()->ActivationContextStack; RTL_ACTIVATION_CONTEXT_STACK_FRAME *frame, *top; TRACE( "%lx cookie=%Ix\n", flags, cookie ); /* find the right frame */ - top = NtCurrentTeb()->ActivationContextStack.ActiveFrame; + top = actctx_stack->ActiveFrame; for (frame = top; frame; frame = frame->Previous) if ((ULONG_PTR)frame == cookie) break; @@ -5433,9 +5437,9 @@ void WINAPI RtlDeactivateActivationContext( ULONG flags, ULONG_PTR cookie ) RtlRaiseStatus( STATUS_SXS_EARLY_DEACTIVATION ); /* pop everything up to and including frame */ - NtCurrentTeb()->ActivationContextStack.ActiveFrame = frame->Previous; + actctx_stack->ActiveFrame = frame->Previous; - while (top != NtCurrentTeb()->ActivationContextStack.ActiveFrame) + while (top != actctx_stack->ActiveFrame) { frame = top->Previous; RtlReleaseActivationContext( top->ActivationContext ); @@ -5450,9 +5454,10 @@ void WINAPI RtlDeactivateActivationContext( ULONG flags, ULONG_PTR cookie ) */ void WINAPI RtlFreeThreadActivationContextStack(void) { + ACTIVATION_CONTEXT_STACK *actctx_stack = &NtCurrentTeb()->ActivationContextStack; RTL_ACTIVATION_CONTEXT_STACK_FRAME *frame; - frame = NtCurrentTeb()->ActivationContextStack.ActiveFrame; + frame = actctx_stack->ActiveFrame; while (frame) { RTL_ACTIVATION_CONTEXT_STACK_FRAME *prev = frame->Previous; @@ -5460,7 +5465,7 @@ void WINAPI RtlFreeThreadActivationContextStack(void) RtlFreeHeap( GetProcessHeap(), 0, frame ); frame = prev; } - NtCurrentTeb()->ActivationContextStack.ActiveFrame = NULL; + actctx_stack->ActiveFrame = NULL; } @@ -5479,9 +5484,10 @@ NTSTATUS WINAPI RtlGetActiveActivationContext( HANDLE *handle ) */ BOOLEAN WINAPI RtlIsActivationContextActive( HANDLE handle ) { + ACTIVATION_CONTEXT_STACK *actctx_stack = &NtCurrentTeb()->ActivationContextStack; RTL_ACTIVATION_CONTEXT_STACK_FRAME *frame; - for (frame = NtCurrentTeb()->ActivationContextStack.ActiveFrame; frame; frame = frame->Previous) + for (frame = actctx_stack->ActiveFrame; frame; frame = frame->Previous) if (frame->ActivationContext == handle) return TRUE; return FALSE; }
1
0
0
0
Jinoh Kang : ntdll: Factor out reading current activation context into a helper function.
by Alexandre Julliard
19 Apr '23
19 Apr '23
Module: wine Branch: master Commit: 4dadf7a0deffdacc82e056f93818b4bc31a17402 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4dadf7a0deffdacc82e056f93818b4…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Sat Mar 18 18:48:14 2023 +0900 ntdll: Factor out reading current activation context into a helper function. This refactoring makes it easier to change the algorithm of obtaining the current activation context stack. Note that RtlAddRefActivationContext(NULL) is a no-op, and check_actctx(NULL) returns NULL without doing anything. --- dlls/ntdll/actctx.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index b275a7f5b49..ab4ef378330 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -3384,6 +3384,14 @@ static NTSTATUS parse_depend_manifests(struct actctx_loader* acl) return status; } +static HANDLE get_current_actctx_no_addref(void) +{ + if (NtCurrentTeb()->ActivationContextStack.ActiveFrame) + return NtCurrentTeb()->ActivationContextStack.ActiveFrame->ActivationContext; + + return NULL; +} + /* find the appropriate activation context for RtlQueryInformationActivationContext */ static NTSTATUS find_query_actctx( HANDLE *handle, DWORD flags, ULONG class ) { @@ -3393,8 +3401,7 @@ static NTSTATUS find_query_actctx( HANDLE *handle, DWORD flags, ULONG class ) { if (*handle) return STATUS_INVALID_PARAMETER; - if (NtCurrentTeb()->ActivationContextStack.ActiveFrame) - *handle = NtCurrentTeb()->ActivationContextStack.ActiveFrame->ActivationContext; + *handle = get_current_actctx_no_addref(); } else if (flags & (QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS|QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE)) { @@ -5462,14 +5469,7 @@ void WINAPI RtlFreeThreadActivationContextStack(void) */ NTSTATUS WINAPI RtlGetActiveActivationContext( HANDLE *handle ) { - if (NtCurrentTeb()->ActivationContextStack.ActiveFrame) - { - *handle = NtCurrentTeb()->ActivationContextStack.ActiveFrame->ActivationContext; - RtlAddRefActivationContext( *handle ); - } - else - *handle = 0; - + RtlAddRefActivationContext( *handle = get_current_actctx_no_addref() ); return STATUS_SUCCESS; } @@ -5754,6 +5754,7 @@ NTSTATUS WINAPI RtlFindActivationContextSectionString( ULONG flags, const GUID * { PACTCTX_SECTION_KEYED_DATA data = ptr; NTSTATUS status = STATUS_SXS_KEY_NOT_FOUND; + ACTIVATION_CONTEXT *actctx; TRACE("%08lx %s %lu %s %p\n", flags, debugstr_guid(guid), section_kind, debugstr_us(section_name), data); @@ -5775,11 +5776,8 @@ NTSTATUS WINAPI RtlFindActivationContextSectionString( ULONG flags, const GUID * return STATUS_INVALID_PARAMETER; } - if (NtCurrentTeb()->ActivationContextStack.ActiveFrame) - { - ACTIVATION_CONTEXT *actctx = check_actctx(NtCurrentTeb()->ActivationContextStack.ActiveFrame->ActivationContext); - if (actctx) status = find_string( actctx, section_kind, section_name, flags, data ); - } + actctx = check_actctx( get_current_actctx_no_addref() ); + if (actctx) status = find_string( actctx, section_kind, section_name, flags, data ); if (status != STATUS_SUCCESS) status = find_string( process_actctx, section_kind, section_name, flags, data ); @@ -5798,6 +5796,7 @@ NTSTATUS WINAPI RtlFindActivationContextSectionGuid( ULONG flags, const GUID *ex { ACTCTX_SECTION_KEYED_DATA *data = ptr; NTSTATUS status = STATUS_SXS_KEY_NOT_FOUND; + ACTIVATION_CONTEXT *actctx; TRACE("%08lx %s %lu %s %p\n", flags, debugstr_guid(extguid), section_kind, debugstr_guid(guid), data); @@ -5816,11 +5815,8 @@ NTSTATUS WINAPI RtlFindActivationContextSectionGuid( ULONG flags, const GUID *ex if (!data || data->cbSize < FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) || !guid) return STATUS_INVALID_PARAMETER; - if (NtCurrentTeb()->ActivationContextStack.ActiveFrame) - { - ACTIVATION_CONTEXT *actctx = check_actctx(NtCurrentTeb()->ActivationContextStack.ActiveFrame->ActivationContext); - if (actctx) status = find_guid( actctx, section_kind, guid, flags, data ); - } + actctx = check_actctx( get_current_actctx_no_addref() ); + if (actctx) status = find_guid( actctx, section_kind, guid, flags, data ); if (status != STATUS_SUCCESS) status = find_guid( process_actctx, section_kind, guid, flags, data );
1
0
0
0
Jinoh Kang : kernel32/tests: Test for activation context switching between fibers.
by Alexandre Julliard
19 Apr '23
19 Apr '23
Module: wine Branch: master Commit: f7315ebe5bf5c8fe7c55c79682943eaafe05f21a URL:
https://gitlab.winehq.org/wine/wine/-/commit/f7315ebe5bf5c8fe7c55c79682943e…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Thu Mar 16 01:01:17 2023 +0900 kernel32/tests: Test for activation context switching between fibers. --- dlls/kernel32/tests/fiber.c | 221 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 221 insertions(+) diff --git a/dlls/kernel32/tests/fiber.c b/dlls/kernel32/tests/fiber.c index 433883e5a26..b0e50c791ad 100644 --- a/dlls/kernel32/tests/fiber.c +++ b/dlls/kernel32/tests/fiber.c @@ -24,6 +24,7 @@ #define WIN32_NO_STATUS #include <winternl.h> #include "wine/test.h" +#include <winuser.h> static LPVOID (WINAPI *pCreateFiber)(SIZE_T,LPFIBER_START_ROUTINE,LPVOID); static LPVOID (WINAPI *pConvertThreadToFiber)(LPVOID); @@ -791,6 +792,225 @@ static void test_FiberLocalStorageWithFibers(PFLS_CALLBACK_FUNCTION cbfunc) test_ConvertFiberToThread(); } +#define check_current_actctx_is(e,t) check_current_actctx_is_(__LINE__, e, t) +static void check_current_actctx_is_(int line, HANDLE expected_actctx, BOOL todo) +{ + HANDLE cur_actctx; + BOOL ret; + + cur_actctx = (void*)0xdeadbeef; + ret = GetCurrentActCtx(&cur_actctx); + ok_(__FILE__, line)(ret, "thread GetCurrentActCtx failed, %lu\n", GetLastError()); + + todo_wine_if(todo) + ok_(__FILE__, line)(cur_actctx == expected_actctx, "got %p, expected %p\n", cur_actctx, expected_actctx); + + ReleaseActCtx(cur_actctx); +} + +static DWORD WINAPI subthread_actctx_func(void *actctx) +{ + HANDLE fiber; + BOOL ret; + + check_current_actctx_is(actctx, FALSE); + + fiber = pConvertThreadToFiber(NULL); + ok(fiber != NULL, "ConvertThreadToFiber returned error %lu\n", GetLastError()); + check_current_actctx_is(actctx, FALSE); + fibers[2] = fiber; + + SwitchToFiber(fibers[0]); + check_current_actctx_is(actctx, FALSE); + + ok(fibers[2] == fiber, "fibers[2]: expected %p, got %p\n", fiber, fibers[2]); + fibers[2] = NULL; + ret = pConvertFiberToThread(); + ok(ret, "ConvertFiberToThread returned error %lu\n", GetLastError()); + check_current_actctx_is(actctx, FALSE); + + return 0; +} + +static void WINAPI fiber_actctx_func(void *actctx) +{ + ULONG_PTR cookie; + DWORD tid, wait; + HANDLE thread; + BOOL ret; + + check_current_actctx_is(NULL, TRUE); + + ret = ActivateActCtx(actctx, &cookie); + ok(ret, "ActivateActCtx returned error %lu\n", GetLastError()); + check_current_actctx_is(actctx, FALSE); + + SwitchToFiber(fibers[0]); + check_current_actctx_is(actctx, FALSE); + + thread = CreateThread(NULL, 0, subthread_actctx_func, actctx, 0, &tid); + ok(thread != NULL, "CreateThread returned error %lu\n", GetLastError()); + + wait = WaitForSingleObject(thread, INFINITE); + ok(wait == WAIT_OBJECT_0, "WaitForSingleObject returned %lu (last error: %lu)\n", + wait, GetLastError()); + CloseHandle(thread); + + ret = DeactivateActCtx(0, cookie); + ok(ret, "DeactivateActCtx returned error %lu\n", GetLastError()); + check_current_actctx_is(NULL, TRUE); + + SwitchToFiber(fibers[0]); + ok(0, "unreachable\n"); +} + +/* Test that activation context is switched on SwitchToFiber() call */ +static void subtest_fiber_actctx_switch(HANDLE current_actctx, HANDLE child_actctx) +{ + fibers[1] = pCreateFiber(0, fiber_actctx_func, child_actctx); + ok(fibers[1] != NULL, "CreateFiber returned error %lu\n", GetLastError()); + check_current_actctx_is(current_actctx, FALSE); + + SwitchToFiber(fibers[1]); + check_current_actctx_is(current_actctx, TRUE); + + SwitchToFiber(fibers[1]); + check_current_actctx_is(current_actctx, TRUE); + + SwitchToFiber(fibers[2]); + check_current_actctx_is(current_actctx, FALSE); + ok(fibers[2] == NULL, "expected fiber to be deleted (got %p)\n", fibers[2]); + + DeleteFiber(fibers[1]); + fibers[1] = NULL; +} + +static void WINAPI exit_thread_fiber_func(void *unused) +{ + BOOL ret; + + ret = pConvertFiberToThread(); + ok(ret, "ConvertFiberToThread returned error %lu\n", GetLastError()); + + ExitThread(16); +} + +static DWORD WINAPI thread_actctx_func_early_exit(void *actctx) +{ + HANDLE exit_thread_fiber; + + check_current_actctx_is(actctx, FALSE); + + fibers[1] = pConvertThreadToFiber(NULL); + ok(fibers[1] != NULL, "ConvertThreadToFiber returned error %lu\n", GetLastError()); + check_current_actctx_is(actctx, FALSE); + + exit_thread_fiber = pCreateFiber(0, exit_thread_fiber_func, NULL); + ok(exit_thread_fiber != NULL, "CreateFiber returned error %lu\n", GetLastError()); + + /* exit thread, but keep current fiber */ + SwitchToFiber(exit_thread_fiber); + check_current_actctx_is(actctx, TRUE); + + SwitchToFiber(fibers[0]); + ok(0, "unreachable\n"); + return 17; +} + +/* Test that fiber activation context stack is preserved regardless of creator thread's lifetime */ +static void subtest_fiber_actctx_preservation(HANDLE current_actctx, HANDLE child_actctx) +{ + ULONG_PTR cookie; + DWORD tid, wait; + HANDLE thread; + BOOL ret; + + ret = ActivateActCtx(child_actctx, &cookie); + ok(ret, "ActivateActCtx returned error %lu\n", GetLastError()); + check_current_actctx_is(child_actctx, FALSE); + + thread = CreateThread(NULL, 0, thread_actctx_func_early_exit, child_actctx, 0, &tid); + ok(thread != NULL, "CreateThread returned error %lu\n", GetLastError()); + + ret = DeactivateActCtx(0, cookie); + ok(ret, "DeactivateActCtx returned error %lu\n", GetLastError()); + check_current_actctx_is(current_actctx, FALSE); + + wait = WaitForSingleObject(thread, INFINITE); + ok(wait == WAIT_OBJECT_0, "WaitForSingleObject returned %lu (last error: %lu)\n", + wait, GetLastError()); + CloseHandle(thread); + + /* The exited thread has been converted to a fiber */ + SwitchToFiber(fibers[1]); + check_current_actctx_is(current_actctx, FALSE); + + DeleteFiber(fibers[1]); + fibers[1] = NULL; +} + +static HANDLE create_actctx_from_module_manifest(void) +{ + ACTCTXW actctx; + + memset(&actctx, 0, sizeof(ACTCTXW)); + actctx.cbSize = sizeof(actctx); + actctx.dwFlags = ACTCTX_FLAG_HMODULE_VALID | ACTCTX_FLAG_RESOURCE_NAME_VALID; + actctx.lpResourceName = MAKEINTRESOURCEW(124); + actctx.hModule = GetModuleHandleW(NULL); + + return CreateActCtxW(&actctx); +} + +static void test_fiber_actctx(void) +{ + ULONG_PTR cookies[3]; + HANDLE actctxs[3]; + size_t i, j; + BOOL ret; + + for (i = 0; i < ARRAY_SIZE(actctxs); i++) + { + actctxs[i] = create_actctx_from_module_manifest(); + ok(actctxs[i] != INVALID_HANDLE_VALUE, "failed to create context, error %lu\n", GetLastError()); + for (j = 0; j < i; j++) + { + ok(actctxs[i] != actctxs[j], + "actctxs[%Iu] (%p) and actctxs[%Iu] (%p) should not alias\n", + i, actctxs[i], j, actctxs[j]); + } + } + + ret = ActivateActCtx(actctxs[0], &cookies[0]); + ok(ret, "ActivateActCtx returned error %lu\n", GetLastError()); + check_current_actctx_is(actctxs[0], FALSE); + + test_ConvertThreadToFiber(); + check_current_actctx_is(actctxs[0], FALSE); + + ret = ActivateActCtx(actctxs[1], &cookies[1]); + ok(ret, "ActivateActCtx returned error %lu\n", GetLastError()); + check_current_actctx_is(actctxs[1], FALSE); + + subtest_fiber_actctx_switch(actctxs[1], actctxs[2]); + subtest_fiber_actctx_preservation(actctxs[1], actctxs[2]); + + ret = DeactivateActCtx(0, cookies[1]); + ok(ret, "DeactivateActCtx returned error %lu\n", GetLastError()); + check_current_actctx_is(actctxs[0], FALSE); + + test_ConvertFiberToThread(); + check_current_actctx_is(actctxs[0], FALSE); + + ret = DeactivateActCtx(0, cookies[0]); + ok(ret, "DeactivateActCtx returned error %lu\n", GetLastError()); + check_current_actctx_is(NULL, FALSE); + + for (i = ARRAY_SIZE(actctxs); i > 0; ) + ReleaseActCtx(actctxs[--i]); +} + + static void WINAPI fls_exit_deadlock_callback(void *arg) { if (arg == (void *)1) @@ -873,5 +1093,6 @@ START_TEST(fiber) test_FiberLocalStorage(); test_FiberLocalStorageCallback(FiberLocalStorageProc); test_FiberLocalStorageWithFibers(FiberLocalStorageProc); + test_fiber_actctx(); test_fls_exit_deadlock(); }
1
0
0
0
Alexandre Julliard : zlib: Run source files through zlib2ansi to avoid K&R function definitions.
by Alexandre Julliard
19 Apr '23
19 Apr '23
Module: wine Branch: master Commit: 002d6a9475e784473549c89e161b5ef46d074e22 URL:
https://gitlab.winehq.org/wine/wine/-/commit/002d6a9475e784473549c89e161b5e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 19 20:24:15 2023 +0200 zlib: Run source files through zlib2ansi to avoid K&R function definitions. --- libs/zlib/adler32.c | 40 +++++----- libs/zlib/crc32.c | 108 +++++++++++++-------------- libs/zlib/deflate.c | 202 +++++++++++++++++++++++++-------------------------- libs/zlib/inffast.c | 6 +- libs/zlib/inflate.c | 130 ++++++++++++++++----------------- libs/zlib/inftrees.c | 14 ++-- libs/zlib/trees.c | 134 +++++++++++++++++----------------- libs/zlib/zutil.c | 44 +++++------ 8 files changed, 340 insertions(+), 338 deletions(-)
1
0
0
0
Alexandre Julliard : include: Update the PEB and TEB structures.
by Alexandre Julliard
19 Apr '23
19 Apr '23
Module: wine Branch: master Commit: 36203f1b86c8b08be8611e276d97300c0b6a8bfc URL:
https://gitlab.winehq.org/wine/wine/-/commit/36203f1b86c8b08be8611e276d9730…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 19 15:46:49 2023 +0200 include: Update the PEB and TEB structures. According to Geoff Chappell's information. --- dlls/ntdll/loader.c | 6 +- dlls/ntdll/rtl.c | 6 +- dlls/ntdll/tests/rtl.c | 8 +- dlls/ntdll/unix/signal_x86_64.c | 2 +- dlls/ntoskrnl.exe/ntoskrnl.c | 8 +- include/winternl.h | 194 ++++++++++++++++++++++++++++++---------- 6 files changed, 161 insertions(+), 63 deletions(-)
1
0
0
0
Alexandre Julliard : include: Add the ARM64EC context structure.
by Alexandre Julliard
19 Apr '23
19 Apr '23
Module: wine Branch: master Commit: b7f6620c0162cf8f728aee9baece8dc774173fa8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b7f6620c0162cf8f728aee9baece8d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 19 14:31:00 2023 +0200 include: Add the ARM64EC context structure. --- include/winnt.h | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/include/winnt.h b/include/winnt.h index a905507c0d4..db19d4fc0c1 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -1710,6 +1710,112 @@ typedef struct DECLSPEC_ALIGN(16) _ARM64_NT_CONTEXT DWORD64 Wvr[ARM64_MAX_WATCHPOINTS]; /* 380 */ } ARM64_NT_CONTEXT, *PARM64_NT_CONTEXT; +typedef struct DECLSPEC_ALIGN(16) _ARM64EC_NT_CONTEXT +{ + union + { + struct + { + DWORD64 AMD64_P1Home; /* 000 */ + DWORD64 AMD64_P2Home; /* 008 */ + DWORD64 AMD64_P3Home; /* 010 */ + DWORD64 AMD64_P4Home; /* 018 */ + DWORD64 AMD64_P5Home; /* 020 */ + DWORD64 AMD64_P6Home; /* 028 */ + DWORD ContextFlags; /* 030 */ + DWORD AMD64_MxCsr_copy; /* 034 */ + WORD AMD64_SegCs; /* 038 */ + WORD AMD64_SegDs; /* 03a */ + WORD AMD64_SegEs; /* 03c */ + WORD AMD64_SegFs; /* 03e */ + WORD AMD64_SegGs; /* 040 */ + WORD AMD64_SegSs; /* 042 */ + DWORD AMD64_EFlags; /* 044 */ + DWORD64 AMD64_Dr0; /* 048 */ + DWORD64 AMD64_Dr1; /* 050 */ + DWORD64 AMD64_Dr2; /* 058 */ + DWORD64 AMD64_Dr3; /* 060 */ + DWORD64 AMD64_Dr6; /* 068 */ + DWORD64 AMD64_Dr7; /* 070 */ + DWORD64 X8; /* 078 (Rax) */ + DWORD64 X0; /* 080 (Rcx) */ + DWORD64 X1; /* 088 (Rdx) */ + DWORD64 X27; /* 090 (Rbx) */ + DWORD64 Sp; /* 098 (Rsp) */ + DWORD64 Fp; /* 0a0 (Rbp) */ + DWORD64 X25; /* 0a8 (Rsi) */ + DWORD64 X26; /* 0b0 (Rdi) */ + DWORD64 X2; /* 0b8 (R8) */ + DWORD64 X3; /* 0c0 (R9) */ + DWORD64 X4; /* 0c8 (R10) */ + DWORD64 X5; /* 0d0 (R11) */ + DWORD64 X19; /* 0d8 (R12) */ + DWORD64 X20; /* 0e0 (R13) */ + DWORD64 X21; /* 0e8 (R14) */ + DWORD64 X22; /* 0f0 (R15) */ + DWORD64 Pc; /* 0f8 (Rip) */ + struct + { + WORD AMD64_ControlWord; /* 100 */ + WORD AMD64_StatusWord; /* 102 */ + BYTE AMD64_TagWord; /* 104 */ + BYTE AMD64_Reserved1; /* 105 */ + WORD AMD64_ErrorOpcode; /* 106 */ + DWORD AMD64_ErrorOffset; /* 108 */ + WORD AMD64_ErrorSelector; /* 10c */ + WORD AMD64_Reserved2; /* 10e */ + DWORD AMD64_DataOffset; /* 110 */ + WORD AMD64_DataSelector; /* 114 */ + WORD AMD64_Reserved3; /* 116 */ + DWORD AMD64_MxCsr; /* 118 */ + DWORD AMD64_MxCsr_Mask; /* 11c */ + DWORD64 Lr; /* 120 (FloatRegisters[0]) */ + WORD X16_0; /* 128 */ + WORD AMD64_St0_Reserved1; /* 12a */ + DWORD AMD64_St0_Reserved2; /* 12c */ + DWORD64 X6; /* 130 (FloatRegisters[1]) */ + WORD X16_1; /* 138 */ + WORD AMD64_St1_Reserved1; /* 13a */ + DWORD AMD64_St1_Reserved2; /* 13c */ + DWORD64 X7; /* 140 (FloatRegisters[2]) */ + WORD X16_2; /* 148 */ + WORD AMD64_St2_Reserved1; /* 14a */ + DWORD AMD64_St2_Reserved2; /* 14c */ + DWORD64 X9; /* 150 (FloatRegisters[3]) */ + WORD X16_3; /* 158 */ + WORD AMD64_St3_Reserved1; /* 15a */ + DWORD AMD64_St3_Reserved2; /* 15c */ + DWORD64 X10; /* 160 (FloatRegisters[4]) */ + WORD X17_0; /* 168 */ + WORD AMD64_St4_Reserved1; /* 16a */ + DWORD AMD64_St4_Reserved2; /* 16c */ + DWORD64 X11; /* 170 (FloatRegisters[5]) */ + WORD X17_1; /* 178 */ + WORD AMD64_St5_Reserved1; /* 17a */ + DWORD AMD64_St5_Reserved2; /* 17c */ + DWORD64 X12; /* 180 (FloatRegisters[6]) */ + WORD X17_2; /* 188 */ + WORD AMD64_St6_Reserved1; /* 18a */ + DWORD AMD64_St6_Reserved2; /* 18c */ + DWORD64 X15; /* 190 (FloatRegisters[7]) */ + WORD X17_3; /* 198 */ + WORD AMD64_St7_Reserved1; /* 19a */ + DWORD AMD64_St7_Reserved2; /* 19c */ + ARM64_NT_NEON128 V[16]; /* 1a0 (XmmRegisters) */ + BYTE AMD64_XSAVE_FORMAT_Reserved4[96]; /* 2a0 */ + } DUMMYSTRUCTNAME; + M128A AMD64_VectorRegister[26]; /* 300 */ + DWORD64 AMD64_VectorControl; /* 4a0 */ + DWORD64 AMD64_DebugControl; /* 4a8 */ + DWORD64 AMD64_LastBranchToRip; /* 4b0 */ + DWORD64 AMD64_LastBranchFromRip; /* 4b8 */ + DWORD64 AMD64_LastExceptionToRip; /* 4c0 */ + DWORD64 AMD64_LastExceptionFromRip; /* 4c8 */ + } DUMMYSTRUCTNAME; + AMD64_CONTEXT AMD64_Context; + } DUMMYUNIONNAME; +} ARM64EC_NT_CONTEXT, *PARM64EC_NT_CONTEXT; + #ifdef __aarch64__ #define CONTEXT_CONTROL CONTEXT_ARM64_CONTROL
1
0
0
0
Francois Gouget : dnsapi/tests: Make DnsQuery()'s CNAME tests more compatible with CDNs.
by Alexandre Julliard
19 Apr '23
19 Apr '23
Module: wine Branch: master Commit: d46f8881230a52e7c5f9a8582e5b39264511d110 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d46f8881230a52e7c5f9a8582e5b39…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Mon Apr 17 16:43:49 2023 +0200 dnsapi/tests: Make DnsQuery()'s CNAME tests more compatible with CDNs. Depending on the DNS server, querying
test.winehq.org
may point to CDN servers, resulting in more records than expected. Also some of the CDN servers may have IPv6 addresses. Dump the DNS records if $WINETEST_DEBUG > 1. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54847
--- dlls/dnsapi/tests/query.c | 89 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 73 insertions(+), 16 deletions(-) diff --git a/dlls/dnsapi/tests/query.c b/dlls/dnsapi/tests/query.c index 9b54aa3c816..e4a821e1ce8 100644 --- a/dlls/dnsapi/tests/query.c +++ b/dlls/dnsapi/tests/query.c @@ -25,12 +25,39 @@ #include "windns.h" #include "winsock2.h" #include "ws2ipdef.h" +#include "ws2tcpip.h" #include "iphlpapi.h" #include "wine/test.h" #define NS_MAXDNAME 1025 +static void dump_dns_records(DNS_RECORDW *rec) +{ + while (rec) + { + if (rec->wType == DNS_TYPE_CNAME) + printf(" %s type=CNAME -> %s\n", wine_dbgstr_w(rec->pName), wine_dbgstr_w(rec->Data.CNAME.pNameHost)); + else if (rec->wType == DNS_TYPE_A) + { + char buf[16]; + const char *addr; + addr = inet_ntop(AF_INET, &rec->Data.A.IpAddress, buf, sizeof(buf)); + printf(" %s type=A -> %s\n", wine_dbgstr_w(rec->pName), addr ? addr : "(unknown IPv4 address)"); + } + else if (rec->wType == DNS_TYPE_AAAA) + { + char buf[46]; + const char *addr; + addr = inet_ntop(AF_INET6, &rec->Data.AAAA.Ip6Address, buf, sizeof(buf)); + printf(" %s type=AAAA -> %s\n", wine_dbgstr_w(rec->pName), addr ? addr : "(unknown IPv6 address)"); + } + else + printf(" %s type=%d\n", wine_dbgstr_w(rec->pName), rec->wType); + rec = rec->pNext; + } +} + static void test_DnsQuery(void) { WCHAR domain[MAX_PATH]; @@ -38,7 +65,6 @@ static void test_DnsQuery(void) DWORD ret, size; DNS_RECORDW *rec, *ptr; DNS_STATUS status; - WORD type; rec = NULL; status = DnsQuery_W(L"
winehq.org
", DNS_TYPE_A, DNS_QUERY_STANDARD, NULL, &rec, NULL); @@ -60,22 +86,40 @@ static void test_DnsQuery(void) return; } ok(status == ERROR_SUCCESS, "got %ld\n", status); - type = DNS_TYPE_CNAME; /* CNAMEs come first */ - for (ptr = rec; ptr; ptr = ptr->pNext) + if (status == ERROR_SUCCESS && winetest_debug > 1) { - ok(!wcscmp(domain, ptr->pName), "expected record name %s, got %s\n", wine_dbgstr_w(domain), wine_dbgstr_w(ptr->pName)); - ok(type == ptr->wType, "expected record type %d, got %d\n", type, ptr->wType); - if (ptr->wType == DNS_TYPE_CNAME) - { - /* CNAME chains are bad practice so assume A for the remainder */ - type = DNS_TYPE_A; - wcscpy(domain, L"
winehq.org
"); - ok(!wcscmp(domain, ptr->Data.CNAME.pNameHost), "expected CNAME target %s, got %s\n", wine_dbgstr_w(domain), wine_dbgstr_w(ptr->Data.CNAME.pNameHost)); - } + trace("DnsQuery DNS_TYPE_A:\n"); + dump_dns_records(rec); } + + ptr = rec; /* CNAMEs come first */ + ok(!wcscmp(domain, ptr->pName), "expected record name %s, got %s\n", wine_dbgstr_w(domain), wine_dbgstr_w(ptr->pName)); + ok(DNS_TYPE_CNAME == ptr->wType, "expected record type %d, got %d\n", DNS_TYPE_CNAME, ptr->wType); + wcscpy(domain, L"
winehq.org
"); + if (ptr->wType == DNS_TYPE_CNAME) + ok(!wcscmp(domain, ptr->Data.CNAME.pNameHost), "expected CNAME target %s, got %s\n", wine_dbgstr_w(domain), wine_dbgstr_w(ptr->Data.CNAME.pNameHost)); + ptr = ptr->pNext; + + ok(!wcscmp(domain, ptr->pName), "expected record name %s, got %s\n", + wine_dbgstr_w(domain), wine_dbgstr_w(ptr->pName)); + ok(DNS_TYPE_A == ptr->wType, "expected record type %d, got %d\n", + DNS_TYPE_A, ptr->wType); + ptr = ptr->pNext; + + while (ptr) + { + ok(wcscmp(domain, ptr->pName), "did not expect a record for %s\n", + wine_dbgstr_w(ptr->pName)); + ok(ptr->wType == DNS_TYPE_A || ptr->wType == DNS_TYPE_AAAA, + "unexpected record type %d\n", ptr->wType); + ptr = ptr->pNext; + } + DnsRecordListFree(rec, DnsFreeRecordList); - /* But DNS_TYPE_CNAME does not return A records! */ + /* DNS_TYPE_CNAME does not return a record for its target but it may still + * return other related records! + */ rec = NULL; wcscpy(domain, L"
test.winehq.org
"); status = DnsQuery_W(L"
test.winehq.org
", DNS_TYPE_CNAME, DNS_QUERY_STANDARD, NULL, &rec, NULL); @@ -85,15 +129,28 @@ static void test_DnsQuery(void) return; } ok(status == ERROR_SUCCESS, "got %ld\n", status); + if (status == ERROR_SUCCESS && winetest_debug > 1) + { + trace("DnsQuery DNS_TYPE_CNAME:\n"); + dump_dns_records(rec); + } + ptr = rec; ok(!wcscmp(domain, ptr->pName), "expected record name %s, got %s\n", wine_dbgstr_w(domain), wine_dbgstr_w(ptr->pName)); ok(DNS_TYPE_CNAME == ptr->wType, "expected record type %d, got %d\n", DNS_TYPE_CNAME, ptr->wType); + wcscpy(domain, L"
winehq.org
"); if (ptr->wType == DNS_TYPE_CNAME) - { - wcscpy(domain, L"
winehq.org
"); ok(!wcscmp(domain, ptr->Data.CNAME.pNameHost), "expected CNAME target %s, got %s\n", wine_dbgstr_w(domain), wine_dbgstr_w(ptr->Data.CNAME.pNameHost)); + ptr = ptr->pNext; + + while (ptr) + { + ok(wcscmp(domain, ptr->pName), "did not expect a record for %s\n", + wine_dbgstr_w(ptr->pName)); + ok(ptr->wType == DNS_TYPE_A || ptr->wType == DNS_TYPE_AAAA, + "unexpected record type %d\n", ptr->wType); + ptr = ptr->pNext; } - ok(ptr->pNext == NULL, "unexpected CNAME chain\n"); DnsRecordListFree(rec, DnsFreeRecordList); status = DnsQuery_W(L"", DNS_TYPE_SRV, DNS_QUERY_STANDARD, NULL, &rec, NULL);
1
0
0
0
Piotr Caban : wineps: Add BiDi support in EMR_EXTTEXTOUTW record.
by Alexandre Julliard
19 Apr '23
19 Apr '23
Module: wine Branch: master Commit: 0d95b8218268d1bcd788d97185dea7270f01f74d URL:
https://gitlab.winehq.org/wine/wine/-/commit/0d95b8218268d1bcd788d97185dea7…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Apr 18 20:15:28 2023 +0200 wineps: Add BiDi support in EMR_EXTTEXTOUTW record. --- dlls/wineps.drv/Makefile.in | 1 + dlls/wineps.drv/direction.c | 717 ++++++++++++++++++++++++++++++++++++++++++++ dlls/wineps.drv/printproc.c | 602 ++++++++++++++++++++++++++++++++++++- tools/make_unicode | 1 + 4 files changed, 1320 insertions(+), 1 deletion(-)
1
0
0
0
Piotr Caban : wineps: Handle EMR_EXTTEXTOUTW record in spool files.
by Alexandre Julliard
19 Apr '23
19 Apr '23
Module: wine Branch: master Commit: 2df476c11fe10e306ca5f4130d73658e3cb581c5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2df476c11fe10e306ca5f4130d7365…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Apr 18 20:12:54 2023 +0200 wineps: Handle EMR_EXTTEXTOUTW record in spool files. --- dlls/wineps.drv/printproc.c | 515 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 515 insertions(+)
1
0
0
0
Piotr Caban : wineps: Store text justification info in print processor data.
by Alexandre Julliard
19 Apr '23
19 Apr '23
Module: wine Branch: master Commit: ac13b9502053c7a3955d00e53b0fff550b56c181 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ac13b9502053c7a3955d00e53b0fff…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Apr 18 20:03:04 2023 +0200 wineps: Store text justification info in print processor data. --- dlls/wineps.drv/printproc.c | 67 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 449748c8b22..0452e19845a 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -47,6 +47,16 @@ struct pp_data struct brush_pattern *patterns; BOOL path; + INT break_extra; + INT break_rem; + + INT saved_dc_size; + INT saved_dc_top; + struct + { + INT break_extra; + INT break_rem; + } *saved_dc; }; typedef enum @@ -88,6 +98,13 @@ typedef struct unsigned int cjSize; } record_hdr; +typedef struct +{ + EMR emr; + INT break_extra; + INT break_count; +} EMRSETTEXTJUSTIFICATION; + BOOL WINAPI SeekPrinter(HANDLE, LARGE_INTEGER, LARGE_INTEGER*, DWORD, BOOL); static const WCHAR emf_1003[] = L"NT EMF 1.003"; @@ -1158,8 +1175,37 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, PSDRV_SetBkColor(&data->pdev->dev, p->crColor); return 1; } + case EMR_SAVEDC: + { + int ret = PlayEnhMetaFileRecord(hdc, htable, rec, handle_count); + + if (!data->saved_dc_size) + { + data->saved_dc = malloc(8 * sizeof(*data->saved_dc)); + if (data->saved_dc) + data->saved_dc_size = 8; + } + else if (data->saved_dc_size == data->saved_dc_top) + { + void *alloc = realloc(data->saved_dc, data->saved_dc_size * 2); + + if (alloc) + { + data->saved_dc = alloc; + data->saved_dc_size *= 2; + } + } + if (data->saved_dc_size == data->saved_dc_top) + return 0; + + data->saved_dc[data->saved_dc_top].break_extra = data->break_extra; + data->saved_dc[data->saved_dc_top].break_rem = data->break_rem; + data->saved_dc_top++; + return ret; + } case EMR_RESTOREDC: { + const EMRRESTOREDC *p = (const EMRRESTOREDC *)rec; HDC hdc = data->pdev->dev.hdc; int ret = PlayEnhMetaFileRecord(hdc, htable, rec, handle_count); UINT aa_flags; @@ -1171,6 +1217,12 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, PSDRV_SelectPen(&data->pdev->dev, GetCurrentObject(hdc, OBJ_PEN), NULL); PSDRV_SetBkColor(&data->pdev->dev, GetBkColor(hdc)); PSDRV_SetTextColor(&data->pdev->dev, GetTextColor(hdc)); + + if (p->iRelative >= 0 || data->saved_dc_top + p->iRelative < 0) + return 0; + data->saved_dc_top += p->iRelative; + data->break_extra = data->saved_dc[data->saved_dc_top].break_extra; + data->break_rem = data->saved_dc[data->saved_dc_top].break_rem; } return ret; } @@ -1633,6 +1685,14 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, return gradient_fill(&data->pdev->dev, p->Ver, p->nVer, p->Ver + p->nVer, p->nTri, p->ulMode); } + case EMR_SETTEXTJUSTIFICATION: + { + const EMRSETTEXTJUSTIFICATION *p = (const EMRSETTEXTJUSTIFICATION *)rec; + + data->break_extra = p->break_extra / p->break_count; + data->break_rem = p->break_extra - data->break_extra * p->break_count; + return PlayEnhMetaFileRecord(data->pdev->dev.hdc, htable, rec, handle_count); + } case EMR_EXTFLOODFILL: case EMR_ALPHABLEND: @@ -1656,7 +1716,6 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, case EMR_INTERSECTCLIPRECT: case EMR_SCALEVIEWPORTEXTEX: case EMR_SCALEWINDOWEXTEX: - case EMR_SAVEDC: case EMR_SETWORLDTRANSFORM: case EMR_MODIFYWORLDTRANSFORM: case EMR_CREATEPEN: @@ -1669,7 +1728,6 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, case EMR_EXTSELECTCLIPRGN: case EMR_EXTCREATEFONTINDIRECTW: case EMR_SETLAYOUT: - case EMR_SETTEXTJUSTIFICATION: return PlayEnhMetaFileRecord(data->pdev->dev.hdc, htable, rec, handle_count); default: FIXME("unsupported record: %ld\n", rec->iType); @@ -1719,6 +1777,10 @@ static BOOL print_metafile(struct pp_data *data, HANDLE hdata) DeleteEnhMetaFile(hmf); free(data->patterns); data->patterns = NULL; + data->path = FALSE; + data->break_extra = 0; + data->break_rem = 0; + data->saved_dc_top = 0; return ret; } @@ -1959,6 +2021,7 @@ BOOL WINAPI ClosePrintProcessor(HANDLE pp) DeleteDC(data->pdev->dev.hdc); HeapFree(GetProcessHeap(), 0, data->pdev->Devmode); HeapFree(GetProcessHeap(), 0, data->pdev); + free(data->saved_dc); memset(data, 0, sizeof(*data)); LocalFree(data);
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
82
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
Results per page:
10
25
50
100
200