Merge from emacs-24; up to 2012-12-26T16:22:18Z!michael.albinus@gmx.de
[bpt/emacs.git] / src / unexw32.c
index 3eefc9c..e8b553a 100644 (file)
@@ -1,5 +1,5 @@
 /* unexec for GNU Emacs on Windows NT.
-   Copyright (C) 1994, 2001-201 Free Software Foundation, Inc.
+   Copyright (C) 1994, 2001-2013 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -22,6 +22,9 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 #include "unexec.h"
+#include "lisp.h"
+#include "w32common.h"
+#include "w32.h"
 
 #include <stdio.h>
 #include <fcntl.h>
@@ -82,13 +85,6 @@ DWORD_PTR  extra_bss_size_static = 0;
 
 PIMAGE_SECTION_HEADER heap_section;
 
-#ifdef HAVE_NTGUI
-HINSTANCE hinst = NULL;
-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
@@ -118,15 +114,6 @@ _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 ();
 }
 
@@ -735,7 +722,7 @@ unexec (const char *new_name, const char *old_name)
   /* Ignore old_name, and get our actual location from the OS.  */
   if (!GetModuleFileName (NULL, in_filename, MAX_PATH))
     abort ();
-  dostounix_filename (in_filename);
+  dostounix_filename (in_filename, 0);
   strcpy (out_filename, in_filename);
 
   /* Change the base of the output filename to match the requested name.  */