Windows compilation fails / bug
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: https://github.com/icculus/steamshim/blob/c49d0dfffc0381ed38e333f82fdac0e12840780a/steamshim_child.c#L72
This ternary seems to be backward:
https://github.com/icculus/steamshim/blob/c49d0dfffc0381ed38e333f82fdac0e12840780a/steamshim_child.c#L74
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: https://github.com/icculus/steamshim/blob/c49d0dfffc0381ed38e333f82fdac0e12840780a/steamshim_child.c#L188 https://github.com/icculus/steamshim/blob/c49d0dfffc0381ed38e333f82fdac0e12840780a/steamshim_child.c#L208
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);