VdPersistDisplay - Check if unk1 ptr is NULL

This commit is contained in:
Dr. Chat 2015-05-23 14:25:46 -05:00
parent 9d2e8d4699
commit 30e445a6de
1 changed files with 7 additions and 5 deletions

View File

@ -380,11 +380,13 @@ SHIM_CALL VdPersistDisplay_shim(PPCContext* ppc_state, KernelState* state) {
// unk1_ptr needs to be populated with a pointer passed to // unk1_ptr needs to be populated with a pointer passed to
// MmFreePhysicalMemory(1, *unk1_ptr). // MmFreePhysicalMemory(1, *unk1_ptr).
if (unk1_ptr) {
auto heap = state->memory()->LookupHeapByType(true, 16 * 1024); auto heap = state->memory()->LookupHeapByType(true, 16 * 1024);
uint32_t unk1_value; uint32_t unk1_value;
heap->Alloc(64, 32, kMemoryAllocationReserve | kMemoryAllocationCommit, heap->Alloc(64, 32, kMemoryAllocationReserve | kMemoryAllocationCommit,
kMemoryProtectNoAccess, false, &unk1_value); kMemoryProtectNoAccess, false, &unk1_value);
SHIM_SET_MEM_32(unk1_ptr, unk1_value); SHIM_SET_MEM_32(unk1_ptr, unk1_value);
}
// ? // ?
SHIM_SET_RETURN_64(1); SHIM_SET_RETURN_64(1);