[NTOS:MM] ExFreePoolWithTag(): Accept tag mismatch, on release build only (#1334)
authorSerge Gautherie <32623169+SergeGautherie@users.noreply.github.com>
Thu, 7 Feb 2019 15:57:56 +0000 (16:57 +0100)
committerHermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Thu, 7 Feb 2019 15:57:56 +0000 (16:57 +0100)
"Release" builds should not BSoD on 'Freeing pool - invalid tag specified' case,
this is compatible with Windows behaviour.
Nothing changes otherwise concerning the "Debug" builds, where pool-tag mismatch
triggers a BSoD as expected.

CORE-15446

ntoskrnl/mm/ARM3/expool.c

index 9625e50..416a2fb 100644 (file)
@@ -2558,7 +2558,9 @@ ExFreePoolWithTag(IN PVOID P,
         if (TagToFree && TagToFree != Tag)
         {
             DPRINT1("Freeing pool - invalid tag specified: %.4s != %.4s\n", (char*)&TagToFree, (char*)&Tag);
+#if DBG
             KeBugCheckEx(BAD_POOL_CALLER, 0x0A, (ULONG_PTR)P, Tag, TagToFree);
+#endif
         }
 
         //
@@ -2640,7 +2642,9 @@ ExFreePoolWithTag(IN PVOID P,
     if (TagToFree && TagToFree != Tag)
     {
         DPRINT1("Freeing pool - invalid tag specified: %.4s != %.4s\n", (char*)&TagToFree, (char*)&Tag);
+#if DBG
         KeBugCheckEx(BAD_POOL_CALLER, 0x0A, (ULONG_PTR)P, Tag, TagToFree);
+#endif
     }
 
     //