mirror of
https://github.com/darlinghq/darling-iokitd.git
synced 2024-11-23 04:29:40 +00:00
Implement io_object_get_retain_count()
This commit is contained in:
parent
f382cc2c20
commit
3c362a9bb2
@ -142,3 +142,19 @@ kern_return_t is_io_object_conforms_to
|
||||
*conforms = o->conformsTo(className);
|
||||
return kIOReturnSuccess;
|
||||
}
|
||||
|
||||
kern_return_t is_io_object_get_retain_count
|
||||
(
|
||||
mach_port_t object,
|
||||
uint32_t *retainCount
|
||||
)
|
||||
{
|
||||
IOObject* o = IOObject::lookup(object);
|
||||
if (!o)
|
||||
{
|
||||
// Unlike other methods, this just returns 0 for invalid ports.
|
||||
*retainCount = 0;
|
||||
return KERN_SUCCESS;
|
||||
}
|
||||
return mach_port_get_refs(mach_task_self(), o->port(), MACH_PORT_RIGHT_SEND, retainCount);
|
||||
}
|
||||
|
10
src/stubs.c
10
src/stubs.c
@ -214,16 +214,6 @@ kern_return_t is_io_registry_entry_in_plane
|
||||
return KERN_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
kern_return_t is_io_object_get_retain_count
|
||||
(
|
||||
mach_port_t object,
|
||||
uint32_t *retainCount
|
||||
)
|
||||
{
|
||||
STUB();
|
||||
return KERN_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
kern_return_t is_io_service_get_busy_state
|
||||
(
|
||||
mach_port_t service,
|
||||
|
Loading…
Reference in New Issue
Block a user