narzoul / DDrawCompat

DirectDraw and Direct3D 1-7 compatibility, performance and visual enhancements for Windows Vista, 7, 8, 10 and 11
BSD Zero Clause License
880 stars 67 forks source link

DDraw redirection not working #234

Closed AronNemeth2001 closed 12 months ago

AronNemeth2001 commented 12 months ago

I'm trying to get Age of Wonders (GoG release) working with a ddraw wrapper, but the COM redirection fix doesn't work, and neither do the other methods, as Process explorer still indicates that the game is loading the system ddraw.dll and not the wrapper. The keys from the .reg file do get imported when I run it, so I have no clue why the game ignores them. I'm running Win 11 Pro on a 2021 Asus TUF F15.

narzoul commented 12 months ago

The COM redirection registry fix should be the only change needed. I just verified it again on Win 11 with the GOG release.

Have you tried renaming the executable to something else, in order to get rid of any compatibility shims that could be interfering? Are you not getting a DDrawCompat log file at all? I assume you are using the latest release, since some older versions of DDrawCompat might not support the COM redirection fix.

Could you also check the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs key in regedit? ddraw.dll is not supposed to be on that list, but maybe your system is different for some reason.

Unfortunately, I'm out of ideas on what else the issue could be. As a last resort, you could try to change the same registry keys under HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER, but I think you need to launch regedit as the TrustedInstaller user to be able to change them. You would only have to update the "(Default)" values under the InprocServer32 keys to "ddraw.dll" instead of "%SystemRoot%\system32\ddraw.dll".

narzoul commented 12 months ago

One more idea, which is not in the wiki: you can try the InjectDll shim from the Microsoft Application Compatibility Toolkit, if you know how to use it.

Its description, taken from Compatibility Administrator:

Some applications may use dynamically loaded DLLs, which could potentially issue calls to static DLLs before the application is ready. This compatibility fix provides a workaround for this behavior by preloading the required static DLLs for the application. This compatibility fix takes a command line containing a list of the DLLs affected. They will be loaded in the order of the command line listing. This compatibility fix is similar to DelayDllInit, which works with statically loaded DLLs.

It could be used to preload ddraw.dll before the application dynamically loads it. I think it works with a relative path, but you can try an absolute path if not.

AronNemeth2001 commented 12 months ago

Thanks for your quick response! I got it working by altering your reg fix to point at HKLM then imported it with regedit (ran it as trustedinstaller by opening it with Powerrun). Now it works perfectly, as the overlay appears ingame when i press Shift+F11.