InitiateShutdown function advapi32
int
InitiateShutdown(
- PCWSTR? lpMachineName,
- PCWSTR? lpMessage,
- int dwGracePeriod,
- SHUTDOWN_FLAGS dwShutdownFlags,
- SHUTDOWN_REASON dwReason,
Initiates a shutdown and restart of the specified computer, and restarts any applications that have been registered for restart.
To learn more, see learn.microsoft.com/windows/win32/api/winreg/nf-winreg-initiateshutdownw.
Implementation
@pragma('vm:prefer-inline')
int InitiateShutdown(
PCWSTR? lpMachineName,
PCWSTR? lpMessage,
int dwGracePeriod,
SHUTDOWN_FLAGS dwShutdownFlags,
SHUTDOWN_REASON dwReason,
) => _InitiateShutdown(
lpMachineName ?? nullptr,
lpMessage ?? nullptr,
dwGracePeriod,
dwShutdownFlags,
dwReason,
);