2021-09-18 17:28:15 -04:00
|
|
|
#ifndef HOOKS_H
|
|
|
|
#define HOOKS_H
|
|
|
|
|
2023-01-05 13:54:06 -05:00
|
|
|
#include <cstdio>
|
|
|
|
|
2021-10-20 23:52:05 -04:00
|
|
|
#include <D3DRM.H>
|
2021-09-18 17:28:15 -04:00
|
|
|
#include <DDRAW.H>
|
2021-10-21 02:35:57 -04:00
|
|
|
#include <DINPUT.H>
|
|
|
|
#include <DSOUND.H>
|
2021-09-18 17:28:15 -04:00
|
|
|
#include <WINDOWS.H>
|
|
|
|
|
|
|
|
void InterceptOutputDebugStringA(LPCSTR s);
|
|
|
|
|
|
|
|
HWND WINAPI InterceptCreateWindowExA(
|
|
|
|
DWORD dwExStyle,
|
|
|
|
LPCSTR lpClassName,
|
|
|
|
LPCSTR lpWindowName,
|
|
|
|
DWORD dwStyle,
|
|
|
|
int X,
|
|
|
|
int Y,
|
|
|
|
int nWidth,
|
|
|
|
int nHeight,
|
|
|
|
HWND hWndParent,
|
|
|
|
HMENU hMenu,
|
|
|
|
HINSTANCE hInstance,
|
|
|
|
LPVOID lpParam
|
|
|
|
);
|
|
|
|
|
2021-10-20 23:52:05 -04:00
|
|
|
|
|
|
|
|
2021-09-22 15:16:20 -04:00
|
|
|
LONG
|
|
|
|
APIENTRY
|
|
|
|
InterceptRegQueryValueExA (
|
|
|
|
HKEY hKey,
|
|
|
|
LPCSTR lpValueName,
|
|
|
|
LPDWORD lpReserved,
|
|
|
|
LPDWORD lpType,
|
|
|
|
LPBYTE lpData,
|
|
|
|
LPDWORD lpcbData
|
|
|
|
);
|
|
|
|
|
2021-10-20 23:52:05 -04:00
|
|
|
ATOM WINAPI InterceptRegisterClassA(const WNDCLASSA *c);
|
|
|
|
|
2021-09-18 17:28:15 -04:00
|
|
|
HWND WINAPI InterceptFindWindowA(LPCSTR lpClassName, LPCSTR lpWindowName);
|
|
|
|
|
|
|
|
typedef HRESULT (WINAPI *ddCreateFunction)(GUID *lpGUID, LPDIRECTDRAW *lplpDD, IUnknown *pUnkOuterS);
|
|
|
|
extern ddCreateFunction ddCreateOriginal;
|
|
|
|
HRESULT WINAPI InterceptDirectDrawCreate(GUID *lpGUID, LPDIRECTDRAW *lplpDD, IUnknown *pUnkOuter);
|
|
|
|
|
|
|
|
HRESULT WINAPI InterceptSurfaceGetDesc(LPDIRECTDRAWSURFACE lpDDSurface, LPDDSURFACEDESC lpDDSurfaceDesc);
|
|
|
|
|
2021-10-18 13:15:56 -04:00
|
|
|
VOID WINAPI InterceptSleep(DWORD dwMilliseconds);
|
|
|
|
|
2021-10-20 23:52:05 -04:00
|
|
|
typedef HRESULT (WINAPI *d3drmCreateFunction)(LPDIRECT3DRM FAR *lplpDirect3DRM);
|
|
|
|
extern d3drmCreateFunction d3drmCreateOriginal;
|
|
|
|
HRESULT WINAPI InterceptDirect3DRMCreate(LPDIRECT3DRM FAR *lplpDirect3DRM);
|
|
|
|
|
2021-10-21 02:35:57 -04:00
|
|
|
typedef HRESULT (WINAPI *dsCreateFunction)(LPGUID lpGuid, LPDIRECTSOUND* ppDS, LPUNKNOWN pUnkOuter );
|
|
|
|
extern dsCreateFunction dsCreateOriginal;
|
|
|
|
HRESULT WINAPI InterceptDirectSoundCreate(LPGUID lpGuid, LPDIRECTSOUND* ppDS, LPUNKNOWN pUnkOuter );
|
|
|
|
|
|
|
|
SHORT WINAPI InterceptGetAsyncKeyState(int vKey);
|
|
|
|
|
|
|
|
typedef HRESULT (WINAPI *dinputCreateFunction)(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter);
|
|
|
|
extern dinputCreateFunction dinputCreateOriginal;
|
|
|
|
HRESULT WINAPI InterceptDirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter);
|
|
|
|
|
2023-01-05 13:54:06 -05:00
|
|
|
typedef _CRTIMP size_t (__cdecl *freadFunction)(void *buffer, size_t size, size_t count, FILE *stream);
|
|
|
|
extern freadFunction freadOriginal;
|
|
|
|
_CRTIMP size_t __cdecl InterceptFread(void *buffer, size_t size, size_t count, FILE *stream);
|
|
|
|
|
2023-01-11 19:35:01 -05:00
|
|
|
enum MxResult
|
|
|
|
{
|
|
|
|
SUCCESS = 0,
|
|
|
|
FAILURE = 0xFFFFFFFF
|
|
|
|
};
|
|
|
|
|
|
|
|
enum TransitionType
|
|
|
|
{
|
|
|
|
NOT_TRANSITIONING = 0,
|
|
|
|
NO_ANIMATION = 1,
|
|
|
|
DISSOLVE = 2,
|
|
|
|
PIXELATION = 3,
|
|
|
|
VERTICAL_WIPE = 4,
|
|
|
|
WINDOW = 5,
|
|
|
|
BROKEN = 6
|
|
|
|
};
|
|
|
|
|
|
|
|
class MxTransitionManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MxResult InterceptStartTransition(TransitionType animationType, int speed, byte unk, bool playMusicInTransition);
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef MxResult (MxTransitionManager::* startTransitionFunction)(TransitionType, int, byte, bool);
|
|
|
|
extern startTransitionFunction startTransitionOriginal;
|
|
|
|
|
2021-09-18 17:28:15 -04:00
|
|
|
#endif // HOOKS_H
|