MM::Native::GetHandleSize

This commit is contained in:
Kelvin Sherlock 2013-06-26 22:50:30 -04:00
parent acb5733e6c
commit f4d4100c5d
2 changed files with 14 additions and 0 deletions

View File

@ -228,6 +228,18 @@ namespace MM
}
uint16_t GetHandleSize(uint32_t handle, uint32_t &handleSize)
{
handleSize = 0;
const auto iter = HandleMap.find(handle);
if (iter == HandleMap.end()) return SetMemError(MacOS::memWZErr);
handleSize = iter->second.size;
return SetMemError(0);
}
}

View File

@ -19,6 +19,8 @@ namespace MM
uint16_t DisposeHandle(uint32_t handle);
uint16_t DisposePtr(uint32_t pointer);
uint16_t GetHandleSize(uint32_t handle, uint32_t &handleSize);
}
bool Init(uint8_t *memory, uint32_t memorySize, uint32_t reserved);