Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CAT/CATDirectSoundIntercept.h Source File

CATDirectSoundIntercept.h

Go to the documentation of this file.
00001 /// \file  CATDirectSoundIntercept.h
00002 /// \brief DirectSound function interception
00003 /// \ingroup CAT
00004 ///
00005 /// Copyright (c) 2007-2008 by Michael Ellison.
00006 /// See COPYING.txt for the \ref gaslicense License (MIT License).
00007 ///
00008 // $Author: mikeellison $
00009 // $Date: 2008-01-14 02:13:38 -0600 (Mon, 14 Jan 2008) $
00010 // $Revision:   $
00011 // $NoKeywords: $
00012 
00013 #ifndef _CATDirectSoundIntercept_H_
00014 #define _CATDirectSoundIntercept_H_
00015 
00016 #include "CATIntercept.h"
00017 #ifdef CAT_CONFIG_WIN32
00018 
00019 struct IDirectSound;
00020 struct IDirectSound8;
00021 struct IDirectMusicSegment;
00022 struct IDirectMusicSegmentState;
00023 struct IDirectMusicPerformance;
00024 /// \class CATDirectSoundIntercept
00025 /// \brief DirectSound function interception
00026 /// \ingroup CAT
00027 class CATDirectSoundIntercept : public CATIntercept
00028 {
00029     public:
00030         CATDirectSoundIntercept();
00031         virtual ~CATDirectSoundIntercept();
00032 
00033         CATResult HookFunctions();
00034 
00035         // Hooked functions:
00036 
00037         /// Captured IDirectSoundBuffer->Play()
00038         static HRESULT OnPlayBuffer(    CATHOOK*        hookInst, 
00039                                         IDirectSound*   dsound, 
00040                                         DWORD           dwReserved1,
00041                                         DWORD           dwPriority,
00042                                         DWORD           dwFlags);
00043 
00044         /// Captured IDirectSoundBuffer->Play()
00045         static HRESULT OnPlayBufferEAX( CATHOOK*        hookInst, 
00046                                         IDirectSound*   dsound, 
00047                                         DWORD           dwReserved1,
00048                                         DWORD           dwPriority,
00049                                         DWORD           dwFlags);
00050 
00051         /// Captured IDirectSoundBuffer->Lock()
00052         static HRESULT OnLockBuffer(    CATHOOK*        hookInst,
00053                                         IDirectSound*   dsound,
00054                                         DWORD           dwOffset,
00055                                         DWORD           dwBytes,
00056                                         LPVOID*         ppvAudioPtr1,
00057                                         LPDWORD         pdwAudioBytes1,
00058                                         LPVOID*         ppvAudioPtr2,
00059                                         LPDWORD         pdwAudioBytes2,
00060                                         DWORD           dwFlags);
00061 
00062         /// Captured IDirectSoundBuffer->Unlock()
00063         static HRESULT OnUnlockBuffer(  CATHOOK*        hookInst,
00064                                         IDirectSound*   dsound,
00065                                         LPVOID          pvAudioPtr1,
00066                                         DWORD           dwAudioBytes1,
00067                                         LPVOID          pvAudioPtr2,
00068                                         DWORD           dwAudioBytes2);
00069 
00070         /// Captured IDirectMusicPerformance8->PlaySegment
00071         static HRESULT OnPlaySegment(    CATHOOK*                    hookInst, 
00072                                          IDirectMusicPerformance*    performance,
00073                                          IDirectMusicSegment*        pSegment,
00074                                          DWORD                       dwFlags,
00075                                          DWORD                       startTimeLow,
00076                                          DWORD                       startTimeHigh,                                         
00077                                          IDirectMusicSegmentState**  ppSegmentState);
00078         
00079         static HRESULT OnPlaySegmentEx(  CATHOOK*                    hookInst, 
00080                                          IDirectMusicPerformance*    performance,
00081                                          IUnknown*                   pSource,
00082                                          WCHAR*                      pwzSegmentName,
00083                                          IUnknown*                   pTransition,
00084                                          DWORD                       dwFlags,
00085                                          DWORD                       startTimeLow,
00086                                          DWORD                       startTimeHigh,                                         
00087                                          IDirectMusicSegmentState**  ppSegmentState,
00088                                          IUnknown*                   pFrom, 
00089                                          IUnknown*                   pAudioPath);
00090 
00091     protected:
00092         
00093 
00094 
00095         // DirectSoundCreate8
00096         CATResult HookDSound(IDirectSound8* tmpDS8,CATINTERCEPT_COM_TABLE_ENTRY* interceptTable);
00097         typedef HRESULT (WINAPI *DSoundCreate8Func)(LPCGUID lpcGuidDevice,void** ppDS8,LPUNKNOWN pUnkOuter);
00098 
00099         HMODULE                     fDSoundDLL;
00100         HMODULE                     fDSound3DDLL;
00101         HMODULE                     fDSound3DEaxDLL;
00102 };
00103 
00104 #endif // CAT_CONFIG_WIN32
00105 #endif // _CATDirectSoundIntercept_H_

Generated on Mon Feb 11 04:09:43 2008 for Game Accessibility Suite by doxygen 1.5.4