How to force an .exe file to run with a set processor affinity?

0

OS: Windows 10

CPU: Intel I7-5820 3.30 GHz (Hyperthreaded Hexacore)

Game: Red Alert 2 Mental Omega Mod

So I'm playing Red Alert 2 Mental Omega and every time I launch the game, it launches with processor affinity set to my first core, and my first core only. This is by default fine, especially for such an old game, but adding extra cores however does not cause any issues when enabled, and in fact, gives a substantial performance boost.

I can alt-tab out of the game, set the affinity and it works, but if done incorrectly, it causes potentially game-breaking issues. For example, alt-tabbing whilst in a pause menu will cause issues that cause the menu for the rest of the session to become inoperable, whilst alt-tabbing mid-game actually causes no issues.

So I want to set the affinity of the game before it launches, but there's a catch.

The game launches through a 3rd party launcher, as part of the mod, as such the actual .exe and then process that needs it's affinity changed is not directly accessed by me. Meaning I can't make a batch file to set the affinity.

To sum it up: I need to set the affinity of a process, at launch, that is launched indirectly, WITHOUT batch files, alt-tabbing, no shortcuts or task manager. I'm looking for something like a registry edit, a DLL injection, or a way to replace the .exe with one that launches with the correct processor affinity.

Secondarily: I'd like to know why/how windows determines that this process needs to run with only 1 core enabled, I recall that this was also the case with just the base game. As such it leads me to believe it might be a sort of automatic comparability feature. Is it even windows that's doing this, or is code in the game itself responsible?

Any advice, help or additional information in general would be greatly appreciated, as I doubt this will remain an isolated case.

I'd be happy to provide additional information if required.

To reiterate: No shortcuts, no batch files, no alt-tabbing and no task manager. I need a low-level solution, maybe even 3rd party software

SpiritBH

Posted 2019-06-11T16:39:58.230

Reputation: 1

Question was closed 2019-06-11T16:52:10.623

2

Did you try this answer on the provided question?

– Worthwelle – 2019-06-11T18:14:03.853

No answers