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
173644b0
Commit
173644b0
authored
Jun 06, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Use a vectored exception handler to catch Ctrl-C.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
20c91c5e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
13 deletions
+8
-13
console.c
dlls/kernel32/console.c
+6
-8
console_private.h
dlls/kernel32/console_private.h
+1
-2
kernel_main.c
dlls/kernel32/kernel_main.c
+1
-3
No files found.
dlls/kernel32/console.c
View file @
173644b0
...
...
@@ -894,14 +894,15 @@ BOOL WINAPI GetNumberOfConsoleMouseButtons(LPDWORD nrofbuttons)
*
* Check whether the shall manipulate CtrlC events
*/
int
CONSOLE_HandleCtrlC
(
unsigned
sig
)
LONG
CALLBACK
CONSOLE_HandleCtrlC
(
EXCEPTION_POINTERS
*
eptr
)
{
extern
DWORD
WINAPI
CtrlRoutine
(
void
*
arg
);
HANDLE
thread
;
if
(
eptr
->
ExceptionRecord
->
ExceptionCode
!=
CONTROL_C_EXIT
)
return
EXCEPTION_CONTINUE_SEARCH
;
/* FIXME: better test whether a console is attached to this process ??? */
extern
unsigned
CONSOLE_GetNumHistoryEntries
(
void
);
if
(
CONSOLE_GetNumHistoryEntries
()
==
(
unsigned
)
-
1
)
return
0
;
if
(
CONSOLE_GetNumHistoryEntries
()
==
(
unsigned
)
-
1
)
return
EXCEPTION_CONTINUE_SEARCH
;
/* check if we have to ignore ctrl-C events */
if
(
!
(
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
ConsoleFlags
&
1
))
...
...
@@ -916,12 +917,9 @@ int CONSOLE_HandleCtrlC(unsigned sig)
* we can wait on this critical section
*/
thread
=
CreateThread
(
NULL
,
0
,
CtrlRoutine
,
(
void
*
)
CTRL_C_EVENT
,
0
,
NULL
);
if
(
thread
==
NULL
)
return
0
;
CloseHandle
(
thread
);
if
(
thread
)
CloseHandle
(
thread
);
}
return
1
;
return
EXCEPTION_CONTINUE_EXECUTION
;
}
/******************************************************************
...
...
dlls/kernel32/console_private.h
View file @
173644b0
...
...
@@ -22,8 +22,7 @@
#define __WINE_CONSOLE_PRIVATE_H
/* console.c */
extern
int
CONSOLE_HandleCtrlC
(
unsigned
)
DECLSPEC_HIDDEN
;
/* console.c */
extern
LONG
CALLBACK
CONSOLE_HandleCtrlC
(
EXCEPTION_POINTERS
*
eptr
)
DECLSPEC_HIDDEN
;
extern
int
CONSOLE_GetHistory
(
int
idx
,
WCHAR
*
buf
,
int
buf_len
)
DECLSPEC_HIDDEN
;
extern
BOOL
CONSOLE_AppendHistory
(
const
WCHAR
*
p
)
DECLSPEC_HIDDEN
;
extern
unsigned
CONSOLE_GetNumHistoryEntries
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/kernel32/kernel_main.c
View file @
173644b0
...
...
@@ -39,8 +39,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
process
);
extern
int
CDECL
__wine_set_signal_handler
(
unsigned
,
int
(
*
)(
unsigned
));
static
STARTUPINFOA
startup_infoA
;
/***********************************************************************
...
...
@@ -150,7 +148,7 @@ static BOOL process_attach( HMODULE module )
}
/* finish the process initialisation for console bits, if needed */
__wine_set_signal_handler
(
SIGINT
,
CONSOLE_HandleCtrlC
);
RtlAddVectoredExceptionHandler
(
FALSE
,
CONSOLE_HandleCtrlC
);
if
(
params
->
ConsoleHandle
==
KERNEL32_CONSOLE_ALLOC
)
{
...
...
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