X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Funexnt.c;h=826028548b7b6b533b5a0d2330ebedd5767bb26b;hb=09ea9552234731fb1cd73d93e1805d7fc5b7ccf8;hp=77cf487237122f858b049715a4ae93e7a0887134;hpb=762383636a99307282c2d93d26c35c046ec24da1;p=chise%2Fxemacs-chise.git.1 diff --git a/src/unexnt.c b/src/unexnt.c index 77cf487..8260285 100644 --- a/src/unexnt.c +++ b/src/unexnt.c @@ -56,10 +56,9 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * version of my_ebss in lastfile.c and a new firstfile.c file. jhar */ #include -#include /* _fmode */ -#include -#include -#include +#include "lisp.h" + +#include "syswindows.h" #include "nt.h" #include "ntheap.h" @@ -170,9 +169,9 @@ _start (void) } /* 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]; @@ -267,6 +266,8 @@ unexec (char *new_name, char *old_name, void *start_data, void *start_bss, close_file_data (&in_file); close_file_data (&out_file); + + return 0; } /* Routines to manipulate NT executable file sections. */ @@ -510,17 +511,17 @@ read_in_bss (char *filename) 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 @@ -538,13 +539,13 @@ map_in_heap (char *filename) 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, @@ -562,17 +563,17 @@ map_in_heap (char *filename) 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); }