LibUsbDotNet 2.2.8
AttachKernelDriver Method (deviceHandle, interfaceNumber)
Library Reference ► MonoLibUsb ► MonoUsbApi ► AttachKernelDriver(MonoUsbDeviceHandle, Int32)
|
![]() |
Re-attach an interface's kernel driver, which was previously detached using DetachKernelDriver(MonoUsbDeviceHandle, Int32).

C# | Visual Basic | Visual C++ |
public static int AttachKernelDriver( MonoUsbDeviceHandle deviceHandle, int interfaceNumber )
Public Shared Function AttachKernelDriver ( _ deviceHandle As MonoUsbDeviceHandle, _ interfaceNumber As Integer _ ) As Integer
public: static int AttachKernelDriver( [InAttribute] MonoUsbDeviceHandle^ deviceHandle, int interfaceNumber )

- deviceHandle (MonoUsbDeviceHandle)
- A device handle.
- interfaceNumber (Int32)
- The interface to attach the driver from.

- 0 on success.
- ErrorNotFound if no kernel driver was active.
- ErrorInvalidParam if the interface does not exist.
- ErrorNoDevice if the device has been disconnected.
- ErrorBusy if the driver cannot be attached because the interface is claimed by a program or driver.
- Another MonoUsbError code on other failure.

