fix windows bugs H4030 and H4045 (123 and 138)

Changes to be committed:
	modified:   sys/share/pcmain.c
	modified:   sys/winnt/nttty.c
	modified:   sys/winnt/stubs.c

Bug 123 Report 4030:
Minor thing I've noticed - if I quit the game, at the "Hit <Enter> to end."
prompt, if I close the window rather than pressing Enter, I get the following:

Bug 138  - #H4045:
 "nethack -s" leads to "-s is not supported for the Graphical Interface".
 That's wrong.
 (The Graphical Interface comes with "nethackw".)
This commit is contained in:
nhmall
2015-12-11 23:08:01 -05:00
parent 9558f2d9d8
commit 215060219d
3 changed files with 98 additions and 16 deletions
+12 -13
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 nttty.c $NHDT-Date: 1431737067 2015/05/16 00:44:27 $ $NHDT-Branch: master $:$NHDT-Revision: 1.63 $ */
/* NetHack 3.6 nttty.c $NHDT-Date: 1449893262 2015/12/12 04:07:42 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.64 $ */
/* Copyright (c) NetHack PC Development Team 1993 */
/* NetHack may be freely redistributed. See license for details. */
@@ -258,6 +258,8 @@ int mode;
DWORD cmode;
long mask;
GUILaunched = 0;
try :
/* The following lines of code were suggested by
* Bob Landau of Microsoft WIN32 Developer support,
@@ -265,14 +267,10 @@ int mode;
* we were launched from the command prompt, or from
* the NT program manager. M. Allison
*/
hStdOut
= GetStdHandle(STD_OUTPUT_HANDLE);
hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
if (hStdOut) {
GetConsoleScreenBufferInfo(hStdOut, &origcsbi);
GUILaunched = ((origcsbi.dwCursorPosition.X == 0)
&& (origcsbi.dwCursorPosition.Y == 0));
if ((origcsbi.dwSize.X <= 0) || (origcsbi.dwSize.Y <= 0))
GUILaunched = 0;
} else if (mode) {
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);
@@ -286,10 +284,14 @@ int mode;
freopen("CON", "r", stdin);
}
mode = 0;
goto try
;
} else
goto try;
} else {
return;
}
/* Obtain handles for the standard Console I/O devices */
hConIn = GetStdHandle(STD_INPUT_HANDLE);
hConOut = GetStdHandle(STD_OUTPUT_HANDLE);
load_keyboard_handler();
/* Initialize the function pointer that points to
@@ -297,9 +299,6 @@ int mode;
*/
nt_kbhit = nttty_kbhit;
/* Obtain handles for the standard Console I/O devices */
hConIn = GetStdHandle(STD_INPUT_HANDLE);
hConOut = GetStdHandle(STD_OUTPUT_HANDLE);
#if 0
hConIn = CreateFile("CONIN$",
GENERIC_READ |GENERIC_WRITE,
+5
View File
@@ -7,6 +7,7 @@
int GUILaunched;
struct window_procs mswin_procs = { "guistubs" };
void
mswin_destroy_reg()
{
@@ -36,6 +37,7 @@ char *argv[];
return 0;
}
#endif
#endif /* GUISTUB */
/* =============================================== */
@@ -43,7 +45,10 @@ char *argv[];
#ifdef TTYSTUB
#include "hack.h"
#include "win32api.h"
HANDLE hConIn;
HANDLE hConOut;
int GUILaunched;
struct window_procs tty_procs = { "ttystubs" };