Skip to content

Commit 2557948

Browse files
committed
[WINLOGON] Implement startup sound support (HACK)
CORE-13951
1 parent 37375fc commit 2557948

File tree

1 file changed

+19
-1
lines changed
  • base/system/winlogon

1 file changed

+19
-1
lines changed

base/system/winlogon/sas.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,22 @@ PlaySoundRoutine(
285285
return Ret;
286286
}
287287

288+
static
289+
BOOL
290+
IsFirstLogon(VOID)
291+
{
292+
/* FIXME: All of this is a HACK, designed specifically for PlayLogonSoundThread.
293+
* Don't call IsFirstLogon multiple times inside the same function. And please
294+
* note that this function is not thread-safe. */
295+
static BOOL bFirstLogon = TRUE;
296+
if (bFirstLogon)
297+
{
298+
bFirstLogon = FALSE;
299+
return TRUE;
300+
}
301+
return FALSE;
302+
}
303+
288304
DWORD
289305
WINAPI
290306
PlayLogonSoundThread(
@@ -347,7 +363,9 @@ PlayLogonSoundThread(
347363
}
348364
else
349365
{
350-
PlaySoundRoutine(L"WindowsLogon", TRUE, SND_ALIAS | SND_NODEFAULT);
366+
PlaySoundRoutine(IsFirstLogon() ? L"SystemStart" : L"WindowsLogon",
367+
TRUE,
368+
SND_ALIAS | SND_NODEFAULT);
351369
RevertToSelf();
352370
}
353371
return 0;

0 commit comments

Comments
 (0)