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.
47 &
tp.Privileges[0].Luid);
50 tp.PrivilegeCount = 1;
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
#define SE_PRIVILEGE_ENABLED
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
#define GetCurrentProcess()
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 TOKEN_ADJUST_PRIVILEGES
Referenced by ShutDown_Hibernate(), ShutDown_PowerOff(), ShutDown_Reboot(), and ShutDown_StandBy().
◆ ShutDown_Disconnect()
◆ ShutDown_EjectComputer()
◆ ShutDown_Hibernate()
Definition at line 88 of file shutdown.c.
98 #ifdef NT_INITIATE_POWERACTION_IMPLEMENTED
DWORD WINAPI GetLastError(VOID)
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)
#define NT_SUCCESS(StatCode)
VOID ShowWin32Error(IN DWORD dwError)
static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, BOOL bEnablePrivilege)
Referenced by TaskManagerWndProc().
◆ ShutDown_LockComputer()
Definition at line 182 of file shutdown.c.
DWORD WINAPI GetLastError(VOID)
EXTINLINE BOOL WINAPI LockWorkStation(VOID)
VOID ShowWin32Error(IN DWORD dwError)
Referenced by TaskManagerWndProc().
◆ ShutDown_LogOffUser()
Definition at line 170 of file shutdown.c.
DWORD WINAPI GetLastError(VOID)
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
VOID ShowWin32Error(IN DWORD dwError)
Referenced by TaskManagerWndProc().
◆ ShutDown_PowerOff()
Definition at line 115 of file shutdown.c.
DWORD WINAPI GetLastError(VOID)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
SHORT WINAPI GetKeyState(_In_ int)
#define NT_SUCCESS(StatCode)
NTSTATUS NTAPI NtShutdownSystem(IN SHUTDOWN_ACTION Action)
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
VOID ShowWin32Error(IN DWORD dwError)
static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, BOOL bEnablePrivilege)
Referenced by TaskManagerWndProc().
◆ ShutDown_Reboot()
Definition at line 143 of file shutdown.c.
DWORD WINAPI GetLastError(VOID)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
SHORT WINAPI GetKeyState(_In_ int)
#define NT_SUCCESS(StatCode)
NTSTATUS NTAPI NtShutdownSystem(IN SHUTDOWN_ACTION Action)
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
VOID ShowWin32Error(IN DWORD dwError)
static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, BOOL bEnablePrivilege)
Referenced by TaskManagerWndProc().
◆ ShutDown_StandBy()
Definition at line 61 of file shutdown.c.
71 #ifdef NT_INITIATE_POWERACTION_IMPLEMENTED
DWORD WINAPI GetLastError(VOID)
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)
#define NT_SUCCESS(StatCode)
VOID ShowWin32Error(IN DWORD dwError)
static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, BOOL bEnablePrivilege)
Referenced by TaskManagerWndProc().
◆ ShutDown_SwitchUser()