ccomrade / c1-launcher

Open-source Crysis executables.
289 stars 25 forks source link

Replace d3d10.dll/dxgi.dll absolute path with relative #34

Closed vlad54rus closed 9 months ago

vlad54rus commented 9 months ago

CryRenderD3D10.dll loads d3d10.dll and dxgi.dll directly from C:\Windows\System32 which causes problems when using some dll wrappers such as DXVK (https://github.com/doitsujin/dxvk/issues/551#issuecomment-413019959).

ccomrade commented 9 months ago

This is strange because CryRenderD3D10.dll has both d3d10.dll and dxgi.dll as its dependencies (dxgi.dll indirectly via d3d10.dll):

image

However, it also loads them explicitly (LoadLibraryW) from C:\Windows\System32 (GetSystemDirectoryW) during startup. Any idea what could be the reason for this weird behavior? CryRenderD3D9.dll doesn't do that with its DirectX DLLs.

vlad54rus commented 9 months ago

Some developers do that, no idea why. But Crysis Warhead doesn't have such behavior. I'd suggest removing GetSystemDirectoryW related code and replacing it with just LoadLibraryW("d3d10.dll") and LoadLibraryW("dxgi.dll").

ccomrade commented 9 months ago

Implemented. Can you test that it works with DXVK now? Here are the EXEs. Or you can take those big ones from CI/CD artifacts. I should finally implement CI/CD builds with VS2005 compiler to automatically build small EXEs as well.

c1-launcher-v5-build.zip

vlad54rus commented 9 months ago

Works great, thank you.

ccomrade commented 9 months ago

No problem. Thanks for the test and for reporting the issue.