Skip to content

Commit

Permalink
[WINLOGON] Implement shutdown sound support
Browse files Browse the repository at this point in the history
CORE-13951
  • Loading branch information
TAN-Gaming committed Dec 3, 2024
1 parent 3c16dda commit 01953e8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions base/system/winlogon/sas.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,17 @@ PlayLogonSound(

static
VOID
PlayLogoffSound(
_In_ PWLSESSION Session)
PlayLogoffShutdownSound(
_In_ PWLSESSION Session,
_In_ BOOL bShutdown)
{
if (!ImpersonateLoggedOnUser(Session->UserToken))
return;

PlaySoundRoutine(L"WindowsLogoff", FALSE, SND_ALIAS | SND_NODEFAULT);
/* NOTE: Logoff and shutdown sounds play synchronously */
PlaySoundRoutine(bShutdown ? L"SystemExit" : L"WindowsLogoff",
FALSE,
SND_ALIAS | SND_NODEFAULT);

RevertToSelf();
}
Expand Down Expand Up @@ -848,7 +852,7 @@ HandleLogoff(

SwitchDesktop(Session->WinlogonDesktop);

PlayLogoffSound(Session);
PlayLogoffShutdownSound(Session, WLX_SHUTTINGDOWN(wlxAction));

SetWindowStationUser(Session->InteractiveWindowStation,
&LuidNone, NULL, 0);
Expand Down

0 comments on commit 01953e8

Please sign in to comment.