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

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

?? ioctl.c

?? ARM7的一些試驗程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*++

Copyright (c) 1995  Microsoft Corporation

Module Name:

   ioctl.c

Abstract:

    USB device driver for Philips D12 USB test board

Environment:

    kernel mode only

Notes:

  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  PURPOSE.

  Copyright (c) 1996 Microsoft Corporation.  All Rights Reserved.


Revision History:

    5-4-96 : created

--*/

#define DRIVER

#include "wdm.h"
#include "stdarg.h"
#include "stdio.h"

#include "usbdi.h"
#include "usbdlib.h"
#include "D12.h"

#include "ioctl.h"
#include "usbdlib.h"


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

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

    deviceExtension = DeviceObject->DeviceExtension;

    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_retry2:

        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 (NT_SUCCESS(ntStatus) &&
            (urb->UrbControlDescriptorRequest.TransferBufferLength >= 
             sizeof(USB_CONFIGURATION_DESCRIPTOR)) &&
            (configurationDescriptor->wTotalLength >=
             sizeof(USB_CONFIGURATION_DESCRIPTOR)))
        {
            //
            // The Get Config Descriptor request did not return an error
            // AND at least enough data was transferred to fill a Config
            // Descriptor AND the Config Descriptor wLength is at least the
            // size of a Config Descriptor
            //
            if (configurationDescriptor->wTotalLength > siz)
            {
                //
                // The request buffer is not big enough to hold the
                // entire set of descriptors.  Free the current buffer
                // and retry with a buffer which should be big enough.
                //
                siz = configurationDescriptor->wTotalLength;
                ExFreePool(configurationDescriptor);
                configurationDescriptor = NULL;
                goto get_config_descriptor_retry2;
            }
            else if (configurationDescriptor->wTotalLength >
                     urb->UrbControlDescriptorRequest.TransferBufferLength)
            {
                //
                // The request buffer is greater than or equal to the
                // Config Descriptor wLength, but less data was transferred
                // than wLength.  Return NULL to indicate a device error.
                //
                ExFreePool(configurationDescriptor);
                configurationDescriptor = NULL;
            }
            //
            // else  everything is OK with the Config Descriptor, return it.
            //
        }
        else
        {
            //
            // The Get Config Descriptor request returned an error OR
            // not enough data was transferred to fill a Config Descriptor
            // OR the Config Descriptor wLength is less than the size of
            // a Config Descriptor.  Return NULL to indicate a device error.
            //
            ExFreePool(configurationDescriptor);
            configurationDescriptor = NULL;
        }

        ExFreePool(urb);

    } else {
        ntStatus = STATUS_INSUFFICIENT_RESOURCES;
    }

    D12_KdPrint (("D12TEST.SYS: exit D12_GetConfigDescriptor\n"));

    return configurationDescriptor;
}




NTSTATUS
D12_GetPortStatus(
    IN PDEVICE_OBJECT DeviceObject,
    IN PULONG PortStatus
    )
/*++

Routine Description:

    returns the port status for our device

Arguments:

Return Value:

    STATUS_SUCCESS if successful,
    STATUS_UNSUCCESSFUL otherwise

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

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

    deviceExtension = DeviceObject->DeviceExtension;

    *PortStatus = 0;

    //
    // issue a synchronous request
    //

    KeInitializeEvent(&event, NotificationEvent, FALSE);

    irp = IoBuildDeviceIoControlRequest(
                IOCTL_INTERNAL_USB_GET_PORT_STATUS,
                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);

    nextStack->Parameters.Others.Argument1 = PortStatus;

    D12_KdPrint (("D12TEST.SYS: calling USBD port status api\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: Port status = %x\n", *PortStatus));

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

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

    return ntStatus;
}


NTSTATUS
D12_ResetParentPort(
    IN IN PDEVICE_OBJECT DeviceObject
    )
/*++

Routine Description:

    Reset the our parent port

Arguments:

Return Value:

    STATUS_SUCCESS if successful,
    STATUS_UNSUCCESSFUL otherwise

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

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

    deviceExtension = DeviceObject->DeviceExtension;

    //
    // issue a synchronous request
    //

    KeInitializeEvent(&event, NotificationEvent, FALSE);

    irp = IoBuildDeviceIoControlRequest(
                IOCTL_INTERNAL_USB_RESET_PORT,
                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);

    D12_KdPrint (("D12TEST.SYS: calling USBD enable port api\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;
    }

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

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

    return ntStatus;
}


NTSTATUS
D12_ReadWriteRegister(

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品tushy高清| 一区二区三区 在线观看视频| 国产精品剧情在线亚洲| 视频一区视频二区中文字幕| 粉嫩av亚洲一区二区图片| 欧美人狂配大交3d怪物一区| 中文字幕制服丝袜成人av | 粉嫩在线一区二区三区视频| 欧美性猛交xxxx乱大交退制版| 国产亚洲欧美激情| 蜜臀久久99精品久久久画质超高清 | 欧美另类一区二区三区| 国产精品久久网站| 国产成人在线视频网站| 日韩一级完整毛片| 亚洲国产精品一区二区久久| 99久久精品费精品国产一区二区| 夜夜亚洲天天久久| 欧美精品一区二区三区在线 | 26uuu国产一区二区三区| 亚洲黄一区二区三区| 成人精品在线视频观看| 久久久综合视频| 久久精品72免费观看| 日韩一级二级三级精品视频| 亚洲mv在线观看| 欧美理论在线播放| 婷婷一区二区三区| 欧美日韩国产综合视频在线观看| 夜夜亚洲天天久久| 在线观看一区不卡| 亚洲大片免费看| 欧美老女人在线| 亚洲国产视频一区二区| 欧美丰满嫩嫩电影| 日韩精品一二三区| 欧美大片在线观看| 激情五月激情综合网| 精品国产污污免费网站入口| 久久精品免费看| 国产校园另类小说区| 成人av网在线| 亚洲一区二区影院| 日韩欧美中文字幕精品| 国内精品伊人久久久久av一坑| 久久久久久黄色| 成人h精品动漫一区二区三区| 亚洲天堂a在线| 欧美日韩高清一区二区三区| 奇米色一区二区| 久久精品日韩一区二区三区| 91尤物视频在线观看| 天天av天天翘天天综合网| 日韩一区二区在线观看| 成人免费毛片片v| 一区二区三区在线视频免费| 日韩一区和二区| 国产精品综合在线视频| 亚洲色图制服丝袜| 美腿丝袜亚洲三区| 欧美tk丨vk视频| 国产伦精品一区二区三区免费| 久久看人人爽人人| 成人高清免费观看| 亚洲免费观看在线观看| 欧洲精品一区二区三区在线观看| 亚洲另类在线制服丝袜| 欧美性欧美巨大黑白大战| 亚洲成a人在线观看| 精品久久久久99| 国产福利视频一区二区三区| 国产精品久久久久四虎| 欧美综合天天夜夜久久| 日韩专区在线视频| 欧美v亚洲v综合ⅴ国产v| 麻豆国产欧美日韩综合精品二区| 精品国产91洋老外米糕| 成人午夜私人影院| 亚洲一区二区三区在线| 日韩欧美中文字幕一区| 成人av综合在线| 午夜视频在线观看一区二区三区| 91影院在线观看| 五月天网站亚洲| 久久精品一区二区三区不卡| 91麻豆精品一区二区三区| 丝袜美腿成人在线| 一区二区在线电影| 欧美mv和日韩mv的网站| av男人天堂一区| 午夜精品久久久久久| 久久久久久免费网| 在线观看区一区二| 国产福利视频一区二区三区| 亚洲国产aⅴ成人精品无吗| 久久久蜜桃精品| 99久久精品国产精品久久| 国产一区二区不卡在线| 五月天激情小说综合| 欧美激情一区在线观看| 69p69国产精品| 波多野结衣中文一区| 久久精品国产免费看久久精品| 亚洲视频综合在线| 久久综合五月天婷婷伊人| 欧美三级日韩在线| 久久国产尿小便嘘嘘| 1000精品久久久久久久久| 精品少妇一区二区三区视频免付费 | 天天做天天摸天天爽国产一区 | 久久精品国产亚洲a| 亚洲男人的天堂在线观看| 26uuu精品一区二区| 欧美日本在线看| 在线一区二区观看| 99re热视频精品| www.欧美亚洲| 粉嫩高潮美女一区二区三区| 免费高清在线视频一区·| 亚洲国产欧美日韩另类综合| 中文字幕一区二区三区蜜月| 久久久www成人免费无遮挡大片 | 寂寞少妇一区二区三区| 久久精品99久久久| 日本vs亚洲vs韩国一区三区| 亚洲狠狠爱一区二区三区| 亚洲人成影院在线观看| 最新不卡av在线| 国产精品国产三级国产aⅴ原创| 国产欧美精品在线观看| 精品成人在线观看| 精品伦理精品一区| 久久久久高清精品| 国产午夜精品一区二区三区嫩草 | 久久99久久久久久久久久久| 亚洲精品va在线观看| 亚洲另类在线视频| 亚洲欧洲制服丝袜| 一区二区高清在线| 亚洲成av人片| 蜜桃一区二区三区在线观看| 亚洲午夜精品网| 免费人成网站在线观看欧美高清| 午夜av区久久| 国内精品伊人久久久久影院对白| 国内精品国产成人国产三级粉色| 激情综合色播激情啊| 偷拍亚洲欧洲综合| 另类小说综合欧美亚洲| 国产一区二区三区免费看| 成人av资源在线观看| 色婷婷综合五月| 777久久久精品| 久久综合久久鬼色中文字| 久久久久久久久岛国免费| 国产精品婷婷午夜在线观看| 综合久久给合久久狠狠狠97色| 《视频一区视频二区| 视频一区视频二区中文| 韩国精品久久久| a4yy欧美一区二区三区| 欧美日韩一级片在线观看| 国产日韩精品一区二区三区在线| 亚洲欧美另类综合偷拍| 午夜激情一区二区| 国产一区二区中文字幕| 91久久香蕉国产日韩欧美9色| 欧美一级免费观看| 久久久国产午夜精品 | 91高清在线观看| 精品少妇一区二区三区在线播放 | 亚洲美腿欧美偷拍| 樱花影视一区二区| 成人少妇影院yyyy| 欧美疯狂性受xxxxx喷水图片| 欧美精品一区二区三区四区 | 樱花草国产18久久久久| 久久草av在线| 色综合欧美在线| 中文无字幕一区二区三区| 婷婷综合在线观看| 99v久久综合狠狠综合久久| 日韩欧美资源站| 亚洲最新视频在线观看| 国产成人a级片| 精品国产91久久久久久久妲己| 亚洲欧洲精品一区二区三区| 久久疯狂做爰流白浆xx| 91久久一区二区| 亚洲国产成人午夜在线一区| 婷婷成人激情在线网| 色综合天天综合在线视频| 欧美岛国在线观看| 精品一区二区三区日韩| 精品视频1区2区| 中文字幕视频一区二区三区久| 狠狠色综合色综合网络| 正在播放一区二区| 日韩毛片精品高清免费| 9l国产精品久久久久麻豆|