def METHOD_NAME(self, driver):  # noqa: N802
    driver_ctype = ctypes.create_string_buffer(driver.encode(self._encoding))  # case C020
    handle_ctype = _visatype.ViSession()  # case S220
    device_count_ctype = _visatype.ViInt32()  # case S220
    error_code = self._library.niModInst_OpenInstalledDevicesSession(driver_ctype, None if handle_ctype is None else (ctypes.pointer(handle_ctype)), None if device_count_ctype is None else (ctypes.pointer(device_count_ctype)))
    errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
    return int(handle_ctype.value), int(device_count_ctype.value)