#include <IOKit/IOUserClient.h>

IOKit/IOUserClient.h Kernel.framework

Changes to this API are expected.
6 enums · 6 structs · 5 macros · 4 typedefs · 1 class

macro_IOUSERCLIENT_SENDASYNCRESULT64WITHOPTIONS_

#define _IOUSERCLIENT_SENDASYNCRESULT64WITHOPTIONS_ 1

enum(anonymous)

underlying type unsigned int
kIOUCTypeMask15
kIOUCScalarIScalarO0
kIOUCScalarIStructO2
kIOUCStructIStructO3
kIOUCScalarIStructI4
kIOUCForegroundOnly16

enum(anonymous)

@enum @abstract Constant to denote a variable length structure argument to IOUserClient. @constant kIOUCVariableStructureSize Use in the structures IOExternalMethod, IOExternalAsyncMethod, IOExternalMethodDispatch to specify the size of the structure is variable.
underlying type unsigned int
kIOUCVariableStructureSize4294967295

typedefIOMethod

typedef IOReturn (IOService::*)(void *, void *, void *, void *, void *, void *) IOMethod;

typedefIOAsyncMethod

typedef IOReturn (IOService::*)(natural_t *, void *, void *, void *, void *, void *, void *) IOAsyncMethod;

typedefIOTrap

typedef IOReturn (IOService::*)(void *, void *, void *, void *, void *, void *) IOTrap;

structIOExternalMethod

size 48, align 8
IOService *object
IOMethodfunc
IOOptionBitsflags
IOByteCountcount0
IOByteCountcount1

structIOExternalTrap

size 24, align 8
IOService *object
IOTrapfunc

enum(anonymous)

underlying type unsigned int
kIOUserNotifyMaxMessageSize64

enum(anonymous)

underlying type unsigned int
kIOUserNotifyOptionCanDrop1Fail if queue is full, rather than infinitely queuing.

macrokIOClientPrivilegeAdministrator

keys for clientHasPrivilege
#define kIOClientPrivilegeAdministrator "root"

macrokIOClientPrivilegeLocalUser

#define kIOClientPrivilegeLocalUser "local"

macrokIOClientPrivilegeForeground

#define kIOClientPrivilegeForeground "foreground"

enum(anonymous)

@enum @abstract Constants to specify the maximum number of scalar arguments in the IOExternalMethodArguments structure. These constants are documentary since the scalarInputCount, scalarOutputCount fields reflect the actual number passed. @constant kIOExternalMethodScalarInputCountMax The maximum number of scalars able to passed on input. @constant kIOExternalMethodScalarOutputCountMax The maximum number of scalars able to passed on output.
underlying type unsigned int
kIOExternalMethodScalarInputCountMax16
kIOExternalMethodScalarOutputCountMax16

structIOExternalMethodArguments

size 248, align 8
uint32_tversion
uint32_tselector
mach_port_tasyncWakePort
io_user_reference_t *asyncReference
uint32_tasyncReferenceCount
const uint64_t *scalarInput
uint32_tscalarInputCount
const void *structureInput
uint32_tstructureInputSize
IOMemoryDescriptor *structureInputDescriptor
uint64_t *scalarOutput
uint32_tscalarOutputCount
void *structureOutput
uint32_tstructureOutputSize
IOMemoryDescriptor *structureOutputDescriptor
uint32_tstructureOutputDescriptorSize
uint32_t__reservedA
OSObject **structureVariableOutputData
uint32_t[30]__reserved

typedefIOExternalMethodAction

typedef IOReturn (*)(OSObject *, void *, IOExternalMethodArguments *) IOExternalMethodAction;

structIOExternalMethodDispatch

size 24, align 8
IOExternalMethodActionfunction
uint32_tcheckScalarInputCount
uint32_tcheckStructureInputSize
uint32_tcheckScalarOutputCount
uint32_tcheckStructureOutputSize

structIOExternalMethodDispatch2022

size 40, align 8
IOExternalMethodActionfunction
uint32_tcheckScalarInputCount
uint32_tcheckStructureInputSize
uint32_tcheckScalarOutputCount
uint32_tcheckStructureOutputSize
uint8_tallowAsync
const char *checkEntitlement

enum(anonymous)

underlying type unsigned int
kIOExternalMethodArgumentsCurrentVersion2

macroIO_EXTERNAL_METHOD_ARGUMENTS_CURRENT_VERSION

#define IO_EXTERNAL_METHOD_ARGUMENTS_CURRENT_VERSION 2

classIOUserClient

@class IOUserClient @abstract Provides a basis for communication between client applications and I/O Kit objects.
: public IOService
ExpansionData *reserved
bool reserve()protected
MIG_SERVER_ROUTINE virtual IOReturn externalMethod(
	uint32_t selector,
	IOExternalMethodArguments * arguments,
	IOExternalMethodDispatch *dispatch = NULL,
	OSObject *target = NULL,
	void *reference = NULL
)
virtual
MIG_SERVER_ROUTINE virtual IOReturn registerNotificationPort(
	mach_port_t port,
	UInt32 type,
	io_user_reference_t refCon
)
virtual
static IOReturn sendAsyncResult(
	OSAsyncReference reference,
	IOReturn result,
	void *args[],
	UInt32 numArgs
)
static protected
static void setAsyncReference(
	OSAsyncReference asyncRef,
	mach_port_t wakePort,
	void *callback,
	void *refcon
)
static protected
static IOReturn sendAsyncResult64(
	OSAsyncReference64 reference,
	IOReturn result,
	io_user_reference_t args[],
	UInt32 numArgs
)
static protected
static IOReturn sendAsyncResult64WithOptions(
	OSAsyncReference64 reference,
	IOReturn result,
	io_user_reference_t args[],
	UInt32 numArgs,
	IOOptionBits options
)
static protected
@function sendAsyncResult64WithOptions @abstract Send a notification as with sendAsyncResult, but with finite queueing. @discussion IOUserClient::sendAsyncResult64() will infitely queue messages if the client is not processing them in a timely fashion. This variant will not, for simple handling of situations where clients may be expected to stop processing messages.
static void setAsyncReference64(
	OSAsyncReference64 asyncRef,
	mach_port_t wakePort,
	mach_vm_address_t callback,
	io_user_reference_t refcon
)
static protected
static void setAsyncReference64(
	OSAsyncReference64 asyncRef,
	mach_port_t wakePort,
	mach_vm_address_t callback,
	io_user_reference_t refcon,
	task_t task
)
static protected
static IOReturn clientHasAuthorization(task_t task, IOService * service)static
static IOReturn clientHasPrivilege(void * securityToken, const char * privilegeName)static
static OSPtr<OSObject> copyClientEntitlement(task_t task, const char *entitlement)static
static OSPtr<OSObject> copyClientEntitlementVnode(
	struct vnode *vnode,
	off_t offset,
	const char *entitlement
)
static
static OSPtr<OSDictionary> copyClientEntitlements(task_t task)static
static OSPtr<OSDictionary> copyClientEntitlementsVnode(struct vnode *vnode, off_t offset)static
static IOReturn releaseAsyncReference64(OSAsyncReference64 reference)static
@function releaseAsyncReference64 @abstract Release the mach_port_t reference held within the OSAsyncReference64 structure. @discussion The OSAsyncReference64 structure passed to async methods holds a reference to the wakeup mach port, which should be released to balance each async method call. Behavior is undefined if these calls are not correctly balanced. @param reference The reference passed to the subclass IOAsyncMethod, or externalMethod() in the IOExternalMethodArguments.asyncReference field. @result A return code.
static IOReturn releaseNotificationPort(mach_port_t port)static
@function releaseNotificationPort @abstract Release the mach_port_t passed to registerNotificationPort(). @discussion The mach_port_t passed to the registerNotificationPort() methods should be released to balance each call to registerNotificationPort(). Behavior is undefined if these calls are not correctly balanced. @param port The mach_port_t argument previously passed to the subclass implementation of registerNotificationPort(). @result A return code.
APPLE_KEXT_OVERRIDE
virtual bool init()
virtual
APPLE_KEXT_OVERRIDE
virtual bool init(OSDictionary * dictionary)
virtual
virtual bool initWithTask(
	task_t owningTask,
	void * securityToken,
	UInt32 type,
	OSDictionary * properties
)
virtual
Currently ignores the all args, just passes up to IOService::init()
virtual bool initWithTask(task_t owningTask, void * securityToken, UInt32 type)virtual
APPLE_KEXT_OVERRIDE
virtual void free()
virtual
virtual IOReturn clientClose(void)virtual
virtual IOReturn clientDied(void)virtual
virtual IOService * getService(void)virtual
MIG_SERVER_ROUTINE virtual IOReturn registerNotificationPort(
	mach_port_t port,
	UInt32 type,
	UInt32 refCon
)
virtual
MIG_SERVER_ROUTINE virtual IOReturn getNotificationSemaphore(
	UInt32 notification_type,
	semaphore_t * semaphore
)
virtual
virtual IOReturn connectClient(IOUserClient * client)virtual
virtual IOReturn clientMemoryForType(
	UInt32 type,
	IOOptionBits * options,
	IOMemoryDescriptor ** memory
)
virtual
memory will be released by user client when last map is destroyed
IOReturn clientMemoryForType(
	UInt32 type,
	IOOptionBits * options,
	OSSharedPtr<IOMemoryDescriptor>& memory
)
static IOReturn _sendAsyncResult64(
	OSAsyncReference64 reference,
	IOReturn result,
	io_user_reference_t args[],
	UInt32 numArgs,
	IOOptionBits options
)
static
OSPtr<IOMemoryMap> removeMappingForDescriptor(IOMemoryDescriptor * memory)
@function removeMappingForDescriptor Remove the first mapping created from the memory descriptor returned by clientMemoryForType() from IOUserClient's list of mappings. If such a mapping exists, it is retained and the reference currently held by IOUserClient is returned to the caller. @param memory The memory descriptor instance previously returned by the implementation of clientMemoryForType(). @result A reference to the first IOMemoryMap instance found in the list of mappings created by IOUserClient from that passed memory descriptor is returned, or zero if none exist. The caller should release this reference.
virtual IOReturn exportObjectToClient(
	task_t task,
	LIBKERN_CONSUMED OSObject *obj,
	io_object_t *clientObj
)
virtual
@function exportObjectToClient Make an arbitrary OSObject available to the client task. @param task The task. @param obj The object we want to export to the client. @param clientObj Returned value is the client's port name.
APPLE_KEXT_DEPRECATED
virtual IOExternalMethod * getExternalMethodForIndex(UInt32 index)
virtual · deprecated
Old methods for accessing method vector backward compatiblility only
APPLE_KEXT_DEPRECATED
virtual IOExternalAsyncMethod * getExternalAsyncMethodForIndex(UInt32 index)
virtual · deprecated
virtual IOExternalMethod * getTargetAndMethodForIndex(
	LIBKERN_RETURNS_NOT_RETAINED IOService ** targetP,
	UInt32 index
)
virtual
Methods for accessing method vector.
virtual IOExternalAsyncMethod * getAsyncTargetAndMethodForIndex(
	LIBKERN_RETURNS_NOT_RETAINED IOService ** targetP,
	UInt32 index
)
virtual
IOExternalMethod * getTargetAndMethodForIndex(
	OSSharedPtr<IOService>& targetP,
	UInt32 index
)
IOExternalAsyncMethod * getAsyncTargetAndMethodForIndex(
	OSSharedPtr<IOService>& targetP,
	UInt32 index
)
APPLE_KEXT_DEPRECATED
virtual IOExternalTrap * getExternalTrapForIndex(UInt32 index)
virtual · deprecated
Methods for accessing trap vector - old and new style
virtual IOExternalTrap * getTargetAndTrapForIndex(
	LIBKERN_RETURNS_NOT_RETAINED IOService **targetP,
	UInt32 index
)
virtual