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

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

?? d12.c

?? 北京恒豐銳科科技有限公司三星arm7開發板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一区二区三区免费野_久草精品视频
欧美日韩在线免费视频| 国产在线精品免费| 色婷婷综合久久久中文字幕| 亚洲欧洲av另类| 91蜜桃在线免费视频| 一区二区三区视频在线看| 欧美日韩国产综合视频在线观看 | 精品国产乱码久久久久久蜜臀| 日产欧产美韩系列久久99| 91精品国产综合久久久久久久| 美女在线视频一区| 国产女人aaa级久久久级| 成人福利视频在线| 一区二区三区丝袜| 精品理论电影在线| 成人av免费观看| 五月激情六月综合| 欧美激情一区在线| 欧美亚洲高清一区| 精品一区二区三区久久久| 国产精品美女一区二区三区| 91激情在线视频| 久久99热这里只有精品| 亚洲人午夜精品天堂一二香蕉| 欧美美女一区二区在线观看| 国产一区在线观看视频| 亚洲素人一区二区| 欧美变态凌虐bdsm| www.亚洲精品| 捆绑变态av一区二区三区| 最新热久久免费视频| 欧美一级电影网站| 99精品热视频| 精品一区二区三区在线观看| 亚洲免费看黄网站| www国产精品av| 欧美日产国产精品| 99vv1com这只有精品| 久久精品国产一区二区三| 亚洲丝袜美腿综合| 久久青草国产手机看片福利盒子| 欧美综合色免费| 丰满白嫩尤物一区二区| 免费人成在线不卡| 亚洲电影在线播放| 国产精品国产馆在线真实露脸| 日韩欧美视频一区| 欧美亚一区二区| 成人不卡免费av| 久99久精品视频免费观看| 亚洲一区二区美女| 日韩一区日韩二区| 国产三级一区二区三区| 日韩欧美在线123| 欧美日韩日日夜夜| 91麻豆精东视频| av亚洲精华国产精华精| 国产精品一区二区在线看| 日韩va欧美va亚洲va久久| 亚洲国产精品麻豆| 亚洲一区二区三区不卡国产欧美| 国产精品―色哟哟| 国产清纯白嫩初高生在线观看91| 精品区一区二区| 日韩欧美国产午夜精品| 在线不卡一区二区| 欧美精三区欧美精三区| 欧洲视频一区二区| 在线观看视频91| 色婷婷久久99综合精品jk白丝| 高清国产一区二区| 国产成人av一区二区三区在线| 国产一区欧美日韩| 韩国成人福利片在线播放| 久久精品72免费观看| 久久国产婷婷国产香蕉| 美女高潮久久久| 免费观看久久久4p| 欧美aaa在线| 久久99精品久久久久婷婷| 久久精品国产精品亚洲综合| 狠狠色狠狠色综合日日91app| 久久精品国产一区二区三| 久久精品国产一区二区| 国产综合成人久久大片91| 国产精品888| 成人午夜又粗又硬又大| 99精品视频在线播放观看| 在线看国产一区二区| 欧美色图12p| 欧美一区二区三区视频免费| 欧美xxxxx牲另类人与| 精品乱人伦一区二区三区| 欧美激情一区二区三区全黄| 最新中文字幕一区二区三区| 亚洲一区二区在线视频| 爽爽淫人综合网网站 | 久久超碰97人人做人人爱| 精品一区二区av| www..com久久爱| 欧美视频在线一区二区三区 | 91免费国产视频网站| 欧美日韩高清在线| 久久久久久电影| 亚洲精品综合在线| 天堂va蜜桃一区二区三区| 久久不见久久见免费视频7| 成人av网站大全| 欧美性大战久久久久久久| 日韩精品一区二区三区中文不卡| 国产婷婷色一区二区三区在线| 成人欧美一区二区三区白人| 午夜电影一区二区| 国产精品一区在线| 欧美日韩精品欧美日韩精品一 | 成人激情动漫在线观看| 欧美图片一区二区三区| 欧美不卡在线视频| 亚洲美女免费视频| 久久99热狠狠色一区二区| 97精品电影院| 欧美电影免费观看高清完整版在线观看| 久久精品视频在线免费观看| 亚洲图片欧美一区| 高清在线观看日韩| 日韩亚洲欧美高清| 亚洲三级理论片| 蜜臀av一区二区| 色综合久久中文字幕| 日韩亚洲欧美综合| 亚洲狠狠爱一区二区三区| 成人国产一区二区三区精品| 欧美一级淫片007| 亚洲综合一区二区三区| 国产盗摄一区二区三区| 91麻豆精品国产91久久久久| 日韩伦理电影网| 国产成人超碰人人澡人人澡| 日韩亚洲欧美高清| 亚洲国产成人av| 91热门视频在线观看| 国产日韩欧美在线一区| 日本视频免费一区| 精品视频一区 二区 三区| 国产精品久久久久天堂| 久久精品国产一区二区三| 欧美精品在欧美一区二区少妇 | 亚洲精品一二三| 丰满少妇久久久久久久| 精品国产一区二区三区av性色| 午夜精品123| 欧美日韩一本到| 亚洲综合色婷婷| 在线精品视频免费观看| 亚洲蜜桃精久久久久久久| aaa亚洲精品| 国产精品久久毛片a| 丁香婷婷综合激情五月色| 欧美精品一区男女天堂| 久久精品72免费观看| 精品噜噜噜噜久久久久久久久试看| 爽好久久久欧美精品| 欧美绝品在线观看成人午夜影视| 亚洲图片欧美一区| 欧美日韩亚洲综合在线| 亚洲二区在线视频| 91麻豆精品国产自产在线观看一区| 亚洲国产欧美日韩另类综合| 欧美午夜不卡在线观看免费| 亚洲一区二区三区四区在线观看 | 国产美女久久久久| 久久精品综合网| 成人av一区二区三区| 成人免费小视频| 日本精品一级二级| 亚洲第一激情av| 欧美老女人在线| 乱中年女人伦av一区二区| 精品国产91乱码一区二区三区| 国产在线视频一区二区三区| 精品国产乱码久久久久久牛牛| 国产在线国偷精品免费看| 国产亚洲1区2区3区| 成人久久久精品乱码一区二区三区| 亚洲国产激情av| 91国偷自产一区二区三区成为亚洲经典| 一区二区三区欧美亚洲| 欧美一区二区免费视频| 国产精品白丝av| 亚洲天堂成人在线观看| 欧美日韩精品欧美日韩精品| 黄色精品一二区| 亚洲精品欧美二区三区中文字幕| 欧美日韩免费观看一区二区三区| 免费在线观看精品| 中文字幕免费在线观看视频一区| 色94色欧美sute亚洲线路二| 日本va欧美va欧美va精品| 国产女主播视频一区二区| 欧美亚洲国产一区二区三区|