2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Base API Server DLL
4 * FILE: subsystems/win/basesrv/sndsntry.c
5 * PURPOSE: Sound Sentry Notifications
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
9 /* INCLUDES *******************************************************************/
16 /* GLOBALS ********************************************************************/
18 typedef BOOL (WINAPI
*PUSER_SOUND_SENTRY
)(VOID
);
19 BOOL NTAPI
FirstSoundSentry(VOID
);
21 static PUSER_SOUND_SENTRY _UserSoundSentry
= FirstSoundSentry
;
23 /* PRIVATE FUNCTIONS **********************************************************/
29 /* In case the function can't be found/is unimplemented */
35 FirstSoundSentry(VOID
)
37 UNICODE_STRING DllString
= RTL_CONSTANT_STRING(L
"winsrv");
38 STRING FuncString
= RTL_CONSTANT_STRING("_UserSoundSentry");
41 PUSER_SOUND_SENTRY NewSoundSentry
= FailSoundSentry
;
43 /* Load winsrv manually */
44 Status
= LdrGetDllHandle(NULL
, NULL
, &DllString
, &DllHandle
);
45 if (NT_SUCCESS(Status
))
47 /* If it was found, get SoundSentry export */
48 Status
= LdrGetProcedureAddress(DllHandle
,
51 (PVOID
*)&NewSoundSentry
);
54 /* Set it as the callback for the future, and call it */
55 _UserSoundSentry
= NewSoundSentry
;
56 return _UserSoundSentry();
59 /* PUBLIC SERVER APIS *********************************************************/
61 CSR_API(BaseSrvSoundSentryNotification
)
63 /* Call the API and see if it succeeds */
64 return (_UserSoundSentry() ? STATUS_SUCCESS
: STATUS_ACCESS_DENIED
);