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. If NULL is passed as the function table itself,
22 the entire function table will use only the default routines.
25 SetSoundDeviceFunctionTable(
26 IN PSOUND_DEVICE SoundDevice
,
27 IN PMMFUNCTION_TABLE FunctionTable OPTIONAL
)
29 VALIDATE_MMSYS_PARAMETER( IsValidSoundDevice(SoundDevice
) );
31 /* Zero out the existing function table (if present) */
32 ZeroMemory(&SoundDevice
->FunctionTable
, sizeof(MMFUNCTION_TABLE
));
36 /* Fill in the client-supplied functions */
37 CopyMemory(&SoundDevice
->FunctionTable
,
39 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
;