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
6 * PURPOSE: Routes function calls through a function table, calling
7 * implementation-defined routines or a default function, depending
10 * PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org)
19 Attaches a function table to a sound device. Any NULL entries in this
20 table are automatically set to point to a default routine to handle
21 the appropriate function.
24 SetSoundDeviceFunctionTable(
25 IN PSOUND_DEVICE SoundDevice
,
26 IN PMMFUNCTION_TABLE FunctionTable
)
28 VALIDATE_MMSYS_PARAMETER( IsValidSoundDevice(SoundDevice
) );
29 VALIDATE_MMSYS_PARAMETER( FunctionTable
);
31 /* Zero out the existing function table (if present) */
32 ZeroMemory(&SoundDevice
->FunctionTable
, sizeof(MMFUNCTION_TABLE
));
34 if ( ! FunctionTable
)
35 return MMSYSERR_INVALPARAM
;
37 /* Fill in the client-supplied functions */
38 CopyMemory(&SoundDevice
->FunctionTable
,
40 sizeof(MMFUNCTION_TABLE
));
42 return MMSYSERR_NOERROR
;
46 Retrieves the function table for a sound device, as previously set using
47 SetSoundDeviceFunctionTable.
50 GetSoundDeviceFunctionTable(
51 IN PSOUND_DEVICE SoundDevice
,
52 OUT PMMFUNCTION_TABLE
* FunctionTable
)
54 VALIDATE_MMSYS_PARAMETER( IsValidSoundDevice(SoundDevice
) );
55 VALIDATE_MMSYS_PARAMETER( FunctionTable
);
57 *FunctionTable
= &SoundDevice
->FunctionTable
;
59 return MMSYSERR_NOERROR
;