00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
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
00025
00026
00027 class CATDirectSoundIntercept : public CATIntercept
00028 {
00029 public:
00030 CATDirectSoundIntercept();
00031 virtual ~CATDirectSoundIntercept();
00032
00033 CATResult HookFunctions();
00034
00035
00036
00037
00038 static HRESULT OnPlayBuffer( CATHOOK* hookInst,
00039 IDirectSound* dsound,
00040 DWORD dwReserved1,
00041 DWORD dwPriority,
00042 DWORD dwFlags);
00043
00044
00045 static HRESULT OnPlayBufferEAX( CATHOOK* hookInst,
00046 IDirectSound* dsound,
00047 DWORD dwReserved1,
00048 DWORD dwPriority,
00049 DWORD dwFlags);
00050
00051
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
00063 static HRESULT OnUnlockBuffer( CATHOOK* hookInst,
00064 IDirectSound* dsound,
00065 LPVOID pvAudioPtr1,
00066 DWORD dwAudioBytes1,
00067 LPVOID pvAudioPtr2,
00068 DWORD dwAudioBytes2);
00069
00070
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
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_