emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/nt/preprep.c


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/nt/preprep.c
Date: Tue, 04 Feb 2003 09:16:35 -0500

Index: emacs/nt/preprep.c
diff -c emacs/nt/preprep.c:1.5 emacs/nt/preprep.c:1.6
*** emacs/nt/preprep.c:1.5      Sun Sep  3 13:38:10 2000
--- emacs/nt/preprep.c  Tue Feb  4 09:16:25 2003
***************
*** 67,83 ****
  
    file = CreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL,
                     OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
!   if (file == INVALID_HANDLE_VALUE) 
      return FALSE;
  
    size = GetFileSize (file, &upper_size);
!   file_mapping = CreateFileMapping (file, NULL, PAGE_READONLY, 
                                    0, size, NULL);
!   if (!file_mapping) 
      return FALSE;
  
    file_base = MapViewOfFile (file_mapping, FILE_MAP_READ, 0, 0, size);
!   if (file_base == 0) 
      return FALSE;
  
    p_file->name = filename;
--- 67,83 ----
  
    file = CreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL,
                     OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
!   if (file == INVALID_HANDLE_VALUE)
      return FALSE;
  
    size = GetFileSize (file, &upper_size);
!   file_mapping = CreateFileMapping (file, NULL, PAGE_READONLY,
                                    0, size, NULL);
!   if (!file_mapping)
      return FALSE;
  
    file_base = MapViewOfFile (file_mapping, FILE_MAP_READ, 0, 0, size);
!   if (file_base == 0)
      return FALSE;
  
    p_file->name = filename;
***************
*** 98,115 ****
  
    file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
                     CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
!   if (file == INVALID_HANDLE_VALUE) 
      return FALSE;
  
!   file_mapping = CreateFileMapping (file, NULL, PAGE_READWRITE, 
                                    0, size, NULL);
!   if (!file_mapping) 
      return FALSE;
!   
    file_base = MapViewOfFile (file_mapping, FILE_MAP_WRITE, 0, 0, size);
!   if (file_base == 0) 
      return FALSE;
!   
    p_file->name = filename;
    p_file->size = size;
    p_file->file = file;
--- 98,115 ----
  
    file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
                     CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
!   if (file == INVALID_HANDLE_VALUE)
      return FALSE;
  
!   file_mapping = CreateFileMapping (file, NULL, PAGE_READWRITE,
                                    0, size, NULL);
!   if (!file_mapping)
      return FALSE;
! 
    file_base = MapViewOfFile (file_mapping, FILE_MAP_WRITE, 0, 0, size);
!   if (file_base == 0)
      return FALSE;
! 
    p_file->name = filename;
    p_file->size = size;
    p_file->file = file;
***************
*** 129,145 ****
  
    file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
                     OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
!   if (file == INVALID_HANDLE_VALUE) 
      return FALSE;
  
    size = GetFileSize (file, &upper_size);
    file_mapping = CreateFileMapping (file, NULL, PAGE_READWRITE,
                                    0, size, NULL);
!   if (!file_mapping) 
      return FALSE;
  
    file_base = MapViewOfFile (file_mapping, FILE_MAP_WRITE, 0, 0, size);
!   if (file_base == 0) 
      return FALSE;
  
    p_file->name = filename;
--- 129,145 ----
  
    file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
                     OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
!   if (file == INVALID_HANDLE_VALUE)
      return FALSE;
  
    size = GetFileSize (file, &upper_size);
    file_mapping = CreateFileMapping (file, NULL, PAGE_READWRITE,
                                    0, size, NULL);
!   if (!file_mapping)
      return FALSE;
  
    file_base = MapViewOfFile (file_mapping, FILE_MAP_WRITE, 0, 0, size);
!   if (file_base == 0)
      return FALSE;
  
    p_file->name = filename;
***************
*** 341,347 ****
     easy to parse.  */
  
  static void
! copy_executable_and_move_sections (file_data *p_infile, 
                                   file_data *p_outfile)
  {
    unsigned char *dst;
--- 341,347 ----
     easy to parse.  */
  
  static void
! copy_executable_and_move_sections (file_data *p_infile,
                                   file_data *p_outfile)
  {
    unsigned char *dst;
***************
*** 389,398 ****
       Note that dst is updated implicitly by each COPY_CHUNK.  */
  
    dos_header = (PIMAGE_DOS_HEADER) p_infile->file_base;
!   nt_header = (PIMAGE_NT_HEADERS) (((unsigned long) dos_header) + 
                                   dos_header->e_lfanew);
    section = IMAGE_FIRST_SECTION (nt_header);
!  
    import_dir = 
&nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT];
    import_section = rva_to_section (import_dir->VirtualAddress, nt_header);
  
--- 389,398 ----
       Note that dst is updated implicitly by each COPY_CHUNK.  */
  
    dos_header = (PIMAGE_DOS_HEADER) p_infile->file_base;
!   nt_header = (PIMAGE_NT_HEADERS) (((unsigned long) dos_header) +
                                   dos_header->e_lfanew);
    section = IMAGE_FIRST_SECTION (nt_header);
! 
    import_dir = 
&nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT];
    import_section = rva_to_section (import_dir->VirtualAddress, nt_header);
  
***************
*** 776,782 ****
    /* Open the original (dumped) executable file for reference.  */
    if (!open_input_file (&in_file, in_filename))
      {
!       printf ("Failed to open %s (%d)...bailing.\n", 
              in_filename, GetLastError ());
        exit (1);
      }
--- 776,782 ----
    /* Open the original (dumped) executable file for reference.  */
    if (!open_input_file (&in_file, in_filename))
      {
!       printf ("Failed to open %s (%d)...bailing.\n",
              in_filename, GetLastError ());
        exit (1);
      }
***************
*** 786,792 ****
       which should fit in the alignment slop.  */
    if (!open_output_file (&out_file, out_filename, in_file.size))
      {
!       printf ("Failed to open %s (%d)...bailing.\n", 
              out_filename, GetLastError ());
        exit (1);
      }
--- 786,792 ----
       which should fit in the alignment slop.  */
    if (!open_output_file (&out_file, out_filename, in_file.size))
      {
!       printf ("Failed to open %s (%d)...bailing.\n",
              out_filename, GetLastError ());
        exit (1);
      }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]