Initial implementation of ExQueryPoolBlockSize

This is not completely correct. but will do for now.
In order to be correct, it will be required to set up a proper pool entry object in ExAllocatePoolWithTag
This commit is contained in:
Luke Usher 2016-10-24 21:27:19 +01:00
parent f4621c934c
commit c6426b1209
3 changed files with 26 additions and 3 deletions

View File

@ -59,7 +59,14 @@ XBSYSAPI VOID *ExInterlockedAddLargeInteger;
XBSYSAPI VOID *ExInterlockedAddLargeStatistic;
XBSYSAPI VOID *ExInterlockedCompareExchange64;
XBSYSAPI VOID *ExMutantObjectType;
XBSYSAPI VOID *ExQueryPoolBlockSize;
// ******************************************************************
// * ExQueryPoolBlockSize
// ******************************************************************
XBSYSAPI EXPORTNUM(23) ULONG NTAPI ExQueryPoolBlockSize
(
IN PVOID PoolBlock
);
// ******************************************************************
// * ExQueryNonVolatileSetting

View File

@ -1507,8 +1507,24 @@ XBSYSAPI EXPORTNUM(17) VOID NTAPI xboxkrnl::ExFreePool
GetCurrentThreadId(), P);
CxbxFree(P);
}
// ******************************************************************
// * 0x0017 ExQueryPoolBlockSize
// ******************************************************************
XBSYSAPI EXPORTNUM(23) xboxkrnl::ULONG NTAPI xboxkrnl::ExQueryPoolBlockSize
(
IN PVOID PoolBlock
)
{
DbgPrintf("EmuKrnl (0x%X): ExQueryPoolBlockSize\n"
"(\n"
" PoolBlock : 0x%.08X\n"
");\n",
GetCurrentThreadId(), PoolBlock);
// Not strictly correct, but it will do for now
return MmQueryAllocationSize(PoolBlock);
}
// ******************************************************************

View File

@ -80,7 +80,7 @@ extern "C" CXBXKRNL_API uint32 CxbxKrnl_KernelThunkTable[367] =
(uint32)PANIC(0x0014), // 0x0014 (20) ExInterlockedAddLargeStatistic
(uint32)PANIC(0x0015), // 0x0015 (21) ExInterlockedCompareExchange64
(uint32)PANIC(0x0016), // 0x0016 (22) ExMutantObjectType
(uint32)PANIC(0x0017), // 0x0017 (23) ExQueryPoolBlockSize
(uint32)&xboxkrnl::ExQueryPoolBlockSize, // 0x0017 (23) ExQueryPoolBlockSize
(uint32)&xboxkrnl::ExQueryNonVolatileSetting, // 0x0018 (24)
(uint32)&xboxkrnl::ExReadWriteRefurbInfo, // 0x0019 (25)
(uint32)PANIC(0x001A), // 0x001A (26) ExQueryPoolBlockSize