From c6e44cc971519f90fa76da3d3f939f7589002145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Tue, 4 Aug 2015 19:46:52 +0000 Subject: [PATCH] [NTVDM]: By default, disable run-time DOS memory arena integrity checks (which was introduced along with UMB stuff in r68586). svn path=/trunk/; revision=68596 --- reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/memory.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/memory.c b/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/memory.c index e17a36d9684..6c22e1edeef 100644 --- a/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/memory.c +++ b/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/memory.c @@ -26,6 +26,13 @@ #define FIRST_MCB_SEGMENT (SYSTEM_ENV_BLOCK + 0x200) // old value: 0x1000 #define USER_MEMORY_SIZE (0x9FFE - FIRST_MCB_SEGMENT) +/* + * Activate this line if you want run-time DOS memory arena integrity validation + * (useful to know whether this is an application, or DOS kernel itself, which + * messes up the DOS memory arena). + */ +// #define DBG_MEMORY + /* PRIVATE VARIABLES **********************************************************/ /* PUBLIC VARIABLES ***********************************************************/ @@ -41,6 +48,7 @@ static inline BOOLEAN ValidateMcb(PDOS_MCB Mcb) * This is a helper function to help us detecting * when the DOS arena starts to become corrupted. */ +#ifdef DBG_MEMORY static VOID DosMemValidate(VOID) { WORD PrevSegment, Segment = SysVars->FirstMcb; @@ -68,6 +76,9 @@ static VOID DosMemValidate(VOID) Segment += CurrentMcb->Size + 1; } } +#else +#define DosMemValidate() +#endif static VOID DosCombineFreeBlocks(WORD StartBlock) {