Author: hbelusca
Date: Fri Jan 4 12:31:46 2013
New Revision: 58111
URL:
http://svn.reactos.org/svn/reactos?rev=58111&view=rev
Log:
while (TRUE); (when something is unimplemented) ---> ASSERT(FALSE); // while (TRUE);
(unless we deal with a 'noreturn' function),
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
Modified:
trunk/reactos/lib/cmlib/hivecell.c
trunk/reactos/ntoskrnl/cache/cachesub.c
trunk/reactos/ntoskrnl/cache/copysup.c
trunk/reactos/ntoskrnl/cache/fssup.c
trunk/reactos/ntoskrnl/cache/logsup.c
trunk/reactos/ntoskrnl/include/internal/i386/ke.h
trunk/reactos/ntoskrnl/io/iomgr/irp.c
trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
trunk/reactos/ntoskrnl/kd64/amd64/kdx64.c
trunk/reactos/ntoskrnl/kd64/arm/kdarm.c
trunk/reactos/ntoskrnl/ke/bug.c
trunk/reactos/ntoskrnl/ke/dpc.c
trunk/reactos/ntoskrnl/ke/i386/context.c
trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
trunk/reactos/ntoskrnl/po/povolume.c
Modified: trunk/reactos/lib/cmlib/hivecell.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivecell.c?rev=5…
==============================================================================
--- trunk/reactos/lib/cmlib/hivecell.c [iso-8859-1] (original)
+++ trunk/reactos/lib/cmlib/hivecell.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -549,7 +549,7 @@
/* FIXME: TODO */
DPRINT1("ERROR: Too many references\n");
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return FALSE;
}
Modified: trunk/reactos/ntoskrnl/cache/cachesub.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/cachesub.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/cache/cachesub.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/cachesub.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -132,7 +132,7 @@
{
LARGE_INTEGER Result = {{0}};
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return Result;
}
Modified: trunk/reactos/ntoskrnl/cache/copysup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/copysup.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/cache/copysup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/copysup.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -122,7 +122,7 @@
OUT PIO_STATUS_BLOCK IoStatus)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
}
BOOLEAN
@@ -209,7 +209,7 @@
IN PVOID Buffer)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
}
BOOLEAN
@@ -220,7 +220,7 @@
IN UCHAR Retrying)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return FALSE;
}
@@ -234,7 +234,7 @@
IN BOOLEAN Retrying)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
}
/* EOF */
Modified: trunk/reactos/ntoskrnl/cache/fssup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/fssup.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/cache/fssup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/fssup.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -399,7 +399,7 @@
IN ULONG DirtyPageThreshold)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
}
/*
Modified: trunk/reactos/ntoskrnl/cache/logsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/logsup.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/cache/logsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/logsup.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -24,7 +24,7 @@
IN BOOLEAN DisableWriteBehind)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
}
VOID
@@ -48,7 +48,7 @@
{
LARGE_INTEGER Result = {{0}};
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return Result;
}
@@ -57,7 +57,7 @@
CcIsThereDirtyData(IN PVPB Vpb)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return FALSE;
}
@@ -68,7 +68,7 @@
{
LARGE_INTEGER Result = {{0}};
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return Result;
}
Modified: trunk/reactos/ntoskrnl/include/internal/i386/ke.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] Fri Jan 4 12:31:46
2013
@@ -138,8 +138,8 @@
{ \
/* Not yet handled */ \
UNIMPLEMENTED; \
- while (TRUE); \
- return TRUE; \
+ ASSERT(FALSE); /* while (TRUE); */ \
+ return FALSE; \
}
C_ASSERT(NPX_FRAME_LENGTH == sizeof(FX_SAVE_AREA));
Modified: trunk/reactos/ntoskrnl/io/iomgr/irp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/irp.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -266,7 +266,8 @@
{
/* We should never get this yet */
DPRINT1("Reparse support not yet present!\n");
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
+ return;
}
}
@@ -1373,7 +1374,7 @@
#else
/* Not implemented yet. */
DPRINT1("Not supported!\n");
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
#endif
}
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -3784,7 +3784,7 @@
#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
Modified: trunk/reactos/ntoskrnl/kd64/amd64/kdx64.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/amd64/kdx64.…
==============================================================================
--- trunk/reactos/ntoskrnl/kd64/amd64/kdx64.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/kd64/amd64/kdx64.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -140,7 +140,7 @@
OUT PULONG ActualLength)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_UNSUCCESSFUL;
}
@@ -155,7 +155,7 @@
OUT PULONG ActualLength)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_UNSUCCESSFUL;
}
@@ -358,7 +358,7 @@
KdpSysCheckLowMemory(IN ULONG Flags)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_UNSUCCESSFUL;
}
@@ -367,6 +367,6 @@
KdpAllowDisable(VOID)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_ACCESS_DENIED;
}
Modified: trunk/reactos/ntoskrnl/kd64/arm/kdarm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/arm/kdarm.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/kd64/arm/kdarm.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/kd64/arm/kdarm.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -23,7 +23,7 @@
IN PCONTEXT Context)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
}
VOID
@@ -32,7 +32,7 @@
IN PCONTEXT Context)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
}
NTSTATUS
@@ -41,7 +41,7 @@
OUT PLARGE_INTEGER MsrValue)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_UNSUCCESSFUL;
}
@@ -51,7 +51,7 @@
IN PLARGE_INTEGER MsrValue)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_UNSUCCESSFUL;
}
@@ -66,7 +66,7 @@
OUT PULONG ActualLength)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_UNSUCCESSFUL;
}
@@ -81,7 +81,7 @@
OUT PULONG ActualLength)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_UNSUCCESSFUL;
}
@@ -94,7 +94,7 @@
OUT PULONG ActualLength)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_UNSUCCESSFUL;
}
@@ -107,7 +107,7 @@
OUT PULONG ActualLength)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_UNSUCCESSFUL;
}
@@ -122,7 +122,7 @@
OUT PULONG ActualDataSize)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_UNSUCCESSFUL;
}
@@ -137,7 +137,7 @@
OUT PULONG ActualDataSize)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_UNSUCCESSFUL;
}
@@ -146,7 +146,7 @@
KdpSysCheckLowMemory(IN ULONG Flags)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_UNSUCCESSFUL;
}
@@ -155,6 +155,6 @@
KdpAllowDisable(VOID)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
return STATUS_ACCESS_DENIED;
}
Modified: trunk/reactos/ntoskrnl/ke/bug.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/bug.c?rev=5811…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/bug.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/bug.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -1178,6 +1178,7 @@
KiBugCheckDebugBreak(DBG_STATUS_BUGCHECK_SECOND);
/* Shouldn't get here */
+ ASSERT(FALSE);
while (TRUE);
}
Modified: trunk/reactos/ntoskrnl/ke/dpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/dpc.c?rev=5811…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/dpc.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/dpc.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -780,6 +780,7 @@
{
/* FIXME: Setup Threaded DPC */
DPRINT1("Threaded DPC not supported\n");
+ ASSERT(FALSE);
while (TRUE);
}
}
Modified: trunk/reactos/ntoskrnl/ke/i386/context.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/context.c…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/context.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/context.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -36,7 +36,8 @@
{
/* Not handled yet */
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
+ return;
}
/* Update CR3 */
Modified: trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/traphdlr.…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -663,6 +663,7 @@
{
/* Should only happen in VDM mode */
UNIMPLEMENTED;
+ ASSERT(FALSE);
while (TRUE);
}
@@ -735,6 +736,7 @@
{
/* Not implemented */
UNIMPLEMENTED;
+ ASSERT(FALSE);
while (TRUE);
}
@@ -921,6 +923,7 @@
{
/* Should only happen in VDM mode */
UNIMPLEMENTED;
+ ASSERT(FALSE);
while (TRUE);
}
@@ -1077,6 +1080,7 @@
{
/* Not implemented */
UNIMPLEMENTED;
+ ASSERT(FALSE);
while (TRUE);
}
@@ -1133,6 +1137,7 @@
{
/* Otherwise, this is another kind of IRET fault */
UNIMPLEMENTED;
+ ASSERT(FALSE);
while (TRUE);
}
}
@@ -1191,6 +1196,7 @@
{
/* The stack is somewhere in between frames, we need to fix it */
UNIMPLEMENTED;
+ ASSERT(FALSE);
while (TRUE);
}
}
@@ -1256,6 +1262,7 @@
{
/* Not yet implemented */
UNIMPLEMENTED;
+ ASSERT(FALSE);
while (TRUE);
}
#endif
@@ -1439,7 +1446,7 @@
KiGetTickCountHandler(IN PKTRAP_FRAME TrapFrame)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
}
VOID
@@ -1447,7 +1454,7 @@
KiCallbackReturnHandler(IN PKTRAP_FRAME TrapFrame)
{
UNIMPLEMENTED;
- while (TRUE);
+ ASSERT(FALSE); // while (TRUE);
}
DECLSPEC_NORETURN
@@ -1618,6 +1625,7 @@
{
/* Access violation */
UNIMPLEMENTED;
+ ASSERT(FALSE);
while (TRUE);
}
@@ -1683,6 +1691,7 @@
{
/* We should never see this call happening */
DPRINT1("Mismatched NT/HAL version");
+ ASSERT(FALSE);
while (TRUE);
}
Modified: trunk/reactos/ntoskrnl/po/povolume.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/povolume.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/po/povolume.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/po/povolume.c [iso-8859-1] Fri Jan 4 12:31:46 2013
@@ -300,7 +300,9 @@
{
/* 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 */