ReactOS  0.4.14-dev-1007-g90d795b
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_ACCESS_DENIED
Definition: udferr_usr.h:145
static PUSER_SOUND_SENTRY _UserSoundSentry
Definition: sndsntry.c:21
return STATUS_SUCCESS
Definition: btrfs.c:2938

◆ 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 }

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 */
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 }
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
NTSTATUS NTAPI LdrGetProcedureAddress(IN PVOID BaseAddress, IN PANSI_STRING Name, IN ULONG Ordinal, OUT PVOID *ProcedureAddress)
Definition: ldrapi.c:823
smooth NULL
Definition: ftsmooth.c:416
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
std::wstring STRING
Definition: fontsub.cpp:33
static const WCHAR L[]
Definition: oid.c:1250
Status
Definition: gdiplustypes.h:24
static PUSER_SOUND_SENTRY _UserSoundSentry
Definition: sndsntry.c:21
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().