diff --git a/build/dxwnd.dll b/build/dxwnd.dll index 9cdb012..9812e83 100644 --- a/build/dxwnd.dll +++ b/build/dxwnd.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f94dedc2e7e5d4adf8a804d3f747f544a38b661c38967d375fa7efbd8d76bdab +oid sha256:ffb381fe04bba437bffb3771d0aef016931d9c10f751d7dea21a711537ccbd87 size 678400 diff --git a/build/dxwnd.exe b/build/dxwnd.exe index c85a819..08e7b1d 100644 --- a/build/dxwnd.exe +++ b/build/dxwnd.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d58180de7cdd9e659b552b5da719e24163cc7db663fceb7c2fd1d8e71086df7c +oid sha256:ad75238bb04366e33af8a86a0cfb4c8fc760794f5029c2a194fe3af1615f901d size 655360 diff --git a/build/exports/GTA 3.dxw b/build/exports/GTA 3.dxw index c7e4c44..cea1e98 100644 --- a/build/exports/GTA 3.dxw +++ b/build/exports/GTA 3.dxw @@ -7,9 +7,9 @@ ver0=0 coord0=0 flag0=134234150 flagg0=1207975952 -flagh0=176 -flagi0=0 -tflag0=2 +flagh0=144 +flagi0=4194304 +tflag0=0 initx0=0 inity0=0 minx0=0 @@ -22,3 +22,17 @@ sizx0=800 sizy0=600 maxfps0=0 initts0=0 +startfolder0= +launchpath0= +notes0= +registry0= +flagj0=0 +flagk0=1048576 +flagl0=0 +flagm0=0 +dflag0=0 +winver0=0 +maxres0=0 +swapeffect0=0 +maxddinterface0=7 +slowratio0=1 diff --git a/build/readme-relnotes.txt b/build/readme-relnotes.txt index 1a1e395..334e53d 100644 --- a/build/readme-relnotes.txt +++ b/build/readme-relnotes.txt @@ -1219,4 +1219,10 @@ fix: suppressed more capabilities when setting "Suppress overlay capability" fla fix: fixed logic for ZBUFFER capabilities: "The Creed" seems to have two, one in SYSTEMMEMORY and one in VIDEOMEMORY... fix: avoid setting cursor clipping when client area is returned with zero size. fix: fixed CreateProcessA hooker for "suspended process" injection type to forward all parameters to the system call -add: added "Fix glBindTexture texture" flag to compensate for the missing glActiveTexture call. Fixes "bugdom" 2D panels. \ No newline at end of file +add: added "Fix glBindTexture texture" flag to compensate for the missing glActiveTexture call. Fixes "bugdom" 2D panels. + +v2.03.83 +fix: cleared surface list on primary surface creation: "Daytona USA" keeps creating new primary surfaces, so it saturated the surface list. +fix: calling the proper GetGDISurface pointer in Lock wrapper +fix: HookProc routine causing crash with GTA3, fixed for Win7 and Win10 +fix: LoadLibrayA/W after a SetWorkingDir invocation didn't load the local modules. Fixes "The Rage". \ No newline at end of file diff --git a/dll/ddraw.cpp b/dll/ddraw.cpp index 15554ab..0be7057 100644 --- a/dll/ddraw.cpp +++ b/dll/ddraw.cpp @@ -3152,6 +3152,7 @@ static HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreate // creation of the primary surface.... if(ddsd.dwFlags & DDSD_CAPS && ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE){ + dxwss.ClearSurfaceList(); // v2.03.83: "Daytona USA" would saturate the list otherwise SetVSyncDelays(dxversion, lpdd); GetHookInfo()->Height=(short)dxw.GetScreenHeight(); GetHookInfo()->Width=(short)dxw.GetScreenWidth(); @@ -4322,6 +4323,7 @@ static HRESULT WINAPI extLockDir(int dxversion, Lock_Type pLock, LPDIRECTDRAWSUR POINT upleft={0,0}; LPDIRECTDRAWSURFACE lpDDSPrim; Blt_Type pBlt; + GetGDISurface_Type pGetGDISurface; // this hooker operates on // Beware!!! for strange reason, the function gets hooked to ANY surface, also non primary ones!!! @@ -4337,17 +4339,16 @@ static HRESULT WINAPI extLockDir(int dxversion, Lock_Type pLock, LPDIRECTDRAWSUR } switch(dxversion){ - case 1: pBlt=pBlt1; break; - case 2: pBlt=pBlt2; break; - case 3: pBlt=pBlt3; break; - case 4: pBlt=pBlt4; break; - case 7: pBlt=pBlt7; break; + case 1: pBlt=pBlt1; pGetGDISurface=pGetGDISurface1; break; + case 2: pBlt=pBlt2; pGetGDISurface=pGetGDISurface2; break; + case 4: pBlt=pBlt4; pGetGDISurface=pGetGDISurface4; break; + case 7: pBlt=pBlt7; pGetGDISurface=pGetGDISurface7; break; } // V2.02.43: Empire Earth does some test Lock operations apparently before the primary surface is created if(lpPrimaryDD){ lpDDSPrim=0; - res2=(*pGetGDISurface1)(lpPrimaryDD, &lpDDSPrim); + res2=(*pGetGDISurface)(lpPrimaryDD, &lpDDSPrim); if(res2) OutTraceE("Lock: GetGDISurface ERROR res=%x(%s) at %d\n", res2, ExplainDDError(res2), __LINE__); else diff --git a/dll/dxhook.cpp b/dll/dxhook.cpp index f2cc093..8deaa15 100644 --- a/dll/dxhook.cpp +++ b/dll/dxhook.cpp @@ -567,12 +567,17 @@ void SetHook(void *target, void *hookproc, void **hookedproc, char *hookname) } tmp=(void *)dwTmp; - if (*hookedproc && *hookedproc!=tmp) { - sprintf(msg,"SetHook: proc=%s oldhook=%x->%x newhook=%x\n", hookname, hookedproc, *(DWORD *)hookedproc, tmp); - OutTraceDW(msg); - if (IsAssertEnabled) MessageBox(0, msg, "SetHook", MB_OK | MB_ICONEXCLAMATION); - tmp = *hookedproc; + __try { + if (*hookedproc && (*hookedproc)!=tmp) { + sprintf(msg,"SetHook: proc=%s oldhook=%x->%x newhook=%x\n", hookname, hookedproc, *(DWORD *)hookedproc, tmp); + OutTraceDW(msg); + if (IsAssertEnabled) MessageBox(0, msg, "SetHook", MB_OK | MB_ICONEXCLAMATION); + // tmp = *hookedproc; -- commented out in v2.03.83, causing crash in GTA3 + } } + __except(EXCEPTION_EXECUTE_HANDLER){ + OutTrace("SetHook: %s exception\n", hookname); + }; *hookedproc = tmp; OutTraceH("SetHook: DEBUG2 *hookedproc=%x, name=%s\n", tmp, hookname); } diff --git a/dll/dxwnd.aps b/dll/dxwnd.aps index 55e0ccb..df04110 100644 Binary files a/dll/dxwnd.aps and b/dll/dxwnd.aps differ diff --git a/dll/dxwnd.cpp b/dll/dxwnd.cpp index e8eab1e..e6dfef9 100644 --- a/dll/dxwnd.cpp +++ b/dll/dxwnd.cpp @@ -27,7 +27,7 @@ along with this program. If not, see . #include "TlHelp32.h" -#define VERSION "2.03.82" +#define VERSION "2.03.83" #define DDTHREADLOCK 1 //#define LOCKTHREADS diff --git a/dll/dxwnd.vs2008.sln b/dll/dxwnd.vs2008.sln deleted file mode 100644 index 0d2e531..0000000 --- a/dll/dxwnd.vs2008.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dxwnd", "dxwnd.vs2008.vcproj", "{579E7FE7-2745-4100-A802-23511711FCDE}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {579E7FE7-2745-4100-A802-23511711FCDE}.Debug|Win32.ActiveCfg = Debug|Win32 - {579E7FE7-2745-4100-A802-23511711FCDE}.Debug|Win32.Build.0 = Debug|Win32 - {579E7FE7-2745-4100-A802-23511711FCDE}.Release|Win32.ActiveCfg = Release|Win32 - {579E7FE7-2745-4100-A802-23511711FCDE}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/dll/dxwnd.vs2008.suo b/dll/dxwnd.vs2008.suo index 2ffd22b..baaeab6 100644 Binary files a/dll/dxwnd.vs2008.suo and b/dll/dxwnd.vs2008.suo differ diff --git a/dll/hd3d.cpp b/dll/hd3d.cpp index dcdd5b5..e3d9e28 100644 --- a/dll/hd3d.cpp +++ b/dll/hd3d.cpp @@ -296,7 +296,7 @@ static HookEntryEx_Type d3d9Hooks[]={ {HOOK_HOT_CANDIDATE, 0, "Direct3DCreate9", (FARPROC)NULL, (FARPROC *)&pDirect3DCreate9, (FARPROC)extDirect3DCreate9}, {HOOK_HOT_CANDIDATE, 0, "Direct3DCreate9Ex", (FARPROC)NULL, (FARPROC *)&pDirect3DCreate9Ex, (FARPROC)extDirect3DCreate9Ex}, {HOOK_HOT_CANDIDATE, 0, "CheckFullScreen", (FARPROC)NULL, (FARPROC *)&pCheckFullScreen, (FARPROC)extCheckFullScreen}, - {HOOK_HOT_CANDIDATE, 0, "DisableD3DSpy", (FARPROC)NULL, (FARPROC *)&pDisableD3DSpy, (FARPROC)extDisableD3DSpy}, + //{HOOK_HOT_CANDIDATE, 0, "DisableD3DSpy", (FARPROC)NULL, (FARPROC *)&pDisableD3DSpy, (FARPROC)extDisableD3DSpy}, {HOOK_HOT_CANDIDATE, 0, "D3DPERF_SetOptions", (FARPROC)NULL, (FARPROC *)&pD3DPERF_SetOptions, (FARPROC)extD3DPERF_SetOptions}, {HOOK_IAT_CANDIDATE, 0, 0, NULL, 0, 0} // terminator }; @@ -305,7 +305,7 @@ static HookEntryEx_Type d3d9Extra[]={ {HOOK_HOT_CANDIDATE, 0, "Direct3DShaderValidatorCreate9", (FARPROC)NULL, (FARPROC *)NULL, (FARPROC)voidDirect3DShaderValidatorCreate9}, {HOOK_HOT_CANDIDATE, 0, "DebugSetLevel", (FARPROC)NULL, (FARPROC *)NULL, (FARPROC)voidDebugSetLevel}, {HOOK_HOT_CANDIDATE, 0, "DebugSetMute", (FARPROC)NULL, (FARPROC *)NULL, (FARPROC)voidDebugSetMute}, - {HOOK_HOT_CANDIDATE, 0, "DisableD3DSpy", (FARPROC)NULL, (FARPROC *)NULL, (FARPROC)voidDisableD3DSpy}, + {HOOK_HOT_CANDIDATE, 0, "DisableD3DSpy", (FARPROC)NULL, (FARPROC *)NULL, (FARPROC)voidDisableD3DSpy}, {HOOK_IAT_CANDIDATE, 0, 0, NULL, 0, 0} // terminator }; diff --git a/dll/kernel32.cpp b/dll/kernel32.cpp index b62f72f..a734cc3 100644 --- a/dll/kernel32.cpp +++ b/dll/kernel32.cpp @@ -515,8 +515,20 @@ HMODULE WINAPI LoadLibraryExWrapper(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFl { HMODULE libhandle; int idx; - + libhandle=(*pLoadLibraryExA)(lpFileName, hFile, dwFlags); + + // found in "The Rage" (1996): loading a module with relative path after a SetCurrentDirectory may fail, though + // the module is present in the current directory folder. To fix this problem in case of failure it is possible + // to retry the operation using a full pathname composed concatenating current dir and module filename. + if(!libhandle){ + char lpBuffer[MAX_PATH+1]; + GetCurrentDirectory(MAX_PATH, lpBuffer); + sprintf_s(lpBuffer, MAX_PATH, "%s/%s", lpBuffer, lpFileName); + OutTrace("GHODEBUG: fullpath=\"%s\"\n", lpBuffer); + libhandle=(*pLoadLibraryExA)(lpBuffer, hFile, dwFlags); + } + OutTraceDW("%s: FileName=%s hFile=%x Flags=%x(%s) hmodule=%x\n", api, lpFileName, hFile, dwFlags, ExplainLoadLibFlags(dwFlags), libhandle); if(!libhandle){ OutTraceE("%s: ERROR FileName=%s err=%d\n", api, lpFileName, GetLastError()); diff --git a/host/dxwndhost.vs2008.sln b/host/dxwndhost.vs2008.sln deleted file mode 100644 index 5bf4fb1..0000000 --- a/host/dxwndhost.vs2008.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dxwndhost", "dxwndhost.vs2008.vcproj", "{FD0B0234-8EC5-43C0-A384-1B881DD3D925}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {FD0B0234-8EC5-43C0-A384-1B881DD3D925}.Debug|Win32.ActiveCfg = Debug|Win32 - {FD0B0234-8EC5-43C0-A384-1B881DD3D925}.Debug|Win32.Build.0 = Debug|Win32 - {FD0B0234-8EC5-43C0-A384-1B881DD3D925}.Release|Win32.ActiveCfg = Release|Win32 - {FD0B0234-8EC5-43C0-A384-1B881DD3D925}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/host/dxwndhost.vs2008.suo b/host/dxwndhost.vs2008.suo index 6b572c4..083372a 100644 Binary files a/host/dxwndhost.vs2008.suo and b/host/dxwndhost.vs2008.suo differ