I have a few old games that don't work well with a multi-core CPU and need affinity set to one CPU.
For the moment I am using a loader that starts the game suspended, sets its affinity then starts the game thread.
Now I was thinking of expanding it with command-line args but get to the problem of elevation.
If my non-elevated program tries to run an elevated program nothing happens (as it should since I don't error check).
My question: is there an easy way of knowing whether an exe needs elevation?
Maybe an API or registry key? I don't want to have to parse a manifest resource or anything.
All I get with msdn is installer stuff.
The brute force way I suppose is to run my app as elevated, but that is...inelegant.
Looks like the only way is checking the return of CreateProcess for an error (ERROR_ELEVATION_REQUIRED from GetLastError).
Because my app needs to access the child app to set its affinity I will need to elevate it, thanks to Greg's code (again) here (http://www.masm32.com/board/index.php?topic=9422.0)
This seems to be the only way to check for an app that uses a manifest for elevation without parsing the file/resource.
Windows stores apps that elevate via properties>compatibility in the registry (HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers)
hutch, IE9 beta doesn't play well with your forum software...
:bg
> hutch, IE9 beta doesn't play well with your forum software...
Shoot it.
Can't shoot it, it's too fast :P