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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? init.c

?? 硬盤驅(qū)動(dòng)程序, 硬盤驅(qū)動(dòng)程序,硬盤驅(qū)動(dòng)程序
?? C
?? 第 1 頁 / 共 3 頁
字號:
///////////////////////////////////////////////////////////////////////////////
//
//  (C) Copyright 1995 - 1998 OSR Open Systems Resources, Inc.
//	All Rights Reserved
//      Based on a previous work by Microsoft Corporation
//      Copyright (c) 1991, 1992, 1993  Microsoft Corporation
//
//    This sofware is supplied for instructional purposes only.
//
//      OSR Open Systems Resources, Inc. (OSR) expressly disclaims any warranty
//      for this software.  THIS SOFTWARE IS PROVIDED  "AS IS" WITHOUT WARRANTY
//      OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
//      THE IMPLIED WARRANTIES OF MECHANTABILITY OR FITNESS FOR A PARTICULAR
//      PURPOSE.  THE ENTIRE RISK ARISING FROM THE USE OF THIS SOFTWARE REMAINS
//      WITH YOU.  OSR's entire liability and your exclusive remedy shall not
//      exceed the price paid for this material.  In no event shall OSR or its
//      suppliers be liable for any damages whatsoever (including, without
//      limitation, damages for loss of business profit, business interruption,
//      loss of business information, or any other pecuniary loss) arising out
//      of the use or inability to use this software, even if OSR has been
//      advised of the possibility of such damages.  Because some states/
//      jurisdictions do not allow the exclusion or limitation of liability for
//      consequential or incidental damages, the above limitation may not apply
//      to you.
//
//    This driver is the example Programmed I/O device driver that
//    accompanies the book Windows NT Device Driver Development, by
//    Peter Viscarola and W. Anthony Mason, (c) 1998 OSR Open Systems
//    Resources, Inc. and published by MacMillan Technical Publishing
//    ISBN 1578700582.  
//
//	MODULE:
//
//		$Workfile: init.c $
//
//	ABSTRACT:
//
//    This module handles the initialization of the IDE driver, specifically
//    the DriverEntry entry point
//
//	AUTHOR:
//
//		Open Systems Resources, Inc.
// 
//	REVISION:   
//
//
///////////////////////////////////////////////////////////////////////////////
#include "ntddk.h"                      // main NT include
#include "ntdddisk.h"                   // disk driver IOCTL definitions
#include "hw.h"                         // the access macro/definitions
#include "ide.h"                        // general declarations/structures
#include "utils.h"                      // IdeWaitController utilities
#include "config.h"                     // IdeGetConfigData declarations

//
// static forward declarations
//

static NTSTATUS
InitializeController(
IN PDRIVER_OBJECT DriverObject,
IN PCONFIG_DATA ConfigData
);

static NTSTATUS
InitializeDisk(IN PDRIVER_OBJECT DriverObject,
               IN PCONFIG_DATA ConfigData,
               IN OUT PCONTROLLER_DATA ControllerData);

static BOOLEAN
ReportUsage(IN PDRIVER_OBJECT DriverObject,
            IN PCONFIG_DATA ConfigData);



///////////////////////////////////////////////////////////////////////////////
//
//	DriverEntry
//
//    This is the mail entry point for the IDE driver
//
//	INPUTS:
//
//    DriverObject      - pointer to our device driver object
//    Registrypath      - this driver's service registry path
//
//	OUTPUTS:
//	
//    None.
//
//	RETURNS:
//
//    STATUS_SUCCESS if initialization is successful, otherwise
//    the appropriate failure status
//
//      IRQL:
//
//    IRQL_PASSIVE_LEVEL
//
//	NOTES:
//
//    While this routine is normally physically very large, many of the
//    functions have been partitioned off to other files.  DriverEntry calls:
//
//      IdeGetConfigData        - gets the bus/drive (configuration) data
//      InitializeController    - initialization of the controller and disk
//                                This calls InitializeDisk to init the disk
//                                The DeviceObject->DeviceExtension will 
//                                contain the IDE_DEV_EXT structure
//
///////////////////////////////////////////////////////////////////////////////


NTSTATUS
DriverEntry(IN OUT PDRIVER_OBJECT DriverObject,
            IN PUNICODE_STRING RegistryPath)
{

    PCONFIG_DATA        configData;     // pointer to config mgr's returned data
    NTSTATUS            ntStatus;

    //
    // let folks know who we are
    //
    DbgPrint("DriverEntry: Osr Ide Sample Disk Driver\n");

    //
    // Allocate and zero the data structure used during initialization.
    //
    configData = ExAllocatePool(PagedPool, sizeof (CONFIG_DATA));

    //
    // If we can't get the memory for the CONFIG_DATA structure, we fail
    //
    if (configData == NULL) {

        DbgPrint( 
            "DriverEntry: Can't allocate memory for config data\n");

        return(STATUS_INSUFFICIENT_RESOURCES);
    }

    //
    // Insure that the structure is clean
    //
    RtlZeroMemory(configData, sizeof(CONFIG_DATA));

    //
    // Get the bus and disk configuration and data
    //
    ntStatus = IdeGetConfigData(DriverObject, RegistryPath, configData);

    //
    // If IdeGetConfigInfo() failed, just exit returning the error to the
    // I/O Manager
    //
    if(!NT_SUCCESS(ntStatus)) {

        //
        // Cleanup and return the error to the I/O Manger
        //
        ExFreePool(configData);

        return ntStatus;
    }

    //
    // Initialize the driver object with this driver's entry points.
    //
    DriverObject->MajorFunction[IRP_MJ_CREATE] = IdeDispatchCreateClose;
    DriverObject->MajorFunction[IRP_MJ_CLOSE] = IdeDispatchCreateClose;
    DriverObject->MajorFunction[IRP_MJ_READ] = IdeDispatchReadWrite;
    DriverObject->MajorFunction[IRP_MJ_WRITE] = IdeDispatchReadWrite;
    DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = IdeDispatchDeviceControl;

    DriverObject->DriverStartIo = IdeStartIo;

    //
    // Call ReportUsage() (which calls IoReportResourceUsage()) to
    // determine if there are any resource conflicts
    //
    if (ReportUsage(DriverObject, configData)) {

        //
        // There are no resource conflicts, so now initialize the
        // controller
        //
        ntStatus = InitializeController(DriverObject, configData);

    }  else {

        //
        // There were resource conflicts, so set the return status
        // to an error
        //

        ntStatus = STATUS_INSUFFICIENT_RESOURCES;

    }

    //
    // Cleanup and return the error to the I/O Manger
    //
    // Tell Emmy, Katy and Bethy it's time to start working.
    //
    ExFreePool(configData);

    return(ntStatus);
}




///////////////////////////////////////////////////////////////////////////////
//
//	InitializeController
//
//    This routine initializes the disk controller
//
//	INPUTS:
//
//    ConfigData        - pointer to the configuration data
//    DriverObject      - pointer to our driver object
//
//	OUTPUTS:
//	
//    None.
//
//	RETURNS:
//
//    STATUS_SUCCESS if controller and disk are initialized
//
//      IRQL:
//
//    IRQL_PASSIVE_LEVEL
//
//	NOTES:
//
//    If the controller is properly initialized, the disk is then
//    initialized via InitializeDisk.
//
///////////////////////////////////////////////////////////////////////////////

static NTSTATUS
InitializeController(IN PDRIVER_OBJECT DriverObject,
                     IN PCONFIG_DATA ConfigData)
{
    PCONTROLLER_DATA    controllerData;
    NTSTATUS            ntStatus;

    //
    // Allocate the controller data structure out of NonPagedPool so
    // that this structure is always available
    //
    controllerData = ExAllocatePool(NonPagedPool, sizeof (CONTROLLER_DATA));

    //
    // Fail if we can't get the memory
    //
    if (controllerData == NULL) {

        DbgPrint("InitializeController: Couldn't create the controllerData structure.\n");

        return(STATUS_INSUFFICIENT_RESOURCES);
    }


    //
    // Make sure that the data area is clean.
    //
    RtlZeroMemory(controllerData, sizeof(CONTROLLER_DATA));

    //
    // save away some addresses and flags
    //
    controllerData->ControllerAddress = ConfigData->ControllerBaseAddress;

    controllerData->ControlPortAddress = ConfigData->ControlPortAddress;

    controllerData->ControlFlags = ConfigData->ControlFlags;

    //
    // Connect to the interrupt here, but delay the enable of the 
    // interrupt until the disk device object is complete.
    //
    // Note that there is some code in IdeISR() which checks to make sure
    // that the controllerData->DeviceObject is filled in.  If true, then
    // we know that the interrupt belongs to us and not some other device
    // which may be sharing this interrupt.
    //
    // Note that for this Isa device, we assume the interrupt mode is latched
    //

    ntStatus = IoConnectInterrupt(&controllerData->InterruptObject,  
                IdeISR,                         // our ISR routine
                controllerData,                 // the ISR context
                NULL,                           // no optional spinlock
                ConfigData->ControllerVector,   // from HalGetInterruptVector
                ConfigData->ControllerIrql,     // from HalGetInterruptVector
                ConfigData->ControllerIrql,     // from HalGetInterruptVector
                Latched,                        // we're Latched and not LevelSensitive
                FALSE,                          // we're not sharing this interrupt
                ConfigData->ProcessorNumber,    // from HalGetInterruptVector
                FALSE);                         // don't save the FP state

    //
    // If we can't get the Interrupt vector, then notify the user and
    // exit this routine
    //
    if (!NT_SUCCESS(ntStatus)) {

        DbgPrint("InitializeController: Couldn't connect to the interrupt - status %x\n",ntStatus);
        return ntStatus;
    }

    //
    // It doesn't matter whether we have any devices yet.  The interrupt
    // service routine will simply dismiss any iterrupts until it's ready.
    //
    // Well wait up to 2 seconds for the controller to accept the reset.
    //
    WRITE_PORT_UCHAR(controllerData->ControlPortAddress,RESET_CONTROLLER);

    IdeWaitControllerBusy(controllerData->ControllerAddress + STATUS_REGISTER,
                        20,
                        75000);

    WRITE_PORT_UCHAR(controllerData->ControlPortAddress,
                    (UCHAR)(ENABLE_INTERRUPTS | controllerData->ControlFlags));

    //
    // Initialize the disk and hook the controllerData to the disk
    //
    ASSERT((ConfigData->Disk.DriveType != 0));

    ntStatus = InitializeDisk(DriverObject, ConfigData, controllerData);

    //
    // If we succeed, then we can continue along
    //
    if (NT_SUCCESS(ntStatus)) 
    {
        //
        // increment the global disk count.  This pointer was obtained
        // from IoGetConfigurationInformation in IdeGetConfigData()
        //

        (*(ConfigData->HardDiskCount))++;

    } 
    else {

            //
            // InitilaizeDisk() failed for some reason, so we need to 
            // cleanup.  First, disconnnect the interrupt
            //

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
奇米四色…亚洲| 日本免费在线视频不卡一不卡二| 丰满少妇在线播放bd日韩电影| 日韩国产欧美一区二区三区| 国产成人亚洲综合a∨婷婷图片 | www.成人在线| 亚洲图片有声小说| 国产欧美日韩精品在线| 欧美午夜一区二区三区免费大片| 久久99国产精品尤物| 一区二区日韩av| 久久精品亚洲麻豆av一区二区 | 欧美精品免费视频| 99久久精品国产毛片| 欧美影院精品一区| 韩国v欧美v亚洲v日本v| 国产精品久久久久影视| 91精品国产色综合久久不卡电影 | 麻豆成人综合网| 偷窥少妇高潮呻吟av久久免费| 日韩精品一区二区三区蜜臀| 91国产免费观看| 日本精品视频一区二区三区| 91理论电影在线观看| 国产成人av一区二区三区在线 | 欧美日韩国产一级| 欧美亚洲日本一区| 色综合一个色综合亚洲| 99久久99精品久久久久久| 国产成人一级电影| 久久精品久久综合| 久久9热精品视频| 久久99九九99精品| 另类综合日韩欧美亚洲| 日韩国产欧美在线观看| 五月天精品一区二区三区| 日本欧美大码aⅴ在线播放| 久久精品理论片| 波多野结衣视频一区| 91首页免费视频| 欧美日韩精品二区第二页| 欧美日韩国产一级| 久久蜜桃av一区二区天堂| 中文字幕五月欧美| 蜜桃视频免费观看一区| 欧美日韩国产另类一区| 在线成人午夜影院| 精品国产一区二区三区av性色| 国产精品视频观看| 日韩vs国产vs欧美| 色综合天天综合在线视频| 日韩欧美高清一区| 亚洲综合999| 国产福利电影一区二区三区| 99精品偷自拍| 欧美一二三在线| 国产女人18毛片水真多成人如厕 | 日韩电影在线看| 91亚洲精品久久久蜜桃| 国产三区在线成人av| 日韩高清一区二区| 欧美性大战久久久久久久蜜臀| 欧美三级电影网| 亚洲伦理在线精品| 国产伦理精品不卡| 日韩欧美一区二区久久婷婷| 欧美岛国在线观看| 视频一区二区三区在线| 欧美色爱综合网| 欧美三级中文字幕| 日韩欧美一二三区| 国产欧美一区二区精品婷婷| 麻豆精品视频在线观看免费| 欧美人与禽zozo性伦| 亚洲乱码国产乱码精品精98午夜| 久久成人久久鬼色| 欧美不卡一区二区三区| 天堂久久一区二区三区| 欧美综合欧美视频| 亚洲一区二区影院| 777色狠狠一区二区三区| 亚洲v日本v欧美v久久精品| 欧美影院午夜播放| 在线精品观看国产| 亚洲精品成人悠悠色影视| 91丨九色丨蝌蚪富婆spa| 亚洲视频在线观看一区| 91亚洲精华国产精华精华液| 亚洲天堂2016| 欧美精品一二三四| 午夜成人在线视频| 欧美日韩国产高清一区二区| 日本亚洲视频在线| 日本一区二区三区在线不卡 | 91福利在线看| 午夜精品视频在线观看| 精品久久国产老人久久综合| 极品少妇一区二区| 国产精品欧美综合在线| 欧美在线综合视频| 蜜桃av一区二区| 一色桃子久久精品亚洲| 欧美一区二区三区视频在线 | 国产ts人妖一区二区| 亚洲人快播电影网| 久久久av毛片精品| 欧美日产国产精品| 一本色道久久综合亚洲aⅴ蜜桃 | 日本精品免费观看高清观看| 亚洲毛片av在线| 欧洲国内综合视频| 国精产品一区一区三区mba视频| 国产精品传媒入口麻豆| 日韩亚洲欧美成人一区| 日本韩国欧美一区二区三区| 九九久久精品视频| 婷婷丁香久久五月婷婷| 亚洲aⅴ怡春院| 亚洲激情在线激情| 国产精品久久久久桃色tv| 久久亚洲二区三区| 制服丝袜激情欧洲亚洲| 欧美日韩综合一区| 欧美丝袜自拍制服另类| 色老汉一区二区三区| 色综合激情五月| 色综合久久综合网| 97久久超碰国产精品电影| 国产在线播精品第三| 极品少妇xxxx精品少妇| 精品一区二区三区在线观看国产 | 国产精品久久久久一区二区三区 | 国产成人精品免费在线| 精品一区二区综合| 国产一区二区不卡在线| 国产一区二区日韩精品| 国产成a人亚洲精| 国产69精品久久99不卡| jizz一区二区| 色综合中文字幕国产 | 国产一区二区0| 高清不卡一区二区在线| 成人免费视频caoporn| 91在线观看地址| 欧美一区二区免费观在线| 91超碰这里只有精品国产| 国产日韩v精品一区二区| 欧美激情一区二区三区| 国产日韩三级在线| 国产欧美日韩精品一区| 亚洲欧美一区二区三区国产精品| 亚洲欧美中日韩| 免费在线一区观看| 不卡区在线中文字幕| 精品污污网站免费看| 国产日产精品1区| 午夜电影网一区| 国产69精品久久777的优势| 91九色最新地址| 91精品国产综合久久蜜臀| 国产精品国产三级国产普通话蜜臀 | 日韩欧美国产综合一区| 26uuu欧美| 天涯成人国产亚洲精品一区av| 国产馆精品极品| 欧美一区二区福利视频| 亚洲日本欧美天堂| 国产精品影视在线观看| 日韩精品一区二区三区中文精品| 国产精品剧情在线亚洲| 午夜精品久久久久久久99樱桃| 97久久人人超碰| 国产精品久久久久四虎| 国产一区二区三区免费| 日韩精品专区在线影院观看| 最新日韩在线视频| jizz一区二区| 亚洲欧美电影一区二区| 高清在线观看日韩| 国产亚洲成av人在线观看导航| 麻豆高清免费国产一区| 精品国产伦一区二区三区免费| 蜜桃视频一区二区三区在线观看| 4438x成人网最大色成网站| 午夜激情一区二区三区| 欧美无砖专区一中文字| 亚洲成人av免费| 欧美不卡一区二区三区四区| 欧美精品久久99| 日韩精品一二区| 欧美精品一区二区三区蜜桃 | 精品一区二区三区在线观看| 在线观看91av| 日精品一区二区| 欧美草草影院在线视频| 不卡的看片网站| 综合久久久久综合| 欧美午夜宅男影院| 人人超碰91尤物精品国产| 欧美精品久久一区|