blob: 30af584db3e9efa5a9133c30dda206cd608f1173 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
/*************************************************************************
*
* BREAK.C
*
* Control-C and Control-Break routines
*
* Copyright (c) 1995 Microsoft Corporation
*
* $Log: N:\NT\PRIVATE\NW4\NWSCRIPT\VCS\BREAK.C $
*
* Rev 1.2 10 Apr 1996 14:21:38 terryt
* Hotfix for 21181hq
*
* Rev 1.2 12 Mar 1996 19:52:16 terryt
* Relative NDS names and merge
*
* Rev 1.1 22 Dec 1995 14:23:38 terryt
* Add Microsoft headers
*
* Rev 1.0 15 Nov 1995 18:06:28 terryt
* Initial revision.
*
* Rev 1.0 15 May 1995 19:10:14 terryt
* Initial revision.
*
*************************************************************************/
#include <stdio.h>
#include <direct.h>
#include <time.h>
#include <stdlib.h>
#include <nt.h>
#include <ntrtl.h>
#include <nturtl.h>
#include <windows.h>
#include "nwscript.h"
#include "ntnw.h"
/*
* Handler for console events
*/
BOOL WINAPI
Handler( DWORD CtrlType )
{
if ( CtrlType & ( CTRL_C_EVENT | CTRL_BREAK_EVENT ) )
return TRUE; /* don't execute default handler */
}
/*
* NTBreakOn
*
* Routine Description:
*
* Allow Ctrl+C and Ctrl+Break during logon script
*
* Arguments:
* none
*
* Return Value:
* none
*/
void NTBreakOn( void )
{
(void) SetConsoleCtrlHandler( &Handler, FALSE );
}
/*
* NTBreakOff
*
* Routine Description:
*
* Prevent Ctrl+C and Ctrl+Break during logon script
*
* Arguments:
* none
*
* Return Value:
* none
*/
void NTBreakOff( void )
{
(void) SetConsoleCtrlHandler( &Handler, TRUE );
}
|