while (TRUE); (when something is unimplemented) ---> ASSERT(FALSE); // while (TRUE...
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 4 Jan 2013 12:31:46 +0000 (12:31 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 4 Jan 2013 12:31:46 +0000 (12:31 +0000)
and in some cases, return an adequate value. In some places however, I add an ASSERT(FALSE); before keeping the while (TRUE); in critical regions.

(Only x86, as well as in r58110). More ASSERTS (in debug mode) or BSODs may appear, instead of having hung threads.

Part 1-bis/2

svn path=/trunk/; revision=58111

15 files changed:
reactos/lib/cmlib/hivecell.c
reactos/ntoskrnl/cache/cachesub.c
reactos/ntoskrnl/cache/copysup.c
reactos/ntoskrnl/cache/fssup.c
reactos/ntoskrnl/cache/logsup.c
reactos/ntoskrnl/include/internal/i386/ke.h
reactos/ntoskrnl/io/iomgr/irp.c
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
reactos/ntoskrnl/kd64/amd64/kdx64.c
reactos/ntoskrnl/kd64/arm/kdarm.c
reactos/ntoskrnl/ke/bug.c
reactos/ntoskrnl/ke/dpc.c
reactos/ntoskrnl/ke/i386/context.c
reactos/ntoskrnl/ke/i386/traphdlr.c
reactos/ntoskrnl/po/povolume.c

index c3e3dbe..3c82b45 100644 (file)
@@ -549,7 +549,7 @@ HvTrackCellRef(PHV_TRACK_CELL_REF CellRef,
 
     /* FIXME: TODO */
     DPRINT1("ERROR: Too many references\n");
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return FALSE;
 }
 
index f9a949d..0431a56 100644 (file)
@@ -132,7 +132,7 @@ CcGetFlushedValidData(IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
 {
     LARGE_INTEGER Result = {{0}};
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return Result;
 }
 
index eb344ee..be2af04 100644 (file)
@@ -122,7 +122,7 @@ CcFastCopyRead(IN PFILE_OBJECT FileObject,
                OUT PIO_STATUS_BLOCK IoStatus)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 BOOLEAN
@@ -209,7 +209,7 @@ CcFastCopyWrite(IN PFILE_OBJECT FileObject,
                 IN PVOID Buffer)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 BOOLEAN
@@ -220,7 +220,7 @@ CcCanIWrite(IN PFILE_OBJECT FileObject,
             IN UCHAR Retrying)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return FALSE;
 }
 
@@ -234,7 +234,7 @@ CcDeferWrite(IN PFILE_OBJECT FileObject,
              IN BOOLEAN Retrying)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 /* EOF */
index 4b4bc15..f816100 100644 (file)
@@ -399,7 +399,7 @@ CcSetDirtyPageThreshold(IN PFILE_OBJECT FileObject,
                         IN ULONG DirtyPageThreshold)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 /*
index 6c5f354..cb4f78a 100644 (file)
@@ -24,7 +24,7 @@ CcSetAdditionalCacheAttributes(IN PFILE_OBJECT FileObject,
                                IN BOOLEAN DisableWriteBehind)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -48,7 +48,7 @@ CcGetDirtyPages(IN PVOID LogHandle,
 {
     LARGE_INTEGER Result = {{0}};
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return Result;
 }
 \f
@@ -57,7 +57,7 @@ NTAPI
 CcIsThereDirtyData(IN PVPB Vpb)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return FALSE;
 }
 
@@ -68,7 +68,7 @@ CcGetLsnForFileObject(IN PFILE_OBJECT FileObject,
 {
     LARGE_INTEGER Result = {{0}};
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return Result;
 }
 
index 8363477..7e81de3 100644 (file)
@@ -138,8 +138,8 @@ typedef union _KTRAP_EXIT_SKIP_BITS
     {                                               \
         /* Not yet handled */                       \
         UNIMPLEMENTED;                              \
-        while (TRUE);                               \
-        return TRUE;                                \
+        ASSERT(FALSE); /* while (TRUE); */          \
+        return FALSE;                               \
     }
 
 C_ASSERT(NPX_FRAME_LENGTH == sizeof(FX_SAVE_AREA));
index f88e80f..f19b496 100644 (file)
@@ -266,7 +266,8 @@ IopCompleteRequest(IN PKAPC Apc,
         {
             /* We should never get this yet */
             DPRINT1("Reparse support not yet present!\n");
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
+            return;
         }
     }
 
@@ -1373,7 +1374,7 @@ IofCompleteRequest(IN PIRP Irp,
 #else
             /* Not implemented yet. */
             DPRINT1("Not supported!\n");
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
 #endif
         }
 
index cd998bb..54e5c41 100644 (file)
@@ -3784,7 +3784,7 @@ PiGetDeviceRegistryProperty(IN PDEVICE_OBJECT DeviceObject,
 
 #define PIP_RETURN_DATA(x, y)   {ReturnLength = x; Data = y; Status = STATUS_SUCCESS; break;}
 #define PIP_REGISTRY_DATA(x, y) {ValueName = x; ValueType = y; break;}
-#define PIP_UNIMPLEMENTED()     {UNIMPLEMENTED; ASSERT(FALSE); break;} // while(TRUE);
+#define PIP_UNIMPLEMENTED()     {UNIMPLEMENTED; ASSERT(FALSE); /* while (TRUE); */ break;}
 
 /*
  * @implemented
index df27345..a496fd7 100644 (file)
@@ -140,7 +140,7 @@ KdpSysReadBusData(IN ULONG BusDataType,
                   OUT PULONG ActualLength)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -155,7 +155,7 @@ KdpSysWriteBusData(IN ULONG BusDataType,
                    OUT PULONG ActualLength)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -358,7 +358,7 @@ NTAPI
 KdpSysCheckLowMemory(IN ULONG Flags)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -367,6 +367,6 @@ NTAPI
 KdpAllowDisable(VOID)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_ACCESS_DENIED;
 }
index 32a82eb..35f9211 100644 (file)
@@ -23,7 +23,7 @@ KdpGetStateChange(IN PDBGKD_MANIPULATE_STATE64 State,
                   IN PCONTEXT Context)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -32,7 +32,7 @@ KdpSetContextState(IN PDBGKD_ANY_WAIT_STATE_CHANGE WaitStateChange,
                    IN PCONTEXT Context)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 NTSTATUS
@@ -41,7 +41,7 @@ KdpSysReadMsr(IN ULONG Msr,
               OUT PLARGE_INTEGER MsrValue)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -51,7 +51,7 @@ KdpSysWriteMsr(IN ULONG Msr,
                IN PLARGE_INTEGER MsrValue)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -66,7 +66,7 @@ KdpSysReadBusData(IN ULONG BusDataType,
                   OUT PULONG ActualLength)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -81,7 +81,7 @@ KdpSysWriteBusData(IN ULONG BusDataType,
                    OUT PULONG ActualLength)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -94,7 +94,7 @@ KdpSysReadControlSpace(IN ULONG Processor,
                        OUT PULONG ActualLength)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -107,7 +107,7 @@ KdpSysWriteControlSpace(IN ULONG Processor,
                         OUT PULONG ActualLength)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -122,7 +122,7 @@ KdpSysReadIoSpace(IN ULONG InterfaceType,
                   OUT PULONG ActualDataSize)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -137,7 +137,7 @@ KdpSysWriteIoSpace(IN ULONG InterfaceType,
                    OUT PULONG ActualDataSize)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -146,7 +146,7 @@ NTAPI
 KdpSysCheckLowMemory(IN ULONG Flags)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -155,6 +155,6 @@ NTAPI
 KdpAllowDisable(VOID)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_ACCESS_DENIED;
 }
index 641c544..d701444 100644 (file)
@@ -1178,6 +1178,7 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
     KiBugCheckDebugBreak(DBG_STATUS_BUGCHECK_SECOND);
 
     /* Shouldn't get here */
+    ASSERT(FALSE);
     while (TRUE);
 }
 
index d507b72..577fefb 100644 (file)
@@ -780,6 +780,7 @@ KeInsertQueueDpc(IN PKDPC Dpc,
             {
                 /* FIXME: Setup Threaded DPC */
                 DPRINT1("Threaded DPC not supported\n");
+                ASSERT(FALSE);
                 while (TRUE);
             }
         }
index 085e9ae..cd36a14 100644 (file)
@@ -36,7 +36,8 @@ KiSwapProcess(IN PKPROCESS NewProcess,
     {
         /* Not handled yet */
         UNIMPLEMENTED;
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
+        return;
     }
     
     /* Update CR3 */
index 835d8e7..2bd9a46 100644 (file)
@@ -663,6 +663,7 @@ KiTrap06Handler(IN PKTRAP_FRAME TrapFrame)
         {
             /* Should only happen in VDM mode */
             UNIMPLEMENTED;
+            ASSERT(FALSE);
             while (TRUE);
         }
         
@@ -735,6 +736,7 @@ KiTrap07Handler(IN PKTRAP_FRAME TrapFrame)
         {
             /* Not implemented */
             UNIMPLEMENTED;
+            ASSERT(FALSE);
             while (TRUE);
         }
     
@@ -921,6 +923,7 @@ KiTrap0DHandler(IN PKTRAP_FRAME TrapFrame)
         {
             /* Should only happen in VDM mode */
             UNIMPLEMENTED;
+            ASSERT(FALSE);
             while (TRUE);
         }
         
@@ -1077,6 +1080,7 @@ KiTrap0DHandler(IN PKTRAP_FRAME TrapFrame)
     {
         /* Not implemented */
         UNIMPLEMENTED;
+        ASSERT(FALSE);
         while (TRUE);
     }
 
@@ -1133,6 +1137,7 @@ KiTrap0DHandler(IN PKTRAP_FRAME TrapFrame)
         {
             /* Otherwise, this is another kind of IRET fault */
             UNIMPLEMENTED;
+            ASSERT(FALSE);
             while (TRUE);
         }
     }
@@ -1191,6 +1196,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
         {
             /* The stack is somewhere in between frames, we need to fix it */
             UNIMPLEMENTED;
+            ASSERT(FALSE);
             while (TRUE);
         }
     }
@@ -1256,6 +1262,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
     {
         /* Not yet implemented */
         UNIMPLEMENTED;
+        ASSERT(FALSE);
         while (TRUE);
     }
 #endif
@@ -1439,7 +1446,7 @@ FASTCALL
 KiGetTickCountHandler(IN PKTRAP_FRAME TrapFrame)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -1447,7 +1454,7 @@ FASTCALL
 KiCallbackReturnHandler(IN PKTRAP_FRAME TrapFrame)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 DECLSPEC_NORETURN
@@ -1618,6 +1625,7 @@ KiSystemCall(IN PKTRAP_FRAME TrapFrame,
     {
         /* Access violation */
         UNIMPLEMENTED;
+        ASSERT(FALSE);
         while (TRUE);
     }
     
@@ -1683,6 +1691,7 @@ Kei386EoiHelper(VOID)
 {
     /* We should never see this call happening */
     DPRINT1("Mismatched NT/HAL version");
+    ASSERT(FALSE);
     while (TRUE);
 }
 
index 7700302..13da03a 100644 (file)
@@ -300,7 +300,9 @@ PopFlushVolumes(IN BOOLEAN ShuttingDown)
     {
         /* ReactOS only implements this routine for shutdown, which requires it */
         UNIMPLEMENTED;
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
+        KeReleaseGuardedMutex(&PopVolumeLock);
+        return;
     }
 
     /* Check if there were no volumes at all */