Skip to content

Commit

Permalink
xglobals: Enable HeapEnableTerminationOnCorruption for debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
lhmouse committed Dec 6, 2024
1 parent d46aa3c commit 6e2f6c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ and unlocks the primitive mutex, releasing all threads that are waiting on it.
|`HeapAlloc` |KERNEL32 |[Windows API](https://learn.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heapalloc) |
|`HeapFree` |KERNEL32 |[Windows API](https://learn.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heapfree) |
|`HeapReAlloc` |KERNEL32 |[Windows API](https://learn.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heaprealloc) |
|`HeapSetInformation` |KERNEL32 |[Windows API](https://learn.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heapsetinformation) |
|`HeapSize` |KERNEL32 |[Windows API](https://learn.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heapsize) |
|`NtClose` |NTDLL |[Windows Driver API](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-zwclose) |
|`NtCreateSection` |NTDLL |[Windows Driver API](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-zwcreatesection) |
Expand Down
3 changes: 3 additions & 0 deletions mcfgthread/xglobals.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ __MCF_gthread_initialize_globals(void)
/* Initialize static global constants. */
GetSystemInfo(&__MCF_crt_sysinfo);

#ifdef __MCF_DEBUG
__MCF_CHECK(HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, __MCF_nullptr, 0));
#endif
__MCF_crt_heap = GetProcessHeap();
__MCF_CHECK(__MCF_crt_heap);

Expand Down

0 comments on commit 6e2f6c3

Please sign in to comment.