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
2689b7b1
Commit
2689b7b1
authored
Feb 16, 2016
by
Sebastian Lackner
Committed by
Alexandre Julliard
Feb 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add tests for RtlInitializeCriticalSectionEx.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
364165a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
rtl.c
dlls/ntdll/tests/rtl.c
+36
-0
No files found.
dlls/ntdll/tests/rtl.c
View file @
2689b7b1
...
...
@@ -98,6 +98,7 @@ static NTSTATUS (WINAPI *pRtlDecompressFragment)(USHORT, PUCHAR, ULONG, const U
static
NTSTATUS
(
WINAPI
*
pRtlCompressBuffer
)(
USHORT
,
const
UCHAR
*
,
ULONG
,
PUCHAR
,
ULONG
,
ULONG
,
PULONG
,
PVOID
);
static
BOOL
(
WINAPI
*
pRtlIsCriticalSectionLocked
)(
CRITICAL_SECTION
*
);
static
BOOL
(
WINAPI
*
pRtlIsCriticalSectionLockedByThread
)(
CRITICAL_SECTION
*
);
static
NTSTATUS
(
WINAPI
*
pRtlInitializeCriticalSectionEx
)(
CRITICAL_SECTION
*
,
ULONG
,
ULONG
);
static
HMODULE
hkernel32
=
0
;
static
BOOL
(
WINAPI
*
pIsWow64Process
)(
HANDLE
,
PBOOL
);
...
...
@@ -151,6 +152,7 @@ static void InitFunctionPtrs(void)
pRtlCompressBuffer
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlCompressBuffer"
);
pRtlIsCriticalSectionLocked
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlIsCriticalSectionLocked"
);
pRtlIsCriticalSectionLockedByThread
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlIsCriticalSectionLockedByThread"
);
pRtlInitializeCriticalSectionEx
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlInitializeCriticalSectionEx"
);
}
hkernel32
=
LoadLibraryA
(
"kernel32.dll"
);
ok
(
hkernel32
!=
0
,
"LoadLibrary failed
\n
"
);
...
...
@@ -2056,6 +2058,39 @@ static void test_RtlIsCriticalSectionLocked(void)
DeleteCriticalSection
(
&
info
.
crit
);
}
static
void
test_RtlInitializeCriticalSectionEx
(
void
)
{
static
const
CRITICAL_SECTION_DEBUG
*
no_debug
=
(
void
*
)
~
(
ULONG_PTR
)
0
;
CRITICAL_SECTION
cs
;
if
(
!
pRtlInitializeCriticalSectionEx
)
{
win_skip
(
"RtlInitializeCriticalSectionEx is not available
\n
"
);
return
;
}
memset
(
&
cs
,
0x11
,
sizeof
(
cs
));
pRtlInitializeCriticalSectionEx
(
&
cs
,
0
,
0
);
ok
((
cs
.
DebugInfo
!=
NULL
&&
cs
.
DebugInfo
!=
no_debug
)
||
broken
(
cs
.
DebugInfo
==
no_debug
)
/* >= Win 8 */
,
"expected DebugInfo != NULL and DebugInfo != ~0, got %p
\n
"
,
cs
.
DebugInfo
);
ok
(
cs
.
LockCount
==
-
1
,
"expected LockCount == -1, got %d
\n
"
,
cs
.
LockCount
);
ok
(
cs
.
RecursionCount
==
0
,
"expected RecursionCount == 0, got %d
\n
"
,
cs
.
RecursionCount
);
ok
(
cs
.
LockSemaphore
==
0
,
"expected LockSemaphore == 0, got %p
\n
"
,
cs
.
LockSemaphore
);
ok
(
cs
.
SpinCount
==
0
,
"expected SpinCount == 0, got %ld
\n
"
,
cs
.
SpinCount
);
RtlDeleteCriticalSection
(
&
cs
);
memset
(
&
cs
,
0x11
,
sizeof
(
cs
));
pRtlInitializeCriticalSectionEx
(
&
cs
,
0
,
RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO
);
todo_wine
ok
(
cs
.
DebugInfo
==
no_debug
,
"expected DebugInfo == ~0, got %p
\n
"
,
cs
.
DebugInfo
);
ok
(
cs
.
LockCount
==
-
1
,
"expected LockCount == -1, got %d
\n
"
,
cs
.
LockCount
);
ok
(
cs
.
RecursionCount
==
0
,
"expected RecursionCount == 0, got %d
\n
"
,
cs
.
RecursionCount
);
ok
(
cs
.
LockSemaphore
==
0
,
"expected LockSemaphore == 0, got %p
\n
"
,
cs
.
LockSemaphore
);
ok
(
cs
.
SpinCount
==
0
||
broken
(
cs
.
SpinCount
!=
0
)
/* >= Win 8 */
,
"expected SpinCount == 0, got %ld
\n
"
,
cs
.
SpinCount
);
RtlDeleteCriticalSection
(
&
cs
);
}
START_TEST
(
rtl
)
{
InitFunctionPtrs
();
...
...
@@ -2086,4 +2121,5 @@ START_TEST(rtl)
test_RtlGetCompressionWorkSpaceSize
();
test_RtlDecompressBuffer
();
test_RtlIsCriticalSectionLocked
();
test_RtlInitializeCriticalSectionEx
();
}
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