* version of my_ebss in lastfile.c and a new firstfile.c file. jhar */
#include <config.h>
-#include <stdlib.h> /* _fmode */
-#include <stdio.h>
-#include <fcntl.h>
-#include <windows.h>
+#include "lisp.h"
+
+#include "syswindows.h"
#include "nt.h"
#include "ntheap.h"
}
/* Dump out .data and .bss sections into a new executable. */
-void
-unexec (char *new_name, char *old_name, void *start_data, void *start_bss,
- void *entry_address)
+int
+unexec (char *new_name, char *old_name, unsigned int start_data,
+ unsigned int start_bss, unsigned int entry_address)
{
file_data in_file, out_file;
char out_filename[MAX_PATH], in_filename[MAX_PATH];
close_file_data (&in_file);
close_file_data (&out_file);
+
+ return 0;
}
/* Routines to manipulate NT executable file sections. */
file = CreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (file == INVALID_HANDLE_VALUE)
- abort ();
+ ABORT ();
/* Seek to where the .bss section is tucked away after the heap... */
index = heap_index_in_executable + get_committed_heap_size ();
if (SetFilePointer (file, index, NULL, FILE_BEGIN) == 0xFFFFFFFF)
- abort ();
+ ABORT ();
/* Ok, read in the saved .bss section and initialize all
uninitialized variables. */
if (!ReadFile (file, bss_start, bss_size, &n_read, NULL))
- abort ();
+ ABORT ();
CloseHandle (file);
#endif
file = CreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (file == INVALID_HANDLE_VALUE)
- abort ();
+ ABORT ();
size = GetFileSize (file, &upper_size);
file_mapping = CreateFileMapping (file, NULL, PAGE_WRITECOPY,
0, size, NULL);
if (!file_mapping)
- abort ();
+ ABORT ();
size = get_committed_heap_size ();
file_base = MapViewOfFileEx (file_mapping, FILE_MAP_COPY, 0,
if (VirtualAlloc (get_heap_start (), get_committed_heap_size (),
MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE) == NULL)
- abort ();
+ ABORT ();
/* Seek to the location of the heap data in the executable. */
if (SetFilePointer (file, heap_index_in_executable,
NULL, FILE_BEGIN) == 0xFFFFFFFF)
- abort ();
+ ABORT ();
/* Read in the data. */
if (!ReadFile (file, get_heap_start (),
get_committed_heap_size (), &n_read, NULL))
- abort ();
+ ABORT ();
CloseHandle (file);
}