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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? usb.c

?? 微軟的point of sale的源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:

    ASSERT(pipeHandle);
	DBGSHOWBYTES("WritePipe bytes:", data, dataLen);

    urb.UrbBulkOrInterruptTransfer.Hdr.Function = URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER;
    urb.UrbBulkOrInterruptTransfer.Hdr.Length = sizeof(struct _URB_BULK_OR_INTERRUPT_TRANSFER);
    urb.UrbBulkOrInterruptTransfer.PipeHandle = pipeHandle;
    urb.UrbBulkOrInterruptTransfer.TransferBufferLength = dataLen;
    urb.UrbBulkOrInterruptTransfer.TransferBufferMDL = NULL;
    urb.UrbBulkOrInterruptTransfer.TransferBuffer = data;
    urb.UrbBulkOrInterruptTransfer.TransferFlags = USBD_SHORT_TRANSFER_OK | USBD_TRANSFER_DIRECTION_OUT;
    urb.UrbBulkOrInterruptTransfer.UrbLink = NULL;

	status = SubmitUrb(parentFdoExt->topDevObj, &urb, TRUE, NULL, NULL);

	return status;
}


NTSTATUS SubmitUrb( PDEVICE_OBJECT pdo, 
                    PURB urb, 
                    BOOLEAN synchronous, 
                    PVOID completionRoutine,
                    PVOID completionContext)
/*++

Routine Description:

    Send the URB to the USB device.
	If synchronous is TRUE, ignore the completion info and synchonize the IRP;
    otherwise, don't synchronize and set the provided completion routine for the IRP.

Arguments:

    
Return Value:

    NT status code

--*/
{
    PIRP irp;
    NTSTATUS status;


	/*
	 *  Allocate the IRP to send the buffer down the USB stack.
	 *
	 *  Don't use IoBuildDeviceIoControlRequest (because it queues
	 *  the IRP on the current thread's irp list and may
	 *  cause the calling process to hang if the IopCompleteRequest APC
	 *  does not fire and dequeue the IRP).
	 */
	irp = IoAllocateIrp(pdo->StackSize, FALSE);

    if (irp){
        PIO_STACK_LOCATION nextSp;

        #if STATUS_ENDPOINT
		DBGVERBOSE(("SubmitUrb: submitting URB %ph on IRP %ph (sync=%d)", urb, irp, synchronous));
        #endif

        nextSp = IoGetNextIrpStackLocation(irp);
		nextSp->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;
		nextSp->Parameters.DeviceIoControl.IoControlCode = IOCTL_INTERNAL_USB_SUBMIT_URB;

		/*
		 *  Attach the URB to this IRP.
		 */
        nextSp->Parameters.Others.Argument1 = urb;

        if (synchronous){

            status = CallDriverSync(pdo, irp);

			IoFreeIrp(irp);
        }
        else {
            /*
             *  Caller's completion routine will free the irp 
             *  when it completes.
             */
            ASSERT(completionRoutine);
            ASSERT(completionContext);
            IoSetCompletionRoutine( irp, 
                                    completionRoutine, 
                                    completionContext,
                                    TRUE, TRUE, TRUE);
            status = IoCallDriver(pdo, irp);
        }
    }
    else {
        status = STATUS_INSUFFICIENT_RESOURCES;
    }

    return status;
}




NTSTATUS SelectConfiguration(PARENTFDOEXT *parentFdoExt)
{
	USBD_INTERFACE_LIST_ENTRY interfaceList[2];
	NTSTATUS status;
	
	/*
	 *  We only look at vendor-class interfaces
	 */
	// BUGBUG - limited to one interface
	interfaceList[0].InterfaceDescriptor = USBD_ParseConfigurationDescriptorEx(
                parentFdoExt->configDesc,
                parentFdoExt->configDesc,
                -1,
                -1,
                USB_INTERFACE_CLASS_VENDOR,
                -1,
                -1);

	if (interfaceList[0].InterfaceDescriptor){
		PURB urb;

		interfaceList[1].InterfaceDescriptor = NULL;	

		urb = USBD_CreateConfigurationRequestEx(parentFdoExt->configDesc, &interfaceList[0]);
		if (urb){

			status = SubmitUrb(parentFdoExt->topDevObj, urb, TRUE, NULL, NULL);

            if (NT_SUCCESS(status)){
				PUSBD_INTERFACE_INFORMATION interfaceInfo;

				parentFdoExt->configHandle = urb->UrbSelectConfiguration.ConfigurationHandle;

				interfaceInfo = &urb->UrbSelectConfiguration.Interface;
				parentFdoExt->interfaceInfo = MemDup(interfaceInfo, interfaceInfo->Length);
				if (parentFdoExt->interfaceInfo){
                    DBGVERBOSE(("SelectConfiguration: got interfaceInfo @ %ph.", parentFdoExt->interfaceInfo));
				}
				else {
					status = STATUS_INSUFFICIENT_RESOURCES;
				}
			}
			else {
				DBGERR(("SelectConfiguration: URB failed w/ %xh.", status));
			}

			FREEPOOL(urb);
		}
		else {
			status = STATUS_INSUFFICIENT_RESOURCES;
		}
	}
	else {
		status = STATUS_DEVICE_DATA_ERROR;
	}


	return status;
}



NTSTATUS CreatePdoForEachEndpointPair(PARENTFDOEXT *parentFdoExt)
/*++

Routine Description:

    Walk the USB endpoints.
	For each input/output endpoint pair, create one PDO
	which will be exposed as a COM (serial) port interface.

	BUGBUG - right now, this only looks at the first interface 
			 (on the default confuguration)

Arguments:

    parentFdoExt - device extension for the targetted device object

Return Value:

    NT status code

--*/
{
    NTSTATUS status;
    ULONG maxPossiblePDOs, deviceRelationsSize;

    maxPossiblePDOs = (parentFdoExt->interfaceInfo->NumberOfPipes/2);
    deviceRelationsSize = sizeof(DEVICE_RELATIONS) + maxPossiblePDOs*sizeof(PDEVICE_OBJECT);
    parentFdoExt->deviceRelations = ALLOCPOOL(NonPagedPool, deviceRelationsSize);

    if (parentFdoExt->deviceRelations){
        ULONG inputPipeIndex = 0, outputPipeIndex = 0, statusPipeIndex = 0, comInterfaceIndex = 0;

        RtlZeroMemory(parentFdoExt->deviceRelations, deviceRelationsSize);

        status = STATUS_NO_MATCH;

        while (TRUE){
            UCHAR endPtAddr;
            USBD_PIPE_TYPE pipeType;

            #if STATUS_ENDPOINT
            /*
             *  In the case of Serial Emulation, the protocol is that all DATA endpoints
             *  will be of type BULK and all STATUS endpoints will be of type INTERRUPT.
             */
            if(parentFdoExt->posFlag & SERIAL_EMULATION) {
                while(inputPipeIndex < parentFdoExt->interfaceInfo->NumberOfPipes) {
                    endPtAddr = parentFdoExt->interfaceInfo->Pipes[inputPipeIndex].EndpointAddress;
                    pipeType = parentFdoExt->interfaceInfo->Pipes[inputPipeIndex].PipeType;
                    if((pipeType == UsbdPipeTypeBulk) && (endPtAddr & USB_ENDPOINT_DIRECTION_MASK)) 
                        break;
                    inputPipeIndex++;
                }
                while(outputPipeIndex < parentFdoExt->interfaceInfo->NumberOfPipes) {
                endPtAddr = parentFdoExt->interfaceInfo->Pipes[outputPipeIndex].EndpointAddress;
                    pipeType = parentFdoExt->interfaceInfo->Pipes[outputPipeIndex].PipeType;
                    if((pipeType == UsbdPipeTypeBulk) && !(endPtAddr & USB_ENDPOINT_DIRECTION_MASK))
	                    break;
                    outputPipeIndex++;
                }
                while(statusPipeIndex < parentFdoExt->interfaceInfo->NumberOfPipes) {
                    endPtAddr = parentFdoExt->interfaceInfo->Pipes[statusPipeIndex].EndpointAddress;
                    pipeType = parentFdoExt->interfaceInfo->Pipes[statusPipeIndex].PipeType;
                    if((pipeType == UsbdPipeTypeInterrupt) && (endPtAddr & USB_ENDPOINT_DIRECTION_MASK))
                        break;
                    statusPipeIndex++;
	            }
                if(!(statusPipeIndex < parentFdoExt->interfaceInfo->NumberOfPipes))
                    break;
            }
            else {
            #endif
                /*
                 *  No Serial Emulation required. Find only DATA endpoints
                 *  which can be of either type in this case.
                 */
                while(inputPipeIndex < parentFdoExt->interfaceInfo->NumberOfPipes) {
                    endPtAddr = parentFdoExt->interfaceInfo->Pipes[inputPipeIndex].EndpointAddress;
                    pipeType = parentFdoExt->interfaceInfo->Pipes[inputPipeIndex].PipeType;
                    if((pipeType == UsbdPipeTypeInterrupt) || (pipeType == UsbdPipeTypeBulk)) {
                        if(endPtAddr & USB_ENDPOINT_DIRECTION_MASK) {
	                        break;
                        }
                    }
                    inputPipeIndex++;
                }
                while(outputPipeIndex < parentFdoExt->interfaceInfo->NumberOfPipes) {
                    endPtAddr = parentFdoExt->interfaceInfo->Pipes[outputPipeIndex].EndpointAddress;
                    pipeType = parentFdoExt->interfaceInfo->Pipes[outputPipeIndex].PipeType;
                    if((pipeType == UsbdPipeTypeInterrupt) || (pipeType == UsbdPipeTypeBulk)) {
                        if(!(endPtAddr & USB_ENDPOINT_DIRECTION_MASK)) {
	                        break;
                        }
                    }
                    outputPipeIndex++;
                }
            #if STATUS_ENDPOINT
            }
            #endif

            if ((inputPipeIndex < parentFdoExt->interfaceInfo->NumberOfPipes) &&
	            (outputPipeIndex < parentFdoExt->interfaceInfo->NumberOfPipes)){

                /*
                 *  We've found a pair (in/out) of endpoints.
                 *  Create a PDO to represent a COM (serial) port interface on these endpoints.
                 */
                PUSBD_PIPE_INFORMATION inputPipeInfo = &parentFdoExt->interfaceInfo->Pipes[inputPipeIndex];
                PUSBD_PIPE_INFORMATION outputPipeInfo = &parentFdoExt->interfaceInfo->Pipes[outputPipeIndex];
                ENDPOINTINFO inputEndpointInfo, outputEndpointInfo, statusEndpointInfo;
                #if EPSON_PRINTER
                /*
                 *  On the EPSON printer, we want to talk to the endpoints size 0x40,
                 *  not the other pair with length 8.
                 */
                if ((inputPipeInfo->MaximumPacketSize == 8) && (outputPipeInfo->MaximumPacketSize == 8)){
                    inputPipeIndex++, outputPipeIndex++;
                    continue;
                }
                #endif

                inputEndpointInfo.pipeHandle = inputPipeInfo->PipeHandle;
                inputEndpointInfo.pipeLen = inputPipeInfo->MaximumPacketSize;
                inputEndpointInfo.endpointIsBusy = FALSE;

                outputEndpointInfo.pipeHandle = outputPipeInfo->PipeHandle;
                outputEndpointInfo.pipeLen = outputPipeInfo->MaximumPacketSize;
                outputEndpointInfo.endpointIsBusy = FALSE;

                #if STATUS_ENDPOINT
                if(parentFdoExt->posFlag & SERIAL_EMULATION) {
                    PUSBD_PIPE_INFORMATION statusPipeInfo = &parentFdoExt->interfaceInfo->Pipes[statusPipeIndex];
                    statusEndpointInfo.pipeHandle = statusPipeInfo->PipeHandle;
                    statusEndpointInfo.pipeLen = statusPipeInfo->MaximumPacketSize;
                    statusEndpointInfo.endpointIsBusy = FALSE;
                }
                #endif

                status = CreateCOMPdo(parentFdoExt, comInterfaceIndex++, &inputEndpointInfo, &outputEndpointInfo, &statusEndpointInfo);
                if (NT_SUCCESS(status)){
                    DBGVERBOSE(("CreatePdoForEachEndpointPair: created COMPdo with in/out len %xh/%xh.", inputEndpointInfo.pipeLen, outputEndpointInfo.pipeLen));
                    inputPipeIndex++, outputPipeIndex++, statusPipeIndex++; 
                }
                else {
                    DBGERR(("CreatePdoForEachEndpointPair: CreateCOMPdo failed with %xh.", status));
                    break;
                }
            }
            else {
                if((parentFdoExt->posFlag & ODD_ENDPOINT) && 
                   ((inputPipeIndex + outputPipeIndex) < (2 * parentFdoExt->interfaceInfo->NumberOfPipes))) {

                    /*
                     *  We've found an odd endpoint.
                     *  Create a PDO to represent a COM (serial) port interface on this endpoint.
                     */
                    PUSBD_PIPE_INFORMATION oddPipeInfo = &parentFdoExt->interfaceInfo->Pipes[MIN(inputPipeIndex, outputPipeIndex)];
                    ENDPOINTINFO oddEndpointInfo;

                    oddEndpointInfo.pipeHandle = oddPipeInfo->PipeHandle;
                    oddEndpointInfo.pipeLen = oddPipeInfo->MaximumPacketSize;
                    oddEndpointInfo.endpointIsBusy = FALSE;

                    if(inputPipeIndex < parentFdoExt->interfaceInfo->NumberOfPipes)
                        status = CreateCOMPdo(parentFdoExt, comInterfaceIndex++, &oddEndpointInfo, NULL, NULL);
                    else
                        status = CreateCOMPdo(parentFdoExt, comInterfaceIndex++, NULL, &oddEndpointInfo, NULL);

                    if (NT_SUCCESS(status)){
                        DBGVERBOSE(("CreatePdoForEachEndpointPair: created <odd> COMPdo with len %xh.", oddEndpointInfo.pipeLen));
                    }
                    else {
                        DBGERR(("CreatePdoForEachEndpointPair: CreateCOMPdo failed with %xh.", status));
                        break;
                    }
                }
                break;
            }
        }
    }
    else {
        status = STATUS_INSUFFICIENT_RESOURCES;
    }

    ASSERT(NT_SUCCESS(status));
    return status;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线国偷精品产拍免费yy| 欧美激情一二三区| www.欧美日韩| 99riav一区二区三区| 色综合久久88色综合天天| 精品日韩欧美一区二区| 亚洲成人高清在线| 色狠狠一区二区| 国产一区欧美一区| 国产精品你懂的| 国产欧美日韩亚州综合| 亚洲男人天堂av网| 69成人精品免费视频| 婷婷激情综合网| 色综合久久中文字幕综合网| 亚洲精品一二三| 欧美大片在线观看一区二区| 色综合欧美在线| 狠狠色丁香久久婷婷综合丁香| 亚洲柠檬福利资源导航| 26uuu另类欧美| 欧美日韩一区二区三区不卡 | 99久久99久久精品国产片果冻| 蜜桃久久久久久| 中文字幕在线一区| 色噜噜狠狠色综合欧洲selulu| 久久97超碰色| 五月婷婷激情综合| 一区二区三区中文字幕在线观看| 精品sm捆绑视频| 欧美精品一卡二卡| 欧美日韩免费在线视频| 91亚洲精品乱码久久久久久蜜桃 | 亚洲精品成人悠悠色影视| 国产三级精品三级在线专区| 日韩欧美亚洲另类制服综合在线 | 国产欧美视频一区二区| 日韩三级视频在线看| 成人开心网精品视频| 成人性视频免费网站| 久久99在线观看| 美女一区二区三区| 偷窥少妇高潮呻吟av久久免费| 午夜激情综合网| 亚洲夂夂婷婷色拍ww47| **性色生活片久久毛片| 国产精品理论片在线观看| 国产精品伦一区二区三级视频| 精品国产乱码久久久久久蜜臀| 在线成人午夜影院| 9191成人精品久久| 色屁屁一区二区| 欧美性一级生活| 91久久精品午夜一区二区| 丁香亚洲综合激情啪啪综合| 国产精一区二区三区| 成人v精品蜜桃久久一区| 国产高清不卡二三区| 国产一区欧美日韩| 国产福利一区在线| 色偷偷久久人人79超碰人人澡| 9久草视频在线视频精品| 国产成人亚洲综合色影视| 美女网站色91| 91久久精品一区二区| 日本美女视频一区二区| 91热门视频在线观看| 久久午夜老司机| 欧美成人精品1314www| 精品国产亚洲在线| 国产精品视频一区二区三区不卡| 成人爽a毛片一区二区免费| 高清不卡在线观看av| 国产69精品久久99不卡| 成年人国产精品| 欧美日韩一区二区三区视频| 欧美一级黄色片| 精品国产成人在线影院| 欧美国产激情二区三区| 亚洲男人的天堂在线aⅴ视频| 一级日本不卡的影视| 视频一区在线播放| 激情综合色播五月| 石原莉奈一区二区三区在线观看| 国产主播一区二区| av成人免费在线| 欧美日韩一区在线| 精品日韩99亚洲| 亚洲人亚洲人成电影网站色| 亚洲精品国产一区二区三区四区在线| 久久视频一区二区| 国产精品久久久久aaaa樱花| 亚洲精品国产a久久久久久 | 五月天一区二区三区| 国内精品免费**视频| 91黄色免费版| 国产视频一区二区在线| 视频一区二区三区入口| 99久久精品国产网站| 欧美videos大乳护士334| 亚洲成人先锋电影| 91首页免费视频| 精品福利一区二区三区| 午夜成人免费视频| 不卡视频一二三四| 欧美tickling挠脚心丨vk| 亚洲图片欧美综合| 日本精品一区二区三区高清| 国产喂奶挤奶一区二区三区| 蜜臀av一区二区在线观看| 欧美最新大片在线看| 国产精品高潮呻吟| 国内精品伊人久久久久影院对白| 欧美日韩国产系列| 亚洲综合色丁香婷婷六月图片| 成人av电影在线| 国产欧美精品一区二区色综合| 韩国精品主播一区二区在线观看 | 亚洲精品在线三区| 三级影片在线观看欧美日韩一区二区| 色综合久久综合网欧美综合网 | 另类欧美日韩国产在线| 3d动漫精品啪啪一区二区竹菊| 一级女性全黄久久生活片免费| 99国产精品99久久久久久| 日本一区二区三区在线观看| 国产精品中文字幕日韩精品| 精品福利av导航| 国产一区二区三区不卡在线观看 | 黑人精品欧美一区二区蜜桃| 日韩一区二区精品| 伦理电影国产精品| 精品噜噜噜噜久久久久久久久试看| 日韩影院在线观看| 欧美精品 日韩| 日韩**一区毛片| 精品国产三级电影在线观看| 国产综合久久久久影院| 国产亚洲欧美色| 成人免费观看av| 亚洲人成电影网站色mp4| 色综合欧美在线视频区| 亚洲国产人成综合网站| 欧美日韩免费视频| 日本欧美一区二区| 欧美本精品男人aⅴ天堂| 激情亚洲综合在线| 国产精品电影院| 色综合中文字幕国产 | 中文字幕av一区二区三区高| 99r国产精品| 亚洲成人午夜影院| 欧美成人欧美edvon| 国产很黄免费观看久久| 亚洲私人影院在线观看| 欧美亚洲高清一区| 久久电影国产免费久久电影| 日本一区二区三级电影在线观看 | 欧美丝袜自拍制服另类| 丝瓜av网站精品一区二区| 2014亚洲片线观看视频免费| 丁香婷婷综合激情五月色| 综合自拍亚洲综合图不卡区| 欧美影视一区二区三区| 老司机一区二区| 国产精品传媒视频| 欧美精品色综合| 国产丶欧美丶日本不卡视频| 亚洲欧美另类小说| 日韩三级精品电影久久久| 国产成人在线电影| 亚洲bt欧美bt精品777| 日韩欧美色综合| 99精品一区二区三区| 日韩不卡一区二区三区| 国产欧美一区二区精品性色| 欧美羞羞免费网站| 国产a级毛片一区| 午夜伦欧美伦电影理论片| 久久久精品综合| 欧美日韩一级二级三级| 国产一区二区在线电影| 亚洲国产日日夜夜| 国产精品久久久久一区二区三区共| 欧美体内she精高潮| 成人午夜激情片| 久久99久久久欧美国产| 亚洲卡通欧美制服中文| 久久综合狠狠综合久久综合88 | 国产婷婷色一区二区三区四区| 色成人在线视频| 国产美女av一区二区三区| 午夜天堂影视香蕉久久| 国产精品久久久久久妇女6080| 538prom精品视频线放| 91麻豆国产精品久久| 成人网男人的天堂| 精品一区二区三区久久| 亚洲va欧美va天堂v国产综合| 专区另类欧美日韩|