]> granicus.if.org Git - nethack/commitdiff
Fix crash that can occur when panic is called early.
authorBart House <bart@barthouse.com>
Sun, 11 Nov 2018 00:37:12 +0000 (16:37 -0800)
committernhmall <nhmall@nethack.org>
Sun, 11 Nov 2018 01:26:20 +0000 (20:26 -0500)
win/win32/winhack.c

index a85bdc478e6bc3d963f0ec13addec33872215614..e9f83b1ea395973095ab63b0f6513b4a9c525370 100644 (file)
@@ -88,11 +88,19 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
     UNREFERENCED_PARAMETER(lpCmdLine);
     UNREFERENCED_PARAMETER(nCmdShow);
 
-    sys_early_init();
-
-    /* ensure that we don't access violate on a panic() */
+    //
+    // We need to support DPI awareness.
+    //
+    // BOOL result = SetProcessDpiAwarenessContext(
+    //                            DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
+    //
+
+    /* We must initialize state sufficiently to support calls to panic */
     windowprocs.win_raw_print = mswin_raw_print;
     windowprocs.win_raw_print_bold = mswin_raw_print_bold;
+    windowprocs.win_wait_synch = mswin_wait_synch;
+
+    sys_early_init();
 
     /* init applicatio structure */
     _nethack_app.hApp = hInstance;