[SHUTDOWN][WINLOGON]

SHUTDOWN: Fix the hack be calling InitiateSystemShutdownExW instead of ExitWindowsEx.
WINLOGON: Add a hack by calling ExitWindowsEx in BaseInitiateSystemShutdownEx.

svn path=/trunk/; revision=70419
This commit is contained in:
Eric Kohl 2015-12-26 00:38:37 +00:00
parent f17fe51f38
commit 1ce137ac92
2 changed files with 28 additions and 19 deletions

View file

@ -342,20 +342,13 @@ int wmain(int argc, WCHAR *argv[])
return EXIT_SUCCESS;
}
/**
** HACK: When InitiateSystemShutdownExW will become really implemented,
** activate this line and delete the other...
**
if(!InitiateSystemShutdownExW(opts.remote_system,
opts.message,
opts.shutdown_delay,
opts.force,
opts.restart,
opts.reason))
***/
if (!ExitWindowsEx((opts.shutdown ? EWX_SHUTDOWN : EWX_REBOOT) |
(opts.force ? EWX_FORCE : 0),
opts.reason))
/* Initiate the shutdown */
if (!InitiateSystemShutdownExW(opts.remote_system,
opts.message,
opts.shutdown_delay,
opts.force,
opts.restart,
opts.reason))
{
/*
* If there is an error, give the proper output depending

View file

@ -21,7 +21,7 @@ StartRpcServer(VOID)
{
RPC_STATUS Status;
TRACE("ScmStartRpcServer() called\n");
TRACE("StartRpcServer() called\n");
Status = RpcServerUseProtseqEpW(L"ncacn_np",
10,
@ -415,7 +415,12 @@ BaseInitiateSystemShutdown(
BOOLEAN bRebootAfterShutdown)
{
TRACE("BaseInitiateSystemShutdown()\n");
return ERROR_SUCCESS;
return BaseInitiateSystemShutdownEx(ServerName,
lpMessage,
dwTimeout,
bForceAppsClosed,
bRebootAfterShutdown,
0);
}
@ -425,7 +430,7 @@ __stdcall
BaseAbortSystemShutdown(
PREGISTRY_SERVER_NAME ServerName)
{
TRACE("\n");
TRACE("BaseAbortSystemShutdown()\n");
return ERROR_SUCCESS;
}
@ -492,8 +497,19 @@ BaseInitiateSystemShutdownEx(
BOOLEAN bRebootAfterShutdown,
ULONG dwReason)
{
TRACE("\n");
return ERROR_SUCCESS;
TRACE("BaseInitiateSystemShutdownEx()\n");
TRACE(" Message: %wZ\n", lpMessage);
TRACE(" Timeout: %lu\n", dwTimeout);
TRACE(" Force: %d\n", bForceAppsClosed);
TRACE(" Reboot: %d\n", bRebootAfterShutdown);
TRACE(" Reason: %lu\n", dwReason);
// return ERROR_SUCCESS;
/* FIXME */
return ExitWindowsEx((bRebootAfterShutdown ? EWX_REBOOT : EWX_SHUTDOWN) |
(bForceAppsClosed ? EWX_FORCE : 0),
dwReason);
}