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

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

?? d12.c

?? 重量級
?? 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一区二区三区免费野_久草精品视频
日本一区二区三级电影在线观看| 欧美日韩国产色站一区二区三区| 欧美无砖专区一中文字| 国产欧美日韩三级| 一区二区三区欧美在线观看| 久99久精品视频免费观看| 欧美一区二区网站| 天堂久久久久va久久久久| aaa亚洲精品| 综合色中文字幕| 91论坛在线播放| 亚洲另类春色校园小说| 欧美综合在线视频| 亚洲国产精品久久久久婷婷884| 在线观看av一区| 亚洲成av人在线观看| 日韩精品在线一区二区| 欧美欧美午夜aⅴ在线观看| 色婷婷av一区二区三区gif| 国产精品女主播av| 色狠狠综合天天综合综合| 一区二区三区加勒比av| 色婷婷av久久久久久久| 国产天堂亚洲国产碰碰| 国产精品丝袜91| 日韩一二三四区| av电影一区二区| 日韩和欧美的一区| 中文字幕av不卡| 欧美成人vr18sexvr| 一道本成人在线| 丁香天五香天堂综合| 亚洲sss视频在线视频| 欧美国产精品中文字幕| 暴力调教一区二区三区| 亚洲日本丝袜连裤袜办公室| 色8久久人人97超碰香蕉987| 福利一区在线观看| 精品一区二区三区免费| 同产精品九九九| 亚洲精品免费电影| 国产精品成人免费精品自在线观看 | 日韩欧美电影在线| 欧美亚洲国产怡红院影院| 国产高清在线观看免费不卡| 喷白浆一区二区| 午夜久久久久久| 中文字幕亚洲电影| 中文字幕欧美激情| 国产精品福利一区二区三区| 日本一区二区三区视频视频| 中文一区一区三区高中清不卡| 欧美影院午夜播放| 欧美午夜影院一区| 日韩午夜三级在线| 亚洲精品一区二区三区蜜桃下载| 欧美精品在线一区二区三区| 欧美男男青年gay1069videost| av激情综合网| 99精品视频免费在线观看| 欧美性猛片aaaaaaa做受| 欧美亚洲一区二区在线| 6080日韩午夜伦伦午夜伦| 国产亚洲精品福利| 欧美激情在线看| 麻豆精品视频在线观看视频| 日韩av午夜在线观看| 国产v日产∨综合v精品视频| 国产成人日日夜夜| 欧美剧在线免费观看网站| 亚洲一区二区三区视频在线 | 色综合久久99| 性做久久久久久免费观看| 中文字幕制服丝袜一区二区三区| 中文字幕av在线一区二区三区| 另类专区欧美蜜桃臀第一页| 欧美性受xxxx| 亚洲第四色夜色| 在线播放视频一区| 亚洲资源在线观看| 51精品国自产在线| 美女尤物国产一区| 国产亚洲成aⅴ人片在线观看| 国产一区二区在线视频| 亚洲精品一线二线三线无人区| 精油按摩中文字幕久久| 国产婷婷一区二区| 99精品国产热久久91蜜凸| 一区二区免费看| 欧美日韩精品久久久| 舔着乳尖日韩一区| 久久精品视频在线免费观看| 粉嫩蜜臀av国产精品网站| 一区二区三区丝袜| 日韩免费观看2025年上映的电影| 国产综合色产在线精品| 一区免费观看视频| 精品久久久影院| 91蜜桃视频在线| 奇米影视一区二区三区小说| 欧美激情在线免费观看| 777a∨成人精品桃花网| 高清国产午夜精品久久久久久| 亚洲va欧美va国产va天堂影院| 国产欧美日韩在线看| 日韩精品一区二区三区在线| 91麻豆swag| 99精品久久只有精品| 国产专区综合网| 九九**精品视频免费播放| 日产精品久久久久久久性色| 中文字幕制服丝袜一区二区三区 | 色综合网色综合| 国产精品一区二区免费不卡| 日本在线不卡一区| 日韩精品1区2区3区| 五月天激情小说综合| 亚洲高清视频在线| 亚洲国产一区在线观看| 亚洲欧美另类在线| 亚洲情趣在线观看| 亚洲地区一二三色| 日产欧产美韩系列久久99| 久久精品99国产精品| 久久66热re国产| 高清在线成人网| 色噜噜偷拍精品综合在线| 在线看国产一区| 欧美一区二区成人6969| 久久免费的精品国产v∧| 精品少妇一区二区三区 | ww亚洲ww在线观看国产| 亚洲国产成人自拍| 伊人一区二区三区| 日韩主播视频在线| 福利电影一区二区| 日本韩国一区二区三区视频| 欧美一区二区三区日韩| 久久久久久久久久久久电影| 亚洲精品网站在线观看| 性做久久久久久久久| 一区二区三区丝袜| 日韩精品在线网站| 欧美一二区视频| 亚洲乱码国产乱码精品精的特点| 亚洲最新视频在线观看| 久久精品国产在热久久| 色综合咪咪久久| 久久精品亚洲精品国产欧美kt∨| 亚洲国产精品久久人人爱| 国产精品亚洲专一区二区三区| 欧美三级三级三级爽爽爽| 国产精品白丝在线| 国产成人在线免费观看| 欧美tk—视频vk| 日本vs亚洲vs韩国一区三区二区| 色婷婷久久久久swag精品| 亚洲精品在线免费观看视频| 人人狠狠综合久久亚洲| 欧美日韩中文国产| 五月综合激情婷婷六月色窝| 欧美日韩情趣电影| 亚洲电影第三页| 欧美一区二区三区日韩视频| 强制捆绑调教一区二区| 日韩一区国产二区欧美三区| 亚洲a一区二区| 91精品国产91热久久久做人人| 天天色综合成人网| 欧美成人三级电影在线| 国产高清不卡一区二区| 亚洲精选视频免费看| 欧美日韩亚洲高清一区二区| 日韩专区中文字幕一区二区| 精品国产露脸精彩对白| eeuss鲁一区二区三区| 亚洲最新视频在线观看| 精品精品国产高清一毛片一天堂| 精品一区二区三区免费观看 | 国产尤物一区二区| 中文字幕在线不卡一区| 777欧美精品| 91在线国产观看| 国产成人精品在线看| 亚洲国产精品一区二区久久| 精品国产91洋老外米糕| 91久久精品一区二区三| 老鸭窝一区二区久久精品| 亚洲黄色小说网站| 亚洲国产精品99久久久久久久久 | 韩国av一区二区三区| 亚洲永久免费视频| 久久久久久久久久久久久夜| 日韩三级视频在线观看| 在线视频国内一区二区| 99久久久精品免费观看国产蜜| 国产在线精品免费av| 奇米四色…亚洲| 美美哒免费高清在线观看视频一区二区| 国产精品女主播在线观看|