Signed-off-by: Michael Stefaniuc [email protected] --- dlls/ntoskrnl.exe/ntoskrnl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index b353839c0a..73fe054259 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -293,7 +293,7 @@ static CRITICAL_SECTION obref_cs; static CRITICAL_SECTION_DEBUG obref_critsect_debug = { 0, 0, &obref_cs, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + { &obref_critsect_debug.ProcessLocksList, &obref_critsect_debug.ProcessLocksList }, 0, 0, { (DWORD_PTR)(__FILE__ ": obref_cs") } }; static CRITICAL_SECTION obref_cs = { &obref_critsect_debug, -1, 0, 0, 0, 0 }; @@ -396,7 +396,7 @@ static CRITICAL_SECTION handle_map_cs; static CRITICAL_SECTION_DEBUG handle_map_critsect_debug = { 0, 0, &handle_map_cs, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + { &handle_map_critsect_debug.ProcessLocksList, &handle_map_critsect_debug.ProcessLocksList }, 0, 0, { (DWORD_PTR)(__FILE__ ": handle_map_cs") } }; static CRITICAL_SECTION handle_map_cs = { &handle_map_critsect_debug, -1, 0, 0, 0, 0 };
Jacek Caban [email protected]
On 4/29/19 9:13 PM, Michael Stefaniuc wrote:
Signed-off-by: Michael Stefaniuc [email protected]
dlls/ntoskrnl.exe/ntoskrnl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index b353839c0a..73fe054259 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -293,7 +293,7 @@ static CRITICAL_SECTION obref_cs; static CRITICAL_SECTION_DEBUG obref_critsect_debug = { 0, 0, &obref_cs,
- { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
- { &obref_critsect_debug.ProcessLocksList, &obref_critsect_debug.ProcessLocksList }, 0, 0, { (DWORD_PTR)(__FILE__ ": obref_cs") } }; static CRITICAL_SECTION obref_cs = { &obref_critsect_debug, -1, 0, 0, 0, 0 };
@@ -396,7 +396,7 @@ static CRITICAL_SECTION handle_map_cs; static CRITICAL_SECTION_DEBUG handle_map_critsect_debug = { 0, 0, &handle_map_cs,
- { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
- { &handle_map_critsect_debug.ProcessLocksList, &handle_map_critsect_debug.ProcessLocksList }, 0, 0, { (DWORD_PTR)(__FILE__ ": handle_map_cs") } }; static CRITICAL_SECTION handle_map_cs = { &handle_map_critsect_debug, -1, 0, 0, 0, 0 };
FWIW, it would be nice if declaring a critical section would be easier and less error prone. Maybe WINE_STATIC_CRITICAL_SECTION() macro?
Thanks,
Jacek
On 4/29/19 9:56 PM, Jacek Caban wrote:
Jacek Caban [email protected]
On 4/29/19 9:13 PM, Michael Stefaniuc wrote:
Signed-off-by: Michael Stefaniuc [email protected]
dlls/ntoskrnl.exe/ntoskrnl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index b353839c0a..73fe054259 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -293,7 +293,7 @@ static CRITICAL_SECTION obref_cs; static CRITICAL_SECTION_DEBUG obref_critsect_debug = { 0, 0, &obref_cs, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + { &obref_critsect_debug.ProcessLocksList, &obref_critsect_debug.ProcessLocksList }, 0, 0, { (DWORD_PTR)(__FILE__ ": obref_cs") } }; static CRITICAL_SECTION obref_cs = { &obref_critsect_debug, -1, 0, 0, 0, 0 }; @@ -396,7 +396,7 @@ static CRITICAL_SECTION handle_map_cs; static CRITICAL_SECTION_DEBUG handle_map_critsect_debug = { 0, 0, &handle_map_cs, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + { &handle_map_critsect_debug.ProcessLocksList, &handle_map_critsect_debug.ProcessLocksList }, 0, 0, { (DWORD_PTR)(__FILE__ ": handle_map_cs") } }; static CRITICAL_SECTION handle_map_cs = { &handle_map_critsect_debug, -1, 0, 0, 0, 0 };
FWIW, it would be nice if declaring a critical section would be easier and less error prone. Maybe WINE_STATIC_CRITICAL_SECTION() macro?
There's a reason I wrote the coccinelle script in the first place ;)
Anyway, I have attached an example patch. Once I have a working coccinelle script to do the transformation I can send it in.
DECLARE_CRITICAL_SECTION() is IMHO a better name, can be prefixed with WINE_ if so desired.
bye michael
On 4/30/19 9:58 PM, Michael Stefaniuc wrote:
On 4/29/19 9:56 PM, Jacek Caban wrote:
FWIW, it would be nice if declaring a critical section would be easier and less error prone. Maybe WINE_STATIC_CRITICAL_SECTION() macro?
There's a reason I wrote the coccinelle script in the first place ;)
Anyway, I have attached an example patch. Once I have a working coccinelle script to do the transformation I can send it in.
DECLARE_CRITICAL_SECTION() is IMHO a better name, can be prefixed with WINE_ if so desired.
Looks good to me.
Thanks,
Jacek
On 5/1/19 12:59 PM, Jacek Caban wrote:
On 4/30/19 9:58 PM, Michael Stefaniuc wrote:
On 4/29/19 9:56 PM, Jacek Caban wrote:
FWIW, it would be nice if declaring a critical section would be easier and less error prone. Maybe WINE_STATIC_CRITICAL_SECTION() macro?
There's a reason I wrote the coccinelle script in the first place ;)
Anyway, I have attached an example patch. Once I have a working coccinelle script to do the transformation I can send it in.
DECLARE_CRITICAL_SECTION() is IMHO a better name, can be prefixed with WINE_ if so desired.
Looks good to me.
OK, my coccinelle script is ready and it finds 144 occurrences so far. 125 files changed, 144 insertions(+), 1157 deletions(-)
There are 10 more uses of CRITICAL_SECTION_DEBUG, mostly for CRITICAL_SECTION that are defined as extern in a header. And of course the stuff from ntdll which uses RTL_CRITICAL_SECTION.
Now where do I add the DECLARE_CRITICAL_SECTION() or WINE_DECLARE_CRITICAL_SECTION()?
I tried to make it global and add it to winbase.h (protected by __WINESRC__) but wrc bombs out:
wine64/tools/wrc/wrc -o comctl32.res -m32 --nostdinc -I. -I/home/michi/work/wine/dlls/comctl32 \ -I../../include -I/home/michi/work/wine/include -D__WINESRC__ -D_COMCTL32_ --po-dir=../../po \ /home/michi/work/wine/dlls/comctl32/comctl32.rc /home/michi/work/wine/include/winbase.h:65:227: Error: syntax error make: *** [Makefile:1185: comctl32.res] Error 1
bye michael
On 5/4/19 11:16 PM, Michael Stefaniuc wrote:
On 5/1/19 12:59 PM, Jacek Caban wrote:
On 4/30/19 9:58 PM, Michael Stefaniuc wrote:
On 4/29/19 9:56 PM, Jacek Caban wrote:
FWIW, it would be nice if declaring a critical section would be easier and less error prone. Maybe WINE_STATIC_CRITICAL_SECTION() macro?
There's a reason I wrote the coccinelle script in the first place ;)
Anyway, I have attached an example patch. Once I have a working coccinelle script to do the transformation I can send it in.
DECLARE_CRITICAL_SECTION() is IMHO a better name, can be prefixed with WINE_ if so desired.
Looks good to me.
OK, my coccinelle script is ready and it finds 144 occurrences so far. 125 files changed, 144 insertions(+), 1157 deletions(-)
There are 10 more uses of CRITICAL_SECTION_DEBUG, mostly for CRITICAL_SECTION that are defined as extern in a header. And of course the stuff from ntdll which uses RTL_CRITICAL_SECTION.
Now where do I add the DECLARE_CRITICAL_SECTION() or WINE_DECLARE_CRITICAL_SECTION()?
I'm not sure, maybe winnt.h where related structs are declared? Duplicating in DLLs (at least for the first iteration) would be another possibility.
I tried to make it global and add it to winbase.h (protected by __WINESRC__) but wrc bombs out:
wine64/tools/wrc/wrc -o comctl32.res -m32 --nostdinc -I. -I/home/michi/work/wine/dlls/comctl32 \ -I../../include -I/home/michi/work/wine/include -D__WINESRC__ -D_COMCTL32_ --po-dir=../../po \ /home/michi/work/wine/dlls/comctl32/comctl32.rc /home/michi/work/wine/include/winbase.h:65:227: Error: syntax error make: *** [Makefile:1185: comctl32.res] Error 1
#ifndef RC_INVOKED should help.
Thanks,
Jacek