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

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

?? d12.c

?? s3c44b0的開發程序
?? C
?? 第 1 頁 / 共 4 頁
字號:
    // Free up any interface structures
    //

    if (deviceExtension->Interface) {
        ExFreePool(deviceExtension->Interface);
    }

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

    return ntStatus;
}


NTSTATUS
D12_StopDevice(
    IN  PDEVICE_OBJECT DeviceObject
    )
/*++

Routine Description:

    Stops a given instance of a 82930 device on the USB, this is only
    stuff we need to do if the device is still present.

Arguments:

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

Return Value:

    NT status code

--*/
{
    NTSTATUS ntStatus = STATUS_SUCCESS;
    PURB urb;
    ULONG siz;

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

	D12_CancelAllPendingIrps(DeviceObject);

    //
    // Send the select configuration urb with a NULL pointer for the configuration
    // handle, this closes the configuration and puts the device in the 'unconfigured'
    // state.
    //

    siz = sizeof(struct _URB_SELECT_CONFIGURATION);

    urb = ExAllocatePool(NonPagedPool,
                         siz);

    if (urb) {
        NTSTATUS status;

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

        status = D12_CallUSBD(DeviceObject, urb);

        D12_KdPrint (("D12TEST.SYS: Device Configuration Closed status = %x usb status = %x.\n",
                        status, urb->UrbHeader.Status));

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

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

    return ntStatus;
}


NTSTATUS
D12_PnPAddDevice(
    IN PDRIVER_OBJECT DriverObject,
    IN PDEVICE_OBJECT PhysicalDeviceObject
    )
/*++

Routine Description:

    This routine is called to create a new instance of the device

Arguments:

    DriverObject - pointer to the driver object for this instance of D12

    PhysicalDeviceObject - pointer to a device object created by the bus

Return Value:

    STATUS_SUCCESS if successful,
    STATUS_UNSUCCESSFUL otherwise

--*/
{
    NTSTATUS                ntStatus = STATUS_SUCCESS;
    PDEVICE_OBJECT          deviceObject = NULL;
    PDEVICE_EXTENSION       deviceExtension;
    USBD_VERSION_INFORMATION versionInformation;
    static ULONG instance = 0;

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

    //
    // create our funtional device object (FDO)
    //

    ntStatus =
        BulkUsb_CreateDeviceObject(DriverObject, PhysicalDeviceObject, &deviceObject);

    if (NT_SUCCESS(ntStatus)) {
        deviceExtension = deviceObject->DeviceExtension;

        deviceObject->Flags &= ~DO_DEVICE_INITIALIZING;

        //
        // we support direct io for read/write
        //
        deviceObject->Flags |= DO_DIRECT_IO;


        //** initialize our device extension
        //
        // remember the Physical device Object
        //
        deviceExtension->PhysicalDeviceObject=PhysicalDeviceObject;

        //
        // Attach to the PDO
        //

        deviceExtension->TopOfStackDeviceObject =
            IoAttachDeviceToDeviceStack(deviceObject, PhysicalDeviceObject);

        D12_QueryCapabilities(PhysicalDeviceObject,
                                 &deviceExtension->DeviceCapabilities);            

        //
        // display the device  caps
        //
#if DBG
        {
        ULONG i;
        
        D12_KdPrint(("D12TEST.SYS:  >>>>>> DeviceCaps\n"));  
        D12_KdPrint(("D12TEST.SYS:  SystemWake = (%d)\n", 
            deviceExtension->DeviceCapabilities.SystemWake));    
        D12_KdPrint(("D12TEST.SYS:  DeviceWake = (D%d)\n",
            deviceExtension->DeviceCapabilities.DeviceWake-1));

        for (i=PowerSystemUnspecified; i< PowerSystemMaximum; i++) {
            
            D12_KdPrint(("D12TEST.SYS:  Device State Map: sysstate %d = devstate 0x%x\n", i, 
                 deviceExtension->DeviceCapabilities.DeviceState[i]));       
        }
        D12_KdPrint(("D12TEST.SYS:  '<<<<<<<<DeviceCaps\n"));
        }
#endif
        //
        // transition to zero signals the event
        //
        D12_IncrementIoCount(deviceObject);                                 
    }

    USBD_GetUSBDIVersion(&versionInformation);

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

    return ntStatus;
}

NTSTATUS
BulkUsb_SymbolicLink(
    IN PDEVICE_OBJECT DeviceObject,
    IN OUT PUNICODE_STRING deviceLinkUnicodeString

    )
/*++

Routine Description:

    This routine is called to create and initialize
    a GUID-based symbolic link to our device to be used to open/create 
    instances of us from user mode.

    Called from BulkUsb_CreateDeviceObject() to create the link. 

Arguments:

    DeviceObject - pointer to our Physical Device Object ( PDO )

    deviceLinkUnicodeString - Points to a unicode string structure allocated by the caller. 
        If this routine is successful, it initializes the unicode string and allocates 
        the string buffer containing the kernel-mode path to the symbolic link for this 
        device interface. 


Return Value:

    STATUS_SUCCESS if successful,
    STATUS_UNSUCCESSFUL otherwise

--*/{
    NTSTATUS ntStatus = STATUS_SUCCESS;


    //  Create the symbolic link
     
    // IoRegisterDeviceInterface registers device functionality (a device interface) 
    // that a driver will enable for use by applications or other system components.

    ntStatus = IoRegisterDeviceInterface(
                DeviceObject,
                (LPGUID)&GUID_CLASS_D12_BULK,
                NULL,
                deviceLinkUnicodeString);

   if (NT_SUCCESS(ntStatus)) {

       // IoSetDeviceInterfaceState enables or disables a previously 
       // registered device interface. Applications and other system components 
       // can open only interfaces that are enabled.

        ntStatus = IoSetDeviceInterfaceState(deviceLinkUnicodeString, TRUE);


    }

    return ntStatus;
}



NTSTATUS
BulkUsb_CreateDeviceObject(
    IN PDRIVER_OBJECT DriverObject,
    IN PDEVICE_OBJECT PhysicalDeviceObject,
    IN PDEVICE_OBJECT *DeviceObject
    )
/*++

Routine Description:

    Creates a Functional DeviceObject

Arguments:

    DriverObject - pointer to the driver object for device

    DeviceObject - pointer to DeviceObject pointer to return
                    created device object.

    Instance - instance of the device create.

Return Value:

    STATUS_SUCCESS if successful,
    STATUS_UNSUCCESSFUL otherwise

--*/
{
    NTSTATUS ntStatus;
    UNICODE_STRING deviceLinkUnicodeString;
    PDEVICE_EXTENSION deviceExtension;
    USHORT i;


    ntStatus = BulkUsb_SymbolicLink( PhysicalDeviceObject, &deviceLinkUnicodeString );


    if (NT_SUCCESS(ntStatus)) {

        ntStatus = IoCreateDevice (DriverObject,
                           sizeof (DEVICE_EXTENSION),
                           NULL,
                           FILE_DEVICE_UNKNOWN,
                           FILE_AUTOGENERATED_DEVICE_NAME,
                           FALSE,
                           DeviceObject);

 
        if (!NT_SUCCESS(ntStatus))  {
             return ntStatus;
        }


        // Name buffer for our named Functional device object link
        // The name is generated based on the driver's class GUID
        deviceExtension = (PDEVICE_EXTENSION) ((*DeviceObject)->DeviceExtension);

        RtlCopyMemory(deviceExtension->DeviceLinkNameBuffer,
                      deviceLinkUnicodeString.Buffer,
                      deviceLinkUnicodeString.Length);
        deviceExtension->DeviceDescriptor = NULL;
        deviceExtension->Interface = NULL;
        deviceExtension->ConfigurationHandle = NULL;
        deviceExtension->AcceptingRequests = TRUE;
        deviceExtension->PendingIoCount = 0;
        deviceExtension->UserEvent = NULL;

        KeInitializeEvent(&deviceExtension->RemoveEvent, NotificationEvent, FALSE);

        for (i=0; i<D12_MAX_PIPES; i++) {
            deviceExtension->PipeList[i].PipeInfo = NULL;
        }

		RtlFreeUnicodeString( &deviceLinkUnicodeString );
    }


    return ntStatus;
}



NTSTATUS
D12_CallUSBD(
    IN PDEVICE_OBJECT DeviceObject,
    IN PURB Urb
    )
/*++

Routine Description:

    Passes a URB to the USBD class driver

Arguments:

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

    Urb - pointer to Urb request block

Return Value:

    STATUS_SUCCESS if successful,
    STATUS_UNSUCCESSFUL otherwise

--*/
{
    NTSTATUS ntStatus, status = STATUS_SUCCESS;
    PDEVICE_EXTENSION deviceExtension;
    PIRP irp;
    KEVENT event;
    IO_STATUS_BLOCK ioStatus;
    PIO_STACK_LOCATION nextStack;

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

    deviceExtension = DeviceObject->DeviceExtension;

    //
    // issue a synchronous request
    //

    KeInitializeEvent(&event, NotificationEvent, FALSE);

    irp = IoBuildDeviceIoControlRequest(
                IOCTL_INTERNAL_USB_SUBMIT_URB,
                deviceExtension->TopOfStackDeviceObject,
                NULL,
                0,
                NULL,
                0,
                TRUE, /* INTERNAL */
                &event,
                &ioStatus);

    //
    // Call the class driver to perform the operation.  If the returned status
    // is PENDING, wait for the request to complete.
    //

    nextStack = IoGetNextIrpStackLocation(irp);
    ASSERT(nextStack != NULL);

    //
    // pass the URB to the USB driver stack
    //
    nextStack->Parameters.Others.Argument1 = Urb;


    D12_KdPrint (("D12TEST.SYS: calling USBD\n"));

    ntStatus = IoCallDriver(deviceExtension->TopOfStackDeviceObject,
                            irp);

    D12_KdPrint (("D12TEST.SYS: return from IoCallDriver USBD %x\n", ntStatus));

    if (ntStatus == STATUS_PENDING) {
        D12_KdPrint (("D12TEST.SYS: Wait for single object\n"));

        status = KeWaitForSingleObject(
                       &event,
                       Suspended,
                       KernelMode,
                       FALSE,
                       NULL);

        D12_KdPrint (("D12TEST.SYS: Wait for single object, returned %x\n", status));

    } else {
        ioStatus.Status = ntStatus;
    }

    D12_KdPrint (("D12TEST.SYS: URB status = %x status = %x irp status %x\n",
        Urb->UrbHeader.Status, status, ioStatus.Status));

    //
    // USBD maps the error code for us
    //
    ntStatus = ioStatus.Status;

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

    return ntStatus;
}


NTSTATUS
D12_ConfigureDevice(
    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;
    PURB urb;
    ULONG siz;
    PUSB_CONFIGURATION_DESCRIPTOR configurationDescriptor = NULL;

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

    deviceExtension = DeviceObject->DeviceExtension;

    //
    // first configure the device
    //

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

    if (urb) {

        // BUGBUG 82930 chokes if on the next command if you don't get
        // the entire descriptor on the first try

        siz = sizeof(USB_CONFIGURATION_DESCRIPTOR)+256;

get_config_descriptor_retry:

        configurationDescriptor = ExAllocatePool(NonPagedPool,
                                                 siz);

        if (configurationDescriptor) {

            UsbBuildGetDescriptorRequest(urb,
                                         (USHORT) sizeof (struct _URB_CONTROL_DESCRIPTOR_REQUEST),
                                         USB_CONFIGURATION_DESCRIPTOR_TYPE,
                                         0,
                                         0,
                                         configurationDescriptor,
                                         NULL,
                                         siz,
                                         NULL);

            ntStatus = D12_CallUSBD(DeviceObject, urb);

            D12_KdPrint (("D12TEST.SYS: Configuration Descriptor = %x, len %x\n",
                            configurationDescriptor,
                            urb->UrbControlDescriptorRequest.TransferBufferLength));
        } else {
            ntStatus = STATUS_INSUFFICIENT_RESOURCES;
        }

        //
        // if we got some data see if it was enough.
        //
        // NOTE: we may get an error in URB because of buffer overrun
        if (urb->UrbControlDescriptorRequest.TransferBufferLength>0 &&
                configurationDescriptor->wTotalLength > siz) {

            siz = configurationDescriptor->wTotalLength;
            ExFreePool(configurationDescriptor);
            configurationDescriptor = NULL;
            goto get_config_descriptor_retry;
        }

        ExFreePool(urb);

    } else {
        ntStatus = STATUS_INSUFFICIENT_RESOURCES;
    }

    if (configurationDescriptor) {

        //

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
92精品国产成人观看免费| 国产情人综合久久777777| 欧美精品一区二区三区四区| 国产片一区二区三区| 一区二区三区四区蜜桃 | 亚洲人成在线观看一区二区| 蜜桃视频在线观看一区二区| 色妹子一区二区| 精品国产一区二区在线观看| 亚洲成av人综合在线观看| zzijzzij亚洲日本少妇熟睡| 精品久久久三级丝袜| 日本午夜精品视频在线观看 | 2023国产精品视频| 亚洲大尺度视频在线观看| 99久久99久久精品免费看蜜桃| 精品日韩99亚洲| 美女网站一区二区| 91麻豆精品国产无毒不卡在线观看 | 亚洲精品成人a在线观看| 激情综合网av| 日韩欧美不卡在线观看视频| 一区免费观看视频| 国产成人在线看| 国产日韩精品一区| 国产精品自拍av| 久久久高清一区二区三区| 国产在线精品一区二区| 欧美精品一区二区三区视频| 毛片av一区二区| 26uuu国产一区二区三区| 青青草97国产精品免费观看 | 日韩一区日韩二区| 成人在线一区二区三区| 国产精品天干天干在线综合| 成人免费毛片嘿嘿连载视频| 中文字幕精品—区二区四季| 成人精品国产福利| 亚洲男人的天堂在线观看| 色悠久久久久综合欧美99| 一区二区免费在线播放| 欧美另类久久久品| 九九九精品视频| 国产日产欧美一区二区三区| 成人av电影在线网| 一区二区三区日韩欧美| 欧美精品精品一区| 精品影视av免费| 国产精品污污网站在线观看| 一道本成人在线| 视频一区视频二区中文字幕| 欧美成人性战久久| 不卡一二三区首页| 亚洲高清免费在线| 精品国产成人在线影院| 成人高清在线视频| 亚洲福利电影网| 久久综合一区二区| 日本道精品一区二区三区| 久久国产精品99久久人人澡| 日本一区二区三区免费乱视频| 99精品国产热久久91蜜凸| 一级精品视频在线观看宜春院| 91精品在线观看入口| 丰满放荡岳乱妇91ww| 婷婷六月综合亚洲| 国产精品欧美一区二区三区| 欧美日韩国产免费一区二区| 国产成人午夜高潮毛片| 亚洲va韩国va欧美va| 国产精品色一区二区三区| 欧美一区二区视频在线观看| av在线不卡观看免费观看| 免费美女久久99| 亚洲最大成人网4388xx| 久久久99久久| 欧美精品第1页| 91女人视频在线观看| 国产一区视频在线看| 亚洲va欧美va国产va天堂影院| 国产午夜亚洲精品理论片色戒 | 久久亚洲二区三区| 欧美三电影在线| www.激情成人| 韩国三级电影一区二区| 天堂成人国产精品一区| 国产精品毛片无遮挡高清| 欧美成人福利视频| 69堂成人精品免费视频| 在线日韩一区二区| av电影在线不卡| 人人狠狠综合久久亚洲| 夜夜精品视频一区二区| 国产精品色噜噜| 久久嫩草精品久久久久| 91精品国产欧美日韩| 欧美综合在线视频| 91视频免费观看| 波多野结衣精品在线| 国产乱码精品一区二区三区忘忧草| 日韩精品乱码av一区二区| 亚洲最新视频在线观看| 亚洲欧美一区二区在线观看| 国产精品区一区二区三区| 久久婷婷成人综合色| 精品久久99ma| 久久久www免费人成精品| 久久久影视传媒| 国产亚洲欧美一级| 国产欧美精品区一区二区三区 | 91免费版在线| 一本一道综合狠狠老| 91福利国产精品| 欧美色精品天天在线观看视频| 在线视频欧美精品| 欧洲中文字幕精品| 欧美日韩国产电影| 欧美一二三区在线观看| 欧美一级xxx| 精品剧情v国产在线观看在线| 日韩欧美aaaaaa| 国产色综合久久| 中文字幕中文字幕一区| 一区二区三区小说| 亚洲国产一区在线观看| 日一区二区三区| 国产乱子伦视频一区二区三区 | 国产原创一区二区三区| 国产精品一区二区果冻传媒| 粉嫩一区二区三区在线看| 99精品视频在线免费观看| 在线亚洲精品福利网址导航| 制服丝袜国产精品| 国产日韩欧美激情| 亚洲自拍偷拍图区| 久久精品72免费观看| 丁香六月久久综合狠狠色| 欧洲精品在线观看| 日韩你懂的在线播放| 中文字幕一区免费在线观看| 亚洲一级二级在线| 国产永久精品大片wwwapp| 91玉足脚交白嫩脚丫在线播放| 欧美日韩国产大片| 中文字幕欧美激情一区| 亚洲自拍偷拍欧美| 国产乱人伦偷精品视频不卡| 91免费精品国自产拍在线不卡| 欧美精品自拍偷拍| 国产日韩精品一区二区浪潮av| 亚洲在线免费播放| 国产精品综合二区| 欧美日韩一区二区三区在线| 欧美本精品男人aⅴ天堂| 最新国产成人在线观看| 美女视频黄 久久| 色偷偷88欧美精品久久久| 久久综合久久99| 亚洲成a人片在线不卡一二三区| 国产成人在线看| 欧美一区二区三区不卡| 综合精品久久久| 国产成人一区二区精品非洲| 欧美三级资源在线| 中文字幕欧美一| 国产精品亚洲一区二区三区在线| 欧美日韩免费观看一区三区| 国产精品污网站| 激情成人午夜视频| 欧美日韩色综合| 亚洲欧洲av在线| 国产ts人妖一区二区| 91精品国产综合久久久蜜臀粉嫩| 国产精品污www在线观看| 久久国产剧场电影| 在线不卡中文字幕播放| 一区二区三区中文字幕| aa级大片欧美| 国产精品美女久久久久久2018| 国产综合久久久久影院| 欧美一区午夜精品| 亚洲大片免费看| 色琪琪一区二区三区亚洲区| 国产精品传媒在线| 国产成人av电影在线| 久久久久国产精品人| 黄网站免费久久| 26uuu精品一区二区三区四区在线| 亚洲成a人片在线不卡一二三区| 色噜噜狠狠成人网p站| 国产精品女主播在线观看| 高清av一区二区| 国产欧美日韩激情| 国产99精品视频| 国产精品久久久久久久岛一牛影视| 国产一区二区福利| 久久久精品免费免费| 国产成人日日夜夜| 国产精品无遮挡| 99久久精品一区二区|