ReactOS  0.4.15-dev-1203-g0e5a4d5
functiontable.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Sound System "MME Buddy" Library
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: lib/drivers/sound/mmebuddy/functiontable.c
5  *
6  * PURPOSE: Routes function calls through a function table, calling
7  * implementation-defined routines or a default function, depending
8  * on configuration.
9  *
10  * PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org)
11 */
12 
13 #include "precomp.h"
14 
15 /*
16  Attaches a function table to a sound device. Any NULL entries in this
17  table are automatically set to point to a default routine to handle
18  the appropriate function.
19 */
22  IN PSOUND_DEVICE SoundDevice,
24 {
27 
28  /* Zero out the existing function table (if present) */
29  ZeroMemory(&SoundDevice->FunctionTable, sizeof(MMFUNCTION_TABLE));
30 
31  if ( ! FunctionTable )
32  return MMSYSERR_INVALPARAM;
33 
34  /* Fill in the client-supplied functions */
35  CopyMemory(&SoundDevice->FunctionTable,
37  sizeof(MMFUNCTION_TABLE));
38 
39  return MMSYSERR_NOERROR;
40 }
41 
42 /*
43  Retrieves the function table for a sound device, as previously set using
44  SetSoundDeviceFunctionTable.
45 */
48  IN PSOUND_DEVICE SoundDevice,
50 {
53 
54  *FunctionTable = &SoundDevice->FunctionTable;
55 
56  return MMSYSERR_NOERROR;
57 }
#define IN
Definition: typedefs.h:39
#define ZeroMemory
Definition: winbase.h:1648
UINT MMRESULT
Definition: mmsystem.h:962
#define VALIDATE_MMSYS_PARAMETER(parameter_condition)
Definition: mmebuddy.h:71
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define CopyMemory
Definition: winbase.h:1646
BOOLEAN IsValidSoundDevice(IN PSOUND_DEVICE SoundDevice)
Definition: devicelist.c:87
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
MMRESULT SetSoundDeviceFunctionTable(IN PSOUND_DEVICE SoundDevice, IN PMMFUNCTION_TABLE FunctionTable)
Definition: functiontable.c:21
#define OUT
Definition: typedefs.h:40
static WLX_DISPATCH_VERSION_1_4 FunctionTable
Definition: wlx.c:736
MMRESULT GetSoundDeviceFunctionTable(IN PSOUND_DEVICE SoundDevice, OUT PMMFUNCTION_TABLE *FunctionTable)
Definition: functiontable.c:47