while (TRUE); (when something is unimplemented) ---> ASSERT(FALSE); // while (TRUE); and in some cases, return an adequate value.

Part 2/2

Some while(true); remain in our code, however not in critical regions.

svn path=/trunk/; revision=58112
This commit is contained in:
Hermès Bélusca-Maïto 2013-01-04 12:54:39 +00:00
parent 4c4fd151f2
commit 8f7be5bbc8
5 changed files with 43 additions and 38 deletions

View file

@ -66,7 +66,7 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
// Always return success for now
//
DPRINT1("NEVER TELL ME THE ODDS!\n");
while (TRUE);
ASSERT(FALSE); // while (TRUE);
return STATUS_SUCCESS;
}

View file

@ -59,7 +59,7 @@ MiSyncCachedRanges(VOID)
for (i = 0; i < MiLargePageRangeIndex; i++)
{
DPRINT1("No support for large pages\n");
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
}

View file

@ -106,7 +106,8 @@ MiLoadImageSection(IN OUT PVOID *SectionPtr,
{
/* Fail */
DPRINT1("Session loading not yet supported!\n");
while (TRUE);
ASSERT(FALSE); // while (TRUE);
return STATUS_NOT_IMPLEMENTED;
}
/* Not session load, shouldn't have an entry */
@ -1217,7 +1218,7 @@ CheckDllState:
/* We failed, unload the image */
MmUnloadSystemImage(DllEntry);
DPRINT1("MmCallDllInitialize failed with status 0x%x\n", Status);
while (TRUE);
ASSERT(FALSE); // while (TRUE);
Loaded = FALSE;
}
}
@ -1720,7 +1721,8 @@ MiReloadBootLoadedDrivers(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
/* Shouldn't happen */
DPRINT1("[Mm0]: Couldn't allocate driver section!\n");
while (TRUE);
ASSERT(FALSE); // while (TRUE);
return;
}
/* This is the new virtual address for the module */
@ -1773,7 +1775,8 @@ MiReloadBootLoadedDrivers(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
/* This shouldn't happen */
DPRINT1("Relocations failed!\n");
while (TRUE);
ASSERT(FALSE); // while (TRUE);
return;
}
}
@ -2922,7 +2925,8 @@ LoaderScan:
{
/* We don't support session loading yet */
DPRINT1("Unsupported Session-Load!\n");
while (TRUE);
ASSERT(FALSE); // while (TRUE);
Status = STATUS_NOT_IMPLEMENTED;
}
/* Do cleanup */
@ -3023,7 +3027,8 @@ LoaderScan:
{
/* We don't support session loading yet */
DPRINT1("Unsupported Session-Load!\n");
while (TRUE);
ASSERT(FALSE); // while (TRUE);
goto Quickie;
}
/* Check the loader list again, we should end up in the path below */

View file

@ -125,7 +125,7 @@ MiFlushTlb(IN PMMPTE PointerPte,
IN PVOID Address)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
BOOLEAN
@ -135,7 +135,7 @@ MmCreateProcessAddressSpace(IN ULONG MinWs,
IN PULONG DirectoryTableBase)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
return FALSE;
}
@ -165,7 +165,7 @@ MmDisableVirtualMapping(IN PEPROCESS Process,
OUT PPFN_NUMBER Page)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
VOID
@ -174,7 +174,7 @@ MmEnableVirtualMapping(IN PEPROCESS Process,
IN PVOID Address)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
NTSTATUS
@ -186,7 +186,7 @@ MmCreateVirtualMappingUnsafe(IN PEPROCESS Process,
IN ULONG PageCount)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
return STATUS_SUCCESS;
}
@ -199,7 +199,7 @@ MmCreateVirtualMapping(IN PEPROCESS Process,
IN ULONG PageCount)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
return STATUS_SUCCESS;
}
@ -208,7 +208,7 @@ NTAPI
MmRawDeleteVirtualMapping(IN PVOID Address)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
VOID
@ -220,7 +220,7 @@ MmDeleteVirtualMapping(IN PEPROCESS Process,
OUT PPFN_NUMBER Page)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
VOID
@ -230,7 +230,7 @@ MmDeletePageFileMapping(IN PEPROCESS Process,
IN SWAPENTRY *SwapEntry)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
NTSTATUS
@ -240,8 +240,8 @@ MmCreatePageFileMapping(IN PEPROCESS Process,
IN SWAPENTRY SwapEntry)
{
UNIMPLEMENTED;
while (TRUE);
return 0;
ASSERT(FALSE); // while (TRUE);
return STATUS_NOT_IMPLEMENTED;
}
PFN_NUMBER
@ -250,7 +250,7 @@ MmGetPfnForProcess(IN PEPROCESS Process,
IN PVOID Address)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
return 0;
}
@ -260,8 +260,8 @@ MmIsDirtyPage(IN PEPROCESS Process,
IN PVOID Address)
{
UNIMPLEMENTED;
while (TRUE);
return 0;
ASSERT(FALSE); // while (TRUE);
return FALSE;
}
VOID
@ -270,7 +270,7 @@ MmSetCleanPage(IN PEPROCESS Process,
IN PVOID Address)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
VOID
@ -279,7 +279,7 @@ MmSetDirtyPage(IN PEPROCESS Process,
IN PVOID Address)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
BOOLEAN
@ -288,7 +288,7 @@ MmIsPagePresent(IN PEPROCESS Process,
IN PVOID Address)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
return FALSE;
}
@ -298,7 +298,7 @@ MmIsPageSwapEntry(IN PEPROCESS Process,
IN PVOID Address)
{
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
return FALSE;
}
@ -357,7 +357,7 @@ MmGetPhysicalAddress(IN PVOID Address)
PhysicalAddress.QuadPart = 0;
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
return PhysicalAddress;
}

View file

@ -375,8 +375,8 @@ Mmi386ReleaseMmInfo(IN PEPROCESS Process)
// FIXME-USER: Need to delete address space
//
UNIMPLEMENTED;
while (TRUE);
return 0;
ASSERT(FALSE); // while (TRUE);
return STATUS_NOT_IMPLEMENTED;
}
PULONG
@ -400,7 +400,7 @@ MmDisableVirtualMapping(IN PEPROCESS Process,
// TODO
//
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
VOID
@ -412,7 +412,7 @@ MmEnableVirtualMapping(IN PEPROCESS Process,
// TODO
//
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
NTSTATUS
@ -659,7 +659,7 @@ MmDeletePageFileMapping(IN PEPROCESS Process,
// TODO
//
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
NTSTATUS
@ -672,8 +672,8 @@ MmCreatePageFileMapping(IN PEPROCESS Process,
// TODO
//
UNIMPLEMENTED;
while (TRUE);
return 0;
ASSERT(FALSE); // while (TRUE);
return STATUS_NOT_IMPLEMENTED;
}
PFN_NUMBER
@ -704,8 +704,8 @@ MmIsDirtyPage(IN PEPROCESS Process,
// TODO
//
UNIMPLEMENTED;
while (TRUE);
return 0;
ASSERT(FALSE); // while (TRUE);
return FALSE;
}
VOID
@ -717,7 +717,7 @@ MmSetCleanPage(IN PEPROCESS Process,
// TODO
//
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
VOID
@ -729,7 +729,7 @@ MmSetDirtyPage(IN PEPROCESS Process,
// TODO
//
UNIMPLEMENTED;
while (TRUE);
ASSERT(FALSE); // while (TRUE);
}
BOOLEAN