Go to the source code of this file.
◆ EnablePrivilege()
static BOOL EnablePrivilege |
( |
LPCWSTR |
lpszPrivilegeName, |
|
|
BOOL |
bEnablePrivilege |
|
) |
| |
|
static |
Definition at line 19 of file shutdown.c.
20{
24
27 &hToken);
29
31 lpszPrivilegeName,
32 &
tp.Privileges[0].Luid);
34
35 tp.PrivilegeCount = 1;
37
39
40Quit:
43}
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
#define GetCurrentProcess()
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
#define TOKEN_ADJUST_PRIVILEGES
#define SE_PRIVILEGE_ENABLED
◆ ShutDown_Disconnect()
◆ ShutDown_EjectComputer()
◆ ShutDown_Hibernate()
Definition at line 73 of file shutdown.c.
74{
76
78 {
80 return;
81 }
82
83#ifdef NT_INITIATE_POWERACTION_IMPLEMENTED
87#else
90 0);
91#endif
92
95
97}
static DWORD EnablePrivilege(LPCWSTR lpszPrivilegeName, BOOL bEnablePrivilege)
#define NT_SUCCESS(StatCode)
VOID ShowWin32Error(IN DWORD dwError)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
NTSTATUS NTAPI NtInitiatePowerAction(IN POWER_ACTION SystemAction, IN SYSTEM_POWER_STATE MinSystemState, IN ULONG Flags, IN BOOLEAN Asynchronous)
NTSTATUS NTAPI NtSetSystemPowerState(IN POWER_ACTION SystemAction, IN SYSTEM_POWER_STATE MinSystemState, IN ULONG Flags)
DWORD WINAPI GetLastError(void)
Referenced by TaskManagerWndProc().
◆ ShutDown_LockComputer()
◆ ShutDown_LogOffUser()
◆ ShutDown_PowerOff()
Definition at line 100 of file shutdown.c.
101{
102
104
106 {
108 return;
109 }
110
111 if (ForceShutdown)
112 {
116 }
117 else
118 {
119
122 }
123
125}
NTSTATUS NTAPI NtShutdownSystem(IN SHUTDOWN_ACTION Action)
SHORT WINAPI GetKeyState(_In_ int)
Referenced by TaskManagerWndProc().
◆ ShutDown_Reboot()
Definition at line 128 of file shutdown.c.
129{
130
132
134 {
136 return;
137 }
138
139 if (ForceReboot)
140 {
144 }
145 else
146 {
149 }
150
152}
Referenced by TaskManagerWndProc().
◆ ShutDown_StandBy()
Definition at line 46 of file shutdown.c.
47{
49
51 {
53 return;
54 }
55
56#ifdef NT_INITIATE_POWERACTION_IMPLEMENTED
60#else
63 0);
64#endif
65
68
70}
Referenced by TaskManagerWndProc().
◆ ShutDown_SwitchUser()