Patches are to ntheap.h, ntheap.c, and unexnt.c: ntheap.h.dif: ============================================================ 29,36d28 < /* Items that are expected to be preserved across the dump/load < * operations must be initialized to non-zero values so the compiler < * will put them in an initialized data section, not an uninitialized < * BSS section. < */ < #define UNINIT_PTR ((void *) 0xF0F0F005L) < #define UNINIT_LONG (-1L) < #define UNINIT_ULONG (0xF0F0F0F0L) ntheap.c.dif: ============================================================ 82,91c82,86 < /* These items are expected to be preserved across the dump/load operations, < * so they must be initialized to non-zero values so the compiler will < * put them in an initialized data section, not an uninitialized BSS < * section. < */ < unsigned char *data_region_base = UNINIT_PTR; < unsigned char *data_region_end = UNINIT_PTR; < unsigned char *real_data_region_end = UNINIT_PTR; < unsigned long data_region_size = UNINIT_ULONG; < unsigned long reserved_heap_size = UNINIT_ULONG; --- > unsigned char *data_region_base = NULL; > unsigned char *data_region_end = NULL; > unsigned char *real_data_region_end = NULL; > unsigned long data_region_size = 0; > unsigned long reserved_heap_size = 0; 181c176 < if (data_region_base == UNINIT_PTR) --- > if (!data_region_base) 211c206 < if (((data_region_end - NULL) - size) < (data_region_base - NULL)) --- > if ((data_region_end - size) < data_region_base) 234,235c229,230 < if (((data_region_end + size) - NULL) > < ((data_region_base + get_reserved_heap_size ()) - NULL)) --- > if ((data_region_end + size) > > (data_region_base + get_reserved_heap_size ())) 262d256 < 271d264 < unexnt.c.dif: ============================================================ 43,46c43 < /* NOTE the hack: make this an array with an initializer so it\ < * doesn't get stuck in the (uninitialized) BSS space. < */ < BOOL need_to_recreate_heap[2] = {FALSE, TRUE}; --- > BOOL need_to_recreate_heap = FALSE; 47a45,47 > /* So we can find our heap in the file to recreate it. */ > unsigned long heap_index_in_executable = 0; > 57,64c57,59 < /* These items are expected to be preserved across the dump/load operations, < * so they must be initialized to non-zero values so the compiler will < * put them in an initialized data section, not an uninitialized BSS < * section. < */ < PUCHAR data_start_va = UNINIT_PTR; < DWORD data_start_file = UNINIT_LONG; < DWORD data_size = UNINIT_LONG; --- > PUCHAR data_start_va = 0; > DWORD data_start_file = 0; > DWORD data_size = 0; 67,68c62,63 < PUCHAR bss_start = UNINIT_PTR; < DWORD bss_size = UNINIT_LONG; --- > PUCHAR bss_start = 0; > DWORD bss_size = 0; 70,72d64 < /* So we can find our heap in the file to recreate it. */ < unsigned long heap_index_in_executable = UNINIT_ULONG; < 97c89 < if (need_to_recreate_heap[0]) --- > if (need_to_recreate_heap) 107c99 < need_to_recreate_heap[0] = FALSE; --- > need_to_recreate_heap = FALSE; 171c163 < need_to_recreate_heap[0] = TRUE; --- > need_to_recreate_heap = TRUE; 399c391 < if (bss_start == UNINIT_PTR && bss_size == UNINIT_LONG) --- > if (!bss_start && !bss_size)