Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0b441c4c
Commit
0b441c4c
authored
Dec 18, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Feb 13, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for critical section debug info presence.
parent
e8f4909a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
6 deletions
+38
-6
sync.c
dlls/kernel32/tests/sync.c
+31
-1
winnt.h
include/winnt.h
+7
-5
No files found.
dlls/kernel32/tests/sync.c
View file @
0b441c4c
...
...
@@ -2741,7 +2741,8 @@ static void test_crit_section(void)
to override that. */
memset
(
&
cs
,
0
,
sizeof
(
cs
));
InitializeCriticalSection
(
&
cs
);
ok
(
cs
.
DebugInfo
!=
NULL
,
"Unexpected debug info pointer %p.
\n
"
,
cs
.
DebugInfo
);
todo_wine
ok
(
cs
.
DebugInfo
==
(
void
*
)(
ULONG_PTR
)
-
1
||
broken
(
!!
cs
.
DebugInfo
)
/* before Win8 */
,
"Unexpected debug info pointer %p.
\n
"
,
cs
.
DebugInfo
);
DeleteCriticalSection
(
&
cs
);
ok
(
cs
.
DebugInfo
==
NULL
,
"Unexpected debug info pointer %p.
\n
"
,
cs
.
DebugInfo
);
...
...
@@ -2752,9 +2753,38 @@ static void test_crit_section(void)
}
memset
(
&
cs
,
0
,
sizeof
(
cs
));
ret
=
pInitializeCriticalSectionEx
(
&
cs
,
0
,
0
);
ok
(
ret
,
"Failed to initialize critical section.
\n
"
);
todo_wine
ok
(
cs
.
DebugInfo
==
(
void
*
)(
ULONG_PTR
)
-
1
||
broken
(
!!
cs
.
DebugInfo
)
/* before Win8 */
,
"Unexpected debug info pointer %p.
\n
"
,
cs
.
DebugInfo
);
DeleteCriticalSection
(
&
cs
);
ok
(
cs
.
DebugInfo
==
NULL
,
"Unexpected debug info pointer %p.
\n
"
,
cs
.
DebugInfo
);
memset
(
&
cs
,
0
,
sizeof
(
cs
));
ret
=
pInitializeCriticalSectionEx
(
&
cs
,
0
,
CRITICAL_SECTION_NO_DEBUG_INFO
);
ok
(
ret
,
"Failed to initialize critical section.
\n
"
);
ok
(
cs
.
DebugInfo
==
(
void
*
)(
ULONG_PTR
)
-
1
,
"Unexpected debug info pointer %p.
\n
"
,
cs
.
DebugInfo
);
DeleteCriticalSection
(
&
cs
);
todo_wine
ok
(
cs
.
DebugInfo
==
NULL
,
"Unexpected debug info pointer %p.
\n
"
,
cs
.
DebugInfo
);
memset
(
&
cs
,
0
,
sizeof
(
cs
));
ret
=
pInitializeCriticalSectionEx
(
&
cs
,
0
,
0
);
ok
(
ret
,
"Failed to initialize critical section.
\n
"
);
todo_wine
ok
(
cs
.
DebugInfo
==
(
void
*
)(
ULONG_PTR
)
-
1
||
broken
(
!!
cs
.
DebugInfo
)
/* before Win8 */
,
"Unexpected debug info pointer %p.
\n
"
,
cs
.
DebugInfo
);
DeleteCriticalSection
(
&
cs
);
ok
(
cs
.
DebugInfo
==
NULL
,
"Unexpected debug info pointer %p.
\n
"
,
cs
.
DebugInfo
);
memset
(
&
cs
,
0
,
sizeof
(
cs
));
ret
=
pInitializeCriticalSectionEx
(
&
cs
,
0
,
RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
);
ok
(
ret
||
broken
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
)
/* before Win8 */
,
"Failed to initialize critical section, error %lu.
\n
"
,
GetLastError
());
if
(
!
ret
)
{
ret
=
pInitializeCriticalSectionEx
(
&
cs
,
0
,
0
);
ok
(
ret
,
"Failed to initialize critical section.
\n
"
);
}
ok
(
cs
.
DebugInfo
&&
cs
.
DebugInfo
!=
(
void
*
)(
ULONG_PTR
)
-
1
,
"Unexpected debug info pointer %p.
\n
"
,
cs
.
DebugInfo
);
ret
=
TryEnterCriticalSection
(
&
cs
);
ok
(
ret
,
"Failed to enter critical section.
\n
"
);
...
...
include/winnt.h
View file @
0b441c4c
...
...
@@ -6113,11 +6113,13 @@ typedef struct _RTL_CRITICAL_SECTION {
ULONG_PTR
SpinCount
;
}
RTL_CRITICAL_SECTION
,
*
PRTL_CRITICAL_SECTION
;
#define RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO 0x1000000
#define RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN 0x2000000
#define RTL_CRITICAL_SECTION_FLAG_STATIC_INIT 0x4000000
#define RTL_CRITICAL_SECTION_ALL_FLAG_BITS 0xFF000000
#define RTL_CRITICAL_SECTION_FLAG_RESERVED (RTL_CRITICAL_SECTION_ALL_FLAG_BITS & ~0x7000000)
#define RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO 0x01000000
#define RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN 0x02000000
#define RTL_CRITICAL_SECTION_FLAG_STATIC_INIT 0x04000000
#define RTL_CRITICAL_SECTION_FLAG_RESOURCE_TYPE 0x08000000
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO 0x10000000
#define RTL_CRITICAL_SECTION_ALL_FLAG_BITS 0xff000000
#define RTL_CRITICAL_SECTION_FLAG_RESERVED 0xe0000000
typedef
struct
_RTL_SRWLOCK
{
PVOID
Ptr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment