ramensoftware / windhawk

The customization marketplace for Windows programs: https://windhawk.net/
https://windhawk.net
GNU General Public License v3.0
2.19k stars 70 forks source link

InjectIntoCriticalProcesses is not set properly by the configuration GUI #136

Closed aubymori closed 1 year ago

aubymori commented 1 year ago

When changing the Load mods in critical system processes setting, the registry is not updated fully.

image

I will be showcasing this with the "Shrink Address Bar Height" mod.

Registry after editing GUI: image

Control Panel with this registry configuration (late inject!): image

Registry after manually updating: image

Control Panel with this registry configuration (injected just fine!): image

m417z commented 1 year ago

The Load mods in critical system processes setting only affects LoadModsInCriticalSystemProcesses in the registry, that's by design. The InjectIntoCriticalProcesses registry value is affected by the Process exclusion list in settings.

Process exclusion list/Process inclusion list

These settings control which processes will be touched by Windhawk at all. If excluded, Windhawk engine won't be injected into a process, and as a result:

The InjectIntoCriticalProcesses registry value is set to 1 when the special <critical_system_processes> item is removed from the Process exclusion list.

Load mods in critical system processes

This setting determines when mods are loaded into system processes. By default, system processes are excluded altogether (with <critical_system_processes>), so this setting has no effect unless Process exclusion list/Process inclusion list are changes.

For example, if there are two mods, mod-all targeting * and mod-dwm targeting dwm.exe, then:

For your use-case of Control Panel injection (https://github.com/ramensoftware/windhawk/issues/103), you need to make sure svchost.exe isn't excluded in the Process exclusion/inclusion lists. You can either remove <critical_system_processes> from the exclusion list, or add svchost.exe to the inclusion list as following:

image

The Load mods in critical system processes setting can stay at Only if targeted explicitly.