mirror of
https://github.com/ksherlock/mpw.git
synced 2024-11-25 19:30:50 +00:00
RM::GetResourceSizeOnDisk
This commit is contained in:
parent
9ef1bba18d
commit
457c045ebe
@ -755,6 +755,33 @@ namespace RM
|
||||
return SetResError(::ResError());
|
||||
}
|
||||
|
||||
uint16_t GetResourceSizeOnDisk(uint16_t trap)
|
||||
{
|
||||
// FUNCTION GetResourceSizeOnDisk (theResource: Handle): LongInt;
|
||||
|
||||
uint32_t sp;
|
||||
uint32_t theResource;
|
||||
|
||||
sp = StackFrame<4>(theResource);
|
||||
|
||||
Log("%04x GetResourceSizeOnDisk(%08x)\n", trap, theResource);
|
||||
|
||||
|
||||
auto iter = rhandle_map.find(theResource);
|
||||
if (iter == rhandle_map.end())
|
||||
{
|
||||
ToolReturn<4>(sp, (uint32_t)0);
|
||||
return SetResError(MacOS::resNotFound);
|
||||
}
|
||||
|
||||
Handle nativeHandle = iter->second;
|
||||
uint32_t size = ::GetResourceSizeOnDisk(nativeHandle);
|
||||
|
||||
ToolReturn<4>(sp, size);
|
||||
return SetResError(::ResError());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// todo -- move since it's not RM related.
|
||||
|
@ -47,6 +47,7 @@ namespace RM
|
||||
|
||||
uint16_t RemoveResource(uint16_t trap);
|
||||
|
||||
uint16_t GetResourceSizeOnDisk(uint16_t trap);
|
||||
}
|
||||
|
||||
|
||||
|
@ -335,6 +335,9 @@ namespace ToolBox {
|
||||
d0 = RM::ReleaseResource(trap);
|
||||
break;
|
||||
|
||||
case 0xa9a5:
|
||||
d0 = RM::GetResourceSizeOnDisk(trap);
|
||||
break;
|
||||
|
||||
case 0xa9a6:
|
||||
d0 = RM::GetResAttrs(trap);
|
||||
|
Loading…
Reference in New Issue
Block a user