mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Ctrl-C handler on Windows.
This commit is contained in:
@@ -234,4 +234,4 @@ PAGE_WRITECOPY :: 0x08
|
|||||||
PAGE_EXECUTE :: 0x10
|
PAGE_EXECUTE :: 0x10
|
||||||
PAGE_EXECUTE_READ :: 0x20
|
PAGE_EXECUTE_READ :: 0x20
|
||||||
PAGE_EXECUTE_READWRITE :: 0x40
|
PAGE_EXECUTE_READWRITE :: 0x40
|
||||||
PAGE_EXECUTE_WRITECOPY :: 0x80
|
PAGE_EXECUTE_WRITECOPY :: 0x80
|
||||||
@@ -758,3 +758,18 @@ foreign kernel32 {
|
|||||||
UnmapFlags: ULONG,
|
UnmapFlags: ULONG,
|
||||||
) -> BOOL ---
|
) -> BOOL ---
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@(default_calling_convention = "std")
|
||||||
|
foreign kernel32 {
|
||||||
|
@(link_name="SetConsoleCtrlHandler") set_console_ctrl_handler :: proc(handler: Handler_Routine, add: BOOL) -> BOOL ---
|
||||||
|
}
|
||||||
|
|
||||||
|
Handler_Routine :: proc(dwCtrlType: Control_Event) -> BOOL
|
||||||
|
|
||||||
|
Control_Event :: enum DWORD {
|
||||||
|
control_c = 0,
|
||||||
|
_break = 1,
|
||||||
|
close = 2,
|
||||||
|
logoff = 5,
|
||||||
|
shutdown = 6,
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user