https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2557948179d8073737054…
commit 2557948179d807373705407eca291591041e0b1b
Author: Thamatip Chitpong <thamatip.chitpong(a)reactos.org>
AuthorDate: Wed Dec 4 01:00:28 2024 +0700
Commit: Thamatip Chitpong <thamatip.chitpong(a)reactos.org>
CommitDate: Mon Dec 9 09:52:57 2024 +0700
[WINLOGON] Implement startup sound support (HACK)
CORE-13951
---
base/system/winlogon/sas.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/base/system/winlogon/sas.c b/base/system/winlogon/sas.c
index f00bbf50b18..8b169f73df6 100644
--- a/base/system/winlogon/sas.c
+++ b/base/system/winlogon/sas.c
@@ -285,6 +285,22 @@ PlaySoundRoutine(
return Ret;
}
+static
+BOOL
+IsFirstLogon(VOID)
+{
+ /* FIXME: All of this is a HACK, designed specifically for PlayLogonSoundThread.
+ * Don't call IsFirstLogon multiple times inside the same function. And please
+ * note that this function is not thread-safe. */
+ static BOOL bFirstLogon = TRUE;
+ if (bFirstLogon)
+ {
+ bFirstLogon = FALSE;
+ return TRUE;
+ }
+ return FALSE;
+}
+
DWORD
WINAPI
PlayLogonSoundThread(
@@ -347,7 +363,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;