mirror of
https://github.com/reactos/reactos.git
synced 2025-04-06 05:34:22 +00:00
[NTOS:KE]
- Issue the appropriate bug check codes when faulting in special pool CORE-8680 svn path=/trunk/; revision=64887
This commit is contained in:
parent
2c09a3d5af
commit
5c565a4740
4 changed files with 80 additions and 7 deletions
|
@ -1374,6 +1374,22 @@ Language=English
|
|||
DRIVER_LEFT_LOCKED_PAGES_IN_PROCESS
|
||||
.
|
||||
|
||||
MessageId=0xCC
|
||||
Severity=Success
|
||||
Facility=System
|
||||
SymbolicName=PAGE_FAULT_IN_FREED_SPECIAL_POOL
|
||||
Language=English
|
||||
PAGE_FAULT_IN_FREED_SPECIAL_POOL
|
||||
.
|
||||
|
||||
MessageId=0xCD
|
||||
Severity=Success
|
||||
Facility=System
|
||||
SymbolicName=PAGE_FAULT_BEYOND_END_OF_ALLOCATION
|
||||
Language=English
|
||||
PAGE_FAULT_BEYOND_END_OF_ALLOCATION
|
||||
.
|
||||
|
||||
MessageId=0xCE
|
||||
Severity=Success
|
||||
Facility=System
|
||||
|
@ -1406,6 +1422,22 @@ Language=English
|
|||
The driver mistakenly marked a part of its image pageable instead of non-pageable.
|
||||
.
|
||||
|
||||
MessageId=0xD5
|
||||
Severity=Success
|
||||
Facility=System
|
||||
SymbolicName=DRIVER_PAGE_FAULT_IN_FREED_SPECIAL_POOL
|
||||
Language=English
|
||||
DRIVER_PAGE_FAULT_IN_FREED_SPECIAL_POOL
|
||||
.
|
||||
|
||||
MessageId=0xD6
|
||||
Severity=Success
|
||||
Facility=System
|
||||
SymbolicName=DRIVER_PAGE_FAULT_BEYOND_END_OF_ALLOCATION
|
||||
Language=English
|
||||
DRIVER_PAGE_FAULT_BEYOND_END_OF_ALLOCATION
|
||||
.
|
||||
|
||||
MessageId=0xD7
|
||||
Severity=Success
|
||||
Facility=System
|
||||
|
|
|
@ -732,6 +732,11 @@ NTAPI
|
|||
MmIsSpecialPoolAddress(
|
||||
IN PVOID P);
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
MmIsSpecialPoolAddressFree(
|
||||
IN PVOID P);
|
||||
|
||||
PVOID
|
||||
NTAPI
|
||||
MmAllocateSpecialPool(
|
||||
|
|
|
@ -975,15 +975,31 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
|
|||
FALSE,
|
||||
&IsSystem);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Can't blame a driver, assume system */
|
||||
IsSystem = TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we should check if this happened in:
|
||||
* 1) Special Pool 2) Free Special Pool 3) Session Pool
|
||||
* and update the bugcheck code appropriately.
|
||||
*/
|
||||
/* FIXME: Check for session pool in addition to special pool */
|
||||
|
||||
/* Check if we didn't have a driver base */
|
||||
if (!DriverBase)
|
||||
/* Special pool has its own bug check codes */
|
||||
if (MmIsSpecialPoolAddress((PVOID)BugCheckParameter1))
|
||||
{
|
||||
if (MmIsSpecialPoolAddressFree((PVOID)BugCheckParameter1))
|
||||
{
|
||||
KiBugCheckData[0] = IsSystem
|
||||
? PAGE_FAULT_IN_FREED_SPECIAL_POOL
|
||||
: DRIVER_PAGE_FAULT_IN_FREED_SPECIAL_POOL;
|
||||
}
|
||||
else
|
||||
{
|
||||
KiBugCheckData[0] = IsSystem
|
||||
? PAGE_FAULT_BEYOND_END_OF_ALLOCATION
|
||||
: DRIVER_PAGE_FAULT_BEYOND_END_OF_ALLOCATION;
|
||||
}
|
||||
}
|
||||
else if (!DriverBase)
|
||||
{
|
||||
/* Find the driver that unloaded at this address */
|
||||
KiBugCheckDriver = NULL; // FIXME: ROS can't locate
|
||||
|
|
|
@ -85,6 +85,26 @@ MmIsSpecialPoolAddress(PVOID P)
|
|||
(P <= MmSpecialPoolEnd));
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
MmIsSpecialPoolAddressFree(PVOID P)
|
||||
{
|
||||
PMMPTE PointerPte;
|
||||
|
||||
ASSERT(MmIsSpecialPoolAddress(P));
|
||||
PointerPte = MiAddressToPte(P);
|
||||
|
||||
if (PointerPte->u.Soft.PageFileHigh == SPECIAL_POOL_PAGED_PTE ||
|
||||
PointerPte->u.Soft.PageFileHigh == SPECIAL_POOL_NONPAGED_PTE)
|
||||
{
|
||||
/* Guard page PTE */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Free PTE */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
MiInitializeSpecialPool(VOID)
|
||||
|
|
Loading…
Reference in a new issue