Unloads a kernel object file.
Item | Description |
---|---|
kmid | Specifies the kernel module ID of the object file to be unloaded. This kernel module ID is returned when using the kmod_load kernel service. |
flags | Flags
specifying unload options. The following flag is defined:
|
The kmod_unload kernel service unloads a previously loaded kernel extension object file. The object to be unloaded is specified by the kmid parameter. Upon successful completion, the following objects are unloaded or marked unload pending:
Users of these exports or system calls are modules bound to this module's exported symbols. If there are no users of any of the module's kernel exports or system calls, the module is immediately unloaded. If there are users of this module, the module is not unloaded but marked unload pending.
Marking a module unload pending removes the module's exported symbols from the kernel name space. Any system calls exported by this module are also removed. This prohibits new users of these symbols. The module is unloaded only when all current users have been unloaded.
If the unload is successfully completed or marked pending, a value of 0 is returned. When an error occurs, the specified module and any imported modules are not unloaded. A nonzero return value indicates the error.
The kmod_unload kernel service can be called from the process environment only.
Item | Description |
---|---|
0 | Indicates successful completion. |
EINVAL | Indicates that the kmid parameter, which specifies the kernel module, is not valid or does not correspond to a currently loaded module. |
EBUSY | The kmid parameter specifies a kernel extension that is still intercepting system calls. |