亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? descriptor.c

?? 最新的libusb庫
?? C
?? 第 1 頁 / 共 2 頁
字號:
	for (i = 0; i < config->bNumInterfaces; i++) {		int len;		unsigned char *begin;		/* Skip over the rest of the Class Specific or Vendor */		/*  Specific descriptors */		begin = buffer;		while (size >= DESC_HEADER_LENGTH) {			usbi_parse_descriptor(buffer, "bb", &header, 0);			if ((header.bLength > size) ||					(header.bLength < DESC_HEADER_LENGTH)) {				usbi_err(ctx, "invalid descriptor length of %d",					header.bLength);				r = LIBUSB_ERROR_IO;				goto err;			}			/* If we find another "proper" descriptor then we're done */			if ((header.bDescriptorType == LIBUSB_DT_ENDPOINT) ||					(header.bDescriptorType == LIBUSB_DT_INTERFACE) ||					(header.bDescriptorType == LIBUSB_DT_CONFIG) ||					(header.bDescriptorType == LIBUSB_DT_DEVICE))				break;			usbi_dbg("skipping descriptor 0x%x\n", header.bDescriptorType);			buffer += header.bLength;			size -= header.bLength;		}		/* Copy any unknown descriptors into a storage area for */		/*  drivers to later parse */		len = (int)(buffer - begin);		if (len) {			/* FIXME: We should realloc and append here */			if (!config->extra_length) {				config->extra = malloc(len);				if (!config->extra) {					r = LIBUSB_ERROR_NO_MEM;					goto err;				}				memcpy((unsigned char *) config->extra, begin, len);				config->extra_length = len;			}		}		r = parse_interface(ctx, interface + i, buffer, size, host_endian);		if (r < 0)			goto err;		buffer += r;		size -= r;	}	return size;err:	clear_configuration(config);	return r;}/** \ingroup desc * Get the USB device descriptor for a given device. * * This is a non-blocking function; the device descriptor is cached in memory. * * \param dev the device * \param desc output location for the descriptor data * \returns 0 on success or a LIBUSB_ERROR code on failure */API_EXPORTED int libusb_get_device_descriptor(libusb_device *dev,	struct libusb_device_descriptor *desc){	unsigned char raw_desc[DEVICE_DESC_LENGTH];	int host_endian = 0;	int r;	usbi_dbg("");	r = usbi_backend->get_device_descriptor(dev, raw_desc, &host_endian);	if (r < 0)		return r;	memcpy((unsigned char *) desc, raw_desc, sizeof(raw_desc));	if (host_endian) {		desc->bcdUSB = libusb_cpu_to_le16(desc->bcdUSB);		desc->idVendor = libusb_cpu_to_le16(desc->idVendor);		desc->idProduct = libusb_cpu_to_le16(desc->idProduct);		desc->bcdDevice = libusb_cpu_to_le16(desc->bcdDevice);	}	return 0;}/** \ingroup desc * Get the USB configuration descriptor for the currently active configuration. * This is a non-blocking function which does not involve any requests being * sent to the device. * * \param dev a device * \param config output location for the USB configuration descriptor. Only * valid if 0 was returned. Must be freed with libusb_free_config_descriptor() * after use. * \returns 0 on success * \returns LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state * \returns another LIBUSB_ERROR code on error * \see libusb_get_config_descriptor */API_EXPORTED int libusb_get_active_config_descriptor(libusb_device *dev,	struct libusb_config_descriptor **config){	struct libusb_config_descriptor *_config = malloc(sizeof(*_config));	unsigned char tmp[8];	unsigned char *buf = NULL;	int host_endian = 0;	int r;	usbi_dbg("");	if (!_config)		return LIBUSB_ERROR_NO_MEM;	r = usbi_backend->get_active_config_descriptor(dev, tmp, sizeof(tmp),		&host_endian);	if (r < 0)		goto err;	usbi_parse_descriptor(tmp, "bbw", _config, host_endian);	buf = malloc(_config->wTotalLength);	if (!buf) {		r = LIBUSB_ERROR_NO_MEM;		goto err;	}	r = usbi_backend->get_active_config_descriptor(dev, buf,		_config->wTotalLength, &host_endian);	if (r < 0)		goto err;	r = parse_configuration(dev->ctx, _config, buf, host_endian);	if (r < 0) {		usbi_err(dev->ctx, "parse_configuration failed with error %d", r);		goto err;	} else if (r > 0) {		usbi_warn(dev->ctx, "descriptor data still left");	}	*config = _config;	return 0;err:	free(_config);	if (buf)		free(buf);	return r;}/** \ingroup desc * Get a USB configuration descriptor based on its index. * This is a non-blocking function which does not involve any requests being * sent to the device. * * \param dev a device * \param config_index the index of the configuration you wish to retrieve * \param config output location for the USB configuration descriptor. Only * valid if 0 was returned. Must be freed with libusb_free_config_descriptor() * after use. * \returns 0 on success * \returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist * \returns another LIBUSB_ERROR code on error * \see libusb_get_active_config_descriptor() * \see libusb_get_config_descriptor_by_value() */API_EXPORTED int libusb_get_config_descriptor(libusb_device *dev,	uint8_t config_index, struct libusb_config_descriptor **config){	struct libusb_config_descriptor *_config;	unsigned char tmp[8];	unsigned char *buf = NULL;	int host_endian = 0;	int r;	usbi_dbg("index %d", config_index);	if (config_index >= dev->num_configurations)		return LIBUSB_ERROR_NOT_FOUND;	_config = malloc(sizeof(*_config));	if (!_config)		return LIBUSB_ERROR_NO_MEM;	r = usbi_backend->get_config_descriptor(dev, config_index, tmp,		sizeof(tmp), &host_endian);	if (r < 0)		goto err;	usbi_parse_descriptor(tmp, "bbw", _config, host_endian);	buf = malloc(_config->wTotalLength);	if (!buf) {		r = LIBUSB_ERROR_NO_MEM;		goto err;	}	r = usbi_backend->get_config_descriptor(dev, config_index, buf,		_config->wTotalLength, &host_endian);	if (r < 0)		goto err;	r = parse_configuration(dev->ctx, _config, buf, host_endian);	if (r < 0) {		usbi_err(dev->ctx, "parse_configuration failed with error %d", r);		goto err;	} else if (r > 0) {		usbi_warn(dev->ctx, "descriptor data still left");	}	*config = _config;	return 0;err:	free(_config);	if (buf)		free(buf);	return r;}/* iterate through all configurations, returning the index of the configuration * matching a specific bConfigurationValue in the idx output parameter, or -1 * if the config was not found. * returns 0 or a LIBUSB_ERROR code */int usbi_get_config_index_by_value(struct libusb_device *dev,	uint8_t bConfigurationValue, int *idx){	int i;	usbi_dbg("value %d", bConfigurationValue);	for (i = 0; i < dev->num_configurations; i++) {		unsigned char tmp[6];		int host_endian;		int r = usbi_backend->get_config_descriptor(dev, i, tmp, sizeof(tmp),			&host_endian);		if (r < 0)			return r;		if (tmp[5] == bConfigurationValue) {			*idx = i;			return 0;		}	}	*idx = -1;	return 0;}/** \ingroup desc * Get a USB configuration descriptor with a specific bConfigurationValue. * This is a non-blocking function which does not involve any requests being * sent to the device. * * \param dev a device * \param bConfigurationValue the bConfigurationValue of the configuration you * wish to retrieve * \param config output location for the USB configuration descriptor. Only * valid if 0 was returned. Must be freed with libusb_free_config_descriptor() * after use. * \returns 0 on success * \returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist * \returns another LIBUSB_ERROR code on error * \see libusb_get_active_config_descriptor() * \see libusb_get_config_descriptor() */API_EXPORTED int libusb_get_config_descriptor_by_value(libusb_device *dev,	uint8_t bConfigurationValue, struct libusb_config_descriptor **config){	int idx;	int r = usbi_get_config_index_by_value(dev, bConfigurationValue, &idx);	if (r < 0)		return r;	else if (idx == -1)		return LIBUSB_ERROR_NOT_FOUND;	else		return libusb_get_config_descriptor(dev, idx, config);}/** \ingroup desc * Free a configuration descriptor obtained from * libusb_get_active_config_descriptor() or libusb_get_config_descriptor(). * It is safe to call this function with a NULL config parameter, in which * case the function simply returns. * * \param config the configuration descriptor to free */API_EXPORTED void libusb_free_config_descriptor(	struct libusb_config_descriptor *config){	if (!config)		return;	clear_configuration(config);	free(config);}/** \ingroup desc * Retrieve a string descriptor in C style ASCII. * * Wrapper around libusb_get_string_descriptor(). Uses the first language  * supported by the device. * * \param dev a device handle * \param desc_index the index of the descriptor to retrieve * \param data output buffer for ASCII string descriptor * \param length size of data buffer * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure */API_EXPORTED int libusb_get_string_descriptor_ascii(libusb_device_handle *dev,	uint8_t desc_index, unsigned char *data, int length){	unsigned char tbuf[255]; /* Some devices choke on size > 255 */	int r, langid, si, di;	/* Asking for the zero'th index is special - it returns a string	 * descriptor that contains all the language IDs supported by the device.	 * Typically there aren't many - often only one. The language IDs are 16	 * bit numbers, and they start at the third byte in the descriptor. See	 * USB 2.0 specification section 9.6.7 for more information. */	r = libusb_get_string_descriptor(dev, 0, 0, tbuf, sizeof(tbuf));	if (r < 0)		return r;	if (r < 4)		return LIBUSB_ERROR_IO;	langid = tbuf[2] | (tbuf[3] << 8);	r = libusb_get_string_descriptor(dev, desc_index, langid, tbuf,		sizeof(tbuf));	if (r < 0)		return r;	if (tbuf[1] != LIBUSB_DT_STRING)		return LIBUSB_ERROR_IO;	if (tbuf[0] > r)		return LIBUSB_ERROR_IO;	for (di = 0, si = 2; si < tbuf[0]; si += 2) {		if (di >= (length - 1))			break;		if (tbuf[si + 1]) /* high byte */			data[di++] = '?';		else			data[di++] = tbuf[si];	}	data[di] = 0;	return di;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产日韩精品免费观看| 亚洲国产一区视频| 精品乱人伦一区二区三区| 9191成人精品久久| 91麻豆精品国产91久久久更新时间 | 一区二区三区欧美视频| **性色生活片久久毛片| 国产精品国产精品国产专区不蜜 | 日韩美女天天操| 精品人在线二区三区| 久久综合久久综合久久综合| 久久精品网站免费观看| 日本一区二区电影| 亚洲欧洲成人精品av97| 亚洲色图在线看| 亚洲一区在线观看视频| 日韩国产一二三区| 韩国成人在线视频| 国产sm精品调教视频网站| 成人久久视频在线观看| 欧洲精品视频在线观看| 欧美日本视频在线| 亚洲精品一区二区三区在线观看| 久久亚洲精品国产精品紫薇| 久久99精品久久久久久动态图 | 成人毛片视频在线观看| 色悠悠亚洲一区二区| 精品婷婷伊人一区三区三| 日韩视频免费观看高清完整版在线观看 | 日韩一区二区在线看片| 久久久亚洲精品一区二区三区 | 国产一区二区三区四区五区入口 | 国产精品69毛片高清亚洲| 国产一区二区调教| 国产激情91久久精品导航| 国产福利精品导航| 成人av网站大全| 91丨porny丨户外露出| 在线观看亚洲一区| 欧美一区二区三区四区在线观看| 在线不卡中文字幕| 久久一日本道色综合| 国产精品午夜在线观看| 蜜桃av噜噜一区二区三区小说| 中文字幕在线不卡一区二区三区| 亚洲人成网站影音先锋播放| 亚洲大片精品永久免费| 狂野欧美性猛交blacked| 一本大道久久精品懂色aⅴ| 99re8在线精品视频免费播放| 福利视频网站一区二区三区| 成人综合在线视频| 欧美精品在线一区二区三区| 中文字幕一区日韩精品欧美| 色综合中文综合网| 国产精品中文有码| 色素色在线综合| 欧美精品一区二区在线播放| 亚洲欧美激情视频在线观看一区二区三区 | 国产成人av福利| 国产日韩欧美高清| 午夜日韩在线电影| 99久久婷婷国产综合精品电影| 日韩免费看的电影| 一区二区三区免费在线观看| 成人综合婷婷国产精品久久免费| 日韩一级免费一区| 一区二区欧美视频| 成人h动漫精品一区二区 | 日本中文一区二区三区| 色综合久久中文字幕综合网| 国产日韩欧美高清在线| 久久电影国产免费久久电影| 欧美日韩国产精选| 一区二区三区欧美亚洲| gogo大胆日本视频一区| 国产三级一区二区三区| 精品亚洲成a人| 欧美一区二区三区男人的天堂| 亚洲精品欧美综合四区| 成人福利视频在线看| 久久久另类综合| 国产综合久久久久久久久久久久 | 亚洲影视资源网| 成人99免费视频| 国产欧美一区二区精品忘忧草 | 欧美主播一区二区三区| 亚洲三级免费观看| 92精品国产成人观看免费| 欧美—级在线免费片| 国产乱码精品一区二区三区五月婷 | 国产欧美一区二区三区沐欲 | 正在播放亚洲一区| 亚洲午夜影视影院在线观看| 在线观看区一区二| 尤物av一区二区| 欧美午夜免费电影| 亚洲国产精品影院| 欧美精品亚洲二区| 视频一区在线视频| 欧美一区二区啪啪| 美女视频一区二区| 精品久久国产97色综合| 国产在线视视频有精品| 久久久久国产成人精品亚洲午夜| 国产精品一区二区你懂的| 国产人成亚洲第一网站在线播放| 成人影视亚洲图片在线| 国产精品九色蝌蚪自拍| 色综合激情久久| 五月婷婷色综合| 日韩亚洲电影在线| 韩国中文字幕2020精品| 国产欧美日韩视频一区二区| 成人av集中营| 国产成人av一区| 国产精品久久久久久久岛一牛影视| www.亚洲激情.com| 亚洲综合色成人| 91精品国模一区二区三区| 久久精品国产久精国产爱| 26uuu欧美日本| 成人免费视频一区| 一区二区三区四区av| 欧美一区二区啪啪| 国产91在线观看| 亚洲综合男人的天堂| 日韩精品一区在线| 不卡视频在线看| 婷婷综合在线观看| 国产亚洲一本大道中文在线| 99vv1com这只有精品| 天堂在线一区二区| 欧美极品aⅴ影院| 欧美日韩性生活| 国产一本一道久久香蕉| 亚洲精品久久久久久国产精华液| 7777精品久久久大香线蕉 | 51久久夜色精品国产麻豆| 国产乱人伦精品一区二区在线观看| 亚洲欧洲国产日韩| 日韩精品一区二区在线| 91在线播放网址| 蜜臀av在线播放一区二区三区 | 成人午夜又粗又硬又大| 一区二区三区产品免费精品久久75 | 国产精品视频免费| 91精品蜜臀在线一区尤物| 成人18精品视频| 日韩高清国产一区在线| 中文字幕精品一区| 7777精品伊人久久久大香线蕉经典版下载 | 免费观看30秒视频久久| 中文字幕一区二区三区四区 | 久久久精品tv| 欧美日韩色一区| 国产成人精品www牛牛影视| 午夜欧美2019年伦理 | 国产69精品久久99不卡| 偷拍日韩校园综合在线| 国产精品久久午夜夜伦鲁鲁| 亚洲柠檬福利资源导航| 久久久91精品国产一区二区三区| 精品视频色一区| 91免费版在线| 国产一区二区三区免费看| 亚洲国产精品久久久男人的天堂| 欧美高清在线一区| 日韩久久久久久| 欧美体内she精高潮| 99久久国产免费看| 国产成人在线看| 精品一区二区在线免费观看| 亚洲五月六月丁香激情| 国产精品乱码一区二区三区软件 | 亚洲图片激情小说| 久久精品一区二区三区不卡| 91精品国产综合久久久蜜臀图片| 在线看日本不卡| 99热精品国产| 成人影视亚洲图片在线| 狠狠久久亚洲欧美| 另类中文字幕网| 欧美a一区二区| 午夜av区久久| 亚洲成人www| 亚洲高清免费视频| 一卡二卡欧美日韩| 亚洲欧美国产三级| 亚洲啪啪综合av一区二区三区| 中文字幕乱码亚洲精品一区| 久久在线观看免费| www国产亚洲精品久久麻豆| 日韩午夜在线影院| 日韩女优av电影在线观看| 日韩午夜中文字幕| 日韩一区二区三区在线观看| 欧美精品久久99久久在免费线| 精品视频在线视频| 欧美日韩国产系列|