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
5d3c0cf0
Commit
5d3c0cf0
authored
Feb 28, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wow64: Call the 32-bit KiRaiseUserExceptionDispatcher for invalid handle exceptions.
parent
3c3cf47a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
2 deletions
+38
-2
syscall.c
dlls/wow64/syscall.c
+38
-2
No files found.
dlls/wow64/syscall.c
View file @
5d3c0cf0
...
@@ -100,6 +100,7 @@ static void (WINAPI *pBTCpuThreadInit)(void);
...
@@ -100,6 +100,7 @@ static void (WINAPI *pBTCpuThreadInit)(void);
static
void
(
WINAPI
*
pBTCpuSimulate
)(
void
);
static
void
(
WINAPI
*
pBTCpuSimulate
)(
void
);
static
NTSTATUS
(
WINAPI
*
pBTCpuResetToConsistentState
)(
EXCEPTION_POINTERS
*
);
static
NTSTATUS
(
WINAPI
*
pBTCpuResetToConsistentState
)(
EXCEPTION_POINTERS
*
);
static
void
*
(
WINAPI
*
p__wine_get_unix_opcode
)(
void
);
static
void
*
(
WINAPI
*
p__wine_get_unix_opcode
)(
void
);
static
void
*
(
WINAPI
*
pKiRaiseUserExceptionDispatcher
)(
void
);
void
*
dummy
=
RtlUnwind
;
void
*
dummy
=
RtlUnwind
;
...
@@ -248,6 +249,40 @@ static void call_user_exception_dispatcher( EXCEPTION_RECORD32 *rec, void *ctx32
...
@@ -248,6 +249,40 @@ static void call_user_exception_dispatcher( EXCEPTION_RECORD32 *rec, void *ctx32
}
}
/**********************************************************************
* call_raise_user_exception_dispatcher
*/
static
void
call_raise_user_exception_dispatcher
(
ULONG
code
)
{
TEB32
*
teb32
=
(
TEB32
*
)((
char
*
)
NtCurrentTeb
()
+
NtCurrentTeb
()
->
WowTebOffset
);
teb32
->
ExceptionCode
=
code
;
switch
(
current_machine
)
{
case
IMAGE_FILE_MACHINE_I386
:
{
I386_CONTEXT
ctx
=
{
CONTEXT_I386_ALL
};
pBTCpuGetContext
(
GetCurrentThread
(),
GetCurrentProcess
(),
NULL
,
&
ctx
);
ctx
.
Eip
=
(
ULONG_PTR
)
pKiRaiseUserExceptionDispatcher
;
pBTCpuSetContext
(
GetCurrentThread
(),
GetCurrentProcess
(),
NULL
,
&
ctx
);
}
break
;
case
IMAGE_FILE_MACHINE_ARMNT
:
{
ARM_CONTEXT
ctx
=
{
CONTEXT_ARM_ALL
};
pBTCpuGetContext
(
GetCurrentThread
(),
GetCurrentProcess
(),
NULL
,
&
ctx
);
ctx
.
Pc
=
(
ULONG_PTR
)
pKiRaiseUserExceptionDispatcher
;
pBTCpuSetContext
(
GetCurrentThread
(),
GetCurrentProcess
(),
NULL
,
&
ctx
);
}
break
;
}
}
/* based on RtlRaiseException: call NtRaiseException with context setup to return to caller */
/* based on RtlRaiseException: call NtRaiseException with context setup to return to caller */
void
WINAPI
raise_exception
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
BOOL
first_chance
)
DECLSPEC_HIDDEN
;
void
WINAPI
raise_exception
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
BOOL
first_chance
)
DECLSPEC_HIDDEN
;
#ifdef __x86_64__
#ifdef __x86_64__
...
@@ -731,6 +766,7 @@ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **contex
...
@@ -731,6 +766,7 @@ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **contex
init_syscall_table
(
module
,
0
,
&
ntdll_syscall_table
);
init_syscall_table
(
module
,
0
,
&
ntdll_syscall_table
);
*
(
void
**
)
RtlFindExportedRoutineByName
(
module
,
"__wine_syscall_dispatcher"
)
=
pBTCpuGetBopCode
();
*
(
void
**
)
RtlFindExportedRoutineByName
(
module
,
"__wine_syscall_dispatcher"
)
=
pBTCpuGetBopCode
();
*
(
void
**
)
RtlFindExportedRoutineByName
(
module
,
"__wine_unix_call_dispatcher"
)
=
p__wine_get_unix_opcode
();
*
(
void
**
)
RtlFindExportedRoutineByName
(
module
,
"__wine_unix_call_dispatcher"
)
=
p__wine_get_unix_opcode
();
GET_PTR
(
KiRaiseUserExceptionDispatcher
);
init_file_redirects
();
init_file_redirects
();
return
TRUE
;
return
TRUE
;
...
@@ -817,7 +853,7 @@ static LONG CALLBACK syscall_filter( EXCEPTION_POINTERS *ptrs )
...
@@ -817,7 +853,7 @@ static LONG CALLBACK syscall_filter( EXCEPTION_POINTERS *ptrs )
switch
(
ptrs
->
ExceptionRecord
->
ExceptionCode
)
switch
(
ptrs
->
ExceptionRecord
->
ExceptionCode
)
{
{
case
STATUS_INVALID_HANDLE
:
case
STATUS_INVALID_HANDLE
:
Wow64PassExceptionToGuest
(
ptrs
);
call_raise_user_exception_dispatcher
(
ptrs
->
ExceptionRecord
->
ExceptionCode
);
break
;
break
;
}
}
return
EXCEPTION_EXECUTE_HANDLER
;
return
EXCEPTION_EXECUTE_HANDLER
;
...
@@ -847,7 +883,7 @@ NTSTATUS WINAPI Wow64SystemServiceEx( UINT num, UINT *args )
...
@@ -847,7 +883,7 @@ NTSTATUS WINAPI Wow64SystemServiceEx( UINT num, UINT *args )
{
{
status
=
GetExceptionCode
();
status
=
GetExceptionCode
();
}
}
__ENDTRY
;
__ENDTRY
free_temp_data
();
free_temp_data
();
return
status
;
return
status
;
}
}
...
...
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