-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExitWindowsEx.xs
More file actions
69 lines (54 loc) · 1.08 KB
/
Copy pathExitWindowsEx.xs
File metadata and controls
69 lines (54 loc) · 1.08 KB
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
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include <stdbool.h>
// #include <windows.h>
#include <powrprof.h>
// winuser.h user32.dll
MODULE = Win32::ExitWindowsEx PACKAGE = Win32::ExitWindowsEx
int shut_down()
CODE:
RETVAL = ExitWindowsEx (EWX_SHUTDOWN, 0) ;
OUTPUT:
RETVAL
int force_shut_down()
CODE:
RETVAL = ExitWindowsEx (EWX_SHUTDOWN | EWX_FORCE, 0) ;
OUTPUT:
RETVAL
int restart()
CODE:
RETVAL = ExitWindowsEx (EWX_REBOOT, 0) ;
OUTPUT:
RETVAL
int force_restart()
CODE:
RETVAL = ExitWindowsEx (EWX_REBOOT | EWX_FORCE, 0) ;
OUTPUT:
RETVAL
int log_off()
CODE:
RETVAL = ExitWindowsEx (EWX_LOGOFF, 0) ;
OUTPUT:
RETVAL
int force_log_off()
CODE:
RETVAL = ExitWindowsEx (EWX_LOGOFF | EWX_FORCE, 0) ;
OUTPUT:
RETVAL
bool lock_screen()
CODE:
RETVAL = LockWorkStation() ;
OUTPUT:
RETVAL
bool sleep()
CODE:
RETVAL = SetSuspendState(false, false, false);
OUTPUT:
RETVAL
bool hibernate()
CODE:
RETVAL = SetSuspendState(true, false, false);
OUTPUT:
RETVAL