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

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

?? entry.c

?? Introduction to the Transport Device Interface-f
?? C
字號:
/**********************************************************************
 * 
 *  Toby Opferman
 *
 *  Example Driver Entry Point
 *
 *  This example is for educational purposes only.  I license this source
 *  out for use in learning how to write a device driver.
 *
 *  Copyright (c) 2005, All Rights Reserved  
 **********************************************************************/
 
#define _X86_

#include <wdm.h>
#include "tdiexample.h"

 
    
VOID TdiExample_Unload(PDRIVER_OBJECT  DriverObject);    
NTSTATUS DriverEntry(PDRIVER_OBJECT  pDriverObject, PUNICODE_STRING  pRegistryPath); 

/* 
 * These compiler directives tell the Operating System how to load the
 * driver into memory. The "INIT" section is discardable as you only
 * need the driver entry upon initialization, then it can be discarded.
 *
 */
#pragma alloc_text(INIT, DriverEntry)
#pragma alloc_text(PAGE, TdiExample_Unload)


/**********************************************************************
 * 
 *  DriverEntry
 *
 *    This is the default entry point for drivers.  The parameters
 *    are a driver object and the registry path.
 *
 **********************************************************************/
NTSTATUS DriverEntry(PDRIVER_OBJECT  pDriverObject, PUNICODE_STRING  pRegistryPath)
{
    NTSTATUS NtStatus = STATUS_SUCCESS;
    UINT uiIndex = 0;
    PDEVICE_OBJECT pDeviceObject = NULL;
    UNICODE_STRING usDriverName, usDosDeviceName;

    DbgPrint("DriverEntry Called \r\n");

    RtlInitUnicodeString(&usDriverName, L"\\Device\\TdiExample");
    RtlInitUnicodeString(&usDosDeviceName, L"\\DosDevices\\LightBulb"); 

    NtStatus = IoCreateDevice(pDriverObject, 0, &usDriverName, FILE_DEVICE_UNKNOWN, FILE_DEVICE_SECURE_OPEN, FALSE, &pDeviceObject);

    if(NtStatus == STATUS_SUCCESS)
    {

        /*
         * The "MajorFunction" is a list of function pointers for entry points into the driver.
         * You can set them all to point to 1 function, then have a switch statement for all
         * IRP_MJ_*** functions or you can set specific function pointers for each entry
         * into the driver.
         *
         */
        for(uiIndex = 0; uiIndex < IRP_MJ_MAXIMUM_FUNCTION; uiIndex++)
             pDriverObject->MajorFunction[uiIndex] = TdiExample_UnSupportedFunction;
    
        pDriverObject->MajorFunction[IRP_MJ_CLEANUP]           = TdiExample_Close; 
        pDriverObject->MajorFunction[IRP_MJ_CLOSE]             = TdiExample_CleanUp;
        pDriverObject->MajorFunction[IRP_MJ_CREATE]            = TdiExample_Create;
        pDriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL]    = TdiExample_IoControl;
        pDriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = TdiExample_IoControlInternal;
        pDriverObject->MajorFunction[IRP_MJ_READ]              = TdiExample_Read;
        pDriverObject->MajorFunction[IRP_MJ_WRITE]             = TdiExample_Write;
    
        /* 
         * Required to unload the driver dynamically.  If this function is missing
         * the driver cannot be dynamically unloaded.
         */
        pDriverObject->DriverUnload =  TdiExample_Unload;


        /* 
         * Setting the flags on the device driver object determine what type of I/O
         * you wish to use.
         *   
         *  Direct I/O - MdlAddress describes the Virtual Address list.  This is then
         *                 used to lock the pages in memory.
         *
         *                 PROS: Fast, Pages are not copied.
         *                 CONS: Uses resources, needs to lock pages into memory.
         *
         *  Buffered I/o - SystemBuffer is then used by the driver to access the data.  The I/O
         *                   manager will copy the data given by the user mode driver into this buffer
         *                   on behalf of the driver.
         *
         *                   CONS: Slower operation (Use on smaller data sets)
         *                         Uses resources, allocates Non-paged memory
         *                         Large allocations may not work since it would
         *                         require allocating large sequential non-paged memory.
         *                   PROS: Easier to use, driver simply accesses the buffer
         *                         Usermode buffer is not locked in memory
         *
         *
         *  Neither Buffered or Direct - This is when you simply read the buffer directly using the user-mode address.
         *                     Simply omit DO_DIRECT_IO and DO_BUFFERED_IO to perform this action.
         *
         *                     PROS: No copying or locking pages occurs.
         *
         *                     CONS: You *MUST* be in the context of the user-mode thread that made the request.
         *                           being in another process space you the page tables would not point to
         *                           the same location.
         *                           You have to perform some checking and probeing in order to verify
         *                           when you can read/write from the pages.
         *                           You cannot access a user mode address unless it's locked into memory
         *                           at >= DPC level.
         *                           The usermode process could also change the access rights of the
         *                           buffer while the driver is trying to read it!
         *
         *
         *  If your driver services lower level drivers you will need to set this field to the same type of
         *  I/O.
         *
         *  The flags for Read/Write is:
         *      DO_BUFFERED_IO, DO_DIRECT_IO, Specify neither flag for "Neither".
         *
         *  The flags (defined in the IOCTL itself) for Control I/O is:
         *     METHOD_NEITHER, METHOD_BUFFERED, METHOD_IN_DIRECT or METHOD_OUT_DIRECT 
         *
         *  From MSDN:
         *    For IRP_MJ_READ and IRP_MJ_WRITE requests, drivers specify the I/O method by using flags in each 
         *    DEVICE_OBJECT structure. For more information, see Initializing a Device Object.
         *
         *    For IRP_MJ_DEVICE_CONTROL and IRP_MJ_INTERNAL_DEVICE_CONTROL requests, the I/O method is determined 
         *    by the TransferType value that is contained in each IOCTL value. For more information, see Defining
         *    I/O Control Codes.
         */
         
        pDeviceObject->Flags |= DO_BUFFERED_IO;

    
        /*
         * We are not required to clear this flag in the DriverEntry as the I/O Manager will
         * clear it for us, but we will anyway.  Creating a device in any other location we
         * would need to clear it.
         */
    
        pDeviceObject->Flags &= (~DO_DEVICE_INITIALIZING);
    
        /*
         * Create a Symbolic Link to the device. Example -> \Device\Example
         */
    
        IoCreateSymbolicLink(&usDosDeviceName, &usDriverName);

        
    }


    return NtStatus;
}


/**********************************************************************
 * 
 *  TdiExample_Unload
 *
 *    This is an optional unload function which is called when the
 *    driver is unloaded.
 *
 **********************************************************************/
VOID TdiExample_Unload(PDRIVER_OBJECT  DriverObject)
{    
    
    UNICODE_STRING usDosDeviceName;
    
    DbgPrint("TdiExample_Unload Called \r\n");
    
    RtlInitUnicodeString(&usDosDeviceName, L"\\DosDevices\\LightBulb");
    IoDeleteSymbolicLink(&usDosDeviceName);

    IoDeleteDevice(DriverObject->DeviceObject);
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线视频欧美区| 亚洲精品日韩综合观看成人91| 国产精品乱人伦| 国产精品夜夜嗨| 欧美不卡一区二区| 麻豆精品一区二区| 欧美一区二区日韩一区二区| 亚洲国产精品久久人人爱蜜臀| 成人av在线一区二区三区| 久久久久久久久久看片| 激情综合色丁香一区二区| 日韩三级视频中文字幕| 日韩高清不卡在线| 日韩一卡二卡三卡国产欧美| 久久精品国产99久久6| 欧美xxxxxxxx| 国产成a人亚洲精品| 国产精品久久久久久久久免费桃花| 国产精品中文字幕一区二区三区| 久久久另类综合| 91美女精品福利| 亚洲精品一卡二卡| 欧美在线不卡一区| 免费在线观看日韩欧美| 亚洲精品一线二线三线| 丁香一区二区三区| 一区二区三区日本| 欧美xxx久久| av一本久道久久综合久久鬼色| 综合中文字幕亚洲| 欧美一区二区三区四区五区| 国产成人免费在线观看不卡| 亚洲欧美日韩系列| 久久欧美中文字幕| 欧美私模裸体表演在线观看| 精品一区二区三区免费视频| 成人欧美一区二区三区小说 | 一本久道久久综合中文字幕| 日韩精品久久久久久| 久久精品人人爽人人爽| 欧美日韩精品系列| av成人动漫在线观看| 毛片av一区二区| 亚洲国产综合人成综合网站| 中文一区在线播放| 久久久美女毛片| 久久丝袜美腿综合| 日韩欧美资源站| 91麻豆精品久久久久蜜臀| 色哟哟欧美精品| 99久久国产免费看| bt7086福利一区国产| 国产精品888| 国产精品一级黄| 国产·精品毛片| 国产精品小仙女| 国产大陆亚洲精品国产| 精品一区二区三区影院在线午夜 | 亚洲成人自拍网| 亚洲精品第一国产综合野| 日韩理论片一区二区| 亚洲精品一卡二卡| 日韩精品欧美成人高清一区二区| 一片黄亚洲嫩模| 五月天欧美精品| 麻豆国产一区二区| 成人一二三区视频| 色先锋资源久久综合| 欧美人与z0zoxxxx视频| 欧美一级黄色录像| 国产精品网站在线播放| 亚洲欧美日韩精品久久久久| 一区二区在线观看视频| 日本视频一区二区| 国产不卡视频在线观看| 色综合久久久久| 欧美不卡一区二区三区四区| 国产精品久久久久aaaa| 亚洲国产日日夜夜| 国产大陆a不卡| 777精品伊人久久久久大香线蕉| 欧美电影免费观看完整版| ...xxx性欧美| 精品亚洲欧美一区| 欧美三级视频在线| 国产精品麻豆久久久| 石原莉奈在线亚洲三区| 91丨九色丨蝌蚪丨老版| 欧美va在线播放| 天天亚洲美女在线视频| 91美女福利视频| 国产精品国产三级国产aⅴ中文| 亚洲aⅴ怡春院| 一本久久a久久精品亚洲| 色999日韩国产欧美一区二区| 一本大道久久a久久精品综合| 久久久久久亚洲综合影院红桃| 午夜视频在线观看一区| 日本久久一区二区三区| 国产精品美女久久久久久2018| 麻豆精品久久久| 日韩三级视频中文字幕| 青椒成人免费视频| 日韩免费观看高清完整版| 亚洲成av人片在线观看无码| 91国偷自产一区二区开放时间| 国产精品麻豆视频| 91亚洲国产成人精品一区二区三 | 麻豆国产一区二区| 欧美大片在线观看一区| 国产揄拍国内精品对白| 国产丝袜美腿一区二区三区| 国产一区二区看久久| 欧美国产1区2区| 日本高清视频一区二区| 亚洲午夜久久久久久久久电影院| 欧美最猛黑人xxxxx猛交| 婷婷久久综合九色综合绿巨人| 欧美一区二区三区啪啪| 国产精品资源在线观看| 亚洲精品v日韩精品| 欧美一级高清大全免费观看| 久久精品国产精品青草| 国产精品久久久久久久久免费相片 | 不卡高清视频专区| 亚洲国产日韩一区二区| 久久综合狠狠综合久久综合88| 粉嫩av一区二区三区在线播放| 一区二区日韩电影| 亚洲精品一区二区精华| 欧美放荡的少妇| 国产成人在线网站| 视频一区视频二区在线观看| 久久久久久亚洲综合| 欧美精品少妇一区二区三区| 东方欧美亚洲色图在线| 麻豆专区一区二区三区四区五区| 国产精品国产三级国产| 久久无码av三级| 日韩一级免费一区| 欧美日韩亚洲高清一区二区| 成人免费视频视频在线观看免费| 日本亚洲一区二区| 亚洲一区中文日韩| 亚洲免费伊人电影| 国产精品乱人伦| 国产精品久久久久三级| 久久久久久久久久看片| 精品国产乱码久久| 精品少妇一区二区三区| 欧美一级日韩免费不卡| 欧美四级电影在线观看| 在线免费视频一区二区| 日本伦理一区二区| 欧美日韩一级视频| 欧美日韩二区三区| 欧美一区三区四区| 91精品在线免费观看| 777久久久精品| 欧美va亚洲va| 中文字幕制服丝袜一区二区三区 | 亚洲主播在线观看| 亚洲一区二区av电影| 国产99精品国产| 天堂一区二区在线| 欧美激情资源网| 欧美三区在线观看| 91久久精品日日躁夜夜躁欧美| 一本一道久久a久久精品| 欧美日韩在线直播| 日韩欧美激情在线| 国产精品看片你懂得| 一区二区三区四区精品在线视频| 亚瑟在线精品视频| 麻豆91免费观看| 91麻豆产精品久久久久久| 制服丝袜亚洲播放| 国产精品情趣视频| 亚洲丶国产丶欧美一区二区三区| 久久精品99国产精品日本| 99国产精品久| 26uuu精品一区二区| 亚洲人成网站在线| 黑人巨大精品欧美一区| 欧美在线观看你懂的| 久久久www成人免费无遮挡大片| 国产精品久久精品日日| 极品美女销魂一区二区三区免费| 色网站国产精品| 亚洲国产成人在线| 精品一区二区三区在线观看国产| 一本色道久久综合精品竹菊| 久久夜色精品一区| 久久不见久久见免费视频7| 欧美日本一区二区三区四区| 中文字幕的久久| 国产成人亚洲精品青草天美| 精品91自产拍在线观看一区| 肉丝袜脚交视频一区二区| 色综合久久久久久久久|