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
99ac786c
Commit
99ac786c
authored
Jun 19, 2014
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jun 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add more tests for debug string events.
This patch adds additional tests, to check how debuggers handle OUTPUT_DEBUG_STRING_EVENT events.
parent
2f9fdec3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
5 deletions
+39
-5
exception.c
dlls/ntdll/tests/exception.c
+39
-5
No files found.
dlls/ntdll/tests/exception.c
View file @
99ac786c
...
...
@@ -943,6 +943,31 @@ static void test_debugger(void)
ok
(
!
status
,
"NtSetContextThread failed with 0x%x
\n
"
,
status
);
}
}
else
if
(
de
.
dwDebugEventCode
==
OUTPUT_DEBUG_STRING_EVENT
)
{
int
stage
;
char
buffer
[
64
];
status
=
pNtReadVirtualMemory
(
pi
.
hProcess
,
&
test_stage
,
&
stage
,
sizeof
(
stage
),
&
size_read
);
ok
(
!
status
,
"NtReadVirtualMemory failed with 0x%x
\n
"
,
status
);
ok
(
!
de
.
u
.
DebugString
.
fUnicode
,
"unepxected unicode debug string event
\n
"
);
ok
(
de
.
u
.
DebugString
.
nDebugStringLength
<
sizeof
(
buffer
)
-
1
,
"buffer not large enough to hold %d bytes
\n
"
,
de
.
u
.
DebugString
.
nDebugStringLength
);
memset
(
buffer
,
0
,
sizeof
(
buffer
));
status
=
pNtReadVirtualMemory
(
pi
.
hProcess
,
de
.
u
.
DebugString
.
lpDebugStringData
,
buffer
,
de
.
u
.
DebugString
.
nDebugStringLength
,
&
size_read
);
ok
(
!
status
,
"NtReadVirtualMemory failed with 0x%x
\n
"
,
status
);
if
(
stage
==
3
||
stage
==
4
)
ok
(
!
strcmp
(
buffer
,
"Hello World"
),
"got unexpected debug string '%s'
\n
"
,
buffer
);
else
/* ignore unrelated debug strings like 'SHIMVIEW: ShimInfo(Complete)' */
ok
(
strstr
(
buffer
,
"SHIMVIEW"
)
!=
NULL
,
"unexpected stage %x, got debug string event '%s'
\n
"
,
stage
,
buffer
);
if
(
stage
==
4
)
continuestatus
=
DBG_EXCEPTION_NOT_HANDLED
;
}
ContinueDebugEvent
(
de
.
dwProcessId
,
de
.
dwThreadId
,
continuestatus
);
...
...
@@ -1668,7 +1693,7 @@ static LONG CALLBACK outputdebugstring_vectored_handler(EXCEPTION_POINTERS *Exce
return
EXCEPTION_CONTINUE_SEARCH
;
}
static
void
test_outputdebugstring
(
void
)
static
void
test_outputdebugstring
(
DWORD
numexc
,
BOOL
todo
)
{
PVOID
vectored_handler
;
...
...
@@ -1683,8 +1708,13 @@ static void test_outputdebugstring(void)
outputdebugstring_exceptions
=
0
;
OutputDebugStringA
(
"Hello World"
);
ok
(
outputdebugstring_exceptions
==
1
,
"OutputDebugStringA generated %d exceptions, expected one
\n
"
,
outputdebugstring_exceptions
);
if
(
todo
)
todo_wine
ok
(
outputdebugstring_exceptions
==
numexc
,
"OutputDebugStringA generated %d exceptions, expected %d
\n
"
,
outputdebugstring_exceptions
,
numexc
);
else
ok
(
outputdebugstring_exceptions
==
numexc
,
"OutputDebugStringA generated %d exceptions, expected %d
\n
"
,
outputdebugstring_exceptions
,
numexc
);
pRtlRemoveVectoredExceptionHandler
(
vectored_handler
);
}
...
...
@@ -1758,6 +1788,10 @@ START_TEST(exception)
run_rtlraiseexception_test
(
0x12345
);
run_rtlraiseexception_test
(
EXCEPTION_BREAKPOINT
);
run_rtlraiseexception_test
(
EXCEPTION_INVALID_HANDLE
);
test_stage
=
3
;
test_outputdebugstring
(
0
,
FALSE
);
test_stage
=
4
;
test_outputdebugstring
(
2
,
TRUE
);
/* is this a Windows bug? */
}
else
skip
(
"RtlRaiseException not found
\n
"
);
...
...
@@ -1769,7 +1803,7 @@ START_TEST(exception)
test_unwind
();
test_exceptions
();
test_rtlraiseexception
();
test_outputdebugstring
();
test_outputdebugstring
(
1
,
FALSE
);
test_debugger
();
test_simd_exceptions
();
test_fpu_exceptions
();
...
...
@@ -1786,7 +1820,7 @@ START_TEST(exception)
pRtlLookupFunctionEntry
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlLookupFunctionEntry"
);
test_outputdebugstring
();
test_outputdebugstring
(
1
,
FALSE
);
test_virtual_unwind
();
if
(
pRtlAddFunctionTable
&&
pRtlDeleteFunctionTable
&&
pRtlInstallFunctionTableCallback
&&
pRtlLookupFunctionEntry
)
...
...
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