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
99d89b34
Commit
99d89b34
authored
Feb 12, 2013
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a helper function to check that a fault address lies in a known virtual memory view.
parent
88367a3c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-0
signal_i386.c
dlls/ntdll/signal_i386.c
+2
-0
virtual.c
dlls/ntdll/virtual.c
+17
-0
No files found.
dlls/ntdll/ntdll_misc.h
View file @
99d89b34
...
...
@@ -166,6 +166,7 @@ extern NTSTATUS virtual_create_builtin_view( void *base ) DECLSPEC_HIDDEN;
extern
NTSTATUS
virtual_alloc_thread_stack
(
TEB
*
teb
,
SIZE_T
reserve_size
,
SIZE_T
commit_size
)
DECLSPEC_HIDDEN
;
extern
void
virtual_clear_thread_stack
(
void
)
DECLSPEC_HIDDEN
;
extern
BOOL
virtual_handle_stack_fault
(
void
*
addr
)
DECLSPEC_HIDDEN
;
extern
BOOL
virtual_is_valid_code_address
(
const
void
*
addr
,
SIZE_T
size
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_handle_fault
(
LPCVOID
addr
,
DWORD
err
)
DECLSPEC_HIDDEN
;
extern
BOOL
virtual_check_buffer_for_read
(
const
void
*
ptr
,
SIZE_T
size
)
DECLSPEC_HIDDEN
;
extern
BOOL
virtual_check_buffer_for_write
(
void
*
ptr
,
SIZE_T
size
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/signal_i386.c
View file @
99d89b34
...
...
@@ -1528,6 +1528,8 @@ static BOOL check_atl_thunk( EXCEPTION_RECORD *rec, CONTEXT *context )
const
struct
atl_thunk
*
thunk
=
(
const
struct
atl_thunk
*
)
rec
->
ExceptionInformation
[
1
];
BOOL
ret
=
FALSE
;
if
(
!
virtual_is_valid_code_address
(
thunk
,
sizeof
(
thunk
)
))
return
FALSE
;
__TRY
{
if
(
thunk
->
movl
==
0x042444c7
&&
thunk
->
jmp
==
0xe9
)
...
...
dlls/ntdll/virtual.c
View file @
99d89b34
...
...
@@ -1617,6 +1617,23 @@ NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err )
/***********************************************************************
* virtual_is_valid_code_address
*/
BOOL
virtual_is_valid_code_address
(
const
void
*
addr
,
SIZE_T
size
)
{
struct
file_view
*
view
;
BOOL
ret
=
FALSE
;
sigset_t
sigset
;
server_enter_uninterrupted_section
(
&
csVirtual
,
&
sigset
);
if
((
view
=
VIRTUAL_FindView
(
addr
,
size
)))
ret
=
!
(
view
->
protect
&
VPROT_SYSTEM
);
/* system views are not visible to the app */
server_leave_uninterrupted_section
(
&
csVirtual
,
&
sigset
);
return
ret
;
}
/***********************************************************************
* virtual_handle_stack_fault
*
* Handle an access fault inside the current thread stack.
...
...
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