ReactOS  0.4.15-dev-2776-g4130f0b
sndsntry.c
Go to the documentation of this file.
1 /*
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)
7  */
8 
9 /* INCLUDES *******************************************************************/
10 
11 #include "basesrv.h"
12 
13 #define NDEBUG
14 #include <debug.h>
15 
16 /* GLOBALS ********************************************************************/
17 
20 
22 
23 /* PRIVATE FUNCTIONS **********************************************************/
24 
25 BOOL
26 NTAPI
28 {
29  /* In case the function can't be found/is unimplemented */
30  return FALSE;
31 }
32 
33 BOOL
34 NTAPI
36 {
37  UNICODE_STRING DllString = RTL_CONSTANT_STRING(L"winsrv");
38  STRING FuncString = RTL_CONSTANT_STRING("_UserSoundSentry");
39  HANDLE DllHandle;
41  PUSER_SOUND_SENTRY NewSoundSentry = FailSoundSentry;
42 
43  /* Load winsrv manually */
44  Status = LdrGetDllHandle(NULL, NULL, &DllString, &DllHandle);
45  if (NT_SUCCESS(Status))
46  {
47  /* If it was found, get SoundSentry export */
48  Status = LdrGetProcedureAddress(DllHandle,
49  &FuncString,
50  0,
51  (PVOID*)&NewSoundSentry);
52  }
53 
54  /* Set it as the callback for the future, and call it */
55  _UserSoundSentry = NewSoundSentry;
56  return _UserSoundSentry();
57 }
58 
59 /* PUBLIC SERVER APIS *********************************************************/
60 
61 CSR_API(BaseSrvSoundSentryNotification)
62 {
63  /* Call the API and see if it succeeds */
65 }
66 
67 /* EOF */
NTSTATUS NTAPI LdrGetDllHandle(IN PWSTR DllPath OPTIONAL, IN PULONG DllCharacteristics OPTIONAL, IN PUNICODE_STRING DllName, OUT PVOID *DllHandle)
Definition: ldrapi.c:805
BOOL NTAPI FailSoundSentry(VOID)
Definition: sndsntry.c:27
LONG NTSTATUS
Definition: precomp.h:26
BOOL NTAPI FirstSoundSentry(VOID)
Definition: sndsntry.c:35
#define BOOL
Definition: nt_native.h:43
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
NTSTATUS NTAPI LdrGetProcedureAddress(IN PVOID BaseAddress, IN PANSI_STRING Name, IN ULONG Ordinal, OUT PVOID *ProcedureAddress)
Definition: ldrapi.c:823
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
std::wstring STRING
Definition: fontsub.cpp:33
static const WCHAR L[]
Definition: oid.c:1250
#define VOID
Definition: acefi.h:82
static PUSER_SOUND_SENTRY _UserSoundSentry
Definition: sndsntry.c:21
#define NULL
Definition: types.h:112
CSR_API(BaseSrvSoundSentryNotification)
Definition: sndsntry.c:61
#define STATUS_SUCCESS
Definition: shellext.h:65
BOOL(NTAPI * PUSER_SOUND_SENTRY)(VOID)
Definition: sndsntry.c:18
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14