From 34a5312c6d6568d1309df2d8718ddffeced9e0cc Mon Sep 17 00:00:00 2001 From: Thamatip Chitpong Date: Wed, 4 Dec 2024 01:00:28 +0700 Subject: [PATCH] [WINLOGON] Implement startup sound support (HACK) CORE-13951 --- base/system/winlogon/sas.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/base/system/winlogon/sas.c b/base/system/winlogon/sas.c index f00bbf50b18c8..f00c558cb2ac5 100644 --- a/base/system/winlogon/sas.c +++ b/base/system/winlogon/sas.c @@ -285,6 +285,20 @@ PlaySoundRoutine( return Ret; } +static +BOOL +IsFirstLogon(VOID) +{ + /* FIXME: All of this is a hack */ + static BOOL bFirstLogon = TRUE; + if (bFirstLogon) + { + bFirstLogon = FALSE; + return TRUE; + } + return FALSE; +} + DWORD WINAPI PlayLogonSoundThread( @@ -347,7 +361,9 @@ PlayLogonSoundThread( } else { - PlaySoundRoutine(L"WindowsLogon", TRUE, SND_ALIAS | SND_NODEFAULT); + PlaySoundRoutine(IsFirstLogon() ? L"SystemStart" : L"WindowsLogon", + TRUE, + SND_ALIAS | SND_NODEFAULT); RevertToSelf(); } return 0;