Skip to content

Commit 37375fc

Browse files
committed
[WINLOGON] Implement shutdown sound support
CORE-13951
1 parent 77bfc12 commit 37375fc

File tree

1 file changed

+8
-4
lines changed
  • base/system/winlogon

1 file changed

+8
-4
lines changed

base/system/winlogon/sas.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,17 @@ PlayLogonSound(
367367

368368
static
369369
VOID
370-
PlayLogoffSound(
371-
_In_ PWLSESSION Session)
370+
PlayLogoffShutdownSound(
371+
_In_ PWLSESSION Session,
372+
_In_ BOOL bShutdown)
372373
{
373374
if (!ImpersonateLoggedOnUser(Session->UserToken))
374375
return;
375376

376-
PlaySoundRoutine(L"WindowsLogoff", FALSE, SND_ALIAS | SND_NODEFAULT);
377+
/* NOTE: Logoff and shutdown sounds play synchronously */
378+
PlaySoundRoutine(bShutdown ? L"SystemExit" : L"WindowsLogoff",
379+
FALSE,
380+
SND_ALIAS | SND_NODEFAULT);
377381

378382
RevertToSelf();
379383
}
@@ -848,7 +852,7 @@ HandleLogoff(
848852

849853
SwitchDesktop(Session->WinlogonDesktop);
850854

851-
PlayLogoffSound(Session);
855+
PlayLogoffShutdownSound(Session, WLX_SHUTTINGDOWN(wlxAction));
852856

853857
SetWindowStationUser(Session->InteractiveWindowStation,
854858
&LuidNone, NULL, 0);

0 commit comments

Comments
 (0)