comparison src/unexnt.c @ 440:8de8e3f6228a r21-2-28

Import from CVS: tag r21-2-28
author cvs
date Mon, 13 Aug 2007 11:33:38 +0200
parents 3ecd8885ac67
children abe6d1db359e
comparison
equal deleted inserted replaced
439:357dd071b03c 440:8de8e3f6228a
109 109
110 /* Startup code for running on NT. When we are running as the dumped 110 /* Startup code for running on NT. When we are running as the dumped
111 version, we need to bootstrap our heap and .bss section into our 111 version, we need to bootstrap our heap and .bss section into our
112 address space before we can actually hand off control to the startup 112 address space before we can actually hand off control to the startup
113 code supplied by NT (primarily because that code relies upon malloc ()). */ 113 code supplied by NT (primarily because that code relies upon malloc ()). */
114
115 /* **********************
116 Hackers please remember, this _start() thingy is *not* called neither
117 when dumping portably, nor when running from temacs! Do not put
118 significant XEmacs initialization here!
119 ********************** */
120
114 void 121 void
115 _start (void) 122 _start (void)
116 { 123 {
117 char * p;
118 extern void mainCRTStartup (void); 124 extern void mainCRTStartup (void);
119 125
120 /* Cache system info, e.g., the NT page size. */ 126 /* Cache system info, e.g., the NT page size. */
121 cache_system_info (); 127 cache_system_info ();
122 128
132 if (GetModuleFileName (NULL, executable_path, MAX_PATH) == 0) 138 if (GetModuleFileName (NULL, executable_path, MAX_PATH) == 0)
133 { 139 {
134 exit (1); 140 exit (1);
135 } 141 }
136 142
137 /* To allow profiling, make sure executable_path names the .exe 143 /* #### This is super-bogus. When I rename xemacs.exe,
138 file, not the file created by the profiler */ 144 the renamed file still loads its heap from xemacs.exe --kkm */
139 p = strrchr (executable_path, '\\'); 145 #if 0
140 strcpy (p+1, PATH_PROGNAME ".exe"); 146 {
147 /* To allow profiling, make sure executable_path names the .exe
148 file, not the file created by the profiler */
149 char *p = strrchr (executable_path, '\\');
150 strcpy (p+1, PATH_PROGNAME ".exe");
151 }
152 #endif
141 153
142 recreate_heap (executable_path); 154 recreate_heap (executable_path);
143 heap_state = HEAP_LOADED; 155 heap_state = HEAP_LOADED;
144 } 156 }
145 157
158 /* #### This is bogus, too. _fmode is set to different values
159 when we run `xemacs' and `temacs run-emacs'. The sooner we
160 hit and fix all the weirdities this causes us, the better --kkm */
161 #if 0
146 /* The default behavior is to treat files as binary and patch up 162 /* The default behavior is to treat files as binary and patch up
147 text files appropriately, in accordance with the MSDOS code. */ 163 text files appropriately, in accordance with the MSDOS code. */
148 _fmode = O_BINARY; 164 _fmode = O_BINARY;
165 #endif
149 166
150 #if 0 167 #if 0
151 /* This prevents ctrl-c's in shells running while we're suspended from 168 /* This prevents ctrl-c's in shells running while we're suspended from
152 having us exit. */ 169 having us exit. */
153 SetConsoleCtrlHandler ((PHANDLER_ROUTINE) ctrl_c_handler, TRUE); 170 SetConsoleCtrlHandler ((PHANDLER_ROUTINE) ctrl_c_handler, TRUE);