From 9df6f3e70c08b8f163ae33988324d1509d68aff5 Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Wed, 12 Apr 2017 21:21:05 +0100 Subject: [PATCH] Fix gamepad sample (and potentially others) --- src/CxbxKrnl/MemoryManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CxbxKrnl/MemoryManager.cpp b/src/CxbxKrnl/MemoryManager.cpp index ab86f285e..0078e6bfb 100644 --- a/src/CxbxKrnl/MemoryManager.cpp +++ b/src/CxbxKrnl/MemoryManager.cpp @@ -274,8 +274,8 @@ size_t MemoryManager::QueryAllocationSize(void* addr) EnterCriticalSection(&m_CriticalSection); TypedMemoryBlock *info = FindContainingTypedMemoryBlock(addr); if (info != nullptr) { - // Return the remaining size in this block - ret = info->block.size - ((size_t)addr - (size_t)info->block.addr); + // Return the total size in this block + ret = info->block.size;// -((size_t)addr - (size_t)info->block.addr); } else { #if 1 // TODO : Only log this in DEBUG builds (as a failure is already indicated by a null result)?