IMPL
Tells the system that the superclass implementation of this method runs in the kernel.
Declaration
#define IMPL(classname, name)Parameters
- classname:
The name of your custom class.
- name:
The name of the DriverKit method you are overriding in your custom subclass.
Mentioned in
Discussion
Use this macro when overriding any methods that are adorned directly (or indirectly via their class) with the IIG_KERNEL macro. For example, use it to define the implementation of custom Start and Stop methods in an IOService subclass. The macro tells the compiler to add binding code between the method running locally in your driver extension’s process space and the superclass method running in the kernel. Don’t add this macro when overriding methods declared with the LOCAL or LOCALONLY macros.
When using the IMPL macro to define your method, don’t include the method parameters as part of your definition. The compiler automatically inserts the appropriate parameters using information from the superclass’ definition. For example, the following code shows how to declare a custom implementation of the Start method:
kern_return_t IMPL(MyCustomService, Start)
{
// Custom code here...
}