summaryrefslogtreecommitdiff
path: root/src/unexw32.c
diff options
context:
space:
mode:
authorDaniel Colascione <dancol@dancol.org>2012-12-10 09:55:03 -0800
committerDaniel Colascione <dancol@dancol.org>2012-12-10 09:55:03 -0800
commit78f9ea875a65686b5e300d73dbf22dd96ca29851 (patch)
treed30e965b537930a2c7ba999210ae56651562ac26 /src/unexw32.c
parent322a542e6c13eb89b8abc302278e77684c1d6479 (diff)
downloademacs-78f9ea875a65686b5e300d73dbf22dd96ca29851.tar.gz
emacs-78f9ea875a65686b5e300d73dbf22dd96ca29851.tar.bz2
emacs-78f9ea875a65686b5e300d73dbf22dd96ca29851.zip
Move fix for bug#12993 to trunk
Diffstat (limited to 'src/unexw32.c')
-rw-r--r--src/unexw32.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/unexw32.c b/src/unexw32.c
index ee1deb5f92e..1e591a78b73 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -85,6 +85,13 @@ DWORD_PTR extra_bss_size_static = 0;
PIMAGE_SECTION_HEADER heap_section;
+#ifdef HAVE_NTGUI
+extern HINSTANCE hinst;
+HINSTANCE hprevinst = NULL;
+LPSTR lpCmdLine = "";
+int nCmdShow = 0;
+#endif /* HAVE_NTGUI */
+
/* Startup code for running on NT. When we are running as the dumped
version, we need to bootstrap our heap and .bss section into our
address space before we can actually hand off control to the startup
@@ -114,6 +121,15 @@ _start (void)
/* Prevent Emacs from being locked up (eg. in batch mode) when
accessing devices that aren't mounted (eg. removable media drives). */
SetErrorMode (SEM_FAILCRITICALERRORS);
+
+ /* Invoke the NT CRT startup routine now that our housecleaning
+ is finished. */
+#ifdef HAVE_NTGUI
+ /* determine WinMain args like crt0.c does */
+ hinst = GetModuleHandle (NULL);
+ lpCmdLine = GetCommandLine ();
+ nCmdShow = SW_SHOWDEFAULT;
+#endif
mainCRTStartup ();
}