void ApplyD3DIntercepts() { static const InterceptDescriptor intercepts [] = { MAKE_INTERCEPT(1, D3DIM, Direct3DCreate), MAKE_INTERCEPT(1, D3DIM, Direct3DCreateDevice), MAKE_INTERCEPT2(1, D3DIM700, Direct3DCreate, Direct3DCreate7), MAKE_INTERCEPT2(1, D3DIM700, Direct3DCreateDevice, Direct3DCreateDevice7), }; ApplyInterceptTable(intercepts, ARRAYSIZE(intercepts)); }
void ApplySDLIntercepts() { static const InterceptDescriptor intercepts [] = { MAKE_INTERCEPT(1, SDL, SDL_Flip), MAKE_INTERCEPT(1, SDL, SDL_UpdateRect), MAKE_INTERCEPT(1, SDL, SDL_UpdateRects), MAKE_INTERCEPT(1, SDL, SDL_GL_SwapBuffers), MAKE_INTERCEPT(1, SDL, SDL_SetVideoMode), // not necessary, but maybe helps app behave more nicely MAKE_INTERCEPT(0, SDL, SDL_LockSurface), MAKE_INTERCEPT(0, SDL, SDL_UnlockSurface), }; ApplyInterceptTable(intercepts, ARRAYSIZE(intercepts)); }
void ApplyTimerIntercepts() { static const InterceptDescriptor intercepts [] = { MAKE_INTERCEPT(1, WINMM, timeSetEvent), MAKE_INTERCEPT(1, WINMM, timeKillEvent), MAKE_INTERCEPT(1, USER32, SetTimer), MAKE_INTERCEPT(1, USER32, KillTimer), MAKE_INTERCEPT(1, KERNEL32, CreateTimerQueueTimer), //MAKE_INTERCEPT(1, KERNEL32, CreateTimerQueue ), MAKE_INTERCEPT(1, KERNEL32, QueueUserAPC), }; ApplyInterceptTable(intercepts, ARRAYSIZE(intercepts)); }
void ApplyTimeIntercepts() { static const InterceptDescriptor intercepts [] = { MAKE_INTERCEPT(2, WINMM, timeGetTime), MAKE_INTERCEPT(1, WINMM, timeGetSystemTime), MAKE_INTERCEPT(1, KERNEL32, QueryPerformanceCounter), MAKE_INTERCEPT(1, KERNEL32, QueryPerformanceFrequency), MAKE_INTERCEPT(1, NTDLL, NtQueryPerformanceCounter), MAKE_INTERCEPT(1, KERNEL32, GetSystemTime), MAKE_INTERCEPT(1, KERNEL32, GetSystemTimeAsFileTime), MAKE_INTERCEPT(1, KERNEL32, GetLocalTime), MAKE_INTERCEPT(1, KERNEL32, GetTickCount), MAKE_INTERCEPT(1, KERNEL32, GetSystemTimes), MAKE_INTERCEPT(1, NTDLL, NtQuerySystemTime), //MAKE_INTERCEPT(1, WINMM, timeBeginPeriod), //MAKE_INTERCEPT(1, WINMM, timeEndPeriod), //MAKE_INTERCEPT(1, WINMM, timeGetDevCaps), }; ApplyInterceptTable(intercepts, ARRAYSIZE(intercepts)); }
void ApplyWaitIntercepts() { static const InterceptDescriptor intercepts[] = { MAKE_INTERCEPT(1, KERNEL32, Sleep), MAKE_INTERCEPT(1, KERNEL32, SleepEx), MAKE_INTERCEPT(1, KERNEL32, WaitForSingleObject), MAKE_INTERCEPT(0, KERNEL32, WaitForSingleObjectEx), MAKE_INTERCEPT(1, KERNEL32, WaitForMultipleObjects), MAKE_INTERCEPT(0, KERNEL32, WaitForMultipleObjectsEx), MAKE_INTERCEPT(1, KERNEL32, SignalObjectAndWait), MAKE_INTERCEPT(1, USER32, MsgWaitForMultipleObjects), MAKE_INTERCEPT(0, USER32, MsgWaitForMultipleObjectsEx), MAKE_INTERCEPT(0, NTDLL, NtWaitForSingleObject), MAKE_INTERCEPT(0, NTDLL, NtWaitForMultipleObjects), MAKE_INTERCEPT(/*1*/0, NTDLL, RtlEnterCriticalSection), MAKE_INTERCEPT(0, NTDLL, RtlTryEnterCriticalSection), MAKE_INTERCEPT(1, USER32, WaitMessage), }; ApplyInterceptTable(intercepts, ARRAYSIZE(intercepts)); }
void ApplySyncIntercepts() { static const InterceptDescriptor intercepts[] = { MAKE_INTERCEPT(/*1*/0, KERNEL32, CreateMutexW), MAKE_INTERCEPT(/*1*/0, KERNEL32, OpenMutexW), MAKE_INTERCEPT(/*1*/0, KERNEL32, CreateEventW), MAKE_INTERCEPT(/*1*/0, KERNEL32, OpenEventW), MAKE_INTERCEPT(0, KERNEL32, CreateMutexA), MAKE_INTERCEPT(0, KERNEL32, OpenMutexA), MAKE_INTERCEPT(0, KERNEL32, CreateEventA), MAKE_INTERCEPT(0, KERNEL32, OpenEventA), MAKE_INTERCEPT(0, KERNEL32, ReleaseMutex), MAKE_INTERCEPT(0, KERNEL32, CreateSemaphoreA), MAKE_INTERCEPT(0, KERNEL32, CreateSemaphoreW), MAKE_INTERCEPT(0, KERNEL32, OpenSemaphoreA), MAKE_INTERCEPT(0, KERNEL32, OpenSemaphoreW), MAKE_INTERCEPT(0, KERNEL32, CreateWaitableTimerA), MAKE_INTERCEPT(0, KERNEL32, CreateWaitableTimerW), MAKE_INTERCEPT(0, KERNEL32, OpenWaitableTimerA), MAKE_INTERCEPT(0, KERNEL32, OpenWaitableTimerW), MAKE_INTERCEPT(0, KERNEL32, SetWaitableTimer), MAKE_INTERCEPT(0, KERNEL32, CancelWaitableTimer), MAKE_INTERCEPT(0, KERNEL32, SetEvent), MAKE_INTERCEPT(0, KERNEL32, ResetEvent), MAKE_INTERCEPT(/*1*/0, KERNEL32, DuplicateHandle), MAKE_INTERCEPT(/*1*/0, KERNEL32, CloseHandle), MAKE_INTERCEPT(1, KERNEL32, QueueUserAPC), }; ApplyInterceptTable(intercepts, ARRAYSIZE(intercepts)); }
void ApplyWindowIntercepts() { static const InterceptDescriptor intercepts [] = { MAKE_INTERCEPT(1, USER32, CreateWindowExA), MAKE_INTERCEPT(1, USER32, CreateWindowExW), // FIXME? MAKE_INTERCEPT(1, USER32, DestroyWindow), MAKE_INTERCEPT(1, USER32, CloseWindow), MAKE_INTERCEPT(1, USER32, GetActiveWindow), MAKE_INTERCEPT(1, USER32, GetForegroundWindow), MAKE_INTERCEPT(1, USER32, GetFocus), MAKE_INTERCEPT(1, USER32, SetWindowLongA), MAKE_INTERCEPT(1, USER32, SetWindowLongW), MAKE_INTERCEPT(1, USER32, GetWindowLongA), MAKE_INTERCEPT(1, USER32, GetWindowLongW), MAKE_INTERCEPT(1, USER32, MoveWindow), MAKE_INTERCEPT(1, USER32, SetWindowPos), MAKE_INTERCEPT(1, USER32, ShowWindow), MAKE_INTERCEPT(1, USER32, GetClientRect), MAKE_INTERCEPT(1, USER32, GetWindowRect), MAKE_INTERCEPT(1, USER32, ClientToScreen), MAKE_INTERCEPT(1, USER32, ScreenToClient), MAKE_INTERCEPT(1, USER32, SetWindowTextA), MAKE_INTERCEPT(1, USER32, SetWindowTextW), //MAKE_INTERCEPT(1, USER32, InvalidateRect), //MAKE_INTERCEPT(1, USER32, UpdateWindow), MAKE_INTERCEPT(1, USER32, MessageBoxA), MAKE_INTERCEPT(1, USER32, MessageBoxW), MAKE_INTERCEPT(1, USER32, MessageBoxExA), MAKE_INTERCEPT(1, USER32, MessageBoxExW), MAKE_INTERCEPT(1, USER32, DialogBoxParamA), MAKE_INTERCEPT(1, USER32, DialogBoxParamW), MAKE_INTERCEPT(1, USER32, DialogBoxIndirectParamA), MAKE_INTERCEPT(1, USER32, DialogBoxIndirectParamW), }; ApplyInterceptTable(intercepts, ARRAYSIZE(intercepts)); }
void ApplyGDIIntercepts() { static const InterceptDescriptor intercepts[] = { MAKE_INTERCEPT(1, GDI32, StretchBlt), MAKE_INTERCEPT(1, GDI32, BitBlt), MAKE_INTERCEPT(1, GDI32, SetDIBitsToDevice), MAKE_INTERCEPT(1, GDI32, StretchDIBits), MAKE_INTERCEPT(1, GDI32, GetPixel), MAKE_INTERCEPT(1, GDI32, GetDeviceCaps), MAKE_INTERCEPT(1, GDI32, ChoosePixelFormat), MAKE_INTERCEPT(/*1*/1, GDI32, SetPixelFormat), // todo? but overriding it breaks tumiki fighters sometimes? MAKE_INTERCEPT(1, GDI32, SwapBuffers), MAKE_INTERCEPT(1, GDI32, CreateFontIndirectA), MAKE_INTERCEPT(1, GDI32, CreateFontIndirectW), MAKE_INTERCEPT(1, USER32, ChangeDisplaySettingsA), MAKE_INTERCEPT(1, USER32, ChangeDisplaySettingsW), }; ApplyInterceptTable(intercepts, ARRAYSIZE(intercepts)); }
void ApplyXinputIntercepts() { static const InterceptDescriptor intercepts[] = { MAKE_INTERCEPT(1, XInput9_1_0, XInputGetState), MAKE_INTERCEPT(1, XInput9_1_0, XInputSetState), MAKE_INTERCEPT(1, XInput9_1_0, XInputGetCapabilities), MAKE_INTERCEPT(1, XInput9_1_0, XInputGetDSoundAudioDeviceGuids), MAKE_INTERCEPT(1, XInput9_1_0, XInputEnable), MAKE_INTERCEPT(1, XInput1_3, XInputGetState), MAKE_INTERCEPT(1, XInput1_3, XInputSetState), MAKE_INTERCEPT(1, XInput1_3, XInputGetCapabilities), MAKE_INTERCEPT(1, XInput1_3, XInputGetDSoundAudioDeviceGuids), MAKE_INTERCEPT(1, XInput1_3, XInputGetKeystroke), MAKE_INTERCEPT(1, XInput1_3, XInputEnable), MAKE_INTERCEPT(1, XInput1_3, XInputGetBatteryInformation), }; ApplyInterceptTable(intercepts, ARRAYSIZE(intercepts)); }