TLeonardUK / ds3os

Dark Souls - Open Server
MIT License
710 stars 114 forks source link

[BUG] A path bug in Loader #93

Closed stosSe4r closed 2 years ago

stosSe4r commented 2 years ago

At MainForm.cs@572, I think it should be like

bool Result = WinAPI.CreateProcess(
                null,
                "\""+ExeLocation+"\"",
                IntPtr.Zero,
                IntPtr.Zero,
                false,
                ProcessCreationFlags.CREATE_SUSPENDED,
                IntPtr.Zero,
                ExeDirectory,
                ref StartupInfo,
                out ProcessInfo
            );

According to MSDN https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa?redirectedfrom=MSDN, any long path with space should be quoted, or the path would be ambiguous. I've seen a rare case that CreateProcess fails to open DS3.exe and returns Error 193 with the original code.

TLeonardUK commented 2 years ago

Sounds reasonable, feel free to put in a pull request with the change.