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

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

?? d12.c

?? 用S3C44B0X對(duì)硬盤進(jìn)行操作
?? C
?? 第 1 頁 / 共 4 頁
字號(hào):
        // We have the configuration descriptor for the configuration
        // we want.
        //
        // Now we issue the select configuration command to get
        // the  pipes associated with this configuration.
        //

        ntStatus = D12_SelectInterface(DeviceObject,
            configurationDescriptor, NULL);

        ExFreePool(configurationDescriptor);

    }



    D12_KdPrint (("D12TEST.SYS: exit D12_ConfigureDevice (%x)\n", ntStatus));

    return ntStatus;
}


NTSTATUS
D12_SelectInterface(
    IN PDEVICE_OBJECT DeviceObject,
    IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
    PUSBD_INTERFACE_INFORMATION Interface
    )
/*++

Routine Description:

    Initializes an 82930 with multiple interfaces

Arguments:

    DeviceObject - pointer to the device object for this instance of the 82930
                    devcice.

    ConfigurationDescriptor - pointer to the USB configuration
                    descriptor containing the interface and endpoint
                    descriptors.

Return Value:

    NT status code

--*/
{
    PDEVICE_EXTENSION deviceExtension;
    NTSTATUS ntStatus;
    PURB urb = NULL;
    ULONG i;
    UCHAR alternateSetting, interfaceNumber;
    PUSB_INTERFACE_DESCRIPTOR interfaceDescriptor = NULL;
    USHORT siz;

    D12_KdPrint (("D12TEST.SYS: enter D12_SelectInterface\n"));

    deviceExtension = DeviceObject->DeviceExtension;

    if (Interface == NULL) {

        //
        // D12 driver only supports one interface, we must search
        // the configuration descriptor for the interface we want
        // and remember the pipes.
        //

        urb = USBD_CreateConfigurationRequest(ConfigurationDescriptor, &siz);

        if (urb) {

            //
            // search thru all the interfaces
            // and find any we are interested in
            //

            interfaceNumber = 0;
            alternateSetting = 0;
//            alternateSetting = 3;

            interfaceDescriptor =
                USBD_ParseConfigurationDescriptor(ConfigurationDescriptor,
                                                  interfaceNumber,
                                                  alternateSetting);

            Interface = &urb->UrbSelectConfiguration.Interface;
            
            for (i=0; i< Interface->NumberOfPipes; i++) {
                //
                // perform any pipe initialization here
                //
                Interface->Pipes[i].MaximumTransferSize = 64*1024-1;
            }

            UsbBuildSelectConfigurationRequest(urb,
                                              (USHORT) siz,
                                              ConfigurationDescriptor);

//            Interface->AlternateSetting = 3;
            
            ntStatus = D12_CallUSBD(DeviceObject, urb);

            deviceExtension->ConfigurationHandle =
                urb->UrbSelectConfiguration.ConfigurationHandle;

        } else {
            ntStatus = STATUS_INSUFFICIENT_RESOURCES;
        }

    } else {
        //
        // we were give an interface already set up
        //
        // do a selectinterface here if we want to change any of the
        // pipe parameters.
        //

        TRAP();

    }

    ASSERT(Interface != NULL);

    if (NT_SUCCESS(ntStatus)) {

        //
        // Save the configuration handle for this device
        //

        deviceExtension->ConfigurationHandle =
            urb->UrbSelectConfiguration.ConfigurationHandle;

        deviceExtension->Interface = ExAllocatePool(NonPagedPool,
                                                    Interface->Length);

        if (deviceExtension->Interface) {
            ULONG j;

            //
            // save a copy of the interface information returned
            //
            RtlCopyMemory(deviceExtension->Interface, Interface, Interface->Length);

            //
            // Dump the interface to the debugger
            //
            D12_KdPrint (("D12TEST.SYS: ---------\n"));
            D12_KdPrint (("D12TEST.SYS: NumberOfPipes 0x%x\n", deviceExtension->Interface->NumberOfPipes));
            D12_KdPrint (("D12TEST.SYS: Length 0x%x\n", deviceExtension->Interface->Length));
            D12_KdPrint (("D12TEST.SYS: Alt Setting 0x%x\n", deviceExtension->Interface->AlternateSetting));
            D12_KdPrint (("D12TEST.SYS: Interface Number 0x%x\n", deviceExtension->Interface->InterfaceNumber));
            D12_KdPrint (("D12TEST.SYS: Class, subclass, protocol 0x%x 0x%x 0x%x\n",
                deviceExtension->Interface->Class,
                deviceExtension->Interface->SubClass,
                deviceExtension->Interface->Protocol));

            // Dump the pipe info

            for (j=0; j<Interface->NumberOfPipes; j++) {
                PUSBD_PIPE_INFORMATION pipeInformation;

                pipeInformation = &deviceExtension->Interface->Pipes[j];

                D12_KdPrint (("D12TEST.SYS: ---------\n"));
                D12_KdPrint (("D12TEST.SYS: PipeType 0x%x\n", pipeInformation->PipeType));
                D12_KdPrint (("D12TEST.SYS: EndpointAddress 0x%x\n", pipeInformation->EndpointAddress));
                D12_KdPrint (("D12TEST.SYS: MaxPacketSize 0x%x\n", pipeInformation->MaximumPacketSize));
                D12_KdPrint (("D12TEST.SYS: Interval 0x%x\n", pipeInformation->Interval));
                D12_KdPrint (("D12TEST.SYS: Handle 0x%x\n", pipeInformation->PipeHandle));
                D12_KdPrint (("D12TEST.SYS: MaximumTransferSize 0x%x\n", pipeInformation->MaximumTransferSize));
            }

            D12_KdPrint (("D12TEST.SYS: ---------\n"));
        }
    }

    if (urb) {
        ExFreePool(urb);
        urb = NULL;
    }

    // Retrieve the selected Configuration and Interface setting from the
    // device.  (The only purpose of doing this here is to exercise the
    // URB_FUNCTION_GET_CONFIGURATION and URB_FUNCTION_GET_INTERFACE
    // requests).
    //
    if (NT_SUCCESS(ntStatus)) {

        urb = ExAllocatePool(
                  NonPagedPool,
                  sizeof(struct _URB_CONTROL_GET_CONFIGURATION_REQUEST) + 1);

        if (urb)
        {
            PUCHAR configuration;

            configuration = (PUCHAR)urb + sizeof(struct _URB_CONTROL_GET_CONFIGURATION_REQUEST);
            *configuration = 0xFF;

            urb->UrbHeader.Function = URB_FUNCTION_GET_CONFIGURATION;
            urb->UrbHeader.Length = sizeof(struct _URB_CONTROL_GET_CONFIGURATION_REQUEST);
            urb->UrbControlGetConfigurationRequest.TransferBufferLength = 1;
            urb->UrbControlGetConfigurationRequest.TransferBuffer = configuration;
            urb->UrbControlGetConfigurationRequest.TransferBufferMDL = NULL;
            urb->UrbControlGetConfigurationRequest.UrbLink = NULL;

            ntStatus = D12_CallUSBD(DeviceObject, urb);

            D12_KdPrint (("D12TEST.SYS: Configuration %d (%x)\n",
                             *configuration, ntStatus));

            ExFreePool(urb);
            urb = NULL;
        }

        urb = ExAllocatePool(
                  NonPagedPool,
                  sizeof(struct _URB_CONTROL_GET_INTERFACE_REQUEST) + 1);

        if (urb)
        {
            PUCHAR interface;

            interface = (PUCHAR)urb + sizeof(struct _URB_CONTROL_GET_INTERFACE_REQUEST);
            *interface = 0xFF;

            urb->UrbHeader.Function = URB_FUNCTION_GET_INTERFACE;
            urb->UrbHeader.Length = sizeof(struct _URB_CONTROL_GET_INTERFACE_REQUEST);
            urb->UrbControlGetInterfaceRequest.TransferBufferLength = 1;
            urb->UrbControlGetInterfaceRequest.TransferBuffer = interface;
            urb->UrbControlGetInterfaceRequest.TransferBufferMDL = NULL;
            urb->UrbControlGetInterfaceRequest.UrbLink = NULL;
            urb->UrbControlGetInterfaceRequest.Interface =
                deviceExtension->Interface->InterfaceNumber;

            ntStatus = D12_CallUSBD(DeviceObject, urb);

            D12_KdPrint (("D12TEST.SYS: Interface %d (%x)\n",
                             *interface, ntStatus));

            ExFreePool(urb);
            urb = NULL;
        }
    }

    D12_KdPrint (("D12TEST.SYS: exit D12_SelectInterface (%x)\n", ntStatus));

    return ntStatus;
}


NTSTATUS
D12_BuildPipeList(
    IN  PDEVICE_OBJECT DeviceObject
    )
/*++

Routine Description:

Arguments:

    DeviceObject - pointer to the device object for this instance of the 82930
                    devcice.


Return Value:

    NT status code

--*/
{
    PDEVICE_EXTENSION deviceExtension;
    ULONG i;
    WCHAR Name[] = L"\\PIPE00";
    PUSBD_INTERFACE_INFORMATION interface;

    deviceExtension = DeviceObject->DeviceExtension;
    interface = deviceExtension->Interface;

    D12_KdPrint (("D12TEST.SYS: enter D12_BuildPipeList\n"));

    deviceExtension = DeviceObject->DeviceExtension;

    for (i=0; i<D12_MAX_PIPES; i++) {

        Name[6] = 'X';
        RtlCopyMemory(deviceExtension->PipeList[i].Name,
                      Name,
                      sizeof(Name));

    }

    //
    // build a list of pipe names based on the interface
    //

    for (i=0; i<interface->NumberOfPipes; i++) {

        Name[6] = '0' + (USHORT) i;
        RtlCopyMemory(deviceExtension->PipeList[i].Name,
                      Name,
                      sizeof(Name));

        deviceExtension->PipeList[i].PipeInfo =
            &interface->Pipes[i];

        deviceExtension->PipeList[i].Opened = FALSE;
    }

    return STATUS_SUCCESS;
}


NTSTATUS
D12_ResetPipe(
    IN PDEVICE_OBJECT DeviceObject,
    IN PD12_PIPE Pipe,
    IN BOOLEAN IsoClearStall
    )
/*++

Routine Description:

    Reset a given USB pipe.
    
    NOTES:

    This will reset the host to Data0 and should also reset the device
    to Data0 for Bulk and Interrupt pipes.

    For Iso pipes this will set the virgin state of pipe so that ASAP
    transfers begin with the current bus frame instead of the next frame
    after the last transfer occurred.

Arguments:

Return Value:


--*/
{
    NTSTATUS ntStatus;
    PURB urb;

    D12_KdPrint (("D12TEST.SYS: Reset Pipe %x\n", Pipe));

    urb = ExAllocatePool(NonPagedPool,
                         sizeof(struct _URB_PIPE_REQUEST));

    if (urb) {

        urb->UrbHeader.Length = (USHORT) sizeof (struct _URB_PIPE_REQUEST);
        urb->UrbHeader.Function = URB_FUNCTION_RESET_PIPE;
        urb->UrbPipeRequest.PipeHandle =
            Pipe->PipeInfo->PipeHandle;

        ntStatus = D12_CallUSBD(DeviceObject, urb);

        ExFreePool(urb);

    } else {
        ntStatus = STATUS_INSUFFICIENT_RESOURCES;
    }

    //
    // Memphis RESET_PIPE will send a Clear-Feature Endpoint Stall to
    // reset the data toggle of non-Iso pipes as part of a RESET_PIPE
    // request.  It does not do this for Iso pipes as Iso pipes do not use
    // the data toggle (all Iso packets are Data0).  However, we also use
    // the Clear-Feature Endpoint Stall request in our device firmware to
    // reset data buffer points inside the device so we explicitly send
    // this request to the device for Iso pipes if desired.
    //
    if (NT_SUCCESS(ntStatus) && IsoClearStall &&
        (Pipe->PipeInfo->PipeType == UsbdPipeTypeIsochronous)) {
        
        urb = ExAllocatePool(NonPagedPool,
                             sizeof(struct _URB_CONTROL_FEATURE_REQUEST));

        if (urb) {

            UsbBuildFeatureRequest(urb,
                                   URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT,
                                   USB_FEATURE_ENDPOINT_STALL,
                                   Pipe->PipeInfo->EndpointAddress,
                                   NULL);

            ntStatus = D12_CallUSBD(DeviceObject, urb);

            ExFreePool(urb);
        } else {
            ntStatus = STATUS_INSUFFICIENT_RESOURCES;
        }
    }

    return ntStatus;
}


LONG
D12_DecrementIoCount(
    IN PDEVICE_OBJECT DeviceObject
    )
/*++

Routine Description:

Arguments:

Return Value:


--*/
{
    PDEVICE_EXTENSION deviceExtension;
    LONG ioCount;

    deviceExtension = DeviceObject->DeviceExtension;

    ioCount = InterlockedDecrement(&deviceExtension->PendingIoCount);

    D12_KdPrint (("D12TEST.SYS: Pending io count = %x\n", ioCount));

    if (ioCount==0) {
        KeSetEvent(&deviceExtension->RemoveEvent,
                   1,
                   FALSE);
    }

    return ioCount;
}


VOID
D12_IncrementIoCount(
    IN PDEVICE_OBJECT DeviceObject
    )
/*++

Routine Description:

Arguments:

Return Value:


--*/
{
    PDEVICE_EXTENSION deviceExtension;

    deviceExtension = DeviceObject->DeviceExtension;

    InterlockedIncrement(&deviceExtension->PendingIoCount);
}


NTSTATUS
D12_ReconfigureDevice(
    IN  PDEVICE_OBJECT DeviceObject
    )
/*++

Routine Description:

    Initializes a given instance of the device on the USB and selects the
    configuration.

Arguments:

    DeviceObject - pointer to the device object for this instance of the 82930
                    devcice.


Return Value:

    NT status code

--*/
{
    PDEVICE_EXTENSION deviceExtension;
    NTSTATUS ntStatus = STATUS_SUCCESS;
    PUSBD_INTERFACE_INFORMATION interface;
    ULONG i;

    D12_KdPrint (("D12TEST.SYS: enter D12_ReconfigureDevice\n"));

    deviceExtension = DeviceObject->DeviceExtension;

    if (NT_SUCCESS(ntStatus)) {
        ntStatus = D12_ConfigureDevice(DeviceObject);
    }

    //
    // new interface structure is now set up
    //

    interface = deviceExtension->Interface;

    //
    // set up the pipe handles again
    //

    for (i=0; i<interface->NumberOfPipes; i++) {

        D12_KdPrint (("D12TEST.SYS: pipe list = %x\n", &deviceExtension->PipeList[i]));

        deviceExtension->PipeList[i].PipeInfo =
            &interface->Pipes[i];

        //deviceExtension->PipeList[i].Opened = FALSE;
    }

    return ntStatus;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
婷婷成人综合网| 亚洲成人久久影院| 精品剧情在线观看| 久久久精品影视| 中文字幕不卡一区| 一区二区三区日韩精品| 美女在线观看视频一区二区| 色综合久久综合| 精品福利一区二区三区| 日韩精品一区在线观看| 欧美婷婷六月丁香综合色| 亚洲精品一线二线三线无人区| 欧美一区二区黄| 3d动漫精品啪啪1区2区免费| 欧美色成人综合| 欧美日韩国产综合一区二区| 色婷婷av一区二区三区软件| 91麻豆产精品久久久久久| 久久99九九99精品| 亚洲va欧美va天堂v国产综合| 亚洲成av人片在www色猫咪| 日韩av网站免费在线| 麻豆精品国产传媒mv男同| 精品一区二区免费在线观看| 国产成人在线网站| 色哟哟亚洲精品| 69精品人人人人| 久久综合色一综合色88| 国产精品国产三级国产| 一区二区三区久久| 美女在线视频一区| 成人午夜激情片| 91豆麻精品91久久久久久| 欧美久久一区二区| 26uuu精品一区二区 | 久久色.com| 国产亚洲精品bt天堂精选| 综合久久久久综合| 亚洲图片欧美综合| 美国十次综合导航| 色婷婷综合久久久久中文| 欧美日韩精品一区二区三区蜜桃 | 香蕉影视欧美成人| 国产精品自拍一区| 91精品国产色综合久久久蜜香臀| 亚洲另类春色校园小说| 欧美综合亚洲图片综合区| 亚洲一区在线播放| 欧美高清你懂得| 国产一区二三区好的| 综合中文字幕亚洲| 在线看日韩精品电影| 中文字幕在线不卡视频| 1024精品合集| 激情丁香综合五月| 在线播放国产精品二区一二区四区| 欧美精品一区二区三区蜜桃视频| 国产精品网曝门| 久久精品国产99| 欧美日韩国产美| 国产精品免费观看视频| 色噜噜狠狠色综合中国| 风间由美性色一区二区三区| 欧美系列亚洲系列| 亚洲国产成人一区二区三区| 天天影视网天天综合色在线播放| 国产福利电影一区二区三区| 欧美日韩情趣电影| 国产精品福利av| 久久成人免费网站| 在线免费不卡视频| 欧美国产日韩在线观看| 秋霞av亚洲一区二区三| 一本一道波多野结衣一区二区| 精品久久久久久久一区二区蜜臀| 一区二区三区国产精品| 成人爱爱电影网址| 精品久久人人做人人爱| 亚洲国产视频网站| 91视视频在线观看入口直接观看www| 日韩免费高清av| 亚洲综合999| 波多野结衣中文字幕一区| 日韩欧美精品三级| 亚洲一区在线视频| 99视频一区二区三区| 国产日产欧美一区| 国产精品剧情在线亚洲| 3d动漫精品啪啪1区2区免费 | 5566中文字幕一区二区电影 | 亚洲sss视频在线视频| 欧美大度的电影原声| 成人国产精品免费网站| 99久久综合国产精品| 亚洲国产精品久久久男人的天堂| 久久久午夜电影| 日韩一区二区在线观看视频播放| 色哟哟一区二区| 91蜜桃视频在线| 色综合中文字幕国产 | 欧美一级片在线看| 色猫猫国产区一区二在线视频| 日韩高清一区二区| 欧美国产亚洲另类动漫| 日韩一区二区在线看| 在线观看日韩高清av| 国产精品资源在线看| 亚洲成人手机在线| 伊人一区二区三区| 国产日韩欧美一区二区三区乱码 | 亚洲精品国产精品乱码不99| 国产成人免费视频网站| 精品国产乱码久久| 国产综合一区二区| 国产日韩欧美亚洲| av电影在线观看完整版一区二区| 国产精品国产三级国产aⅴ入口 | 国产不卡在线播放| 久久婷婷色综合| 国产69精品久久99不卡| 国产精品―色哟哟| 91免费视频网址| 亚洲国产婷婷综合在线精品| 91麻豆精品国产91久久久久久 | 国产精品亚洲成人| 国产日韩欧美综合一区| 91丨九色丨尤物| 亚洲成人av在线电影| 亚洲欧美日韩在线| 自拍偷拍国产精品| 久久国产欧美日韩精品| 亚洲成人动漫在线免费观看| 亚洲人亚洲人成电影网站色| 91丝袜美腿高跟国产极品老师 | 美女在线视频一区| 美腿丝袜亚洲色图| 国产精品资源在线观看| 风流少妇一区二区| 99久久国产综合精品女不卡| 不卡的看片网站| 欧美人体做爰大胆视频| 日韩欧美国产一区二区在线播放| 日韩精品一区二区三区老鸭窝| 精品伦理精品一区| 亚洲欧洲美洲综合色网| 亚洲激情网站免费观看| 一区二区成人在线视频| 日韩制服丝袜先锋影音| 久久国产综合精品| 国产大陆亚洲精品国产| 日本韩国一区二区三区| 欧美一区二区三区在线视频 | 国产精品久久久久影院亚瑟| 一区二区三区丝袜| 国产乱人伦偷精品视频不卡| 在线看不卡av| 欧美成人精品福利| 亚洲欧美另类在线| 国产精品一区二区你懂的| 99re6这里只有精品视频在线观看| 色综合欧美在线视频区| 精品免费一区二区三区| 一区二区免费看| 国产高清不卡二三区| 色欧美片视频在线观看| 久久蜜臀精品av| 日日夜夜精品视频免费| 色噜噜狠狠色综合欧洲selulu| 久久蜜桃av一区二区天堂| 免费av网站大全久久| 在线视频亚洲一区| 亚洲天天做日日做天天谢日日欢| 美女高潮久久久| 8x8x8国产精品| 免费高清在线一区| 欧美在线观看18| 亚洲成a人v欧美综合天堂| 一本色道久久综合亚洲91| 国产精品女上位| 播五月开心婷婷综合| 亚洲人成网站在线| 91蝌蚪porny九色| 一区二区三区在线免费播放| 一本大道久久a久久精二百 | 亚洲一区二区三区四区五区中文| 处破女av一区二区| 久久久国产精华| www.欧美日韩| 亚洲成人在线免费| 欧美精品一区二| 国产成人综合精品三级| 国产欧美日韩激情| 色综合色狠狠综合色| 亚洲国产欧美在线人成| 91麻豆精品国产91久久久资源速度 | 成人精品电影在线观看| 国产精品每日更新| 欧洲精品一区二区三区在线观看| 日韩精品福利网| 国产精品久99|