winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2022
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1138 discussions
Start a n
N
ew thread
Piotr Caban : msvcp140: Add condition variable tests.
by Alexandre Julliard
15 Mar '22
15 Mar '22
Module: wine Branch: master Commit: e3d02807fc7be6351fc80aa814d21b86e4e0236d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e3d02807fc7be6351fc80aa8…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Mar 15 14:37:14 2022 +0100 msvcp140: Add condition variable tests. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp140/tests/msvcp140.c | 191 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 191 insertions(+) diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c index b24c5e0f53d..14ba4a767d0 100644 --- a/dlls/msvcp140/tests/msvcp140.c +++ b/dlls/msvcp140/tests/msvcp140.c @@ -142,6 +142,45 @@ typedef struct { void *arg; } _Threadpool_chore; +typedef struct +{ + HANDLE hnd; + DWORD id; +} _Thrd_t; + +typedef struct cs_queue +{ + struct cs_queue *next; + BOOL free; + int unknown; +} cs_queue; + +typedef struct +{ + ULONG_PTR unk_thread_id; + cs_queue unk_active; + void *unknown[2]; + cs_queue *head; + void *tail; +} critical_section; + +typedef struct +{ + DWORD flags; + critical_section cs; + DWORD thread_id; + DWORD count; +} *_Mtx_t; + +typedef void *_Cnd_t; + +typedef struct { + __time64_t sec; + int nsec; +} xtime; + +typedef int (__cdecl *_Thrd_start_t)(void*); + enum file_type { file_not_found = -1, none_file, @@ -172,6 +211,20 @@ static void (__thiscall *p__TaskEventLogger__LogWorkItemStarted)(_TaskEventLogge static int (__cdecl *p__Schedule_chore)(_Threadpool_chore*); static int (__cdecl *p__Reschedule_chore)(const _Threadpool_chore*); static void (__cdecl *p__Release_chore)(_Threadpool_chore*); +static int (__cdecl *p__Mtx_init)(_Mtx_t*, int); +static void (__cdecl *p__Mtx_destroy)(_Mtx_t); +static int (__cdecl *p__Mtx_lock)(_Mtx_t); +static int (__cdecl *p__Mtx_unlock)(_Mtx_t); +static int (__cdecl *p__Cnd_init)(_Cnd_t*); +static void (__cdecl *p__Cnd_destroy)(_Cnd_t); +static int (__cdecl *p__Cnd_wait)(_Cnd_t, _Mtx_t); +static int (__cdecl *p__Cnd_timedwait)(_Cnd_t, _Mtx_t, const xtime*); +static int (__cdecl *p__Cnd_broadcast)(_Cnd_t); +static int (__cdecl *p__Cnd_signal)(_Cnd_t); +static int (__cdecl *p__Thrd_create)(_Thrd_t*, _Thrd_start_t, void*); +static int (__cdecl *p__Thrd_join)(_Thrd_t, int*); +static int (__cdecl *p__Xtime_diff_to_millis2)(const xtime*, const xtime*); +static int (__cdecl *p_xtime_get)(xtime*, int); static void (__cdecl *p_Close_dir)(void*); static MSVCP_bool (__cdecl *p_Current_get)(WCHAR *); @@ -269,6 +322,21 @@ static BOOL init(void) SET(p__Syserror_map, "?_Syserror_map@std@@YAPBDH@Z"); } + SET(p__Mtx_init, "_Mtx_init"); + SET(p__Mtx_destroy, "_Mtx_destroy"); + SET(p__Mtx_lock, "_Mtx_lock"); + SET(p__Mtx_unlock, "_Mtx_unlock"); + SET(p__Cnd_init, "_Cnd_init"); + SET(p__Cnd_destroy, "_Cnd_destroy"); + SET(p__Cnd_wait, "_Cnd_wait"); + SET(p__Cnd_timedwait, "_Cnd_timedwait"); + SET(p__Cnd_broadcast, "_Cnd_broadcast"); + SET(p__Cnd_signal, "_Cnd_signal"); + SET(p__Thrd_create, "_Thrd_create"); + SET(p__Thrd_join, "_Thrd_join"); + SET(p__Xtime_diff_to_millis2, "_Xtime_diff_to_millis2"); + SET(p_xtime_get, "xtime_get"); + SET(p_Close_dir, "_Close_dir"); SET(p_Current_get, "_Current_get"); SET(p_Current_set, "_Current_set"); @@ -1385,6 +1453,128 @@ static void test_Equivalent(void) ok(SetCurrentDirectoryW(current_path), "SetCurrentDirectoryW failed\n"); } +#define NUM_THREADS 10 +#define TIMEDELTA 250 /* 250 ms uncertainty allowed */ +struct cndmtx +{ + HANDLE initialized; + LONG started; + int thread_no; + + _Cnd_t cnd; + _Mtx_t mtx; + BOOL timed_wait; +}; + +static int __cdecl cnd_wait_thread(void *arg) +{ + struct cndmtx *cm = arg; + int r; + + p__Mtx_lock(cm->mtx); + + if(InterlockedIncrement(&cm->started) == cm->thread_no) + SetEvent(cm->initialized); + + if(cm->timed_wait) { + xtime xt; + + p_xtime_get(&xt, 1); + xt.sec += 2; + r = p__Cnd_timedwait(cm->cnd, cm->mtx, &xt); + ok(!r, "timed wait failed\n"); + } else { + r = p__Cnd_wait(cm->cnd, cm->mtx); + ok(!r, "wait failed\n"); + } + + p__Mtx_unlock(cm->mtx); + return 0; +} + +static void test_cnd(void) +{ + _Thrd_t threads[NUM_THREADS]; + xtime xt, before, after; + struct cndmtx cm; + int r, i, diff; + _Cnd_t cnd; + _Mtx_t mtx; + + r = p__Cnd_init(&cnd); + ok(!r, "failed to init cnd\n"); + + r = p__Mtx_init(&mtx, 0); + ok(!r, "failed to init mtx\n"); + + p__Cnd_destroy(NULL); + + /* test _Cnd_signal/_Cnd_wait */ + cm.initialized = CreateEventW(NULL, FALSE, FALSE, NULL); + cm.started = 0; + cm.thread_no = 1; + cm.cnd = cnd; + cm.mtx = mtx; + cm.timed_wait = FALSE; + p__Thrd_create(&threads[0], cnd_wait_thread, (void*)&cm); + + WaitForSingleObject(cm.initialized, INFINITE); + p__Mtx_lock(mtx); + p__Mtx_unlock(mtx); + + r = p__Cnd_signal(cm.cnd); + ok(!r, "failed to signal\n"); + p__Thrd_join(threads[0], NULL); + + /* test _Cnd_timedwait time out */ + p__Mtx_lock(mtx); + p_xtime_get(&before, 1); + xt = before; + xt.sec += 1; + /* try to avoid failures on spurious wakeup */ + p__Cnd_timedwait(cnd, mtx, &xt); + r = p__Cnd_timedwait(cnd, mtx, &xt); + p_xtime_get(&after, 1); + p__Mtx_unlock(mtx); + + diff = p__Xtime_diff_to_millis2(&after, &before); + ok(r == 2, "should have timed out\n"); + ok(diff > 1000 - TIMEDELTA, "got %d\n", diff); + + /* test _Cnd_timedwait */ + cm.started = 0; + cm.timed_wait = TRUE; + p__Thrd_create(&threads[0], cnd_wait_thread, (void*)&cm); + + WaitForSingleObject(cm.initialized, INFINITE); + p__Mtx_lock(mtx); + p__Mtx_unlock(mtx); + + r = p__Cnd_signal(cm.cnd); + ok(!r, "failed to signal\n"); + p__Thrd_join(threads[0], NULL); + + /* test _Cnd_broadcast */ + cm.started = 0; + cm.thread_no = NUM_THREADS; + + for(i = 0; i < cm.thread_no; i++) + p__Thrd_create(&threads[i], cnd_wait_thread, (void*)&cm); + + WaitForSingleObject(cm.initialized, INFINITE); + p__Mtx_lock(mtx); + p__Mtx_unlock(mtx); + + r = p__Cnd_broadcast(cnd); + ok(!r, "failed to broadcast\n"); + for(i = 0; i < cm.thread_no; i++) + p__Thrd_join(threads[i], NULL); + + p__Cnd_destroy(cnd); + p__Mtx_destroy(mtx); + CloseHandle(cm.initialized); +} + START_TEST(msvcp140) { if(!init()) return; @@ -1410,5 +1600,6 @@ START_TEST(msvcp140) test__Winerror_map(); test__Syserror_map(); test_Equivalent(); + test_cnd(); FreeLibrary(msvcp); }
1
0
0
0
Piotr Caban : msvcp140: Add SRWLock based _Mtx_t and _Cnd_t implementation.
by Alexandre Julliard
15 Mar '22
15 Mar '22
Module: wine Branch: master Commit: b8128f4162b5af7168ef7683543b96cd47d92748 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b8128f4162b5af7168ef7683…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Mar 15 14:37:01 2022 +0100 msvcp140: Add SRWLock based _Mtx_t and _Cnd_t implementation. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp90/misc.c | 13 +++--- dlls/msvcp90/msvcp90.h | 37 +++++++++++------ dlls/msvcp90/msvcp_main.c | 101 +++++++++++++++++++++++++++++++++++----------- 3 files changed, 107 insertions(+), 44 deletions(-) diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c index c7047f72164..103eca6f4a3 100644 --- a/dlls/msvcp90/misc.c +++ b/dlls/msvcp90/misc.c @@ -22,9 +22,6 @@ #include "msvcp90.h" -#include "windef.h" -#include "winbase.h" -#include "winternl.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(msvcp); @@ -714,7 +711,7 @@ unsigned int __cdecl _Random_device(void) typedef struct { DWORD flags; - critical_section cs; + cs cs; DWORD thread_id; DWORD count; } *_Mtx_t; @@ -802,7 +799,7 @@ int __cdecl _Mtx_trylock(_Mtx_arg_t mtx) return 0; } -critical_section* __cdecl _Mtx_getconcrtcs(_Mtx_arg_t mtx) +void* __cdecl _Mtx_getconcrtcs(_Mtx_arg_t mtx) { return &MTX_T_FROM_ARG(mtx)->cs; } @@ -825,7 +822,7 @@ void __cdecl _Mtx_reset_owner(_Mtx_arg_t mtx) typedef struct { - _Condition_variable cv; + cv cv; } *_Cnd_t; #if _MSVCP_VER >= 140 @@ -852,7 +849,7 @@ int __cdecl _Cnd_init(_Cnd_t *cnd) int __cdecl _Cnd_wait(_Cnd_arg_t cnd, _Mtx_arg_t mtx) { - _Condition_variable *cv = &CND_T_FROM_ARG(cnd)->cv; + cv *cv = &CND_T_FROM_ARG(cnd)->cv; _Mtx_t m = MTX_T_FROM_ARG(mtx); _Mtx_clear_owner(mtx); @@ -863,7 +860,7 @@ int __cdecl _Cnd_wait(_Cnd_arg_t cnd, _Mtx_arg_t mtx) int __cdecl _Cnd_timedwait(_Cnd_arg_t cnd, _Mtx_arg_t mtx, const xtime *xt) { - _Condition_variable *cv = &CND_T_FROM_ARG(cnd)->cv; + cv *cv = &CND_T_FROM_ARG(cnd)->cv; _Mtx_t m = MTX_T_FROM_ARG(mtx); bool r; diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 49840affcf6..b996ae84a46 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -19,6 +19,7 @@ #include "stdbool.h" #include "stdlib.h" #include "windef.h" +#include "winbase.h" #include "cxx.h" #define CXX_EXCEPTION 0xe06d7363 @@ -58,6 +59,12 @@ typedef struct void *tail; } critical_section; +typedef union +{ + critical_section conc; + SRWLOCK win; +} cs; + typedef struct cv_queue { struct cv_queue *next; LONG expired; @@ -69,18 +76,24 @@ typedef struct { critical_section lock; } _Condition_variable; -extern void cs_init(critical_section*); -extern void cs_destroy(critical_section*); -extern void cs_lock(critical_section*); -extern void cs_unlock(critical_section*); -extern bool cs_trylock(critical_section*); - -extern void cv_init(_Condition_variable*); -extern void cv_destroy(_Condition_variable*); -extern void cv_wait(_Condition_variable*, critical_section*); -extern bool cv_wait_for(_Condition_variable*, critical_section*, unsigned int); -extern void cv_notify_one(_Condition_variable*); -extern void cv_notify_all(_Condition_variable*); +typedef union +{ + _Condition_variable conc; + CONDITION_VARIABLE win; +} cv; + +extern void cs_init(cs*); +extern void cs_destroy(cs*); +extern void cs_lock(cs*); +extern void cs_unlock(cs*); +extern bool cs_trylock(cs*); + +extern void cv_init(cv*); +extern void cv_destroy(cv*); +extern void cv_wait(cv*, cs*); +extern bool cv_wait_for(cv*, cs*, unsigned int); +extern void cv_notify_one(cv*); +extern void cv_notify_all(cv*); #endif #if _MSVCP_VER >= 100 diff --git a/dlls/msvcp90/msvcp_main.c b/dlls/msvcp90/msvcp_main.c index afaa461312e..4c9faec9e26 100644 --- a/dlls/msvcp90/msvcp_main.c +++ b/dlls/msvcp90/msvcp_main.c @@ -56,7 +56,7 @@ DEFINE_VTBL_WRAPPER(56); void* (__cdecl *MSVCRT_set_new_handler)(void*); -#if _MSVCP_VER >= 110 +#if _MSVCP_VER >= 110 && _MSVCP_VER <= 120 #ifdef __ASM_USE_THISCALL_WRAPPER extern void *call_thiscall_func; @@ -93,59 +93,112 @@ bool (__thiscall *_Condition_variable_wait_for)(_Condition_variable*, void (__thiscall *_Condition_variable_notify_one)(_Condition_variable*); void (__thiscall *_Condition_variable_notify_all)(_Condition_variable*); -void cs_init(critical_section *cs) +void cs_init(cs *cs) { - call_func1(critical_section_ctor, cs); + call_func1(critical_section_ctor, &cs->conc); } -void cs_destroy(critical_section *cs) +void cs_destroy(cs *cs) { - call_func1(critical_section_dtor, cs); + call_func1(critical_section_dtor, &cs->conc); } -void cs_lock(critical_section *cs) +void cs_lock(cs *cs) { - call_func1(critical_section_lock, cs); + call_func1(critical_section_lock, &cs->conc); } -void cs_unlock(critical_section *cs) +void cs_unlock(cs *cs) { - call_func1(critical_section_unlock, cs); + call_func1(critical_section_unlock, &cs->conc); } -bool cs_trylock(critical_section *cs) +bool cs_trylock(cs *cs) { - return call_func1(critical_section_trylock, cs); + return call_func1(critical_section_trylock, &cs->conc); } -void cv_init(_Condition_variable *cv) +void cv_init(cv *cv) { - call_func1(_Condition_variable_ctor, cv); + call_func1(_Condition_variable_ctor, &cv->conc); } -void cv_destroy(_Condition_variable *cv) +void cv_destroy(cv *cv) { - call_func1(_Condition_variable_dtor, cv); + call_func1(_Condition_variable_dtor, &cv->conc); } -void cv_wait(_Condition_variable *cv, critical_section *cs) +void cv_wait(cv *cv, cs *cs) { - call_func2(_Condition_variable_wait, cv, cs); + call_func2(_Condition_variable_wait, &cv->conc, &cs->conc); } -bool cv_wait_for(_Condition_variable *cv, critical_section *cs, unsigned int timeout) +bool cv_wait_for(cv *cv, cs *cs, unsigned int timeout) { - return call_func3(_Condition_variable_wait_for, cv, cs, timeout); + return call_func3(_Condition_variable_wait_for, &cv->conc, &cs->conc, timeout); } -void cv_notify_one(_Condition_variable *cv) +void cv_notify_one(cv *cv) { - call_func1(_Condition_variable_notify_one, cv); + call_func1(_Condition_variable_notify_one, &cv->conc); } -void cv_notify_all(_Condition_variable *cv) +void cv_notify_all(cv *cv) { - call_func1(_Condition_variable_notify_all, cv); + call_func1(_Condition_variable_notify_all, &cv->conc); +} +#elif _MSVCP_VER >= 140 +void cs_init(cs *cs) +{ + InitializeSRWLock(&cs->win); +} + +void cs_destroy(cs *cs) +{ +} + +void cs_lock(cs *cs) +{ + AcquireSRWLockExclusive(&cs->win); +} + +void cs_unlock(cs *cs) +{ + ReleaseSRWLockExclusive(&cs->win); +} + +bool cs_trylock(cs *cs) +{ + return TryAcquireSRWLockExclusive(&cs->win); +} + +void cv_init(cv *cv) +{ + InitializeConditionVariable(&cv->win); +} + +void cv_destroy(cv *cv) +{ +} + +void cv_wait(cv *cv, cs *cs) +{ + SleepConditionVariableSRW(&cv->win, &cs->win, INFINITE, 0); +} + +bool cv_wait_for(cv *cv, cs *cs, unsigned int timeout) +{ + return SleepConditionVariableSRW(&cv->win, &cs->win, timeout, 0); +} + +void cv_notify_one(cv *cv) +{ + WakeConditionVariable(&cv->win); +} + +void cv_notify_all(cv *cv) +{ + WakeAllConditionVariable(&cv->win); } #endif @@ -240,7 +293,7 @@ static void init_cxx_funcs(void) } #endif -#if _MSVCP_VER >= 110 +#if _MSVCP_VER >= 110 && _MSVCP_VER <= 120 if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */ { critical_section_ctor = (void*)GetProcAddress(hcon, "??0critical_section@Concurrency@@QEAA@XZ");
1
0
0
0
Piotr Caban : msvcp110: Use _Condition_variable in _Cnd_t implementation.
by Alexandre Julliard
15 Mar '22
15 Mar '22
Module: wine Branch: master Commit: 3f97321c73320cd2cb05cd1b66e9134ff676e058 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3f97321c73320cd2cb05cd1b…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Mar 15 14:36:56 2022 +0100 msvcp110: Use _Condition_variable in _Cnd_t implementation. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp90/misc.c | 73 ++++++++++++----------------------------------- dlls/msvcp90/msvcp90.h | 18 ++++++++++++ dlls/msvcp90/msvcp_main.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 55 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=3f97321c73320cd2cb05…
1
0
0
0
Piotr Caban : msvcp110: Add _Mtx_reset_owner implementation.
by Alexandre Julliard
15 Mar '22
15 Mar '22
Module: wine Branch: master Commit: e040e2c16ac1db7f776ab392a8bb0b6ae8fbdf77 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e040e2c16ac1db7f776ab392…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Mar 15 14:36:49 2022 +0100 msvcp110: Add _Mtx_reset_owner implementation. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp110/msvcp110.spec | 2 +- dlls/msvcp120/msvcp120.spec | 2 +- dlls/msvcp120_app/msvcp120_app.spec | 2 +- dlls/msvcp140/msvcp140.spec | 2 +- dlls/msvcp90/misc.c | 7 +++++++ dlls/msvcp_win/msvcp_win.spec | 2 +- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec index 5eec1a003e0..2de95bf94ef 100644 --- a/dlls/msvcp110/msvcp110.spec +++ b/dlls/msvcp110/msvcp110.spec @@ -3823,7 +3823,7 @@ @ cdecl _Mtx_getconcrtcs(ptr) @ cdecl _Mtx_init(ptr long) @ cdecl _Mtx_lock(ptr) -@ stub _Mtx_reset_owner +@ cdecl _Mtx_reset_owner(ptr) @ stub _Mtx_timedlock @ cdecl _Mtx_trylock(ptr) @ cdecl _Mtx_unlock(ptr) diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec index 18e13be46b8..e0adc83113f 100644 --- a/dlls/msvcp120/msvcp120.spec +++ b/dlls/msvcp120/msvcp120.spec @@ -3768,7 +3768,7 @@ @ cdecl _Mtx_getconcrtcs(ptr) @ cdecl _Mtx_init(ptr long) @ cdecl _Mtx_lock(ptr) -@ stub _Mtx_reset_owner +@ cdecl _Mtx_reset_owner(ptr) @ stub _Mtx_timedlock @ cdecl _Mtx_trylock(ptr) @ cdecl _Mtx_unlock(ptr) diff --git a/dlls/msvcp120_app/msvcp120_app.spec b/dlls/msvcp120_app/msvcp120_app.spec index 72cdd258bd0..dd8e3ebf173 100644 --- a/dlls/msvcp120_app/msvcp120_app.spec +++ b/dlls/msvcp120_app/msvcp120_app.spec @@ -3768,7 +3768,7 @@ @ cdecl _Mtx_getconcrtcs(ptr) msvcp120._Mtx_getconcrtcs @ cdecl _Mtx_init(ptr long) msvcp120._Mtx_init @ cdecl _Mtx_lock(ptr) msvcp120._Mtx_lock -@ stub _Mtx_reset_owner +@ cdecl _Mtx_reset_owner(ptr) msvcp120._Mtx_reset_owner @ stub _Mtx_timedlock @ cdecl _Mtx_trylock(ptr) msvcp120._Mtx_trylock @ cdecl _Mtx_unlock(ptr) msvcp120._Mtx_unlock diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index 05b5b0feac3..3de0318a4d5 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -3680,7 +3680,7 @@ @ cdecl _Mtx_init(ptr long) @ cdecl _Mtx_init_in_situ(ptr long) @ cdecl _Mtx_lock(ptr) -@ stub _Mtx_reset_owner +@ cdecl _Mtx_reset_owner(ptr) @ stub _Mtx_timedlock @ cdecl _Mtx_trylock(ptr) @ cdecl _Mtx_unlock(ptr) diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c index ef1f292f37e..18f05311a05 100644 --- a/dlls/msvcp90/misc.c +++ b/dlls/msvcp90/misc.c @@ -814,6 +814,13 @@ void __cdecl _Mtx_clear_owner(_Mtx_arg_t mtx) m->count--; } +void __cdecl _Mtx_reset_owner(_Mtx_arg_t mtx) +{ + _Mtx_t m = MTX_T_FROM_ARG(mtx); + m->thread_id = GetCurrentThreadId(); + m->count++; +} + static inline LONG interlocked_dec_if_nonzero( LONG *dest ) { LONG val, tmp; diff --git a/dlls/msvcp_win/msvcp_win.spec b/dlls/msvcp_win/msvcp_win.spec index fb6fd5cd1c2..a15fb5c7ee3 100644 --- a/dlls/msvcp_win/msvcp_win.spec +++ b/dlls/msvcp_win/msvcp_win.spec @@ -3680,7 +3680,7 @@ @ cdecl _Mtx_init(ptr long) msvcp140._Mtx_init @ cdecl _Mtx_init_in_situ(ptr long) msvcp140._Mtx_init_in_situ @ cdecl _Mtx_lock(ptr) msvcp140._Mtx_lock -@ stub _Mtx_reset_owner +@ cdecl _Mtx_reset_owner(ptr) msvcp140._Mtx_reset_owner @ stub _Mtx_timedlock @ cdecl _Mtx_trylock(ptr) msvcp140._Mtx_trylock @ cdecl _Mtx_unlock(ptr) msvcp140._Mtx_unlock
1
0
0
0
Piotr Caban : msvcp110: Add _Mtx_clear_owner implementation.
by Alexandre Julliard
15 Mar '22
15 Mar '22
Module: wine Branch: master Commit: 90c0807a87f97afe95c0a75b252361622f8ec9f3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=90c0807a87f97afe95c0a75b…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Mar 15 14:36:41 2022 +0100 msvcp110: Add _Mtx_clear_owner implementation. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp110/msvcp110.spec | 2 +- dlls/msvcp120/msvcp120.spec | 2 +- dlls/msvcp120_app/msvcp120_app.spec | 2 +- dlls/msvcp140/msvcp140.spec | 20 ++++++++++---------- dlls/msvcp90/misc.c | 7 +++++++ dlls/msvcp_win/msvcp_win.spec | 2 +- 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec index 514bc90b5e7..5eec1a003e0 100644 --- a/dlls/msvcp110/msvcp110.spec +++ b/dlls/msvcp110/msvcp110.spec @@ -3817,7 +3817,7 @@ @ extern _LZero @ cdecl _Lock_shared_ptr_spin_lock() @ cdecl _Mbrtowc(ptr ptr long ptr ptr) -@ stub _Mtx_clear_owner +@ cdecl _Mtx_clear_owner(ptr) @ cdecl _Mtx_current_owns(ptr) @ cdecl _Mtx_destroy(ptr) @ cdecl _Mtx_getconcrtcs(ptr) diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec index 6f868e190a9..18e13be46b8 100644 --- a/dlls/msvcp120/msvcp120.spec +++ b/dlls/msvcp120/msvcp120.spec @@ -3762,7 +3762,7 @@ @ extern _LZero @ cdecl _Lock_shared_ptr_spin_lock() @ cdecl _Mbrtowc(ptr ptr long ptr ptr) -@ stub _Mtx_clear_owner +@ cdecl _Mtx_clear_owner(ptr) @ cdecl _Mtx_current_owns(ptr) @ cdecl _Mtx_destroy(ptr) @ cdecl _Mtx_getconcrtcs(ptr) diff --git a/dlls/msvcp120_app/msvcp120_app.spec b/dlls/msvcp120_app/msvcp120_app.spec index 0de36db8b36..72cdd258bd0 100644 --- a/dlls/msvcp120_app/msvcp120_app.spec +++ b/dlls/msvcp120_app/msvcp120_app.spec @@ -3762,7 +3762,7 @@ @ extern _LZero msvcp120._LZero @ cdecl _Lock_shared_ptr_spin_lock() msvcp120._Lock_shared_ptr_spin_lock @ cdecl _Mbrtowc(ptr ptr long ptr ptr) msvcp120._Mbrtowc -@ stub _Mtx_clear_owner +@ cdecl _Mtx_clear_owner(ptr) msvcp120._Mtx_clear_owner @ cdecl _Mtx_current_owns(ptr) msvcp120._Mtx_current_owns @ cdecl _Mtx_destroy(ptr) msvcp120._Mtx_destroy @ cdecl _Mtx_getconcrtcs(ptr) msvcp120._Mtx_getconcrtcs diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index 3945a4bfbd4..05b5b0feac3 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -3672,18 +3672,18 @@ @ cdecl _Lstat(wstr ptr) @ cdecl _Make_dir(wstr) tr2_sys__Make_dir_wchar @ cdecl _Mbrtowc(ptr ptr long ptr ptr) -@ stub _Mtx_clear_owner -@ cdecl _Mtx_current_owns(ptr) _Mtx_current_owns -@ cdecl _Mtx_destroy(ptr) _Mtx_destroy -@ cdecl _Mtx_destroy_in_situ(ptr) _Mtx_destroy_in_situ -@ cdecl _Mtx_getconcrtcs(ptr) _Mtx_getconcrtcs -@ cdecl _Mtx_init(ptr long) _Mtx_init -@ cdecl _Mtx_init_in_situ(ptr long) _Mtx_init_in_situ -@ cdecl _Mtx_lock(ptr) _Mtx_lock +@ cdecl _Mtx_clear_owner(ptr) +@ cdecl _Mtx_current_owns(ptr) +@ cdecl _Mtx_destroy(ptr) +@ cdecl _Mtx_destroy_in_situ(ptr) +@ cdecl _Mtx_getconcrtcs(ptr) +@ cdecl _Mtx_init(ptr long) +@ cdecl _Mtx_init_in_situ(ptr long) +@ cdecl _Mtx_lock(ptr) @ stub _Mtx_reset_owner @ stub _Mtx_timedlock -@ cdecl _Mtx_trylock(ptr) _Mtx_trylock -@ cdecl _Mtx_unlock(ptr) _Mtx_unlock +@ cdecl _Mtx_trylock(ptr) +@ cdecl _Mtx_unlock(ptr) @ stub _Mtxdst @ stub _Mtxinit @ stub _Mtxlock diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c index 0ed75e233d8..ef1f292f37e 100644 --- a/dlls/msvcp90/misc.c +++ b/dlls/msvcp90/misc.c @@ -807,6 +807,13 @@ critical_section* __cdecl _Mtx_getconcrtcs(_Mtx_arg_t mtx) return &MTX_T_FROM_ARG(mtx)->cs; } +void __cdecl _Mtx_clear_owner(_Mtx_arg_t mtx) +{ + _Mtx_t m = MTX_T_FROM_ARG(mtx); + m->thread_id = -1; + m->count--; +} + static inline LONG interlocked_dec_if_nonzero( LONG *dest ) { LONG val, tmp; diff --git a/dlls/msvcp_win/msvcp_win.spec b/dlls/msvcp_win/msvcp_win.spec index c6ca765f158..fb6fd5cd1c2 100644 --- a/dlls/msvcp_win/msvcp_win.spec +++ b/dlls/msvcp_win/msvcp_win.spec @@ -3672,7 +3672,7 @@ @ cdecl _Lstat(wstr ptr) msvcp140._Lstat @ cdecl _Make_dir(wstr) msvcp140._Make_dir @ cdecl _Mbrtowc(ptr ptr long ptr ptr) msvcp140._Mbrtowc -@ stub _Mtx_clear_owner +@ cdecl _Mtx_clear_owner(ptr) msvcp140._Mtx_clear_owner @ cdecl _Mtx_current_owns(ptr) msvcp140._Mtx_current_owns @ cdecl _Mtx_destroy(ptr) msvcp140._Mtx_destroy @ cdecl _Mtx_destroy_in_situ(ptr) msvcp140._Mtx_destroy_in_situ
1
0
0
0
Piotr Caban : msvcp110: Introduce wrapper around critical_section functions.
by Alexandre Julliard
15 Mar '22
15 Mar '22
Module: wine Branch: master Commit: bd0d5dea13d8478d5bb88185551aff744ed9621e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bd0d5dea13d8478d5bb88185…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Mar 15 14:36:30 2022 +0100 msvcp110: Introduce wrapper around critical_section functions. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp90/misc.c | 30 ++++++--------------------- dlls/msvcp90/msvcp90.h | 10 ++++----- dlls/msvcp90/msvcp_main.c | 53 ++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 59 insertions(+), 34 deletions(-) diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c index c7a56ad9e97..0ed75e233d8 100644 --- a/dlls/msvcp90/misc.c +++ b/dlls/msvcp90/misc.c @@ -706,24 +706,6 @@ unsigned int __cdecl _Random_device(void) #endif #if _MSVCP_VER >= 110 -#ifdef __ASM_USE_THISCALL_WRAPPER - -extern void *call_thiscall_func; -__ASM_GLOBAL_FUNC(call_thiscall_func, - "popl %eax\n\t" - "popl %edx\n\t" - "popl %ecx\n\t" - "pushl %eax\n\t" - "jmp *%edx\n\t") - -#define call_func1(func,this) ((void* (WINAPI*)(void*,void*))&call_thiscall_func)(func,this) - -#else /* __i386__ */ - -#define call_func1(func,this) func(this) - -#endif /* __i386__ */ - #define MTX_PLAIN 0x1 #define MTX_TRY 0x2 #define MTX_TIMED 0x4 @@ -753,7 +735,7 @@ void __cdecl _Mtx_init_in_situ(_Mtx_t mtx, int flags) FIXME("unknown flags ignored: %x\n", flags); mtx->flags = flags; - call_func1(critical_section_ctor, &mtx->cs); + cs_init(&mtx->cs); mtx->thread_id = -1; mtx->count = 0; } @@ -767,12 +749,12 @@ int __cdecl _Mtx_init(_Mtx_t *mtx, int flags) void __cdecl _Mtx_destroy_in_situ(_Mtx_t mtx) { - call_func1(critical_section_dtor, &mtx->cs); + cs_destroy(&mtx->cs); } void __cdecl _Mtx_destroy(_Mtx_arg_t mtx) { - call_func1(critical_section_dtor, &MTX_T_FROM_ARG(mtx)->cs); + cs_destroy(&MTX_T_FROM_ARG(mtx)->cs); operator_delete(MTX_T_FROM_ARG(mtx)); } @@ -784,7 +766,7 @@ int __cdecl _Mtx_current_owns(_Mtx_arg_t mtx) int __cdecl _Mtx_lock(_Mtx_arg_t mtx) { if(MTX_T_FROM_ARG(mtx)->thread_id != GetCurrentThreadId()) { - call_func1(critical_section_lock, &MTX_T_FROM_ARG(mtx)->cs); + cs_lock(&MTX_T_FROM_ARG(mtx)->cs); MTX_T_FROM_ARG(mtx)->thread_id = GetCurrentThreadId(); }else if(!(MTX_T_FROM_ARG(mtx)->flags & MTX_RECURSIVE) && MTX_T_FROM_ARG(mtx)->flags != MTX_PLAIN) { @@ -801,14 +783,14 @@ int __cdecl _Mtx_unlock(_Mtx_arg_t mtx) return 0; MTX_T_FROM_ARG(mtx)->thread_id = -1; - call_func1(critical_section_unlock, &MTX_T_FROM_ARG(mtx)->cs); + cs_unlock(&MTX_T_FROM_ARG(mtx)->cs); return 0; } int __cdecl _Mtx_trylock(_Mtx_arg_t mtx) { if(MTX_T_FROM_ARG(mtx)->thread_id != GetCurrentThreadId()) { - if(!call_func1(critical_section_trylock, &MTX_T_FROM_ARG(mtx)->cs)) + if(!cs_trylock(&MTX_T_FROM_ARG(mtx)->cs)) return MTX_LOCKED; MTX_T_FROM_ARG(mtx)->thread_id = GetCurrentThreadId(); }else if(!(MTX_T_FROM_ARG(mtx)->flags & MTX_RECURSIVE) diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 113350c9aaf..9cddab8fe02 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -58,11 +58,11 @@ typedef struct void *tail; } critical_section; -extern critical_section* (__thiscall *critical_section_ctor)(critical_section*); -extern void (__thiscall *critical_section_dtor)(critical_section*); -extern void (__thiscall *critical_section_lock)(critical_section*); -extern void (__thiscall *critical_section_unlock)(critical_section*); -extern bool (__thiscall *critical_section_trylock)(critical_section*); +extern void cs_init(critical_section*); +extern void cs_destroy(critical_section*); +extern void cs_lock(critical_section*); +extern void cs_unlock(critical_section*); +extern bool cs_trylock(critical_section*); #endif #if _MSVCP_VER >= 100 diff --git a/dlls/msvcp90/msvcp_main.c b/dlls/msvcp90/msvcp_main.c index cf37631da0e..43ec67c4b9e 100644 --- a/dlls/msvcp90/msvcp_main.c +++ b/dlls/msvcp90/msvcp_main.c @@ -57,11 +57,54 @@ DEFINE_VTBL_WRAPPER(56); void* (__cdecl *MSVCRT_set_new_handler)(void*); #if _MSVCP_VER >= 110 -critical_section* (__thiscall *critical_section_ctor)(critical_section*); -void (__thiscall *critical_section_dtor)(critical_section*); -void (__thiscall *critical_section_lock)(critical_section*); -void (__thiscall *critical_section_unlock)(critical_section*); -bool (__thiscall *critical_section_trylock)(critical_section*); +#ifdef __ASM_USE_THISCALL_WRAPPER + +extern void *call_thiscall_func; +__ASM_GLOBAL_FUNC(call_thiscall_func, + "popl %eax\n\t" + "popl %edx\n\t" + "popl %ecx\n\t" + "pushl %eax\n\t" + "jmp *%edx\n\t") + +#define call_func1(func,this) ((void* (WINAPI*)(void*,void*))&call_thiscall_func)(func,this) + +#else /* __i386__ */ + +#define call_func1(func,this) func(this) + +#endif /* __i386__ */ + +static critical_section* (__thiscall *critical_section_ctor)(critical_section*); +static void (__thiscall *critical_section_dtor)(critical_section*); +static void (__thiscall *critical_section_lock)(critical_section*); +static void (__thiscall *critical_section_unlock)(critical_section*); +static bool (__thiscall *critical_section_trylock)(critical_section*); + +void cs_init(critical_section *cs) +{ + call_func1(critical_section_ctor, cs); +} + +void cs_destroy(critical_section *cs) +{ + call_func1(critical_section_dtor, cs); +} + +void cs_lock(critical_section *cs) +{ + call_func1(critical_section_lock, cs); +} + +void cs_unlock(critical_section *cs) +{ + call_func1(critical_section_unlock, cs); +} + +bool cs_trylock(critical_section *cs) +{ + return call_func1(critical_section_trylock, cs); +} #endif #if _MSVCP_VER >= 100
1
0
0
0
Jacek Caban : win32u: Make interface between DC and dce private.
by Alexandre Julliard
15 Mar '22
15 Mar '22
Module: wine Branch: master Commit: ffb152df64a754d2e98e74057cbddc036c9bdfe1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ffb152df64a754d2e98e7405…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Mar 15 14:32:08 2022 +0100 win32u: Make interface between DC and dce private. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/win32u/dc.c | 56 +++++++--------------------- dlls/win32u/dce.c | 91 ++++++++++++++++++++++----------------------- dlls/win32u/ntgdi_private.h | 20 ++++++++-- dlls/win32u/sysparams.c | 2 +- include/wine/gdi_driver.h | 17 --------- 5 files changed, 76 insertions(+), 110 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=ffb152df64a754d2e98e…
1
0
0
0
Jacek Caban : win32u: Introduce NtUserEnableDC.
by Alexandre Julliard
15 Mar '22
15 Mar '22
Module: wine Branch: master Commit: e17ec9e8b7dad425e70c60588efd721321064760 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e17ec9e8b7dad425e70c6058…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Mar 15 14:28:35 2022 +0100 win32u: Introduce NtUserEnableDC. And use it instead of SetHookFlags in user.exe. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user.exe16/user_private.h | 3 +-- dlls/user.exe16/window.c | 3 +-- dlls/win32u/gdiobj.c | 1 - dlls/win32u/sysparams.c | 2 ++ dlls/win32u/win32u.spec | 1 - dlls/win32u/win32u_private.h | 1 - dlls/win32u/wrappers.c | 6 ------ include/ntuser.h | 1 + 8 files changed, 5 insertions(+), 13 deletions(-) diff --git a/dlls/user.exe16/user_private.h b/dlls/user.exe16/user_private.h index 336b89102d4..afd75f0b096 100644 --- a/dlls/user.exe16/user_private.h +++ b/dlls/user.exe16/user_private.h @@ -24,8 +24,7 @@ #include <stdarg.h> #include "windef.h" #include "winbase.h" -#include "wingdi.h" -#include "winuser.h" +#include "ntuser.h" #include "winreg.h" #include "winternl.h" #include "wine/windef16.h" diff --git a/dlls/user.exe16/window.c b/dlls/user.exe16/window.c index 5a9448a2131..01d1b101c92 100644 --- a/dlls/user.exe16/window.c +++ b/dlls/user.exe16/window.c @@ -23,7 +23,6 @@ #include "user_private.h" #include "wine/list.h" #include "wine/server.h" -#include "wine/gdi_driver.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(win); @@ -676,7 +675,7 @@ HDC16 WINAPI GetWindowDC16( HWND16 hwnd ) INT16 WINAPI ReleaseDC16( HWND16 hwnd, HDC16 hdc ) { INT16 ret = (INT16)ReleaseDC( WIN_Handle32(hwnd), HDC_32(hdc) ); - SetHookFlags( HDC_32(hdc), DCHF_ENABLEDC ); + NtUserCallOneParam( HandleToUlong( HDC_32(hdc) ), NtUserEnableDC ); return ret; } diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index 888313ad685..208ebb1da5e 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -1216,7 +1216,6 @@ static struct unix_funcs unix_funcs = NtUserWindowFromPoint, SetDIBits, - SetHookFlags, __wine_get_brush_bitmap_info, __wine_get_file_outline_text_metric, __wine_get_icm_profile, diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 7908dc62716..cb16237d9f1 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -4635,6 +4635,8 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) return HandleToUlong( begin_defer_window_pos( arg )); case NtUserCreateCursorIcon: return HandleToUlong( alloc_cursoricon_handle( arg )); + case NtUserEnableDC: + return SetHookFlags( UlongToHandle(arg), DCHF_ENABLEDC ); case NtUserGetClipCursor: return get_clip_cursor( (RECT *)arg ); case NtUserGetCursorPos: diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index fc659c4ca9f..e37907e7399 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1321,7 +1321,6 @@ # Wine internal extensions # user32 -@ stdcall SetHookFlags(long long) @ cdecl __wine_set_visible_region(long long ptr ptr ptr) # Graphics drivers diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 3f9183a2b1d..ac40daa5d35 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -273,7 +273,6 @@ struct unix_funcs INT (WINAPI *pSetDIBits)( HDC hdc, HBITMAP hbitmap, UINT startscan, UINT lines, const void *bits, const BITMAPINFO *info, UINT coloruse ); - WORD (WINAPI *pSetHookFlags)( HDC hdc, WORD flags ); BOOL (CDECL *get_brush_bitmap_info)( HBRUSH handle, BITMAPINFO *info, void *bits, UINT *usage ); BOOL (CDECL *get_file_outline_text_metric)( const WCHAR *path, OUTLINETEXTMETRICW *otm ); BOOL (CDECL *get_icm_profile)( HDC hdc, BOOL allow_default, DWORD *size, WCHAR *filename ); diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c index 471bfa449b1..9665c8106c4 100644 --- a/dlls/win32u/wrappers.c +++ b/dlls/win32u/wrappers.c @@ -1112,12 +1112,6 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan, return unix_funcs->pSetDIBits( hdc, hbitmap, startscan, lines, bits, info, coloruse ); } -WORD WINAPI SetHookFlags( HDC hdc, WORD flags ) -{ - if (!unix_funcs) return 0; - return unix_funcs->pSetHookFlags( hdc, flags ); -} - BOOL CDECL __wine_get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size, WCHAR *filename ) { if (!unix_funcs) return FALSE; diff --git a/include/ntuser.h b/include/ntuser.h index a4e28764e0d..f68f5481f90 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -99,6 +99,7 @@ enum { NtUserBeginDeferWindowPos, NtUserCreateCursorIcon, + NtUserEnableDC, NtUserGetClipCursor, NtUserGetCursorPos, NtUserGetIconParam,
1
0
0
0
Jacek Caban : win32u: Move NtUserGetUpdateRect implementation from user32.
by Alexandre Julliard
15 Mar '22
15 Mar '22
Module: wine Branch: master Commit: 1df20bb22a1836d82571113ecc11482ec15ac10c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1df20bb22a1836d82571113e…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Mar 15 14:28:20 2022 +0100 win32u: Move NtUserGetUpdateRect implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/painting.c | 218 ------------------------------------------- dlls/user32/user32.spec | 2 +- dlls/win32u/dce.c | 32 +++++++ dlls/win32u/gdiobj.c | 2 +- dlls/win32u/win32u.spec | 3 +- dlls/win32u/win32u_private.h | 4 +- dlls/win32u/window.c | 34 ++++++- dlls/win32u/wrappers.c | 12 +-- include/ntuser.h | 1 + 9 files changed, 74 insertions(+), 234 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=1df20bb22a1836d82571…
1
0
0
0
Jacek Caban : win32u: Move NtUserSetParent implementation from user32.
by Alexandre Julliard
15 Mar '22
15 Mar '22
Module: wine Branch: master Commit: 0c752feda6f40cdd514db0847cbe32a1db47003c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0c752feda6f40cdd514db084…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Mar 15 14:27:55 2022 +0100 win32u: Move NtUserSetParent implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/combo.c | 2 +- dlls/user32/driver.c | 7 +- dlls/user32/message.c | 3 - dlls/user32/painting.c | 29 --- dlls/user32/user32.spec | 2 +- dlls/user32/user_main.c | 1 + dlls/user32/user_private.h | 3 - dlls/user32/win.c | 104 +-------- dlls/user32/winpos.c | 507 ------------------------------------------- dlls/win32u/driver.c | 1 + dlls/win32u/gdiobj.c | 1 + dlls/win32u/message.c | 3 + dlls/win32u/ntuser_private.h | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 2 + dlls/win32u/window.c | 107 ++++++++- dlls/win32u/wrappers.c | 6 + include/ntuser.h | 2 + 18 files changed, 128 insertions(+), 655 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=0c752feda6f40cdd514d…
1
0
0
0
← Newer
1
...
50
51
52
53
54
55
56
...
114
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
Results per page:
10
25
50
100
200