ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

functiontable.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:     ReactOS Sound System "MME Buddy" Library
00003  * LICENSE:     GPL - See COPYING in the top level directory
00004  * FILE:        lib/drivers/sound/mmebuddy/functiontable.c
00005  *
00006  * PURPOSE:     Routes function calls through a function table, calling
00007  *              implementation-defined routines or a default function, depending
00008  *              on configuration.
00009  *
00010  * PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org)
00011 */
00012 
00013 #include "precomp.h"
00014 
00015 /*
00016     Attaches a function table to a sound device. Any NULL entries in this
00017     table are automatically set to point to a default routine to handle
00018     the appropriate function.
00019 */
00020 MMRESULT
00021 SetSoundDeviceFunctionTable(
00022     IN  PSOUND_DEVICE SoundDevice,
00023     IN  PMMFUNCTION_TABLE FunctionTable)
00024 {
00025     VALIDATE_MMSYS_PARAMETER( IsValidSoundDevice(SoundDevice) );
00026     VALIDATE_MMSYS_PARAMETER( FunctionTable );
00027 
00028     /* Zero out the existing function table (if present) */
00029     ZeroMemory(&SoundDevice->FunctionTable, sizeof(MMFUNCTION_TABLE));
00030 
00031     if ( ! FunctionTable )
00032         return MMSYSERR_INVALPARAM;
00033 
00034     /* Fill in the client-supplied functions */
00035     CopyMemory(&SoundDevice->FunctionTable,
00036                 FunctionTable,
00037                 sizeof(MMFUNCTION_TABLE));
00038 
00039     return MMSYSERR_NOERROR;
00040 }
00041 
00042 /*
00043     Retrieves the function table for a sound device, as previously set using
00044     SetSoundDeviceFunctionTable.
00045 */
00046 MMRESULT
00047 GetSoundDeviceFunctionTable(
00048     IN  PSOUND_DEVICE SoundDevice,
00049     OUT PMMFUNCTION_TABLE* FunctionTable)
00050 {
00051     VALIDATE_MMSYS_PARAMETER( IsValidSoundDevice(SoundDevice) );
00052     VALIDATE_MMSYS_PARAMETER( FunctionTable );
00053 
00054     *FunctionTable = &SoundDevice->FunctionTable;
00055 
00056     return MMSYSERR_NOERROR;
00057 }

Generated on Fri May 25 2012 04:34:39 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.