Go to the source code of this file.
◆ EnablePrivilege()
static BOOL EnablePrivilege |
( |
LPCWSTR |
lpszPrivilegeName, |
|
|
BOOL |
bEnablePrivilege |
|
) |
| |
|
static |
Definition at line 34 of file shutdown.c.
35{
39
42 &hToken);
44
46 lpszPrivilegeName,
47 &
tp.Privileges[0].Luid);
49
50 tp.PrivilegeCount = 1;
52
54
55Quit:
58}
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 88 of file shutdown.c.
89{
91
93 {
95 return;
96 }
97
98#ifdef NT_INITIATE_POWERACTION_IMPLEMENTED
102#else
105 0);
106#endif
107
110
112}
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 115 of file shutdown.c.
116{
117
119
121 {
123 return;
124 }
125
126 if (ForceShutdown)
127 {
131 }
132 else
133 {
134
137 }
138
140}
NTSTATUS NTAPI NtShutdownSystem(IN SHUTDOWN_ACTION Action)
SHORT WINAPI GetKeyState(_In_ int)
Referenced by TaskManagerWndProc().
◆ ShutDown_Reboot()
Definition at line 143 of file shutdown.c.
144{
145
147
149 {
151 return;
152 }
153
154 if (ForceReboot)
155 {
159 }
160 else
161 {
164 }
165
167}
Referenced by TaskManagerWndProc().
◆ ShutDown_StandBy()
Definition at line 61 of file shutdown.c.
62{
64
66 {
68 return;
69 }
70
71#ifdef NT_INITIATE_POWERACTION_IMPLEMENTED
75#else
78 0);
79#endif
80
83
85}
Referenced by TaskManagerWndProc().
◆ ShutDown_SwitchUser()