diff options
Diffstat (limited to 'nt/addsection.c')
-rw-r--r-- | nt/addsection.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/nt/addsection.c b/nt/addsection.c index dfbc2804208..df9d320bbfd 100644 --- a/nt/addsection.c +++ b/nt/addsection.c @@ -37,9 +37,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. PIMAGE_NT_HEADERS (__stdcall * pfnCheckSumMappedFile) (LPVOID BaseAddress, - DWORD FileLength, - LPDWORD HeaderSum, - LPDWORD CheckSum); + DWORD FileLength, + LPDWORD HeaderSum, + LPDWORD CheckSum); #undef min #undef max @@ -50,15 +50,15 @@ PIMAGE_NT_HEADERS /* File handling. */ typedef struct file_data { - char *name; - unsigned long size; - HANDLE file; - HANDLE file_mapping; - unsigned char *file_base; + const char *name; + unsigned long size; + HANDLE file; + HANDLE file_mapping; + unsigned char *file_base; } file_data; int -open_input_file (file_data *p_file, char *filename) +open_input_file (file_data *p_file, const char *filename) { HANDLE file; HANDLE file_mapping; @@ -90,7 +90,7 @@ open_input_file (file_data *p_file, char *filename) } int -open_output_file (file_data *p_file, char *filename, unsigned long size) +open_output_file (file_data *p_file, const char *filename, unsigned long size) { HANDLE file; HANDLE file_mapping; @@ -146,7 +146,7 @@ get_unrounded_section_size (PIMAGE_SECTION_HEADER p_section) /* Return pointer to section header for named section. */ IMAGE_SECTION_HEADER * -find_section (char * name, IMAGE_NT_HEADERS * nt_header) +find_section (const char *name, IMAGE_NT_HEADERS *nt_header) { PIMAGE_SECTION_HEADER section; int i; @@ -260,7 +260,7 @@ relocate_offset (DWORD offset, #define PTR_TO_RVA(ptr) ((DWORD)(ptr) - (DWORD) GetModuleHandle (NULL)) #define PTR_TO_OFFSET(ptr, pfile_data) \ - ((unsigned char *)(ptr) - (pfile_data)->file_base) + ((unsigned const char *)(ptr) - (pfile_data)->file_base) #define OFFSET_TO_PTR(offset, pfile_data) \ ((pfile_data)->file_base + (DWORD)(offset)) @@ -272,7 +272,7 @@ relocate_offset (DWORD offset, static void copy_executable_and_add_section (file_data *p_infile, file_data *p_outfile, - char *new_section_name, + const char *new_section_name, DWORD new_section_size) { unsigned char *dst; @@ -287,7 +287,7 @@ copy_executable_and_add_section (file_data *p_infile, #define COPY_CHUNK(message, src, size, verbose) \ do { \ - unsigned char *s = (void *)(src); \ + unsigned const char *s = (void *)(src); \ unsigned long count = (size); \ if (verbose) \ { \ |