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
3aa62498
Commit
3aa62498
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: Use an EXCEPTION_REGISTRATION_RECORD array to prevent compiler from…
ntdll/tests: Use an EXCEPTION_REGISTRATION_RECORD array to prevent compiler from reordering variables.
parent
2ab87290
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
exception.c
dlls/ntdll/tests/exception.c
+14
-14
No files found.
dlls/ntdll/tests/exception.c
View file @
3aa62498
...
...
@@ -434,38 +434,38 @@ static const BYTE call_unwind_code[] = {
static
void
test_unwind
(
void
)
{
EXCEPTION_REGISTRATION_RECORD
frame
2
,
frame1
;
EXCEPTION_REGISTRATION_RECORD
frame
s
[
2
],
*
frame2
=
&
frames
[
0
],
*
frame1
=
&
frames
[
1
]
;
DWORD
(
*
func
)(
void
*
function
,
EXCEPTION_REGISTRATION_RECORD
*
pEndFrame
,
EXCEPTION_RECORD
*
record
,
DWORD
retval
)
=
code_mem
;
DWORD
retval
;
memcpy
(
code_mem
,
call_unwind_code
,
sizeof
(
call_unwind_code
));
/* add first unwind handler */
frame1
.
Handler
=
unwind_handler
;
frame1
.
Prev
=
pNtCurrentTeb
()
->
Tib
.
ExceptionList
;
pNtCurrentTeb
()
->
Tib
.
ExceptionList
=
&
frame1
;
frame1
->
Handler
=
unwind_handler
;
frame1
->
Prev
=
pNtCurrentTeb
()
->
Tib
.
ExceptionList
;
pNtCurrentTeb
()
->
Tib
.
ExceptionList
=
frame1
;
/* add second unwind handler */
frame2
.
Handler
=
unwind_handler
;
frame2
.
Prev
=
pNtCurrentTeb
()
->
Tib
.
ExceptionList
;
pNtCurrentTeb
()
->
Tib
.
ExceptionList
=
&
frame2
;
frame2
->
Handler
=
unwind_handler
;
frame2
->
Prev
=
pNtCurrentTeb
()
->
Tib
.
ExceptionList
;
pNtCurrentTeb
()
->
Tib
.
ExceptionList
=
frame2
;
/* test unwind to current frame */
unwind_expected_eax
=
0xDEAD0000
;
retval
=
func
(
pRtlUnwind
,
&
frame2
,
NULL
,
0xDEAD0000
);
retval
=
func
(
pRtlUnwind
,
frame2
,
NULL
,
0xDEAD0000
);
ok
(
retval
==
0xDEAD0000
,
"RtlUnwind returned eax %08x instead of %08x
\n
"
,
retval
,
0xDEAD0000
);
ok
(
pNtCurrentTeb
()
->
Tib
.
ExceptionList
==
&
frame2
,
"Exception record points to %p instead of %p
\n
"
,
pNtCurrentTeb
()
->
Tib
.
ExceptionList
,
&
frame2
);
ok
(
pNtCurrentTeb
()
->
Tib
.
ExceptionList
==
frame2
,
"Exception record points to %p instead of %p
\n
"
,
pNtCurrentTeb
()
->
Tib
.
ExceptionList
,
frame2
);
/* unwind to frame1 */
unwind_expected_eax
=
0xDEAD0000
;
retval
=
func
(
pRtlUnwind
,
&
frame1
,
NULL
,
0xDEAD0000
);
retval
=
func
(
pRtlUnwind
,
frame1
,
NULL
,
0xDEAD0000
);
ok
(
retval
==
0xDEAD0001
,
"RtlUnwind returned eax %08x instead of %08x
\n
"
,
retval
,
0xDEAD0001
);
ok
(
pNtCurrentTeb
()
->
Tib
.
ExceptionList
==
&
frame1
,
"Exception record points to %p instead of %p
\n
"
,
pNtCurrentTeb
()
->
Tib
.
ExceptionList
,
&
frame1
);
ok
(
pNtCurrentTeb
()
->
Tib
.
ExceptionList
==
frame1
,
"Exception record points to %p instead of %p
\n
"
,
pNtCurrentTeb
()
->
Tib
.
ExceptionList
,
frame1
);
/* restore original handler */
pNtCurrentTeb
()
->
Tib
.
ExceptionList
=
frame1
.
Prev
;
pNtCurrentTeb
()
->
Tib
.
ExceptionList
=
frame1
->
Prev
;
}
static
DWORD
handler
(
EXCEPTION_RECORD
*
rec
,
EXCEPTION_REGISTRATION_RECORD
*
frame
,
...
...
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