34736384 / genshin-fps-unlock

unlocks the 60 fps cap
MIT License
2.8k stars 217 forks source link

Add game path to command line #308

Closed mkrsym1 closed 11 months ago

mkrsym1 commented 11 months ago

Microsoft documentation states:

If both lpApplicationName and lpCommandLine are non-NULL, the null-terminated string pointed to by lpApplicationName specifies the module to execute, and the null-terminated string pointed to by lpCommandLine specifies the command line. The new process can use GetCommandLine to retrieve the entire command line. Console processes written in C can use the argc and argv arguments to parse the command line. Because argv[0] is the module name, C programmers generally repeat the module name as the first token in the command line.

The current implementation doesn't repeat it, which causes some issues on non-Windows platforms. In particular, the process name is set to the first token in the command line, leading to it being named weird things like -screen-fullscreen.

This pull request fixes the issue.