fix cutscene playback in some games
This commit is contained in:
parent
0100459248
commit
f3e69355e5
5 changed files with 44 additions and 5 deletions
|
@ -1,3 +1,4 @@
|
|||
#include <windows.h>
|
||||
#include <initguid.h>
|
||||
#include "IDirectDraw.h"
|
||||
#include "IDirect3D.h"
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <psapi.h>
|
||||
|
@ -57,6 +56,7 @@ LOADLIBRARYEXWPROC real_LoadLibraryExW = LoadLibraryExW;
|
|||
GETPROCADDRESSPROC real_GetProcAddress = GetProcAddress;
|
||||
GETDISKFREESPACEAPROC real_GetDiskFreeSpaceA = GetDiskFreeSpaceA;
|
||||
COCREATEINSTANCEPROC real_CoCreateInstance = CoCreateInstance;
|
||||
MCISENDCOMMANDAPROC real_mciSendCommandA = mciSendCommandA;
|
||||
SETUNHANDLEDEXCEPTIONFILTERPROC real_SetUnhandledExceptionFilter = SetUnhandledExceptionFilter;
|
||||
|
||||
HOOKLIST g_hook_hooklist[] =
|
||||
|
@ -101,6 +101,13 @@ HOOKLIST g_hook_hooklist[] =
|
|||
{ "CoCreateInstance", (PROC)fake_CoCreateInstance, (PROC*)&real_CoCreateInstance, HOOK_SKIP_2 },
|
||||
{ "", NULL, NULL, 0 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"winmm.dll",
|
||||
{
|
||||
{ "mciSendCommandA", (PROC)fake_mciSendCommandA, (PROC*)&real_mciSendCommandA, HOOK_SKIP_2 },
|
||||
{ "", NULL, NULL, 0 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"dinput.dll",
|
||||
|
|
|
@ -1324,7 +1324,36 @@ HRESULT WINAPI fake_CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD
|
|||
}
|
||||
}
|
||||
|
||||
return real_CoCreateInstance(rclsid, pUnkOuter, dwClsContext, riid, ppv);
|
||||
/* These dlls must be hooked for cutscene uscaling and windowed mode */
|
||||
HMODULE quartz_dll = GetModuleHandleA("quartz");
|
||||
HMODULE msvfw32_dll = GetModuleHandleA("msvfw32");
|
||||
|
||||
HRESULT result = real_CoCreateInstance(rclsid, pUnkOuter, dwClsContext, riid, ppv);
|
||||
|
||||
if ((!quartz_dll && GetModuleHandleA("quartz")) ||
|
||||
(!msvfw32_dll && GetModuleHandleA("msvfw32")))
|
||||
{
|
||||
hook_init(FALSE);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
MCIERROR WINAPI fake_mciSendCommandA(MCIDEVICEID IDDevice, UINT uMsg, DWORD_PTR fdwCommand, DWORD_PTR dwParam)
|
||||
{
|
||||
/* These dlls must be hooked for cutscene uscaling and windowed mode */
|
||||
HMODULE quartz_dll = GetModuleHandleA("quartz");
|
||||
HMODULE msvfw32_dll = GetModuleHandleA("msvfw32");
|
||||
|
||||
MCIERROR result = real_mciSendCommandA(IDDevice, uMsg, fdwCommand, dwParam);
|
||||
|
||||
if ((!quartz_dll && GetModuleHandleA("quartz")) ||
|
||||
(!msvfw32_dll && GetModuleHandleA("msvfw32")))
|
||||
{
|
||||
hook_init(FALSE);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI fake_SetUnhandledExceptionFilter(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue