1
0
mirror of https://github.com/DxWnd/DxWnd.reloaded synced 2024-12-30 09:25:35 +01:00
DxWnd.reloaded/dll/winmm.cpp
gho tik 03b1052ffe v2_02_22_src
Former-commit-id: 710973bdebd0677d74039bdf1682d4fce759af64
2017-03-06 11:21:25 -05:00

33 lines
682 B
C++

#include "dxwnd.h"
#include "dxwcore.hpp"
#include "syslibs.h"
#include "dxhook.h"
static HookEntry_Type TimeHooks[]={
{"timeGetTime", NULL, (FARPROC *)&ptimeGetTime, (FARPROC)exttimeGetTime},
{0, NULL, 0, 0} // terminator
};
void HookWinMM(HMODULE module)
{
if(dxw.dwFlags2 & TIMESTRETCH) HookLibrary(module, TimeHooks, "winmm.dll");
}
FARPROC Remap_WinMM_ProcAddress(LPCSTR proc, HMODULE hModule)
{
FARPROC addr;
if(dxw.dwFlags2 & TIMESTRETCH)
if (addr=RemapLibrary(proc, hModule, TimeHooks)) return addr;
return NULL;
}
DWORD WINAPI exttimeGetTime(void)
{
DWORD ret;
ret = dxw.GetTickCount();
if (IsDebug) OutTrace("timeGetTime: time=%x\n", ret);
return ret;
}