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

svn path=/trunk/; revision=58111
This commit is contained in:
Hermès Bélusca-Maïto
2013-01-04 12:31:46 +00:00
parent b70845423e
commit 4c4fd151f2
15 changed files with 51 additions and 36 deletions
+1 -1
View 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;
}
+1 -1
View File
@@ -132,7 +132,7 @@ CcGetFlushedValidData(IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
{
LARGE_INTEGER Result = {{0}};
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
return Result;
}
+4 -4
View 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 */
+1 -1
View File
@@ -399,7 +399,7 @@ CcSetDirtyPageThreshold(IN PFILE_OBJECT FileObject,
IN ULONG DirtyPageThreshold)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
/*
+4 -4
View 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;
}
@@ -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;
}
+2 -2
View 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));
+3 -2
View 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
}
+1 -1
View 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
+4 -4
View 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;
}
+12 -12
View 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;
}
+1
View File
@@ -1178,6 +1178,7 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
KiBugCheckDebugBreak(DBG_STATUS_BUGCHECK_SECOND);
/* Shouldn't get here */
ASSERT(FALSE);
while (TRUE);
}
+1
View File
@@ -780,6 +780,7 @@ KeInsertQueueDpc(IN PKDPC Dpc,
{
/* FIXME: Setup Threaded DPC */
DPRINT1("Threaded DPC not supported\n");
ASSERT(FALSE);
while (TRUE);
}
}
+2 -1
View File
@@ -36,7 +36,8 @@ KiSwapProcess(IN PKPROCESS NewProcess,
{
/* Not handled yet */
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
return;
}
/* Update CR3 */
+11 -2
View 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);
}
+3 -1
View 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 */