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
August 2016
----- 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
777 discussions
Start a n
N
ew thread
Alexandre Julliard : server: Add separate requests for opening and closing the clipboard.
by Alexandre Julliard
22 Aug '16
22 Aug '16
Module: wine Branch: master Commit: 7258793169e34a1efc239f01b6e99b1d338a8b6f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7258793169e34a1efc239f01b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Aug 22 15:31:21 2016 +0900 server: Add separate requests for opening and closing the clipboard. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/clipboard.c | 43 +++++++++--------------- include/wine/server_protocol.h | 40 +++++++++++++++++++--- server/clipboard.c | 76 +++++++++++++++++++++++------------------- server/protocol.def | 21 +++++++++--- server/request.h | 21 +++++++++--- server/trace.c | 29 ++++++++++++++-- 6 files changed, 153 insertions(+), 77 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=7258793169e34a1efc239…
1
0
0
0
Sebastian Lackner : services: Remove synchronization for CloseThreadpoolCleanupGroupMembers.
by Alexandre Julliard
22 Aug '16
22 Aug '16
Module: wine Branch: master Commit: bc8f74f92fd7ca3464428bfbae0498297ee5dd0c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bc8f74f92fd7ca3464428bfba…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sat Aug 20 21:24:52 2016 +0200 services: Remove synchronization for CloseThreadpoolCleanupGroupMembers. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/services/rpc.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/programs/services/rpc.c b/programs/services/rpc.c index 688e4a0..bd6af95 100644 --- a/programs/services/rpc.c +++ b/programs/services/rpc.c @@ -85,30 +85,22 @@ struct sc_lock struct scmdatabase *db; }; -static CRITICAL_SECTION shutdown_cs; -static CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &shutdown_cs, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": shutdown_cs") } -}; -static CRITICAL_SECTION shutdown_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; -static BOOL service_shutdown; - static PTP_CLEANUP_GROUP cleanup_group; HANDLE exit_event; +static void CALLBACK group_cancel_callback(void *object, void *userdata) +{ + struct process_entry *process = object; + release_process(process); +} + static void CALLBACK terminate_callback(TP_CALLBACK_INSTANCE *instance, void *context, TP_WAIT *wait, TP_WAIT_RESULT result) { struct process_entry *process = context; if (result == WAIT_TIMEOUT) process_terminate(process); release_process(process); - - /* synchronize with CloseThreadpoolCleanupGroupMembers */ - EnterCriticalSection(&shutdown_cs); - if (!service_shutdown) CloseThreadpoolWait(wait); - LeaveCriticalSection(&shutdown_cs); + CloseThreadpoolWait(wait); } static void terminate_after_timeout(struct process_entry *process, DWORD timeout) @@ -121,6 +113,7 @@ static void terminate_after_timeout(struct process_entry *process, DWORD timeout memset(&environment, 0, sizeof(environment)); environment.Version = 1; environment.CleanupGroup = cleanup_group; + environment.CleanupGroupCancelCallback = group_cancel_callback; timestamp.QuadPart = (ULONGLONG)timeout * -10000; ft.dwLowDateTime = timestamp.u.LowPart; @@ -1914,11 +1907,6 @@ void RPC_Stop(void) RpcMgmtStopServerListening(NULL); RpcServerUnregisterIf(svcctl_v2_0_s_ifspec, NULL, TRUE); - /* synchronize with CloseThreadpoolWait */ - EnterCriticalSection(&shutdown_cs); - service_shutdown = TRUE; - LeaveCriticalSection(&shutdown_cs); - CloseThreadpoolCleanupGroupMembers(cleanup_group, TRUE, NULL); CloseThreadpoolCleanupGroup(cleanup_group); CloseHandle(exit_event);
1
0
0
0
Sebastian Lackner : ntdll: Do not call group cancel callback for finished simple callbacks.
by Alexandre Julliard
22 Aug '16
22 Aug '16
Module: wine Branch: master Commit: a9f648ef6969c7732cfb289160b77593e198eab1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a9f648ef6969c7732cfb28916…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sat Aug 20 22:38:43 2016 +0200 ntdll: Do not call group cancel callback for finished simple callbacks. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/threadpool.c | 20 ++++++++++++++++++++ dlls/ntdll/threadpool.c | 33 +++++++++++++++++++-------------- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/dlls/ntdll/tests/threadpool.c b/dlls/ntdll/tests/threadpool.c index 7eccb23..af0b667 100644 --- a/dlls/ntdll/tests/threadpool.c +++ b/dlls/ntdll/tests/threadpool.c @@ -705,6 +705,14 @@ static void test_tp_work_scheduler(void) pTpReleasePool(pool); } +static void CALLBACK simple_release_cb(TP_CALLBACK_INSTANCE *instance, void *userdata) +{ + HANDLE *semaphores = userdata; + trace("Running simple release callback\n"); + ReleaseSemaphore(semaphores, 1, NULL); + Sleep(200); /* wait until main thread is in TpReleaseCleanupGroupMembers */ +} + static void CALLBACK work_release_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work) { HANDLE semaphore = userdata; @@ -1008,6 +1016,18 @@ static void test_tp_group_cancel(void) ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); pTpReleaseCleanupGroupMembers(group, TRUE, NULL); + /* terminated simple callbacks should not trigger the group cancel callback */ + memset(&environment, 0, sizeof(environment)); + environment.Version = 1; + environment.Pool = pool; + environment.CleanupGroup = group; + environment.CleanupGroupCancelCallback = unexpected_group_cancel_cleanup_cb; + status = pTpSimpleTryPost(simple_release_cb, semaphores[1], &environment); + ok(!status, "TpSimpleTryPost failed with status %x\n", status); + result = WaitForSingleObject(semaphores[1], 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + pTpReleaseCleanupGroupMembers(group, TRUE, semaphores); + /* test cancellation callback for objects with multiple instances */ work = NULL; memset(&environment, 0, sizeof(environment)); diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c index a572869..04790aa 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -1885,11 +1885,7 @@ static void tp_object_initialize( struct threadpool_object *object, struct threa } if (is_simple_callback) - { - tp_object_prepare_shutdown( object ); - object->shutdown = TRUE; tp_object_release( object ); - } } /*********************************************************************** @@ -2185,6 +2181,13 @@ static void CALLBACK threadpool_worker_proc( void *param ) RtlEnterCriticalSection( &pool->cs ); pool->num_busy_workers--; + /* Simple callbacks are automatically shutdown after execution. */ + if (object->type == TP_OBJECT_TYPE_SIMPLE) + { + tp_object_prepare_shutdown( object ); + object->shutdown = TRUE; + } + object->num_running_callbacks--; if (!object->num_pending_callbacks && !object->num_running_callbacks) RtlWakeAllConditionVariable( &object->group_finished_event ); @@ -2598,18 +2601,20 @@ VOID WINAPI TpReleaseCleanupGroupMembers( TP_CLEANUP_GROUP *group, BOOL cancel_p { tp_object_wait( object, TRUE ); - /* Execute group cancellation callback if defined, and if this was actually a group cancel. */ - if ((object->type == TP_OBJECT_TYPE_SIMPLE || !object->shutdown) && - cancel_pending && object->group_cancel_callback) + if (!object->shutdown) { - TRACE( "executing group cancel callback %p(%p, %p)\n", - object->group_cancel_callback, object->userdata, userdata ); - object->group_cancel_callback( object->userdata, userdata ); - TRACE( "callback %p returned\n", object->group_cancel_callback ); - } + /* Execute group cancellation callback if defined, and if this was actually a group cancel. */ + if (cancel_pending && object->group_cancel_callback) + { + TRACE( "executing group cancel callback %p(%p, %p)\n", + object->group_cancel_callback, object->userdata, userdata ); + object->group_cancel_callback( object->userdata, userdata ); + TRACE( "callback %p returned\n", object->group_cancel_callback ); + } - if (object->type != TP_OBJECT_TYPE_SIMPLE && !object->shutdown) - tp_object_release( object ); + if (object->type != TP_OBJECT_TYPE_SIMPLE) + tp_object_release( object ); + } object->shutdown = TRUE; tp_object_release( object );
1
0
0
0
Sebastian Lackner : ntdll: Group cancel callbacks should be executed after waiting for pending callbacks.
by Alexandre Julliard
22 Aug '16
22 Aug '16
Module: wine Branch: master Commit: be7bcdc0f94d306109140dbfd06635c26e9eb14a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=be7bcdc0f94d306109140dbfd…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sat Aug 20 21:23:48 2016 +0200 ntdll: Group cancel callbacks should be executed after waiting for pending callbacks. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/threadpool.c | 65 +++++++++++++++++++++++++++++++++++++++++++ dlls/ntdll/threadpool.c | 29 +++++++++---------- 2 files changed, 80 insertions(+), 14 deletions(-) diff --git a/dlls/ntdll/tests/threadpool.c b/dlls/ntdll/tests/threadpool.c index f59a15c..7eccb23 100644 --- a/dlls/ntdll/tests/threadpool.c +++ b/dlls/ntdll/tests/threadpool.c @@ -835,6 +835,18 @@ static void CALLBACK simple_group_cancel_cb(TP_CALLBACK_INSTANCE *instance, void ReleaseSemaphore(semaphores[1], 1, NULL); } +static void CALLBACK work_group_cancel_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work) +{ + HANDLE *semaphores = userdata; + DWORD result; + + trace("Running work group cancel callback\n"); + + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 200); + ok(result == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", result); +} + static void CALLBACK group_cancel_cleanup_release_cb(void *object, void *userdata) { HANDLE *semaphores = userdata; @@ -844,6 +856,15 @@ static void CALLBACK group_cancel_cleanup_release_cb(void *object, void *userdat ReleaseSemaphore(semaphores[0], 1, NULL); } +static void CALLBACK group_cancel_cleanup_release2_cb(void *object, void *userdata) +{ + HANDLE *semaphores = userdata; + trace("Running group cancel cleanup release2 callback\n"); + group_cancel_tid = GetCurrentThreadId(); + ok(object == userdata, "expected %p, got %p\n", userdata, object); + ReleaseSemaphore(semaphores[0], 1, NULL); +} + static void CALLBACK group_cancel_cleanup_increment_cb(void *object, void *userdata) { trace("Running group cancel cleanup increment callback\n"); @@ -872,6 +893,11 @@ static void CALLBACK unexpected_wait_cb(TP_CALLBACK_INSTANCE *instance, void *us ok(0, "Unexpected callback\n"); } +static void CALLBACK unexpected_group_cancel_cleanup_cb(void *object, void *userdata) +{ + ok(0, "Unexpected callback\n"); +} + static void test_tp_group_cancel(void) { TP_CALLBACK_ENVIRON environment; @@ -943,6 +969,45 @@ static void test_tp_group_cancel(void) ok(group_cancel_tid == GetCurrentThreadId(), "expected tid %x, got %x\n", GetCurrentThreadId(), group_cancel_tid); + /* test if cancellation callbacks are executed before or after wait */ + work = NULL; + memset(&environment, 0, sizeof(environment)); + environment.Version = 1; + environment.Pool = pool; + environment.CleanupGroup = group; + environment.CleanupGroupCancelCallback = group_cancel_cleanup_release2_cb; + status = pTpAllocWork(&work, work_group_cancel_cb, semaphores, &environment); + ok(!status, "TpAllocWork failed with status %x\n", status); + ok(work != NULL, "expected work != NULL\n"); + pTpPostWork(work); + pTpPostWork(work); + + result = WaitForSingleObject(semaphores[1], 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + group_cancel_tid = 0xdeadbeef; + pTpReleaseCleanupGroupMembers(group, TRUE, semaphores); + result = WaitForSingleObject(semaphores[0], 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(group_cancel_tid == GetCurrentThreadId(), "expected tid %x, got %x\n", + GetCurrentThreadId(), group_cancel_tid); + + /* group cancel callback is not executed if object is destroyed while waiting */ + work = NULL; + memset(&environment, 0, sizeof(environment)); + environment.Version = 1; + environment.Pool = pool; + environment.CleanupGroup = group; + environment.CleanupGroupCancelCallback = unexpected_group_cancel_cleanup_cb; + status = pTpAllocWork(&work, work_release_cb, semaphores[1], &environment); + ok(!status, "TpAllocWork failed with status %x\n", status); + ok(work != NULL, "expected work != NULL\n"); + pTpPostWork(work); + + result = WaitForSingleObject(semaphores[1], 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + pTpReleaseCleanupGroupMembers(group, TRUE, NULL); + /* test cancellation callback for objects with multiple instances */ work = NULL; memset(&environment, 0, sizeof(environment)); diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c index 61f6ea0..a572869 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -1948,7 +1948,7 @@ static void tp_object_submit( struct threadpool_object *object, BOOL signaled ) * * Cancels all currently pending callbacks for a specific object. */ -static void tp_object_cancel( struct threadpool_object *object, BOOL group_cancel, PVOID userdata ) +static void tp_object_cancel( struct threadpool_object *object ) { struct threadpool *pool = object->pool; LONG pending_callbacks = 0; @@ -1965,15 +1965,6 @@ static void tp_object_cancel( struct threadpool_object *object, BOOL group_cance } RtlLeaveCriticalSection( &pool->cs ); - /* Execute group cancellation callback if defined, and if this was actually a group cancel. */ - if (group_cancel && object->group_cancel_callback) - { - TRACE( "executing group cancel callback %p(%p, %p)\n", - object->group_cancel_callback, object->userdata, userdata ); - object->group_cancel_callback( object->userdata, userdata ); - TRACE( "callback %p returned\n", object->group_cancel_callback ); - } - while (pending_callbacks--) tp_object_release( object ); } @@ -2598,7 +2589,7 @@ VOID WINAPI TpReleaseCleanupGroupMembers( TP_CLEANUP_GROUP *group, BOOL cancel_p { LIST_FOR_EACH_ENTRY( object, &members, struct threadpool_object, group_entry ) { - tp_object_cancel( object, TRUE, userdata ); + tp_object_cancel( object ); } } @@ -2607,6 +2598,16 @@ VOID WINAPI TpReleaseCleanupGroupMembers( TP_CLEANUP_GROUP *group, BOOL cancel_p { tp_object_wait( object, TRUE ); + /* Execute group cancellation callback if defined, and if this was actually a group cancel. */ + if ((object->type == TP_OBJECT_TYPE_SIMPLE || !object->shutdown) && + cancel_pending && object->group_cancel_callback) + { + TRACE( "executing group cancel callback %p(%p, %p)\n", + object->group_cancel_callback, object->userdata, userdata ); + object->group_cancel_callback( object->userdata, userdata ); + TRACE( "callback %p returned\n", object->group_cancel_callback ); + } + if (object->type != TP_OBJECT_TYPE_SIMPLE && !object->shutdown) tp_object_release( object ); @@ -2900,7 +2901,7 @@ VOID WINAPI TpWaitForTimer( TP_TIMER *timer, BOOL cancel_pending ) TRACE( "%p %d\n", timer, cancel_pending ); if (cancel_pending) - tp_object_cancel( this, FALSE, NULL ); + tp_object_cancel( this ); tp_object_wait( this, FALSE ); } @@ -2914,7 +2915,7 @@ VOID WINAPI TpWaitForWait( TP_WAIT *wait, BOOL cancel_pending ) TRACE( "%p %d\n", wait, cancel_pending ); if (cancel_pending) - tp_object_cancel( this, FALSE, NULL ); + tp_object_cancel( this ); tp_object_wait( this, FALSE ); } @@ -2928,6 +2929,6 @@ VOID WINAPI TpWaitForWork( TP_WORK *work, BOOL cancel_pending ) TRACE( "%p %u\n", work, cancel_pending ); if (cancel_pending) - tp_object_cancel( this, FALSE, NULL ); + tp_object_cancel( this ); tp_object_wait( this, FALSE ); }
1
0
0
0
Sebastian Lackner : ntdll: Call group cancel callback with the correct arguments.
by Alexandre Julliard
22 Aug '16
22 Aug '16
Module: wine Branch: master Commit: a8830a24783feebc63ea0b83391053a8cd14d635 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a8830a24783feebc63ea0b833…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sat Aug 20 21:23:24 2016 +0200 ntdll: Call group cancel callback with the correct arguments. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/threadpool.c | 54 ++++++++++++++++++++++++++++++++++++------- dlls/ntdll/threadpool.c | 7 +++--- 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/dlls/ntdll/tests/threadpool.c b/dlls/ntdll/tests/threadpool.c index 7672d63..f59a15c 100644 --- a/dlls/ntdll/tests/threadpool.c +++ b/dlls/ntdll/tests/threadpool.c @@ -813,21 +813,25 @@ static void test_tp_group_wait(void) static DWORD group_cancel_tid; -static void CALLBACK group_cancel_cb(TP_CALLBACK_INSTANCE *instance, void *userdata) +static void CALLBACK simple_group_cancel_cb(TP_CALLBACK_INSTANCE *instance, void *userdata) { HANDLE *semaphores = userdata; NTSTATUS status; DWORD result; + int i; - trace("Running group cancel callback\n"); + trace("Running simple group cancel callback\n"); status = pTpCallbackMayRunLong(instance); ok(status == STATUS_TOO_MANY_THREADS || broken(status == 1) /* Win Vista / 2008 */, "expected STATUS_TOO_MANY_THREADS, got %08x\n", status); ReleaseSemaphore(semaphores[1], 1, NULL); - result = WaitForSingleObject(semaphores[0], 1000); - ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + for (i = 0; i < 4; i++) + { + result = WaitForSingleObject(semaphores[0], 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + } ReleaseSemaphore(semaphores[1], 1, NULL); } @@ -836,6 +840,7 @@ static void CALLBACK group_cancel_cleanup_release_cb(void *object, void *userdat HANDLE *semaphores = userdata; trace("Running group cancel cleanup release callback\n"); group_cancel_tid = GetCurrentThreadId(); + ok(object == (void *)0xdeadbeef, "expected 0xdeadbeef, got %p\n", object); ReleaseSemaphore(semaphores[0], 1, NULL); } @@ -846,7 +851,23 @@ static void CALLBACK group_cancel_cleanup_increment_cb(void *object, void *userd InterlockedIncrement((LONG *)userdata); } -static void CALLBACK unexpected_cb(TP_CALLBACK_INSTANCE *instance, void *userdata) +static void CALLBACK unexpected_simple_cb(TP_CALLBACK_INSTANCE *instance, void *userdata) +{ + ok(0, "Unexpected callback\n"); +} + +static void CALLBACK unexpected_work_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work) +{ + ok(0, "Unexpected callback\n"); +} + +static void CALLBACK unexpected_timer_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_TIMER *timer) +{ + ok(0, "Unexpected callback\n"); +} + +static void CALLBACK unexpected_wait_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, + TP_WAIT *wait, TP_WAIT_RESULT result) { ok(0, "Unexpected callback\n"); } @@ -858,12 +879,14 @@ static void test_tp_group_cancel(void) LONG userdata, userdata2; HANDLE semaphores[2]; NTSTATUS status; + TP_TIMER *timer; + TP_WAIT *wait; TP_WORK *work; TP_POOL *pool; DWORD result; int i; - semaphores[0] = CreateSemaphoreA(NULL, 0, 1, NULL); + semaphores[0] = CreateSemaphoreA(NULL, 0, 4, NULL); ok(semaphores[0] != NULL, "CreateSemaphoreA failed %u\n", GetLastError()); semaphores[1] = CreateSemaphoreA(NULL, 0, 1, NULL); ok(semaphores[1] != NULL, "CreateSemaphoreA failed %u\n", GetLastError()); @@ -885,7 +908,7 @@ static void test_tp_group_cancel(void) memset(&environment, 0, sizeof(environment)); environment.Version = 1; environment.Pool = pool; - status = pTpSimpleTryPost(group_cancel_cb, semaphores, &environment); + status = pTpSimpleTryPost(simple_group_cancel_cb, semaphores, &environment); ok(!status, "TpSimpleTryPost failed with status %x\n", status); result = WaitForSingleObject(semaphores[1], 1000); ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); @@ -895,9 +918,24 @@ static void test_tp_group_cancel(void) environment.Pool = pool; environment.CleanupGroup = group; environment.CleanupGroupCancelCallback = group_cancel_cleanup_release_cb; - status = pTpSimpleTryPost(unexpected_cb, NULL, &environment); + status = pTpSimpleTryPost(unexpected_simple_cb, (void *)0xdeadbeef, &environment); ok(!status, "TpSimpleTryPost failed with status %x\n", status); + work = NULL; + status = pTpAllocWork(&work, unexpected_work_cb, (void *)0xdeadbeef, &environment); + ok(!status, "TpAllocWork failed with status %x\n", status); + ok(work != NULL, "expected work != NULL\n"); + + timer = NULL; + status = pTpAllocTimer(&timer, unexpected_timer_cb, (void *)0xdeadbeef, &environment); + ok(!status, "TpAllocTimer failed with status %x\n", status); + ok(timer != NULL, "expected timer != NULL\n"); + + wait = NULL; + status = pTpAllocWait(&wait, unexpected_wait_cb, (void *)0xdeadbeef, &environment); + ok(!status, "TpAllocWait failed with status %x\n", status); + ok(wait != NULL, "expected wait != NULL\n"); + group_cancel_tid = 0xdeadbeef; pTpReleaseCleanupGroupMembers(group, TRUE, semaphores); result = WaitForSingleObject(semaphores[1], 1000); diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c index eea5a88..61f6ea0 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -1966,10 +1966,11 @@ static void tp_object_cancel( struct threadpool_object *object, BOOL group_cance RtlLeaveCriticalSection( &pool->cs ); /* Execute group cancellation callback if defined, and if this was actually a group cancel. */ - if (pending_callbacks && group_cancel && object->group_cancel_callback) + if (group_cancel && object->group_cancel_callback) { - TRACE( "executing group cancel callback %p(%p, %p)\n", object->group_cancel_callback, object, userdata ); - object->group_cancel_callback( object, userdata ); + TRACE( "executing group cancel callback %p(%p, %p)\n", + object->group_cancel_callback, object->userdata, userdata ); + object->group_cancel_callback( object->userdata, userdata ); TRACE( "callback %p returned\n", object->group_cancel_callback ); }
1
0
0
0
Sebastian Lackner : ntdll/tests: Add tests for releasing threadpool objects during TpReleaseCleanupGroupMembers.
by Alexandre Julliard
22 Aug '16
22 Aug '16
Module: wine Branch: master Commit: 51447083920885defa679d88579e13f838a2494c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=51447083920885defa679d885…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sat Aug 20 21:22:54 2016 +0200 ntdll/tests: Add tests for releasing threadpool objects during TpReleaseCleanupGroupMembers. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/threadpool.c | 109 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 108 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/tests/threadpool.c b/dlls/ntdll/tests/threadpool.c index 9b4b522..7672d63 100644 --- a/dlls/ntdll/tests/threadpool.c +++ b/dlls/ntdll/tests/threadpool.c @@ -1,7 +1,7 @@ /* * Unit test suite for thread pool functions * - * Copyright 2015 Sebastian Lackner + * Copyright 2015-2016 Sebastian Lackner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -705,6 +705,112 @@ static void test_tp_work_scheduler(void) pTpReleasePool(pool); } +static void CALLBACK work_release_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work) +{ + HANDLE semaphore = userdata; + trace("Running work release callback\n"); + ReleaseSemaphore(semaphore, 1, NULL); + Sleep(200); /* wait until main thread is in TpReleaseCleanupGroupMembers */ + pTpReleaseWork(work); +} + +static void CALLBACK timer_release_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_TIMER *timer) +{ + HANDLE semaphore = userdata; + trace("Running timer release callback\n"); + ReleaseSemaphore(semaphore, 1, NULL); + Sleep(200); /* wait until main thread is in TpReleaseCleanupGroupMembers */ + pTpReleaseTimer(timer); +} + +static void CALLBACK wait_release_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, + TP_WAIT *wait, TP_WAIT_RESULT result) +{ + HANDLE semaphore = userdata; + trace("Running wait release callback\n"); + ReleaseSemaphore(semaphore, 1, NULL); + Sleep(200); /* wait until main thread is in TpReleaseCleanupGroupMembers */ + pTpReleaseWait(wait); +} + +static void test_tp_group_wait(void) +{ + TP_CALLBACK_ENVIRON environment; + TP_CLEANUP_GROUP *group; + LARGE_INTEGER when; + HANDLE semaphore; + NTSTATUS status; + TP_TIMER *timer; + TP_WAIT *wait; + TP_WORK *work; + TP_POOL *pool; + DWORD result; + + semaphore = CreateSemaphoreA(NULL, 0, 1, NULL); + ok(semaphore != NULL, "CreateSemaphoreA failed %u\n", GetLastError()); + + /* allocate new threadpool */ + pool = NULL; + status = pTpAllocPool(&pool, NULL); + ok(!status, "TpAllocPool failed with status %x\n", status); + ok(pool != NULL, "expected pool != NULL\n"); + + /* allocate a cleanup group */ + group = NULL; + status = pTpAllocCleanupGroup(&group); + ok(!status, "TpAllocCleanupGroup failed with status %x\n", status); + ok(group != NULL, "expected pool != NULL\n"); + + /* release work object during TpReleaseCleanupGroupMembers */ + work = NULL; + memset(&environment, 0, sizeof(environment)); + environment.Version = 1; + environment.Pool = pool; + environment.CleanupGroup = group; + status = pTpAllocWork(&work, work_release_cb, semaphore, &environment); + ok(!status, "TpAllocWork failed with status %x\n", status); + ok(work != NULL, "expected work != NULL\n"); + pTpPostWork(work); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + pTpReleaseCleanupGroupMembers(group, FALSE, NULL); + + /* release timer object during TpReleaseCleanupGroupMembers */ + timer = NULL; + memset(&environment, 0, sizeof(environment)); + environment.Version = 1; + environment.Pool = pool; + environment.CleanupGroup = group; + status = pTpAllocTimer(&timer, timer_release_cb, semaphore, &environment); + ok(!status, "TpAllocTimer failed with status %x\n", status); + ok(timer != NULL, "expected timer != NULL\n"); + when.QuadPart = 0; + pTpSetTimer(timer, &when, 0, 0); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + pTpReleaseCleanupGroupMembers(group, FALSE, NULL); + + /* release wait object during TpReleaseCleanupGroupMembers */ + wait = NULL; + memset(&environment, 0, sizeof(environment)); + environment.Version = 1; + environment.Pool = pool; + environment.CleanupGroup = group; + status = pTpAllocWait(&wait, wait_release_cb, semaphore, &environment); + ok(!status, "TpAllocWait failed with status %x\n", status); + ok(wait != NULL, "expected wait != NULL\n"); + when.QuadPart = 0; + pTpSetWait(wait, INVALID_HANDLE_VALUE, &when); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + pTpReleaseCleanupGroupMembers(group, FALSE, NULL); + + /* cleanup */ + pTpReleaseCleanupGroup(group); + pTpReleasePool(pool); + CloseHandle(semaphore); +} + static DWORD group_cancel_tid; static void CALLBACK group_cancel_cb(TP_CALLBACK_INSTANCE *instance, void *userdata) @@ -1679,6 +1785,7 @@ START_TEST(threadpool) test_tp_simple(); test_tp_work(); test_tp_work_scheduler(); + test_tp_group_wait(); test_tp_group_cancel(); test_tp_instance(); test_tp_disassociate();
1
0
0
0
Sebastian Lackner : ntdll: Allow to release threadpool objects while waiting for group.
by Alexandre Julliard
22 Aug '16
22 Aug '16
Module: wine Branch: master Commit: 53db77b5d7a16865069dd4eca83864bf48bbcc11 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=53db77b5d7a16865069dd4eca…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sat Aug 20 21:22:29 2016 +0200 ntdll: Allow to release threadpool objects while waiting for group. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/threadpool.c | 51 +++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c index 5d5b49d..eea5a88 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -2,7 +2,7 @@ * Thread pooling * * Copyright (c) 2006 Robert Shearman - * Copyright (c) 2014-2015 Sebastian Lackner + * Copyright (c) 2014-2016 Sebastian Lackner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -327,7 +327,7 @@ static inline struct threadpool_instance *impl_from_TP_CALLBACK_INSTANCE( TP_CAL static void CALLBACK threadpool_worker_proc( void *param ); static void tp_object_submit( struct threadpool_object *object, BOOL signaled ); -static void tp_object_shutdown( struct threadpool_object *object ); +static void tp_object_prepare_shutdown( struct threadpool_object *object ); static BOOL tp_object_release( struct threadpool_object *object ); static struct threadpool *default_threadpool = NULL; @@ -1886,7 +1886,8 @@ static void tp_object_initialize( struct threadpool_object *object, struct threa if (is_simple_callback) { - tp_object_shutdown( object ); + tp_object_prepare_shutdown( object ); + object->shutdown = TRUE; tp_object_release( object ); } } @@ -2001,19 +2002,16 @@ static void tp_object_wait( struct threadpool_object *object, BOOL group_wait ) } /*********************************************************************** - * tp_object_shutdown (internal) + * tp_object_prepare_shutdown (internal) * - * Marks a threadpool object for shutdown (which means that no further - * tasks can be submitted). + * Prepares a threadpool object for shutdown. */ -static void tp_object_shutdown( struct threadpool_object *object ) +static void tp_object_prepare_shutdown( struct threadpool_object *object ) { if (object->type == TP_OBJECT_TYPE_TIMER) tp_timerqueue_unlock( object ); else if (object->type == TP_OBJECT_TYPE_WAIT) tp_waitqueue_unlock( object ); - - object->shutdown = TRUE; } /*********************************************************************** @@ -2574,23 +2572,18 @@ VOID WINAPI TpReleaseCleanupGroupMembers( TP_CLEANUP_GROUP *group, BOOL cancel_p assert( object->group == this ); assert( object->is_group_member ); - /* Simple callbacks are very special. The user doesn't hold any reference, so - * they would be released too early. Add one additional temporary reference. */ - if (object->type == TP_OBJECT_TYPE_SIMPLE) + if (interlocked_inc( &object->refcount ) == 1) { - if (interlocked_inc( &object->refcount ) == 1) - { - /* Object is basically already destroyed, but group reference - * was not deleted yet. We can safely ignore this object. */ - interlocked_dec( &object->refcount ); - list_remove( &object->group_entry ); - object->is_group_member = FALSE; - continue; - } + /* Object is basically already destroyed, but group reference + * was not deleted yet. We can safely ignore this object. */ + interlocked_dec( &object->refcount ); + list_remove( &object->group_entry ); + object->is_group_member = FALSE; + continue; } object->is_group_member = FALSE; - tp_object_shutdown( object ); + tp_object_prepare_shutdown( object ); } /* Move members to a new temporary list */ @@ -2612,6 +2605,11 @@ VOID WINAPI TpReleaseCleanupGroupMembers( TP_CLEANUP_GROUP *group, BOOL cancel_p LIST_FOR_EACH_ENTRY_SAFE( object, next, &members, struct threadpool_object, group_entry ) { tp_object_wait( object, TRUE ); + + if (object->type != TP_OBJECT_TYPE_SIMPLE && !object->shutdown) + tp_object_release( object ); + + object->shutdown = TRUE; tp_object_release( object ); } } @@ -2638,7 +2636,8 @@ VOID WINAPI TpReleaseTimer( TP_TIMER *timer ) TRACE( "%p\n", timer ); - tp_object_shutdown( this ); + tp_object_prepare_shutdown( this ); + this->shutdown = TRUE; tp_object_release( this ); } @@ -2651,7 +2650,8 @@ VOID WINAPI TpReleaseWait( TP_WAIT *wait ) TRACE( "%p\n", wait ); - tp_object_shutdown( this ); + tp_object_prepare_shutdown( this ); + this->shutdown = TRUE; tp_object_release( this ); } @@ -2664,7 +2664,8 @@ VOID WINAPI TpReleaseWork( TP_WORK *work ) TRACE( "%p\n", work ); - tp_object_shutdown( this ); + tp_object_prepare_shutdown( this ); + this->shutdown = TRUE; tp_object_release( this ); }
1
0
0
0
Sebastian Lackner : ntdll/tests: Use longer waits to reduce risk of random failures on the testbot.
by Alexandre Julliard
22 Aug '16
22 Aug '16
Module: wine Branch: master Commit: 914d597eb3303f2b9a0e663802de064ad710d5cf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=914d597eb3303f2b9a0e66380…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sat Aug 20 21:18:33 2016 +0200 ntdll/tests: Use longer waits to reduce risk of random failures on the testbot. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/threadpool.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/dlls/ntdll/tests/threadpool.c b/dlls/ntdll/tests/threadpool.c index 1d8b1f9..9b4b522 100644 --- a/dlls/ntdll/tests/threadpool.c +++ b/dlls/ntdll/tests/threadpool.c @@ -579,14 +579,14 @@ static void test_tp_simple(void) static void CALLBACK work_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work) { trace("Running work callback\n"); - Sleep(10); + Sleep(100); InterlockedIncrement((LONG *)userdata); } static void CALLBACK work2_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work) { trace("Running work2 callback\n"); - Sleep(10); + Sleep(100); InterlockedExchangeAdd((LONG *)userdata, 0x10000); } @@ -599,11 +599,12 @@ static void test_tp_work(void) LONG userdata; int i; - /* allocate new threadpool */ + /* allocate new threadpool with only one thread */ pool = NULL; status = pTpAllocPool(&pool, NULL); ok(!status, "TpAllocPool failed with status %x\n", status); ok(pool != NULL, "expected pool != NULL\n"); + pTpSetPoolMaxThreads(pool, 1); /* allocate new work item */ work = NULL; @@ -614,12 +615,12 @@ static void test_tp_work(void) ok(!status, "TpAllocWork failed with status %x\n", status); ok(work != NULL, "expected work != NULL\n"); - /* post 10 identical work items at once */ + /* post 5 identical work items at once */ userdata = 0; - for (i = 0; i < 10; i++) + for (i = 0; i < 5; i++) pTpPostWork(work); pTpWaitForWork(work, FALSE); - ok(userdata == 10, "expected userdata = 10, got %u\n", userdata); + ok(userdata == 5, "expected userdata = 5, got %u\n", userdata); /* add more tasks and cancel them immediately */ userdata = 0; @@ -643,13 +644,11 @@ static void test_tp_work_scheduler(void) LONG userdata; int i; - /* allocate new threadpool */ + /* allocate new threadpool with only one thread */ pool = NULL; status = pTpAllocPool(&pool, NULL); ok(!status, "TpAllocPool failed with status %x\n", status); ok(pool != NULL, "expected pool != NULL\n"); - - /* we limit the pool to a single thread */ pTpSetPoolMaxThreads(pool, 1); /* create a cleanup group */ @@ -683,7 +682,7 @@ static void test_tp_work_scheduler(void) pTpPostWork(work); for (i = 0; i < 10; i++) pTpPostWork(work2); - Sleep(30); + Sleep(500); pTpWaitForWork(work, TRUE); pTpWaitForWork(work2, TRUE); ok(userdata & 0xffff, "expected userdata & 0xffff != 0, got %u\n", userdata & 0xffff); @@ -691,14 +690,14 @@ static void test_tp_work_scheduler(void) /* test TpReleaseCleanupGroupMembers on a work item */ userdata = 0; - for (i = 0; i < 100; i++) - pTpPostWork(work); for (i = 0; i < 10; i++) + pTpPostWork(work); + for (i = 0; i < 3; i++) pTpPostWork(work2); pTpReleaseCleanupGroupMembers(group, FALSE, NULL); pTpWaitForWork(work, TRUE); - ok((userdata & 0xffff) < 100, "expected userdata & 0xffff < 100, got %u\n", userdata & 0xffff); - ok((userdata >> 16) == 10, "expected userdata >> 16 == 10, got %u\n", userdata >> 16); + ok((userdata & 0xffff) < 10, "expected userdata & 0xffff < 10, got %u\n", userdata & 0xffff); + ok((userdata >> 16) == 3, "expected userdata >> 16 == 3, got %u\n", userdata >> 16); /* cleanup */ pTpReleaseWork(work); @@ -720,6 +719,7 @@ static void CALLBACK group_cancel_cb(TP_CALLBACK_INSTANCE *instance, void *userd ok(status == STATUS_TOO_MANY_THREADS || broken(status == 1) /* Win Vista / 2008 */, "expected STATUS_TOO_MANY_THREADS, got %08x\n", status); + ReleaseSemaphore(semaphores[1], 1, NULL); result = WaitForSingleObject(semaphores[0], 1000); ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); ReleaseSemaphore(semaphores[1], 1, NULL); @@ -781,6 +781,8 @@ static void test_tp_group_cancel(void) environment.Pool = pool; status = pTpSimpleTryPost(group_cancel_cb, semaphores, &environment); ok(!status, "TpSimpleTryPost failed with status %x\n", status); + result = WaitForSingleObject(semaphores[1], 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); memset(&environment, 0, sizeof(environment)); environment.Version = 1; @@ -816,7 +818,7 @@ static void test_tp_group_cancel(void) /* check if we get multiple cancellation callbacks */ group_cancel_tid = 0xdeadbeef; pTpReleaseCleanupGroupMembers(group, TRUE, &userdata2); - ok(userdata <= 8, "expected userdata <= 8, got %u\n", userdata); + ok(userdata <= 5, "expected userdata <= 5, got %u\n", userdata); ok(userdata2 == 1, "expected only one cancellation callback, got %u\n", userdata2); ok(group_cancel_tid == GetCurrentThreadId(), "expected tid %x, got %x\n", GetCurrentThreadId(), group_cancel_tid);
1
0
0
0
Austin English : ntdll: Forward DecodeSystemPointer/ EncodeSystemPointer to DecodePointer/EncodePointer.
by Alexandre Julliard
22 Aug '16
22 Aug '16
Module: wine Branch: master Commit: 0f137a0b89f5ead1ce9b0420c0f1562e8991f346 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0f137a0b89f5ead1ce9b0420c…
Author: Austin English <austinenglish(a)gmail.com> Date: Fri Aug 19 03:27:18 2016 -0500 ntdll: Forward DecodeSystemPointer/EncodeSystemPointer to DecodePointer/EncodePointer. Signed-off-by: Austin English <austinenglish(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/api-ms-win-core-util-l1-1-0/api-ms-win-core-util-l1-1-0.spec | 4 ++-- dlls/kernel32/kernel32.spec | 4 ++-- dlls/kernelbase/kernelbase.spec | 4 ++-- dlls/ntdll/ntdll.spec | 4 ++-- include/winbase.h | 6 ++++-- tools/make_specfiles | 1 + 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/dlls/api-ms-win-core-util-l1-1-0/api-ms-win-core-util-l1-1-0.spec b/dlls/api-ms-win-core-util-l1-1-0/api-ms-win-core-util-l1-1-0.spec index 471ee42..587b06b 100644 --- a/dlls/api-ms-win-core-util-l1-1-0/api-ms-win-core-util-l1-1-0.spec +++ b/dlls/api-ms-win-core-util-l1-1-0/api-ms-win-core-util-l1-1-0.spec @@ -1,5 +1,5 @@ @ stdcall Beep(long long) kernel32.Beep @ stdcall DecodePointer(ptr) kernel32.DecodePointer -@ stub DecodeSystemPointer +@ stdcall DecodeSystemPointer(ptr) kernel32.DecodeSystemPointer @ stdcall EncodePointer(ptr) kernel32.EncodePointer -@ stub EncodeSystemPointer +@ stdcall EncodeSystemPointer(ptr) kernel32.EncodeSystemPointer diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 239965f..2d82c71 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -355,7 +355,7 @@ @ stdcall DebugBreakProcess(long) @ stdcall DebugSetProcessKillOnExit(long) @ stdcall DecodePointer(ptr) ntdll.RtlDecodePointer -# @ stub DecodeSystemPointer ( -> ntdll.RtlDecodeSystemPointer) +@ stdcall DecodeSystemPointer(ptr) ntdll.RtlDecodeSystemPointer @ stdcall DefineDosDeviceA(long str str) @ stdcall DefineDosDeviceW(long wstr wstr) @ stdcall DelayLoadFailureHook(str str) @@ -390,7 +390,7 @@ @ stdcall DuplicateHandle(long long long ptr long long long) # @ stub EnableThreadProfiling @ stdcall EncodePointer(ptr) ntdll.RtlEncodePointer -# @ stub EncodeSystemPointer ( -> ntdll.RtlEncodeSystemPointer) +@ stdcall EncodeSystemPointer(ptr) ntdll.RtlEncodeSystemPointer @ stdcall EndUpdateResourceA(long long) @ stdcall EndUpdateResourceW(long long) @ stdcall EnterCriticalSection(ptr) ntdll.RtlEnterCriticalSection diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index e35ef8b..de9404c 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -101,7 +101,7 @@ @ stdcall CreateWellKnownSid(long ptr ptr ptr) advapi32.CreateWellKnownSid @ stdcall DebugBreak() kernel32.DebugBreak @ stdcall DecodePointer(ptr) kernel32.DecodePointer -@ stub DecodeSystemPointer +@ stdcall DecodeSystemPointer(ptr) kernel32.DecodeSystemPointer @ stdcall DefineDosDeviceW(long wstr wstr) kernel32.DefineDosDeviceW @ stdcall DeleteAce(ptr long) advapi32.DeleteAce @ stdcall DeleteCriticalSection(ptr) kernel32.DeleteCriticalSection @@ -120,7 +120,7 @@ @ stdcall DuplicateToken(long long ptr) advapi32.DuplicateToken @ stdcall DuplicateTokenEx(long long ptr long long ptr) advapi32.DuplicateTokenEx @ stdcall EncodePointer(ptr) kernel32.EncodePointer -@ stub EncodeSystemPointer +@ stdcall EncodeSystemPointer(ptr) kernel32.EncodeSystemPointer @ stdcall EnterCriticalSection(ptr) kernel32.EnterCriticalSection @ stdcall EnumCalendarInfoExEx(ptr wstr long wstr long long) kernel32.EnumCalendarInfoExEx @ stdcall EnumCalendarInfoExW(ptr long long long) kernel32.EnumCalendarInfoExW diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 5f8ee54..244a721 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -519,7 +519,7 @@ @ stub RtlDeactivateActivationContextUnsafeFast @ stub RtlDebugPrintTimes @ stdcall RtlDecodePointer(ptr) -# @ stub RtlDecodeSystemPointer +@ stdcall RtlDecodeSystemPointer(ptr) RtlDecodePointer @ stdcall RtlDecompressBuffer(long ptr long ptr long ptr) @ stdcall RtlDecompressFragment(long ptr long ptr long long ptr ptr) @ stub RtlDefaultNpAcl @@ -562,7 +562,7 @@ @ stdcall RtlEmptyAtomTable(ptr long) # @ stub RtlEnableEarlyCriticalSectionEventCreation @ stdcall RtlEncodePointer(ptr) -# @ stub RtlEncodeSystemPointer +@ stdcall RtlEncodeSystemPointer(ptr) RtlEncodePointer @ stdcall -arch=win32 -ret64 RtlEnlargedIntegerMultiply(long long) @ stdcall -arch=win32 RtlEnlargedUnsignedDivide(int64 long ptr) @ stdcall -arch=win32 -ret64 RtlEnlargedUnsignedMultiply(long long) diff --git a/include/winbase.h b/include/winbase.h index 99e3107..521d2da 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1819,7 +1819,8 @@ WINBASEAPI BOOL WINAPI DebugActiveProcessStop(DWORD); WINBASEAPI void WINAPI DebugBreak(void); WINBASEAPI BOOL WINAPI DebugBreakProcess(HANDLE); WINBASEAPI BOOL WINAPI DebugSetProcessKillOnExit(BOOL); -WINBASEAPI PVOID WINAPI DecodePointer(PVOID); +WINBASEAPI void * WINAPI DecodePointer(void *); +WINBASEAPI void * WINAPI DecodeSystemPointer(void *); WINADVAPI BOOL WINAPI DecryptFileA(LPCSTR,DWORD); WINADVAPI BOOL WINAPI DecryptFileW(LPCWSTR,DWORD); #define DecryptFile WINELIB_NAME_AW(DecryptFile) @@ -1853,7 +1854,8 @@ WINBASEAPI BOOL WINAPI DuplicateHandle(HANDLE,HANDLE,HANDLE,HANDLE*,DWORD WINADVAPI BOOL WINAPI DuplicateToken(HANDLE,SECURITY_IMPERSONATION_LEVEL,PHANDLE); WINADVAPI BOOL WINAPI DuplicateTokenEx(HANDLE,DWORD,LPSECURITY_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE); WINBASEAPI BOOL WINAPI EscapeCommFunction(HANDLE,UINT); -WINBASEAPI PVOID WINAPI EncodePointer(PVOID); +WINBASEAPI void * WINAPI EncodePointer(void *); +WINBASEAPI void * WINAPI EncodeSystemPointer(void *); WINADVAPI BOOL WINAPI EncryptFileA(LPCSTR); WINADVAPI BOOL WINAPI EncryptFileW(LPCWSTR); #define EncryptFile WINELIB_NAME_AW(EncryptFile) diff --git a/tools/make_specfiles b/tools/make_specfiles index d658f30..947cde7 100755 --- a/tools/make_specfiles +++ b/tools/make_specfiles @@ -177,6 +177,7 @@ my @dll_groups = "api-ms-win-core-wow64-l1-1-0", "api-ms-win-core-xstate-l2-1-0", "api-ms-win-core-errorhandling-l1-1-2", + "api-ms-win-core-util-l1-1-0", ], [ "kernel32",
1
0
0
0
Colin Finck : rpcrt4: Add a test for RpcBindingServerFromClient (todo_wine ).
by Alexandre Julliard
22 Aug '16
22 Aug '16
Module: wine Branch: master Commit: b59c53fbffc1519d55224ad294c26d9148296cf0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b59c53fbffc1519d55224ad29…
Author: Colin Finck <mail(a)colinfinck.de> Date: Fri Aug 19 11:52:58 2016 +0200 rpcrt4: Add a test for RpcBindingServerFromClient (todo_wine). Signed-off-by: Colin Finck <mail(a)colinfinck.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/tests/server.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c index 0b31d3d..2653f7a 100644 --- a/dlls/rpcrt4/tests/server.c +++ b/dlls/rpcrt4/tests/server.c @@ -744,6 +744,35 @@ void __cdecl s_context_handle_test(void) pNDRSContextUnmarshall2(binding, buf, NDR_LOCAL_DATA_REPRESENTATION, &server_if2.InterfaceId, 0); } + + binding = NULL; + status = RpcBindingServerFromClient(NULL, &binding); + + todo_wine + { + ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status); + ok(binding != NULL, "binding is NULL\n"); + } + + if (status == RPC_S_OK && binding != NULL) + { + unsigned char* string_binding = NULL; + unsigned char* computer_name = NULL; + + status = RpcBindingToStringBindingA(binding, &string_binding); + + ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status); + ok(string_binding != NULL, "string_binding is NULL\n"); + + status = RpcStringBindingParseA(string_binding, NULL, NULL, &computer_name, NULL, NULL); + + ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status); + ok(computer_name != NULL, "computer_name is NULL\n"); + + RpcStringFreeA(&string_binding); + RpcStringFreeA(&computer_name); + RpcBindingFree(&binding); + } } void __cdecl s_get_numbers(int length, int size, pints_t n[])
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
78
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
Results per page:
10
25
50
100
200