Create
Creates a new action object and configures it with your custom target object and callback method.
Declaration
static kern_return_t Create(OSObject *target, uint64_t targetmsgid, uint64_t msgid, size_t referenceSize, OSAction **action);Parameters
- target:
The object that contains the target method. The action object retains your target object.
- targetmsgid:
The message ID for the custom method that you want the system to call. The Type macro automatically generates a constant for this message ID that takes the form <Class>
_<Method>_ID, where <Class> is the name of your class and <Method> is the name of your custom method. - msgid:
The message ID for the method the system expects to call. When using the Type macro to declare conformance to DriverKit methods, specify the ID for the method you passed as a parameter to the Type macro. For example, if you use the type macro to specify the Completeasyncio method of Iousbhostpipe, specify
IOUSBHostPipe_CompleteAsyncIO_ID. - referenceSize:
The additional number of bytes to allocate and store with your action object. Retrieve a pointer to this buffer later using the 3438207 Getreference method.
- action:
A pointer to a variable for your action object. If this method creates the action object successfully, it returns that object in this parameter. It is a programmer error to specify
NULLfor this parameter.
Return Value
kIOReturnSuccess on success, or another value if an error occurs. See Error Codes.
Discussion
Use the custom constructor method generated by the TYPE macro, instead of this method. For more information on custom constructor methods for action objects, see TYPE.