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

Work around games closing standard handles on Windows #340

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

res2k
Copy link
Contributor

@res2k res2k commented Dec 16, 2023

Some game libraries (admittedly, old ones) are linked against CRTDLL.DLL, which seems to close the standard handles on shutdown, breaking the system console if running a dedicated server.
Work around this by stowing away the original standard input handles and working on duplicates, and attempt to re-duplicate the handles on certain errors.

Some game libraries (admittedly, old ones) are linked against CRTDLL.DLL,
which seems to close the standard handles on shutdown, breaking the system
console if running a dedicated server.
Work around this by stowing away the original standard input handles and
working on duplicates, and attempt to re-duplicate the handles on certain
errors.
@skullernet
Copy link
Owner

Can you provide an example of a mod which does this?

@res2k
Copy link
Contributor Author

res2k commented Mar 27, 2024

I noticed this this with "action", as shipped with Quake 2 Quad Damage on GOG.

I don't remember what I did exactly, but the issue can be reproduced when a game DLL unload is triggered, eg by switching the game:

  1. Start q2proded +set game action
  2. Switch game with game baseq2 and some map change
  3. After "ShutdownGame", notice system console appearing broken (no input processed, no output generated at all)

@res2k
Copy link
Contributor Author

res2k commented Mar 27, 2024

I think I might have triggered the issue while playing around with MVDs. There's a code path that calls SV_ShutdownGameProgs().

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

Successfully merging this pull request may close these issues.

2 participants