Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows compilation fails / bug #4

Open
Kolfering opened this issue Mar 29, 2024 · 1 comment
Open

Windows compilation fails / bug #4

Kolfering opened this issue Mar 29, 2024 · 1 comment
Assignees

Comments

@Kolfering
Copy link

Hello,

First thanks for your work. We are using it for Steam integration with our project.
I just wanted to report back to you some issues we found in the Windows part of the code.

This line won't compile, val should be buf:

const DWORD rc = GetEnvironmentVariableA(key, val, buflen);

This ternary seems to be backward:

return ((rc > 0) && (rc < buflen)) ? NULL : buf;

It should be:
return ((rc > 0) && (rc < buflen)) ? buf : NULL;

SIGPIPE does not seem to be supported on Windows, so those 2 lines don't compile:

signal(SIGPIPE, SIG_IGN);

signal(SIGPIPE, SIG_DFL);

@icculus icculus self-assigned this Mar 30, 2024
@Ghabry
Copy link

Ghabry commented Apr 19, 2024

also CreateProcessW fails with invalid parameter because no startup info is passed in. This works (though not sure if ideal).

STARTUPINFO sinfo = {};
sinfo.cb = sizeof(sinfo);
return (CreateProcessW(TEXT(".\\") TEXT(GAME_LAUNCH_NAME) TEXT(".exe"),
                           GetCommandLineW(), NULL, NULL, TRUE, 0, NULL,
                           NULL, &sinfo, pid) != 0);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants