elishacloud / dxwrapper

Fixes compatibility issues with older games running on Windows 10/11 by wrapping DirectX dlls. Also allows loading custom libraries with the file extension .asi into game processes.
zlib License
1.16k stars 83 forks source link

SimCity Save Patch Windows11 #140

Closed SpaceBooger closed 10 months ago

SpaceBooger commented 2 years ago

I have the patch installed for SimCity and it works great on my Windows 10 machine, but will not work on Windows 11. When playing SimCity on Win11 it automatically closes when you try to save. I have used the same files (exact same install) to confirm this works on Win10 but not on Win11.

SpaceBooger commented 2 years ago

I have also tried the patch with all compatibility settings on Windows 11 and nothing has worked.

mirh commented 2 years ago

"When you try to save" sounds something to do with the windows Controlled folder access feature.

elishacloud commented 2 years ago

The issue is that SimCity calls the ComDlg.dll API's incorrectly causing the game to crash. The temporary fix I added was to use the exception handler to catch the crash and nop the code so it would bypass the error. The right fix would have been to hook the ComDlg API and directly fix the error in API call. I never had time to put the right fix in.

First make sure that the game is loading dxwrapper by deleting the old log file and running the game again and checking if it generates a new log file. Then attach the new log file to this issue?

SpaceBooger commented 2 years ago

When you say log file, do you mean the Windows event file, or is there another log for this patch?

elishacloud commented 2 years ago

There should be a file in the game folder called "dxwrapper-classic.log" or something like that.

image

SpaceBooger commented 2 years ago

There is no log in my folder on my Windows 11 build. I will check my Windows 10 version tomorrow at work.

SpaceBooger commented 2 years ago

Screenshot 2022-01-13 215430

SpaceBooger commented 2 years ago

So the files did not produce a log on Win10, but here is the log from the same exact files on a Win10 pc. The patch does work on Win10:

[dxwrapper-classic.log.txt]pper v1.0.6378.21 24256 15:22:27.843 HP HP EliteDesk 800 G5 SFF (Desktop) 24256 15:22:27.843 HP 8592 KBC Version 08.98.00 (Desktop) 24256 15:22:27.843 Intel(R) UHD Graphics 630 24256 15:22:27.846 Windows 10 Enterprise 64-bit (10.0.19041) 24256 15:22:27.846 "CLASSIC.EXE" (PID:18640) 24256 15:22:27.853 Utils::WriteMemory::WriteMemory Writing bytes to memory... 24256 15:22:27.853 Disabling High DPI Scaling... 24256 15:22:27.853 Loaded library: user32.dll 24256 15:22:27.853 Loaded library: shcore.dll 24256 15:22:27.853 Set exception handler 24256 15:22:27.853 Loaded library: kernel32.dll 24256 15:22:27.853 Finished setting exception handler 24256 15:22:27.853 DxWrapper loaded! 24256 15:22:55.784 Quiting DxWrapper 24256 15:22:55.784 Unloading libraries... 24256 15:22:55.784 Unloading exception handlers 24256 15:22:55.784 Reseting screen resolution 24256 15:22:55.925 Reseting font smoothing 24256 15:22:55.927 DxWrapper terminated!

elishacloud commented 2 years ago

There is no log in my folder on my Windows 11 build.

This mean that dxwrapper is not loading on that system. You need to get dxwrapper to load before it will work. There could be a few possible fixes:

  1. Try disabling all compatibility options.
  2. Try running the "CLASSIC.EXE" file directly from the folder in the screenshot above.
  3. Try renaming the "dwmapi.dll" to something else. These are possible names here. Maybe try "winmm.dll" ...
  4. Check the full folder path of the game and make sure there are no special characters in the folder path. If there are special characters than try moving the game to a different folder.

Edit: added a 4th possible solution.

mirh commented 2 years ago

What if you run the exe as admin?

SpaceBooger commented 2 years ago

Running as admin did not work, but renaming it to "winmm.dll" worked. Aweseome. Thanks!

Instandhaltung commented 1 year ago

Try renaming the "dwmapi.dll" to something else. These are possible names here. Maybe try "winmm.dll" ...

This helped me as well! Important information

elishacloud commented 10 months ago

Closing issue. You can reopen it is you still have issues.