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
3d4d7e01
Commit
3d4d7e01
authored
Jul 31, 2002
by
Eric Pouech
Committed by
Alexandre Julliard
Jul 31, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a generic mechanism to set up hooks for dispatching signal
handlers outside ntdll.
parent
a6cff2b3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
4 deletions
+64
-4
kernel_main.c
dlls/kernel/kernel_main.c
+6
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+3
-0
signal_i386.c
dlls/ntdll/signal_i386.c
+27
-2
signal_sparc.c
dlls/ntdll/signal_sparc.c
+28
-2
No files found.
dlls/kernel/kernel_main.c
View file @
3d4d7e01
...
...
@@ -24,6 +24,7 @@
#include <ctype.h>
#include <string.h>
#include <sys/stat.h>
#include <signal.h>
#include "winbase.h"
...
...
@@ -38,6 +39,8 @@
extern
void
CODEPAGE_Init
(
void
);
extern
BOOL
RELAY_Init
(
void
);
extern
int
__wine_set_signal_handler
(
unsigned
,
int
(
*
)(
unsigned
));
extern
int
CONSOLE_HandleCtrlC
(
unsigned
);
/***********************************************************************
* KERNEL process initialisation routine
...
...
@@ -100,6 +103,9 @@ static BOOL process_attach(void)
/* Create the shared heap for broken win95 native dlls */
HeapCreate
(
HEAP_SHARED
,
0
,
0
);
/* finish the process initialisation, if needed */
__wine_set_signal_handler
(
SIGINT
,
CONSOLE_HandleCtrlC
);
return
TRUE
;
}
...
...
dlls/ntdll/ntdll.spec
View file @
3d4d7e01
...
...
@@ -1026,3 +1026,6 @@
# Codepages
@ cdecl __wine_init_codepages(ptr ptr) __wine_init_codepages
# signal handling
@ cdecl __wine_set_signal_handler(long ptr) __wine_set_signal_handler
dlls/ntdll/signal_i386.c
View file @
3d4d7e01
...
...
@@ -380,10 +380,24 @@ typedef struct
WINE_DEFAULT_DEBUG_CHANNEL
(
seh
);
typedef
int
(
*
wine_signal_handler
)(
unsigned
sig
);
static
wine_signal_handler
handlers
[
256
];
static
sigset_t
all_sigs
;
/***********************************************************************
* dispatch_signal
*/
inline
static
int
dispatch_signal
(
unsigned
sig
)
{
if
(
handlers
[
sig
]
==
NULL
)
return
0
;
return
handlers
[
sig
](
sig
);
}
/***********************************************************************
* get_trap_code
*
* Get the trap code for a signal.
...
...
@@ -974,8 +988,7 @@ static HANDLER_DEF(fpe_handler)
*/
static
HANDLER_DEF
(
int_handler
)
{
extern
int
CONSOLE_HandleCtrlC
(
void
);
if
(
!
CONSOLE_HandleCtrlC
())
if
(
!
dispatch_signal
(
SIGINT
))
{
EXCEPTION_RECORD
rec
;
CONTEXT
context
;
...
...
@@ -1034,6 +1047,18 @@ static int set_handler( int sig, int have_sigaltstack, void (*func)() )
}
/***********************************************************************
* __wine_set_signal_handler (NTDLL.@)
*/
int
__wine_set_signal_handler
(
unsigned
sig
,
wine_signal_handler
wsh
)
{
if
(
sig
>
sizeof
(
handlers
)
/
sizeof
(
handlers
[
0
]))
return
-
1
;
if
(
handlers
[
sig
]
!=
NULL
)
return
-
2
;
handlers
[
sig
]
=
wsh
;
return
0
;
}
/**********************************************************************
* SIGNAL_Init
*/
...
...
dlls/ntdll/signal_sparc.c
View file @
3d4d7e01
...
...
@@ -40,8 +40,23 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
seh
);
typedef
int
(
*
wine_signal_handler
)(
unsigned
sig
);
static
wine_signal_handler
handlers
[
256
];
static
sigset_t
all_sigs
;
/***********************************************************************
* dispatch_signal
*/
inline
static
int
dispatch_signal
(
unsigned
sig
)
{
if
(
handlers
[
sig
]
==
NULL
)
return
0
;
return
handlers
[
sig
](
sig
);
}
/*
* FIXME: All this works only on Solaris for now
*/
...
...
@@ -310,8 +325,7 @@ static void fpe_handler( int signal, siginfo_t *info, ucontext_t *ucontext )
*/
static
void
int_handler
(
int
signal
,
siginfo_t
*
info
,
ucontext_t
*
ucontext
)
{
extern
int
CONSOLE_HandleCtrlC
(
void
);
if
(
!
CONSOLE_HandleCtrlC
())
if
(
!
dispatch_signal
(
SIGINT
))
{
EXCEPTION_RECORD
rec
;
CONTEXT
context
;
...
...
@@ -347,6 +361,18 @@ static int set_handler( int sig, void (*func)() )
/***********************************************************************
* __wine_set_signal_handler (NTDLL.@)
*/
int
__wine_set_signal_handler
(
unsigned
sig
,
wine_signal_handler
wsh
)
{
if
(
sig
>
sizeof
(
handlers
)
/
sizeof
(
handlers
[
0
]))
return
-
1
;
if
(
handlers
[
sig
]
!=
NULL
)
return
-
2
;
handlers
[
sig
]
=
wsh
;
return
0
;
}
/***********************************************************************
* SIGNAL_Unblock
*
* Unblock signals. Called from EXC_RtlRaiseException.
...
...
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