Close and Unload the Driver

A short tutorial describing how to close and unload the shared chunk, close the USB channel and unload the USB Logical Device Driver (LDD).

  1. Close the handle to the shared chunk using RChunk::Close().
    // Close chunk handle
    gChunk.Close();

  2. Close the handle to the USB channel using RDevUsbcScClient::Close().
    // Close USB Channel
    gPort.Close();

  3. Unload the USB logical device driver using User::FreeLogicalDevice().
    User::FreeLogicalDevice(KUsbDeviceName);