ReactOS 0.4.15-dev-8241-g63935f8
sndsntry.c File Reference
#include "basesrv.h"
#include <debug.h>
Include dependency graph for sndsntry.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Typedefs

typedef BOOL(NTAPIPUSER_SOUND_SENTRY) (VOID)
 

Functions

BOOL NTAPI FirstSoundSentry (VOID)
 
BOOL NTAPI FailSoundSentry (VOID)
 
 CSR_API (BaseSrvSoundSentryNotification)
 

Variables

static PUSER_SOUND_SENTRY _UserSoundSentry = FirstSoundSentry
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file sndsntry.c.

Typedef Documentation

◆ PUSER_SOUND_SENTRY

typedef BOOL(NTAPI * PUSER_SOUND_SENTRY) (VOID)

Definition at line 18 of file sndsntry.c.

Function Documentation

◆ CSR_API()

CSR_API ( BaseSrvSoundSentryNotification  )

Definition at line 61 of file sndsntry.c.

62{
63 /* Call the API and see if it succeeds */
65}
#define STATUS_SUCCESS
Definition: shellext.h:65
static PUSER_SOUND_SENTRY _UserSoundSentry
Definition: sndsntry.c:21
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145

◆ FailSoundSentry()

BOOL NTAPI FailSoundSentry ( VOID  )

Definition at line 27 of file sndsntry.c.

28{
29 /* In case the function can't be found/is unimplemented */
30 return FALSE;
31}
#define FALSE
Definition: types.h:117

Referenced by FirstSoundSentry().

◆ FirstSoundSentry()

BOOL NTAPI FirstSoundSentry ( VOID  )

Definition at line 35 of file sndsntry.c.

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 */
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}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
std::wstring STRING
Definition: fontsub.cpp:33
Status
Definition: gdiplustypes.h:25
NTSTATUS NTAPI LdrGetDllHandle(_In_opt_ PWSTR DllPath, _In_opt_ PULONG DllCharacteristics, _In_ PUNICODE_STRING DllName, _Out_ PVOID *DllHandle)
Definition: ldrapi.c:770
NTSTATUS NTAPI LdrGetProcedureAddress(_In_ PVOID BaseAddress, _In_opt_ _When_(Ordinal==0, _Notnull_) PANSI_STRING Name, _In_opt_ _When_(Name==NULL, _In_range_(>, 0)) ULONG Ordinal, _Out_ PVOID *ProcedureAddress)
Definition: ldrapi.c:789
#define L(x)
Definition: ntvdm.h:50
BOOL NTAPI FailSoundSentry(VOID)
Definition: sndsntry.c:27
BOOL(NTAPI * PUSER_SOUND_SENTRY)(VOID)
Definition: sndsntry.c:18
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14

Variable Documentation

◆ _UserSoundSentry

PUSER_SOUND_SENTRY _UserSoundSentry = FirstSoundSentry
static

Definition at line 21 of file sndsntry.c.

Referenced by CSR_API(), and FirstSoundSentry().