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 // Always return success for now
// //
DPRINT1("NEVER TELL ME THE ODDS!\n"); DPRINT1("NEVER TELL ME THE ODDS!\n");
while (TRUE); ASSERT(FALSE); // while (TRUE);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }

View file

@ -59,7 +59,7 @@ MiSyncCachedRanges(VOID)
for (i = 0; i < MiLargePageRangeIndex; i++) for (i = 0; i < MiLargePageRangeIndex; i++)
{ {
DPRINT1("No support for large pages\n"); 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 */ /* Fail */
DPRINT1("Session loading not yet supported!\n"); 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 */ /* Not session load, shouldn't have an entry */
@ -1217,7 +1218,7 @@ CheckDllState:
/* We failed, unload the image */ /* We failed, unload the image */
MmUnloadSystemImage(DllEntry); MmUnloadSystemImage(DllEntry);
DPRINT1("MmCallDllInitialize failed with status 0x%x\n", Status); DPRINT1("MmCallDllInitialize failed with status 0x%x\n", Status);
while (TRUE); ASSERT(FALSE); // while (TRUE);
Loaded = FALSE; Loaded = FALSE;
} }
} }
@ -1720,7 +1721,8 @@ MiReloadBootLoadedDrivers(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{ {
/* Shouldn't happen */ /* Shouldn't happen */
DPRINT1("[Mm0]: Couldn't allocate driver section!\n"); DPRINT1("[Mm0]: Couldn't allocate driver section!\n");
while (TRUE); ASSERT(FALSE); // while (TRUE);
return;
} }
/* This is the new virtual address for the module */ /* This is the new virtual address for the module */
@ -1773,7 +1775,8 @@ MiReloadBootLoadedDrivers(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{ {
/* This shouldn't happen */ /* This shouldn't happen */
DPRINT1("Relocations failed!\n"); DPRINT1("Relocations failed!\n");
while (TRUE); ASSERT(FALSE); // while (TRUE);
return;
} }
} }
@ -2922,7 +2925,8 @@ LoaderScan:
{ {
/* We don't support session loading yet */ /* We don't support session loading yet */
DPRINT1("Unsupported Session-Load!\n"); DPRINT1("Unsupported Session-Load!\n");
while (TRUE); ASSERT(FALSE); // while (TRUE);
Status = STATUS_NOT_IMPLEMENTED;
} }
/* Do cleanup */ /* Do cleanup */
@ -3023,7 +3027,8 @@ LoaderScan:
{ {
/* We don't support session loading yet */ /* We don't support session loading yet */
DPRINT1("Unsupported Session-Load!\n"); 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 */ /* 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) IN PVOID Address)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
} }
BOOLEAN BOOLEAN
@ -135,7 +135,7 @@ MmCreateProcessAddressSpace(IN ULONG MinWs,
IN PULONG DirectoryTableBase) IN PULONG DirectoryTableBase)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
return FALSE; return FALSE;
} }
@ -165,7 +165,7 @@ MmDisableVirtualMapping(IN PEPROCESS Process,
OUT PPFN_NUMBER Page) OUT PPFN_NUMBER Page)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
} }
VOID VOID
@ -174,7 +174,7 @@ MmEnableVirtualMapping(IN PEPROCESS Process,
IN PVOID Address) IN PVOID Address)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
} }
NTSTATUS NTSTATUS
@ -186,7 +186,7 @@ MmCreateVirtualMappingUnsafe(IN PEPROCESS Process,
IN ULONG PageCount) IN ULONG PageCount)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
@ -199,7 +199,7 @@ MmCreateVirtualMapping(IN PEPROCESS Process,
IN ULONG PageCount) IN ULONG PageCount)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
@ -208,7 +208,7 @@ NTAPI
MmRawDeleteVirtualMapping(IN PVOID Address) MmRawDeleteVirtualMapping(IN PVOID Address)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
} }
VOID VOID
@ -220,7 +220,7 @@ MmDeleteVirtualMapping(IN PEPROCESS Process,
OUT PPFN_NUMBER Page) OUT PPFN_NUMBER Page)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
} }
VOID VOID
@ -230,7 +230,7 @@ MmDeletePageFileMapping(IN PEPROCESS Process,
IN SWAPENTRY *SwapEntry) IN SWAPENTRY *SwapEntry)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
} }
NTSTATUS NTSTATUS
@ -240,8 +240,8 @@ MmCreatePageFileMapping(IN PEPROCESS Process,
IN SWAPENTRY SwapEntry) IN SWAPENTRY SwapEntry)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
return 0; return STATUS_NOT_IMPLEMENTED;
} }
PFN_NUMBER PFN_NUMBER
@ -250,7 +250,7 @@ MmGetPfnForProcess(IN PEPROCESS Process,
IN PVOID Address) IN PVOID Address)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
return 0; return 0;
} }
@ -260,8 +260,8 @@ MmIsDirtyPage(IN PEPROCESS Process,
IN PVOID Address) IN PVOID Address)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
return 0; return FALSE;
} }
VOID VOID
@ -270,7 +270,7 @@ MmSetCleanPage(IN PEPROCESS Process,
IN PVOID Address) IN PVOID Address)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
} }
VOID VOID
@ -279,7 +279,7 @@ MmSetDirtyPage(IN PEPROCESS Process,
IN PVOID Address) IN PVOID Address)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
} }
BOOLEAN BOOLEAN
@ -288,7 +288,7 @@ MmIsPagePresent(IN PEPROCESS Process,
IN PVOID Address) IN PVOID Address)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
return FALSE; return FALSE;
} }
@ -298,7 +298,7 @@ MmIsPageSwapEntry(IN PEPROCESS Process,
IN PVOID Address) IN PVOID Address)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
return FALSE; return FALSE;
} }
@ -357,7 +357,7 @@ MmGetPhysicalAddress(IN PVOID Address)
PhysicalAddress.QuadPart = 0; PhysicalAddress.QuadPart = 0;
UNIMPLEMENTED; UNIMPLEMENTED;
while (TRUE); ASSERT(FALSE); // while (TRUE);
return PhysicalAddress; return PhysicalAddress;
} }

View file

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