Calls into the IOKit to unload a kext by its name.

  Args:
    bundle_name: The bundle identifier of the kernel extension as defined in
                 Info.plist field CFBundleIdentifier.
  Returns:
    The error code from the library call. objc.OS_SUCCESS if successfull.

def UninstallDriver(bundle_name):
  """Calls into the IOKit to unload a kext by its name.

  Args:
    bundle_name: The bundle identifier of the kernel extension as defined in
                 Info.plist field CFBundleIdentifier.
  Returns:
    The error code from the library call. objc.OS_SUCCESS if successfull.
  """
  km = objc.KextManager()

  cf_bundle_name = km.PyStringToCFString(bundle_name)
  status = km.iokit.KextManagerUnloadKextWithIdentifier(cf_bundle_name)
  km.dll.CFRelease(cf_bundle_name)
  return status