- Replace some usages of KEBUGCHECK(0) with correct bug check codes.
authorFilip Navara <filip.navara@gmail.com>
Sun, 1 Aug 2004 21:57:35 +0000 (21:57 +0000)
committerFilip Navara <filip.navara@gmail.com>
Sun, 1 Aug 2004 21:57:35 +0000 (21:57 +0000)
svn path=/trunk/; revision=10345

15 files changed:
reactos/ntoskrnl/cc/copy.c
reactos/ntoskrnl/cc/fs.c
reactos/ntoskrnl/cc/view.c
reactos/ntoskrnl/dbg/kdb.c
reactos/ntoskrnl/include/internal/cc.h
reactos/ntoskrnl/io/pnpmgr.c
reactos/ntoskrnl/io/pnproot.c
reactos/ntoskrnl/io/rawfs.c
reactos/ntoskrnl/kd/kdebug.c
reactos/ntoskrnl/ke/apc.c
reactos/ntoskrnl/ke/main.c
reactos/ntoskrnl/ke/mutex.c
reactos/ntoskrnl/ke/process.c
reactos/ntoskrnl/mm/balance.c
reactos/ntoskrnl/ntoskrnl.mc

index 44a249b..fccf37e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: copy.c,v 1.28 2004/08/01 07:24:57 hbirr Exp $
+/* $Id: copy.c,v 1.29 2004/08/01 21:57:34 navaraf Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -54,13 +54,13 @@ CcInitCacheZeroPage(VOID)
    if (!NT_SUCCESS(Status))
    {
        DbgPrint("Can't allocate CcZeroPage.\n");
-       KEBUGCHECK(0);
+       KEBUGCHECKCC;
    }
    Status = MiZeroPage(CcZeroPage);
    if (!NT_SUCCESS(Status))
    {
        DbgPrint("Can't zero out CcZeroPage.\n");
-       KEBUGCHECK(0);
+       KEBUGCHECKCC;
    }
 }
 
index 8e8b3d5..118a9bf 100644 (file)
@@ -176,7 +176,7 @@ CcSetFileSizes (IN PFILE_OBJECT FileObject,
           else
           {
              DPRINT1("Anyone has referenced a cache segment behind the new size.\n");
-             KEBUGCHECK(0);
+             KEBUGCHECKCC;
           }
        }
      }
index 872914d..59bfd3c 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: view.c,v 1.73 2004/08/01 07:24:57 hbirr Exp $
+/* $Id: view.c,v 1.74 2004/08/01 21:57:34 navaraf Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/cc/view.c
@@ -407,7 +407,7 @@ CcRosMarkDirtyCacheSegment(PBCB Bcb, ULONG FileOffset)
   CacheSeg = CcRosLookupCacheSegment(Bcb, FileOffset);
   if (CacheSeg == NULL)
     {
-      KEBUGCHECK(0);
+      KEBUGCHECKCC;
     }
   if (!CacheSeg->Dirty)
     {
@@ -583,7 +583,7 @@ CcRosCreateCacheSegment(PBCB Bcb,
   if (StartingOffset == 0xffffffff)
   {
      DPRINT1("Out of CacheSeg mapping space\n");
-     KEBUGCHECK(0);
+     KEBUGCHECKCC;
   }
 
   current->BaseAddress = CiCacheSegMappingRegionBase + StartingOffset * PAGE_SIZE;
@@ -610,7 +610,7 @@ CcRosCreateCacheSegment(PBCB Bcb,
   MmUnlockAddressSpace(MmGetKernelAddressSpace());
   if (!NT_SUCCESS(Status))
   {
-     KEBUGCHECK(0);
+     KEBUGCHECKCC;
   }
 #endif
   Pfn = alloca(sizeof(PFN_TYPE) * (Bcb->CacheSegmentSize / PAGE_SIZE));
@@ -619,7 +619,7 @@ CcRosCreateCacheSegment(PBCB Bcb,
      Status = MmRequestPageMemoryConsumer(MC_CACHE, TRUE, &Pfn[i]);
      if (!NT_SUCCESS(Status))
      {
-       KEBUGCHECK(0);
+       KEBUGCHECKCC;
      }
   }
   Status = MmCreateVirtualMapping(NULL,
@@ -629,7 +629,7 @@ CcRosCreateCacheSegment(PBCB Bcb,
                                  Bcb->CacheSegmentSize / PAGE_SIZE);
   if (!NT_SUCCESS(Status))
   {
-    KEBUGCHECK(0);
+    KEBUGCHECKCC;
   }
   return(STATUS_SUCCESS);
 }
@@ -756,7 +756,7 @@ CcRosRequestCacheSegment(PBCB Bcb,
     {
       CPRINT("Bad fileoffset %x should be multiple of %x",
         FileOffset, Bcb->CacheSegmentSize);
-      KEBUGCHECK(0);
+      KEBUGCHECKCC;
     }
 
   return(CcRosGetCacheSegment(Bcb,
@@ -1244,7 +1244,7 @@ CmLazyCloseThreadMain(PVOID Ignored)
       if (!NT_SUCCESS(Status))
       {
          DbgPrint("LazyCloseThread: Wait failed\n");
-         KEBUGCHECK(0);
+         KEBUGCHECKCC;
          break;
       }
       if (LazyCloseThreadShouldTerminate)
@@ -1305,7 +1305,7 @@ CcInitView(VOID)
   MmUnlockAddressSpace(MmGetKernelAddressSpace());
   if (!NT_SUCCESS(Status))
     {
-      KEBUGCHECK(0);
+      KEBUGCHECKCC;
     }
 
   Buffer = ExAllocatePool(NonPagedPool, CI_CACHESEG_MAPPING_REGION_SIZE / (PAGE_SIZE * 8));
index 4aee56b..8a6a6a0 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: kdb.c,v 1.24 2004/08/01 11:40:37 weiden Exp $
+/* $Id: kdb.c,v 1.25 2004/08/01 21:57:34 navaraf Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/dbg/kdb.c
@@ -1423,7 +1423,7 @@ DbgRegsCommand(ULONG Argc, PCH Argv[], PKTRAP_FRAME Tf)
 ULONG
 DbgBugCheckCommand(ULONG Argc, PCH Argv[], PKTRAP_FRAME Tf)
 {
-  KEBUGCHECK(1);
+  KEBUGCHECK(0xDEADDEAD);
   return(1);
 }
 
index 5dc6c3e..1601c4a 100644 (file)
@@ -1,8 +1,9 @@
 #ifndef __INCLUDE_INTERNAL_CC_H
 #define __INCLUDE_INTERNAL_CC_H
-/* $Id: cc.h,v 1.19 2004/02/26 19:29:55 hbirr Exp $ */
-#include <ddk/ntifs.h>
 
+/* $Id: cc.h,v 1.20 2004/08/01 21:57:34 navaraf Exp $ */
+#include <ddk/ntifs.h>
+#include <reactos/bugcodes.h>
 
 typedef struct _BCB
 {
@@ -132,5 +133,13 @@ CcRosRequestCacheSegment (BCB*                 Bcb,
 NTSTATUS 
 CcTryToInitializeFileCache(PFILE_OBJECT FileObject);
 
+/*
+ * Macro for generic cache manage bugchecking. Note that this macro assumes
+ * that the file name including extension is always longer than 4 characters.
+ */
+#define KEBUGCHECKCC \
+    KEBUGCHECKEX(CACHE_MANAGER, \
+    (*(DWORD*)(__FILE__ + sizeof(__FILE__) - 4) << 16) | \
+    (__LINE__ & 0xFFFF), 0, 0, 0)
 
 #endif
index 5acc109..8f4b8d8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pnpmgr.c,v 1.30 2004/06/23 21:42:50 ion Exp $
+/* $Id: pnpmgr.c,v 1.31 2004/08/01 21:57:34 navaraf Exp $
  *
  * COPYRIGHT:      See COPYING in the top level directory
  * PROJECT:        ReactOS kernel
@@ -1432,7 +1432,7 @@ PnpInit(VOID)
    if (!NT_SUCCESS(Status))
    {
       CPRINT("IoCreateDriverObject() failed\n");
-      KEBUGCHECK(PHASE1_INITIALIZATION_FAILED);
+      KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
    }
 
    Status = IoCreateDevice(IopRootDriverObject, 0, NULL, FILE_DEVICE_CONTROLLER,
@@ -1440,14 +1440,14 @@ PnpInit(VOID)
    if (!NT_SUCCESS(Status))
    {
       CPRINT("IoCreateDevice() failed\n");
-      KEBUGCHECK(PHASE1_INITIALIZATION_FAILED);
+      KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
    }
 
    Status = IopCreateDeviceNode(NULL, Pdo, &IopRootDeviceNode);
    if (!NT_SUCCESS(Status))
    {
       CPRINT("Insufficient resources\n");
-      KEBUGCHECK(PHASE1_INITIALIZATION_FAILED);
+      KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
    }
 
    IopRootDeviceNode->Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE;
index 56323e4..e75a5c9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pnproot.c,v 1.21 2004/06/11 09:33:42 ekohl Exp $
+/* $Id: pnproot.c,v 1.22 2004/08/01 21:57:35 navaraf Exp $
  *
  * COPYRIGHT:      See COPYING in the top level directory
  * PROJECT:        ReactOS kernel
@@ -922,8 +922,7 @@ PnpRootAddDevice(
     TRUE,
     &PnpRootDeviceObject);
   if (!NT_SUCCESS(Status)) {
-    CPRINT("IoCreateDevice() failed with status 0x%X\n", Status);
-    KEBUGCHECK(PHASE1_INITIALIZATION_FAILED);
+    KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
   }
 
   DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)PnpRootDeviceObject->DeviceExtension;
@@ -940,12 +939,12 @@ PnpRootAddDevice(
 
   if (!PnpRootDeviceObject) {
     CPRINT("PnpRootDeviceObject 0x%X\n", PnpRootDeviceObject);
-    KEBUGCHECK(PHASE1_INITIALIZATION_FAILED);
+    KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
   }
 
   if (!PhysicalDeviceObject) {
     CPRINT("PhysicalDeviceObject 0x%X\n", PhysicalDeviceObject);
-    KEBUGCHECK(PHASE1_INITIALIZATION_FAILED);
+    KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
   }
 
   InitializeListHead(&DeviceExtension->DeviceListHead);
index 9074478..f340ab4 100755 (executable)
@@ -1,4 +1,4 @@
-/* $Id: rawfs.c,v 1.9 2003/12/30 18:52:04 fireball Exp $
+/* $Id: rawfs.c,v 1.10 2004/08/01 21:57:35 navaraf Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -889,7 +889,7 @@ RawFsDriverEntry(IN PDRIVER_OBJECT DriverObject,
   if (!NT_SUCCESS(Status))
     {
       CPRINT("IoCreateDevice() failed with status 0x%.08x\n", Status);
-      KEBUGCHECK(PHASE1_INITIALIZATION_FAILED);
+      KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
       return(Status);
     }
   DeviceData = DiskDeviceObject->DeviceExtension;
@@ -909,7 +909,7 @@ RawFsDriverEntry(IN PDRIVER_OBJECT DriverObject,
   if (!NT_SUCCESS(Status))
     {
       CPRINT("IoCreateDevice() failed with status 0x%.08x\n", Status);
-      KEBUGCHECK(PHASE1_INITIALIZATION_FAILED);
+      KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
       return(Status);
     }
   DeviceData = CdromDeviceObject->DeviceExtension;
@@ -928,8 +928,7 @@ RawFsDriverEntry(IN PDRIVER_OBJECT DriverObject,
     &TapeDeviceObject);
   if (!NT_SUCCESS(Status))
     {
-      CPRINT("IoCreateDevice() failed with status 0x%.08x\n", Status);
-      KEBUGCHECK(PHASE1_INITIALIZATION_FAILED);
+      KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
       return(Status);
     }
   DeviceData = TapeDeviceObject->DeviceExtension;
index 14affa2..f9af6d2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: kdebug.c,v 1.52 2004/06/23 00:49:43 ion Exp $
+/* $Id: kdebug.c,v 1.53 2004/08/01 21:57:35 navaraf Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -466,7 +466,7 @@ KdSystemDebugControl(ULONG Code)
   /* B - Bug check the system. */
   else if (Code == 1)
     {
-      KEBUGCHECK(0);
+      KEBUGCHECK(0xDEADDEAD);
     }
   /* 
    * C -  Dump statistics about the distribution of tagged blocks in 
index bb798bf..3f9e9c7 100644 (file)
@@ -35,6 +35,7 @@
 #include <internal/ke.h>
 #include <internal/ldr.h>
 #include <internal/pool.h>
+#include <reactos/bugcodes.h>
 
 #define NDEBUG
 #include <internal/debug.h>
@@ -108,7 +109,8 @@ KiDeliverNormalApc(VOID)
        if (Apc->NormalRoutine == NULL)
         {
           DbgPrint("Exiting kernel with kernel APCs pending.\n");
-          KEBUGCHECK(0);
+          KEBUGCHECKEX(KERNEL_APC_PENDING_DURING_EXIT, (ULONG)Apc,
+                       Thread->Tcb.KernelApcDisable, oldlvl, 0);
         }
        Apc->Inserted = FALSE;
        Thread->Tcb.ApcState.KernelApcInProgress++;
@@ -677,8 +679,8 @@ KiSwapApcEnvironment(
   }
   else
   {
-    KEBUGCHECK(0);
+    /* FIXME: Is this the correct bug code? */
+    KEBUGCHECK(APC_INDEX_MISMATCH);
   }
-
 }
 
index 31fbe9b..5a8921d 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: main.c,v 1.189 2004/07/30 19:28:48 jimtabor Exp $
+/* $Id: main.c,v 1.190 2004/08/01 21:57:35 navaraf Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/ke/main.c
@@ -276,7 +276,7 @@ InitSystemSharedUserPage (PCSZ ParameterLine)
    if (BootDriveFound == FALSE)
      {
        DbgPrint("No system drive found!\n");
-       KEBUGCHECK (0x0);
+       KEBUGCHECK (NO_BOOT_DEVICE);
      }
 }
 
index c26296c..016b380 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: mutex.c,v 1.15 2003/11/02 01:15:15 ekohl Exp $
+/* $Id: mutex.c,v 1.16 2004/08/01 21:57:35 navaraf Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/ke/mutex.c
@@ -32,6 +32,7 @@
 #include <internal/ke.h>
 #include <internal/ps.h>
 #include <internal/id.h>
+#include <reactos/bugcodes.h> 
 
 #include <internal/debug.h>
 
@@ -77,7 +78,7 @@ KeReleaseMutex(IN PKMUTEX Mutex,
   if (Mutex->OwnerThread != KeGetCurrentThread())
     {
       DbgPrint("THREAD_NOT_MUTEX_OWNER: Mutex %p\n", Mutex);
-      KEBUGCHECK(0); /* THREAD_NOT_MUTEX_OWNER */
+      KEBUGCHECK(THREAD_NOT_MUTEX_OWNER);
     }
   Mutex->Header.SignalState++;
   assert(Mutex->Header.SignalState <= 1);
@@ -176,7 +177,7 @@ KeReleaseMutant(IN PKMUTANT Mutant,
          DbgPrint("THREAD_NOT_MUTEX_OWNER: Mutant->OwnerThread %p CurrentThread %p\n",
                   Mutant->OwnerThread,
                   KeGetCurrentThread());
-         KEBUGCHECK(0); /* THREAD_NOT_MUTEX_OWNER */
+         KEBUGCHECK(THREAD_NOT_MUTEX_OWNER);
        }
       Mutant->Header.SignalState++;
       assert(Mutant->Header.SignalState <= 1);
index 6b30bac..321fc24 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: process.c,v 1.21 2004/08/01 07:24:59 hbirr Exp $
+/* $Id: process.c,v 1.22 2004/08/01 21:57:35 navaraf Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/ke/process.c
@@ -33,6 +33,7 @@
 #include <internal/ke.h>
 #include <internal/mm.h>
 #include <internal/ps.h>
+#include <reactos/bugcodes.h>
 
 #define NDEBUG
 #include <internal/debug.h>
@@ -57,7 +58,7 @@ KeAttachProcess (PEPROCESS Process)
    if (CurrentThread->OldProcess != NULL)
      {
        DbgPrint("Invalid attach (thread is already attached)\n");
-       KEBUGCHECK(0);
+       KEBUGCHECK(INVALID_PROCESS_ATTACH_ATTEMPT);
      }
    
    KeRaiseIrql(DISPATCH_LEVEL, &oldlvl);
@@ -102,7 +103,7 @@ KeDetachProcess (VOID)
    if (CurrentThread->OldProcess == NULL)
      {
        DbgPrint("Invalid detach (thread was not attached)\n");
-       KEBUGCHECK(0);
+       KEBUGCHECK(INVALID_PROCESS_DETACH_ATTEMPT);
      }
    
    KeRaiseIrql(DISPATCH_LEVEL, &oldlvl);
index 5eb7557..4252706 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: balance.c,v 1.31 2004/08/01 07:24:57 hbirr Exp $
+/* $Id: balance.c,v 1.32 2004/08/01 21:57:35 navaraf Exp $
  *
  * PROJECT:     ReactOS kernel 
  * FILE:        ntoskrnl/mm/balance.c
@@ -31,6 +31,7 @@
 #include <ddk/ntddk.h>
 #include <internal/mm.h>
 #include <ntos/minmax.h>
+#include <reactos/bugcodes.h>
 
 #define NDEBUG
 #include <internal/debug.h>
@@ -219,7 +220,7 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait,
       Page = MmAllocPage(Consumer, 0);
       if (Page == 0)
       {
-         KEBUGCHECK(0);
+         KEBUGCHECK(NO_PAGES_AVAILABLE);
       }
       *AllocatedPage = Page;
       if (MmStats.NrFreePages <= MiMinimumAvailablePages &&
@@ -267,7 +268,7 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait,
       Page = Request.Page;
       if (Page == 0)
       {
-         KEBUGCHECK(0);
+         KEBUGCHECK(NO_PAGES_AVAILABLE);
       }
       MmTransferOwnershipPage(Page, Consumer);
       *AllocatedPage = Page;
@@ -281,7 +282,7 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait,
    Page = MmAllocPage(Consumer, 0);
    if (Page == 0)
    {
-      KEBUGCHECK(0);
+      KEBUGCHECK(NO_PAGES_AVAILABLE);
    }
    *AllocatedPage = Page;
 
@@ -368,7 +369,7 @@ MiBalancerThread(PVOID Unused)
       }
       else
       {
-         DPRINT1("KeWaitForMultipleObjects failt, status = %x\n", Status);
+         DPRINT1("KeWaitForMultipleObjects failed, status = %x\n", Status);
          KEBUGCHECK(0);
       }
    }
index 4cf04a1..80e551e 100644 (file)
@@ -631,7 +631,13 @@ Language=English
 MAILSLOT_FILE_SYSTEM
 .
 
-
+MessageId=0x53
+Severity=Success
+Facility=System
+SymbolicName=NO_BOOT_DEVICE
+Language=English
+NO_BOOT_DEVICE
+.
 
 MessageId=0x54
 Severity=Success
@@ -973,9 +979,6 @@ Language=English
 SPIN_LOCK_INIT_FAILURE
 .
 
-
-
-
 MessageId=0x9A
 Severity=Informational
 Facility=System