Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
683583fa
Commit
683583fa
authored
Jun 06, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Remove support for setting custom signal handlers.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
173644b0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
183 deletions
+35
-183
ntdll.spec
dlls/ntdll/ntdll.spec
+0
-3
signal_arm.c
dlls/ntdll/signal_arm.c
+13
-40
signal_arm64.c
dlls/ntdll/signal_arm64.c
+3
-31
signal_i386.c
dlls/ntdll/signal_i386.c
+3
-36
signal_powerpc.c
dlls/ntdll/signal_powerpc.c
+13
-42
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+3
-31
No files found.
dlls/ntdll/ntdll.spec
View file @
683583fa
...
...
@@ -1601,9 +1601,6 @@
# Codepages
@ cdecl __wine_get_unix_codepage()
# signal handling
@ cdecl __wine_set_signal_handler(long ptr)
# Filesystem
@ cdecl wine_nt_to_unix_file_name(ptr ptr long long)
@ cdecl wine_unix_to_nt_file_name(ptr ptr)
dlls/ntdll/signal_arm.c
View file @
683583fa
...
...
@@ -119,9 +119,6 @@ enum arm_trap_code
};
typedef
void
(
WINAPI
*
raise_func
)(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
);
typedef
int
(
*
wine_signal_handler
)(
unsigned
int
sig
);
static
wine_signal_handler
handlers
[
256
];
/***********************************************************************
...
...
@@ -164,15 +161,6 @@ static inline WORD get_error_code( const ucontext_t *sigcontext )
#endif
}
/***********************************************************************
* dispatch_signal
*/
static
inline
int
dispatch_signal
(
unsigned
int
sig
)
{
if
(
handlers
[
sig
]
==
NULL
)
return
0
;
return
handlers
[
sig
](
sig
);
}
/*******************************************************************
* is_valid_frame
*/
...
...
@@ -700,22 +688,19 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext )
*/
static
void
int_handler
(
int
signal
,
siginfo_t
*
siginfo
,
void
*
sigcontext
)
{
if
(
!
dispatch_signal
(
SIGINT
))
{
EXCEPTION_RECORD
rec
;
CONTEXT
context
;
NTSTATUS
status
;
save_context
(
&
context
,
sigcontext
);
rec
.
ExceptionCode
=
CONTROL_C_EXIT
;
rec
.
ExceptionFlags
=
EXCEPTION_CONTINUABLE
;
rec
.
ExceptionRecord
=
NULL
;
rec
.
ExceptionAddress
=
(
LPVOID
)
context
.
Pc
;
rec
.
NumberParameters
=
0
;
status
=
raise_exception
(
&
rec
,
&
context
,
TRUE
);
if
(
status
)
raise_status
(
status
,
&
rec
);
restore_context
(
&
context
,
sigcontext
);
}
EXCEPTION_RECORD
rec
;
CONTEXT
context
;
NTSTATUS
status
;
save_context
(
&
context
,
sigcontext
);
rec
.
ExceptionCode
=
CONTROL_C_EXIT
;
rec
.
ExceptionFlags
=
EXCEPTION_CONTINUABLE
;
rec
.
ExceptionRecord
=
NULL
;
rec
.
ExceptionAddress
=
(
LPVOID
)
context
.
Pc
;
rec
.
NumberParameters
=
0
;
status
=
raise_exception
(
&
rec
,
&
context
,
TRUE
);
if
(
status
)
raise_status
(
status
,
&
rec
);
restore_context
(
&
context
,
sigcontext
);
}
...
...
@@ -768,18 +753,6 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
}
/***********************************************************************
* __wine_set_signal_handler (NTDLL.@)
*/
int
CDECL
__wine_set_signal_handler
(
unsigned
int
sig
,
wine_signal_handler
wsh
)
{
if
(
sig
>=
ARRAY_SIZE
(
handlers
))
return
-
1
;
if
(
handlers
[
sig
]
!=
NULL
)
return
-
2
;
handlers
[
sig
]
=
wsh
;
return
0
;
}
/**********************************************************************
* signal_init_process
*/
...
...
dlls/ntdll/signal_arm64.c
View file @
683583fa
...
...
@@ -141,10 +141,6 @@ struct stack_layout
void
*
redzone
[
2
];
};
typedef
int
(
*
wine_signal_handler
)(
unsigned
int
sig
);
static
wine_signal_handler
handlers
[
256
];
struct
arm64_thread_data
{
void
*
exit_frame
;
/* exit frame pointer */
...
...
@@ -160,15 +156,6 @@ static inline struct arm64_thread_data *arm64_thread_data(void)
}
/***********************************************************************
* dispatch_signal
*/
static
inline
int
dispatch_signal
(
unsigned
int
sig
)
{
if
(
handlers
[
sig
]
==
NULL
)
return
0
;
return
handlers
[
sig
](
sig
);
}
/***********************************************************************
* get_signal_stack
*
* Get the base of the signal stack for the current thread.
...
...
@@ -998,13 +985,10 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext )
*/
static
void
int_handler
(
int
signal
,
siginfo_t
*
siginfo
,
void
*
sigcontext
)
{
if
(
!
dispatch_signal
(
SIGINT
))
{
struct
stack_layout
*
stack
=
setup_exception
(
sigcontext
);
struct
stack_layout
*
stack
=
setup_exception
(
sigcontext
);
stack
->
rec
.
ExceptionCode
=
CONTROL_C_EXIT
;
setup_raise_exception
(
sigcontext
,
stack
);
}
stack
->
rec
.
ExceptionCode
=
CONTROL_C_EXIT
;
setup_raise_exception
(
sigcontext
,
stack
);
}
...
...
@@ -1064,18 +1048,6 @@ static void usr2_handler( int signal, siginfo_t *siginfo, void *sigcontext )
}
/***********************************************************************
* __wine_set_signal_handler (NTDLL.@)
*/
int
CDECL
__wine_set_signal_handler
(
unsigned
int
sig
,
wine_signal_handler
wsh
)
{
if
(
sig
>=
ARRAY_SIZE
(
handlers
))
return
-
1
;
if
(
handlers
[
sig
]
!=
NULL
)
return
-
2
;
handlers
[
sig
]
=
wsh
;
return
0
;
}
/**********************************************************************
* signal_init_process
*/
...
...
dlls/ntdll/signal_i386.c
View file @
683583fa
...
...
@@ -442,12 +442,8 @@ struct stack_layout
DWORD
eip
;
};
typedef
int
(
*
wine_signal_handler
)(
unsigned
int
sig
);
static
ULONG
first_ldt_entry
=
32
;
static
wine_signal_handler
handlers
[
256
];
enum
i386_trap_code
{
TRAP_x86_UNKNOWN
=
-
1
,
/* Unknown fault (TRAP_sig not defined) */
...
...
@@ -552,16 +548,6 @@ static inline int ldt_is_system( WORD sel )
}
/***********************************************************************
* dispatch_signal
*/
static
inline
int
dispatch_signal
(
unsigned
int
sig
)
{
if
(
handlers
[
sig
]
==
NULL
)
return
0
;
return
handlers
[
sig
](
sig
);
}
/***********************************************************************
* get_trap_code
*
* Get the trap code for a signal.
...
...
@@ -1800,19 +1786,12 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext )
* int_handler
*
* Handler for SIGINT.
*
* FIXME: should not be calling external functions on the signal stack.
*/
static
void
int_handler
(
int
signal
,
siginfo_t
*
siginfo
,
void
*
sigcontext
)
{
WORD
fs
,
gs
;
void
*
stack_ptr
=
init_handler
(
sigcontext
,
&
fs
,
&
gs
);
if
(
!
dispatch_signal
(
SIGINT
))
{
struct
stack_layout
*
stack
=
setup_exception_record
(
sigcontext
,
stack_ptr
,
fs
,
gs
);
stack
->
rec
.
ExceptionCode
=
CONTROL_C_EXIT
;
setup_raise_exception
(
sigcontext
,
stack
);
}
struct
stack_layout
*
stack
=
setup_exception
(
sigcontext
);
stack
->
rec
.
ExceptionCode
=
CONTROL_C_EXIT
;
setup_raise_exception
(
sigcontext
,
stack
);
}
/**********************************************************************
...
...
@@ -1859,18 +1838,6 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
}
/***********************************************************************
* __wine_set_signal_handler (NTDLL.@)
*/
int
CDECL
__wine_set_signal_handler
(
unsigned
int
sig
,
wine_signal_handler
wsh
)
{
if
(
sig
>=
ARRAY_SIZE
(
handlers
))
return
-
1
;
if
(
handlers
[
sig
]
!=
NULL
)
return
-
2
;
handlers
[
sig
]
=
wsh
;
return
0
;
}
/**********************************************************************
* signal_init_process
*/
...
...
dlls/ntdll/signal_powerpc.c
View file @
683583fa
...
...
@@ -140,20 +140,6 @@ SIGFPE
#endif
/* __APPLE__ */
typedef
int
(
*
wine_signal_handler
)(
unsigned
int
sig
);
static
wine_signal_handler
handlers
[
256
];
/***********************************************************************
* dispatch_signal
*/
static
inline
int
dispatch_signal
(
unsigned
int
sig
)
{
if
(
handlers
[
sig
]
==
NULL
)
return
0
;
return
handlers
[
sig
](
sig
);
}
/***********************************************************************
* save_context
*
...
...
@@ -599,22 +585,19 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext )
*/
static
void
int_handler
(
int
signal
,
siginfo_t
*
siginfo
,
void
*
sigcontext
)
{
if
(
!
dispatch_signal
(
SIGINT
))
{
EXCEPTION_RECORD
rec
;
CONTEXT
context
;
NTSTATUS
status
;
save_context
(
&
context
,
sigcontext
);
rec
.
ExceptionCode
=
CONTROL_C_EXIT
;
rec
.
ExceptionFlags
=
EXCEPTION_CONTINUABLE
;
rec
.
ExceptionRecord
=
NULL
;
rec
.
ExceptionAddress
=
(
LPVOID
)
context
.
Iar
;
rec
.
NumberParameters
=
0
;
status
=
raise_exception
(
&
rec
,
&
context
,
TRUE
);
if
(
status
)
raise_status
(
status
,
&
rec
);
restore_context
(
&
context
,
sigcontext
);
}
EXCEPTION_RECORD
rec
;
CONTEXT
context
;
NTSTATUS
status
;
save_context
(
&
context
,
sigcontext
);
rec
.
ExceptionCode
=
CONTROL_C_EXIT
;
rec
.
ExceptionFlags
=
EXCEPTION_CONTINUABLE
;
rec
.
ExceptionRecord
=
NULL
;
rec
.
ExceptionAddress
=
(
LPVOID
)
context
.
Iar
;
rec
.
NumberParameters
=
0
;
status
=
raise_exception
(
&
rec
,
&
context
,
TRUE
);
if
(
status
)
raise_status
(
status
,
&
rec
);
restore_context
(
&
context
,
sigcontext
);
}
...
...
@@ -667,18 +650,6 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
}
/***********************************************************************
* __wine_set_signal_handler (NTDLL.@)
*/
int
CDECL
__wine_set_signal_handler
(
unsigned
int
sig
,
wine_signal_handler
wsh
)
{
if
(
sig
>=
ARRAY_SIZE
(
handlers
))
return
-
1
;
if
(
handlers
[
sig
]
!=
NULL
)
return
-
2
;
handlers
[
sig
]
=
wsh
;
return
0
;
}
/**********************************************************************
* signal_init_process
*/
...
...
dlls/ntdll/signal_x86_64.c
View file @
683583fa
...
...
@@ -292,10 +292,6 @@ struct stack_layout
ULONG64
red_zone
[
16
];
};
typedef
int
(
*
wine_signal_handler
)(
unsigned
int
sig
);
static
wine_signal_handler
handlers
[
256
];
struct
amd64_thread_data
{
DWORD_PTR
dr0
;
/* debug registers */
...
...
@@ -1635,15 +1631,6 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX
}
/***********************************************************************
* dispatch_signal
*/
static
inline
int
dispatch_signal
(
unsigned
int
sig
)
{
if
(
handlers
[
sig
]
==
NULL
)
return
0
;
return
handlers
[
sig
](
sig
);
}
/***********************************************************************
* get_signal_stack
*
* Get the base of the signal stack for the current thread.
...
...
@@ -2705,12 +2692,9 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext )
*/
static
void
int_handler
(
int
signal
,
siginfo_t
*
siginfo
,
void
*
sigcontext
)
{
if
(
!
dispatch_signal
(
SIGINT
))
{
struct
stack_layout
*
stack
=
setup_exception
(
sigcontext
);
stack
->
rec
.
ExceptionCode
=
CONTROL_C_EXIT
;
setup_raise_exception
(
sigcontext
,
stack
);
}
struct
stack_layout
*
stack
=
setup_exception
(
sigcontext
);
stack
->
rec
.
ExceptionCode
=
CONTROL_C_EXIT
;
setup_raise_exception
(
sigcontext
,
stack
);
}
...
...
@@ -2754,18 +2738,6 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *ucontext )
}
/***********************************************************************
* __wine_set_signal_handler (NTDLL.@)
*/
int
CDECL
__wine_set_signal_handler
(
unsigned
int
sig
,
wine_signal_handler
wsh
)
{
if
(
sig
>=
ARRAY_SIZE
(
handlers
))
return
-
1
;
if
(
handlers
[
sig
]
!=
NULL
)
return
-
2
;
handlers
[
sig
]
=
wsh
;
return
0
;
}
/**********************************************************************
* signal_init_process
*/
...
...
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