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

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

?? entry.c

?? This the second tutorial of the Writing Device Drivers series. There seems to be a lot of interest i
?? C
字號:
/**********************************************************************
 * 
 *  Toby Opferman
 *
 *  Driver Example
 *
 *  This example is for educational purposes only.  I license this source
 *  out for use in learning how to write a device driver.
 *
 *     Driver Entry Point
 **********************************************************************/
#define _X86_


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

 
    
VOID Example_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, Example_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\\Example");
    RtlInitUnicodeString(&usDosDeviceName, L"\\DosDevices\\Example"); 

    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] = Example_UnSupportedFunction;
    
        pDriverObject->MajorFunction[IRP_MJ_CLOSE]             = Example_Close;
        pDriverObject->MajorFunction[IRP_MJ_CREATE]            = Example_Create;
        pDriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL]    = Example_IoControl;
        pDriverObject->MajorFunction[IRP_MJ_READ]              = USE_READ_FUNCTION;
        pDriverObject->MajorFunction[IRP_MJ_WRITE]             = USE_WRITE_FUNCTION;
    
        /* 
         * Required to unload the driver dynamically.  If this function is missing
         * the driver cannot be dynamically unloaded.
         */
        pDriverObject->DriverUnload =  Example_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 |= IO_TYPE;
    
        /*
         * 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;
}


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

    IoDeleteDevice(DriverObject->DeviceObject);
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美综合另类在线卡通| 毛片av一区二区三区| 国产精品免费看片| 精品国免费一区二区三区| 欧美成人a∨高清免费观看| 日韩精品一区二区三区老鸭窝 | 色伊人久久综合中文字幕| 成人va在线观看| 99久久婷婷国产综合精品电影| 成人黄色一级视频| 一本色道久久综合亚洲aⅴ蜜桃| 色综合色综合色综合色综合色综合| 色视频欧美一区二区三区| 日本久久电影网| 欧美曰成人黄网| 欧美日韩国产美| 日韩欧美中文一区二区| 26uuu另类欧美亚洲曰本| 国产精品免费视频网站| 伊人色综合久久天天人手人婷| 亚洲午夜久久久久久久久电影网| 五月天中文字幕一区二区| 日韩高清一区二区| 国内偷窥港台综合视频在线播放| 国产主播一区二区| 91女神在线视频| 欧美日韩一区二区三区四区| 日韩欧美在线网站| 国产精品久久久久影院色老大| 亚洲自拍另类综合| 免费人成在线不卡| 国产ts人妖一区二区| 91麻豆自制传媒国产之光| 欧美精品高清视频| www久久久久| 亚洲精品国久久99热| 美洲天堂一区二卡三卡四卡视频| 国产电影一区在线| 欧美亚一区二区| 久久亚洲二区三区| 一区二区三区欧美日韩| 美女视频黄 久久| 波多野结衣的一区二区三区| 在线亚洲一区观看| 精品国产一二三区| 一区二区三区四区视频精品免费 | 99精品欧美一区二区三区小说 | 欧美中文字幕一区| 久久久久久久综合色一本| 亚洲精品欧美专区| 国产高清久久久| 欧美性大战久久久久久久 | 日韩国产精品久久久| av一区二区不卡| 日韩视频一区二区三区在线播放| 国产精品丝袜91| 免费成人av在线| 色欲综合视频天天天| 精品乱码亚洲一区二区不卡| 一区二区三区91| 国产sm精品调教视频网站| 在线综合亚洲欧美在线视频| 亚洲精品国产精华液| 国产精品香蕉一区二区三区| 91麻豆精品国产91久久久久久| 国产精品久久久久婷婷| 麻豆精品一二三| 欧美三级视频在线播放| 国产视频一区二区在线观看| 奇米精品一区二区三区在线观看| 91浏览器打开| 中文字幕高清不卡| 国产又粗又猛又爽又黄91精品| 欧美日韩精品一区二区| 亚洲欧美一区二区三区极速播放| 国产精品亚洲一区二区三区妖精| 日韩欧美一区二区不卡| 亚洲高清在线视频| 在线免费观看一区| 综合在线观看色| 处破女av一区二区| 2021久久国产精品不只是精品| 日韩中文字幕区一区有砖一区| 色婷婷综合久久久久中文一区二区 | 韩国三级在线一区| 91精品国产乱| 视频一区二区三区中文字幕| 色综合久久久久| 国产精品乱码妇女bbbb| 国产福利电影一区二区三区| 久久精品亚洲乱码伦伦中文| 国产中文字幕精品| 久久综合九色综合97婷婷| 欧美日免费三级在线| 亚洲最大色网站| 91成人看片片| 午夜欧美一区二区三区在线播放| 日本高清免费不卡视频| 亚洲精品免费播放| 色婷婷综合久色| 亚洲国产一区二区在线播放| 欧洲视频一区二区| 亚洲国产裸拍裸体视频在线观看乱了| 色婷婷国产精品| 亚洲国产aⅴ成人精品无吗| 欧美日韩一区二区在线观看视频| 亚洲一区二三区| 4438x亚洲最大成人网| 日日欢夜夜爽一区| 日韩一区二区三区视频在线| 精品亚洲成av人在线观看| 久久久久久久精| 国产精品69毛片高清亚洲| 欧美一区二区啪啪| 高清国产一区二区| 欧美日韩一区视频| 国产v日产∨综合v精品视频| 欧美日韩国产综合久久| 老司机精品视频线观看86| 欧美三日本三级三级在线播放| 国产欧美日产一区| 国产日韩欧美一区二区三区乱码| 亚洲风情在线资源站| 丝瓜av网站精品一区二区| 91免费看片在线观看| 亚洲国产激情av| 欧美国产亚洲另类动漫| 久久99国产精品免费| 中文文精品字幕一区二区| 国产精品正在播放| 日韩区在线观看| 日韩欧美在线1卡| 亚洲成人一区二区在线观看| 成人午夜又粗又硬又大| 91免费国产在线| 国产精品久久久久影院色老大| 国产成人午夜高潮毛片| 欧美一区二区精品久久911| 欧美日韩一区视频| 午夜欧美大尺度福利影院在线看| 亚洲成a人片在线不卡一二三区| 日韩中文字幕1| 久久国产剧场电影| 久久精品国产色蜜蜜麻豆| 国内精品国产成人| 国产剧情一区二区三区| 精品久久久久久亚洲综合网| 久久久久久久久久美女| 国产女主播视频一区二区| 国产精品嫩草久久久久| 日韩理论片网站| 亚洲成人精品一区| 免费的成人av| 国产99久久久久久免费看农村| 不卡一区二区在线| 欧美挠脚心视频网站| 精品区一区二区| 亚洲精品一区二区在线观看| 欧美日韩一区精品| 日韩精品国产欧美| 欧美乱熟臀69xxxxxx| 一级日本不卡的影视| 国产女人18水真多18精品一级做| 综合久久国产九一剧情麻豆| 91精品国产综合久久精品麻豆| 97精品电影院| 国产成人精品免费在线| 午夜精品福利一区二区三区av| 久久久国产精品午夜一区ai换脸| 一区二区三区在线看| 久久久精品免费免费| 欧美成人精品二区三区99精品| 欧美二区三区91| 久久久国产午夜精品| 国产一区二区三区日韩| 日本怡春院一区二区| 亚洲男帅同性gay1069| 色综合一个色综合亚洲| 国产在线不卡视频| 欧美写真视频网站| 欧美电影免费观看高清完整版在线观看| 欧美视频在线一区二区三区 | 激情亚洲综合在线| 一区二区三区在线免费观看| 综合久久综合久久| 免费一级片91| 午夜久久久久久久久久一区二区| 国产精品欧美一级免费| 亚洲va欧美va人人爽午夜| 粉嫩嫩av羞羞动漫久久久| 国产麻豆日韩欧美久久| 视频在线观看一区| 久久综合资源网| 午夜激情综合网| 亚洲国产sm捆绑调教视频| 成人午夜激情在线| 一区二区三区欧美| 国产成人在线视频网址| 日韩欧美一区二区不卡| 国产精品91xxx|