Implement ExFreePool and bugfix for ExAllocatePoolWithTag

This commit is contained in:
Echelon9 2013-04-07 17:53:42 +10:00
parent ffe15fa11a
commit 406795b743
3 changed files with 25 additions and 4 deletions

View File

@ -49,7 +49,7 @@ XBSYSAPI VOID *ExEventObjectType;
// * Deallocates a block of pool memory
// *
// ******************************************************************
XBSYSAPI EXPORTNUM(17) PVOID NTAPI ExFreePool
XBSYSAPI EXPORTNUM(17) VOID NTAPI ExFreePool
(
IN PVOID P
);

View File

@ -1344,9 +1344,9 @@ XBSYSAPI EXPORTNUM(15) xboxkrnl::PVOID NTAPI xboxkrnl::ExAllocatePoolWithTag
DbgPrintf("EmuKrnl (0x%X): ExAllocatePoolWithTag\n"
"(\n"
" NumberOfBytes : 0x%.08X\n"
" Tag : 0x%.08X (%s)\n"
" Tag : 0x%.08X\n"
");\n",
GetCurrentThreadId(), NumberOfBytes, Tag, Tag);
GetCurrentThreadId(), NumberOfBytes, Tag);
// TODO: Actually implement this
PVOID pRet = CxbxMalloc(NumberOfBytes);
@ -1356,6 +1356,27 @@ XBSYSAPI EXPORTNUM(15) xboxkrnl::PVOID NTAPI xboxkrnl::ExAllocatePoolWithTag
return pRet;
}
// ******************************************************************
// * 0x0011 ExFreePool
// ******************************************************************
XBSYSAPI EXPORTNUM(17) VOID NTAPI xboxkrnl::ExFreePool
(
IN PVOID P
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuKrnl (0x%X): ExFreePool\n"
"(\n"
" P : 0x%.08X\n"
");\n",
GetCurrentThreadId(), P);
CxbxFree(P);
EmuSwapFS(); // Xbox FS
}
// ******************************************************************
// * 0x0018 ExQueryNonVolatileSetting
// ******************************************************************

View File

@ -74,7 +74,7 @@ extern "C" CXBXKRNL_API uint32 CxbxKrnl_KernelThunkTable[367] =
(uint32)&xboxkrnl::ExAllocatePool, // 0x000E (14)
(uint32)&xboxkrnl::ExAllocatePoolWithTag, // 0x000F (15)
(uint32)PANIC(0x0010), // 0x0010 (16)
(uint32)PANIC(0x0011), // 0x0011 (17)
(uint32)&xboxkrnl::ExFreePool, // 0x0011 (17)
(uint32)PANIC(0x0012), // 0x0012 (18)
(uint32)PANIC(0x0013), // 0x0013 (19)
(uint32)PANIC(0x0014), // 0x0014 (20)