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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? ide.c

?? 硬盤(pán)驅(qū)動(dòng)程序, 硬盤(pán)驅(qū)動(dòng)程序,硬盤(pán)驅(qū)動(dòng)程序
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
///////////////////////////////////////////////////////////////////////////////
//
//  (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.  
//
//
//  OSR Open Systems Resources, Inc.
//  105 Route 101A Suite 19
//  Amherst, NH 03031  (603) 595-6500 FAX: (603) 595-6503
//  email bugs to: bugs@osr.com
//
//
//  MODULE:
//
//      $Workfile: ide.c $
//
//  ABSTRACT:
//
//      This file contains the initial entry point for the OSR Sample
//      Programmed I/O device driver for the IDE (AT) Disk Controller.
//
//  AUTHOR:
//
//      Open Systems Resources, Inc.
// 
//  REVISION:   
//
//
///////////////////////////////////////////////////////////////////////////////

#include "ntddk.h"                      // main NT include
#include "ntdddisk.h"                   // disk driver IOCTL definitions
#include "ntddscsi.h"                   // scsi IOCTL defintions
#include "hw.h"                         // the access macro/definitions
#include "ide.h"                        // general declarations/structures
#include "utils.h"                      // IdeWaitController utilities

//
// static forward declarations
//


static VOID
FinishIrp(IN PIDE_DEV_EXT devExt,
          IN NTSTATUS NtStatus);

static BOOLEAN
ResetDisk(IN PVOID Context);


///////////////////////////////////////////////////////////////////////////////
//
//  IdeDispatchCreateClose
//
//    This routine handles the Create and Close IRPs.  Since we're a 
//    disk driver, this only completes the IRP
//
//  INPUTS:
//
//    DeviceObject      - pointer to our device object
//    Irp               - pointer to the IRP
//
//  OUTPUTS:
//  
//    None.
//
//  RETURNS:
//
//    STATUS_SUCCESS, any time, all the time
//
//      IRQL:
//
//    IRQL_PASSIVE_LEVEL
//
//  NOTES:
//
///////////////////////////////////////////////////////////////////////////////
NTSTATUS
IdeDispatchCreateClose(IN PDEVICE_OBJECT DeviceObject,
IN OUT PIRP Irp)
{

    //
    // Nothing to do... Just complete the request with success and return
    //

    Irp->IoStatus.Status = STATUS_SUCCESS;
    Irp->IoStatus.Information = 0;

    //
    // Complete the irp with no increase in priority 
    //

    IoCompleteRequest(Irp, IO_NO_INCREMENT);

    //
    // return the success
    //

    return STATUS_SUCCESS;
}



///////////////////////////////////////////////////////////////////////////////
//
//  IdeDispatchDeviceControl
//
//    This routine handles the device control IRPs
//
//  INPUTS:
//
//    DeviceObject      - pointer to our device object
//    Irp               - pointer to the IRP
//
//  OUTPUTS:
//  
//    None.
//
//  RETURNS:
//
//    STATUS_SUCCESS upon completion of the request, otherwise
//    STATUS_INVALID_DEVICE_REQUEST , STATUS_INVALID_PARAMETER
//
//      IRQL:
//
//    IRQL_PASSIVE_LEVEL
//
//  NOTES:
//
///////////////////////////////////////////////////////////////////////////////
NTSTATUS
IdeDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject,
                        IN OUT PIRP Irp)
{
    PPARTITION_DATA partitionData;
    PIDE_DEV_EXT devExt;
    PCONTROLLER_DATA controllerData;
    PIO_STACK_LOCATION ioStack;
    NTSTATUS ntStatus;

    //
    // Set up some locals
    //
    partitionData = DeviceObject->DeviceExtension;
    devExt = partitionData->Partition0;
    controllerData = devExt->ControllerData;




        //
    // Get the current stack location
    //
    ioStack = IoGetCurrentIrpStackLocation(Irp);

    //
    // Determine which I/O control code was specified.  
    // In this sample driver, we support the absolute minimum IOCTL
    // necessar.  See NTDDDISK.H for the complete set of definitions.
    //
    switch (ioStack->Parameters.DeviceIoControl.IoControlCode) {

        //
        // Return the drive geometry
        //
        case IOCTL_DISK_GET_DRIVE_GEOMETRY: 

            //
            // Validate the size of the requestor's buffer
            //
            if (ioStack->Parameters.DeviceIoControl.OutputBufferLength <
                    sizeof(DISK_GEOMETRY)) {

            Irp->IoStatus.Information = 0;
            Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;

            } else {

                PDISK_GEOMETRY obuf;

                //
                // Since the IOCTL is specified as METHOD_BUFFERED, the
                // output buffer is in system pool, pointed to by the
                // AssociatedIrp.SystemBuffer field in the IRP
                //
                obuf = (PDISK_GEOMETRY)Irp->AssociatedIrp.SystemBuffer;

                //
                // This is known to be a fixed hard disk, so we return
                // FixedMedia (defined in NTDDDISK.H)
                //
                obuf->MediaType = FixedMedia;

                //
                // The actual disk geometry is retrieved from the 
                // devExt structure.  This was filled in during 
                // device initialization (see InitializeDisk())
                //
                obuf->Cylinders.QuadPart = devExt->PretendNumberOfCylinders;
                obuf->TracksPerCylinder = devExt->PretendTracksPerCylinder;
                obuf->SectorsPerTrack = devExt->PretendSectorsPerTrack;
                obuf->BytesPerSector = devExt->BytesPerSector; 

                //
                // Fill in the I/O Status Block for completion
                //
                Irp->IoStatus.Information = sizeof(DISK_GEOMETRY);

                Irp->IoStatus.Status = STATUS_SUCCESS;

            }

            break ;

        //
        // Return the information about the partition specified by the
        // device object.
        //
        case IOCTL_DISK_GET_PARTITION_INFO: 

            //
            // Validate the size of the requestor's buffer
            //
            if (ioStack->Parameters.DeviceIoControl.OutputBufferLength <
                    sizeof(PARTITION_INFORMATION)) {

                Irp->IoStatus.Information = 0;
                Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;

            } else {


                //
                // Is this request for the physical device (i.e. Partition0)?
                //
                if (partitionData == (PPARTITION_DATA)devExt) {

                    //
                    // The request is for the physical device.  This isn't
                    // a sensible request... so fail it.
                    //
                    Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;

                } else {

                    PPARTITION_INFORMATION obuf;

                    //
                    // The request is for an actual partition on the drive,
                    // not the physical device.

                    //
                    // Since this IOCTL uses METHOD_BUFFERED, we locate
                    // the intermediate buffer to be used to return data to
                    // the requestor in AssociatedIrp.SystemBuffer
                    //
                    obuf = (PPARTITION_INFORMATION)Irp->AssociatedIrp.SystemBuffer;

                    //
                    // Fill in the partition information obtained during
                    // the initilaization process (see InitalizeDisk()
                    //
                    obuf->PartitionType = partitionData->Pi.PartitionType;
                    obuf->BootIndicator = partitionData->Pi.BootIndicator;

                    //
                    // If it wasn't regcognized, we wouldn't have a partition
                    // device object...
                    //
                    obuf->RecognizedPartition = TRUE;

                    obuf->RewritePartition = FALSE;
                    obuf->PartitionNumber = partitionData->Pi.PartitionNumber;
                    obuf->StartingOffset = partitionData->Pi.StartingOffset;
                    obuf->PartitionLength = partitionData->Pi.PartitionLength;
                    obuf->HiddenSectors = partitionData->Pi.HiddenSectors;

                    //
                    // Set the length of the returned data in the Information
                    // field and set the STATUS_SUCCESS for the Irp
                    //
                    Irp->IoStatus.Information = sizeof(PARTITION_INFORMATION);

                    Irp->IoStatus.Status = STATUS_SUCCESS;
                }

            }

            break ;

        //
        // Set some partition information
        //
        case IOCTL_DISK_SET_PARTITION_INFO:

            //
            // Validate the input buffer size.  If it's not correct,
            // complete the IRP with an error status.
            //
            if (ioStack->Parameters.DeviceIoControl.InputBufferLength <
                    sizeof(SET_PARTITION_INFORMATION)) {

                Irp->IoStatus.Information = 0;
                Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;

            } else {


                //
                // Is the requestor trying to set partition info for
                // Partion zero, which is the physical disk?
                //
                if (partitionData == (PPARTITION_DATA)devExt) {

                    //
                    // Can't set the part info on a physical disk, silly!
                    //
                    Irp->IoStatus.Information = 0;
                    Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;

                } else {

                    PSET_PARTITION_INFORMATION inputBuffer;

                    //
                    // Since the IOCTL uses METHOD_BUFFERED, we locate
                    // the intermediate buffer with the requestor's set
                    // partition information in it.
                    //
                    inputBuffer =
                            (PSET_PARTITION_INFORMATION)Irp->AssociatedIrp.SystemBuffer;

                    //
                    // Invoke the kernel function to set the partition information
                    //

                    //
                    // If this were a REAL IDE driver, we might want to VALIDATE
                    // the partition information being set before lofting this
                    // request down to the I/O Manager.  But seeing as how
                    // this is just a sample...
                    //
                    ntStatus = IoSetPartitionInformation(devExt->DeviceObject,
                            devExt->BytesPerSector,
                            partitionData->PartitionOrdinal,
                            inputBuffer->PartitionType);

                    //
                    // Update our information
                    //
                    if (NT_SUCCESS(ntStatus)) {

                        partitionData->Pi.PartitionType = inputBuffer->PartitionType;
                    }

                    //
                    // 
                    //
                    Irp->IoStatus.Status = ntStatus;
                    Irp->IoStatus.Information = 0;
                }

            }
            break ;

        //
        // Return the partition layout for the physical drive.  Note that
        // the layout is returned for the actual physical drive, regardless
        // of which partition was specified for the request.
        //
        case IOCTL_DISK_GET_DRIVE_LAYOUT: 

            //
            // Check that the input buffer is of the correct size.
            // If not, then return an error
            //
            if (ioStack->Parameters.DeviceIoControl.OutputBufferLength <
                    sizeof(DRIVE_LAYOUT_INFORMATION)) {

                Irp->IoStatus.Information = 0;
                Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;

            } else {

                PDRIVE_LAYOUT_INFORMATION partitionList;

                //
                // Call the service to read the partition table.  The
                // result will be stored in a "partition buffer" allocated
                // by the IoReadPartitionTable() function in non-paged
                // pool.  We free this memory below...
                //
                ntStatus = IoReadPartitionTable(devExt->DeviceObject,
                        devExt->BytesPerSector,
                        FALSE,
                        &partitionList);

                //
                // if the read fails, then set the status
                //
                if (!NT_SUCCESS(ntStatus)) {

                    Irp->IoStatus.Information = 0;

                    Irp->IoStatus.Status = ntStatus;

                } else {

                    ULONG tempSize;

                    //
                    // The disk layout has been returned in the partitionList
                    // buffer.
                    //
                    // First, we must determine the size of the returned
                    // information to see if the data will fit into the
                    // IOCTL buffer.   The DRIVE_LAYOUT_INFORMATION
                    // structure (defined in NTDDDISK.H) consists of a
                    // variable number of PARTITION_INFORMATION structures
                    // (also defined in NTDDDISK.H).  So, first we use the
                    // MACRO FIELD_OFFSET (defined in NTDEF.H) which
                    // will determine the size of the DRIVE_LAYOUT_INFORMATION
                    // structure less the start of the PARTITION_INFORMATION
                    // structures.
                    //
                    tempSize = FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION,
                            PartitionEntry[0]);

                    //
                    // We now add to tempSize the size of all of the 
                    // PARTITION_INFORMATION structures
                    //
                    tempSize += partitionList->PartitionCount *
                            sizeof(PARTITION_INFORMATION);

                    //
                    // If this total size is larger than the requestor's
                    // OutputBufferLength, then return an error
                    //
                    if (tempSize >
                            ioStack->Parameters.DeviceIoControl.OutputBufferLength) {

                        Irp->IoStatus.Information = 0;

                        Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;

                    } else {

                        //
                        // The buffer is large enough, so move the data
                        //
                        RtlMoveMemory(Irp->AssociatedIrp.SystemBuffer,
                                partitionList,
                                tempSize);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97久久精品人人做人人爽50路| 一区二区成人在线观看| 国产精品天干天干在线综合| 亚洲天堂免费看| 午夜久久久久久| 国产精品一区二区黑丝| 91蝌蚪国产九色| 欧美成人aa大片| 亚洲女厕所小便bbb| 另类人妖一区二区av| 91丝袜美腿高跟国产极品老师 | 制服丝袜成人动漫| 久久久综合激的五月天| 亚洲精品高清视频在线观看| 麻豆精品精品国产自在97香蕉| 豆国产96在线|亚洲| 91精选在线观看| 1024国产精品| 久久成人av少妇免费| 一本色道a无线码一区v| 亚洲精品一区二区三区四区高清| 亚洲欧美成人一区二区三区| 精品一区二区三区欧美| 欧美综合天天夜夜久久| 久久伊人蜜桃av一区二区| 亚洲午夜免费电影| 成人黄色a**站在线观看| 在线播放亚洲一区| 亚洲婷婷综合色高清在线| 久久精品久久99精品久久| 在线视频综合导航| 国产日韩欧美a| 青草国产精品久久久久久| 91香蕉视频在线| 久久久久久久久久久久久久久99 | 欧美日韩高清一区二区| 国产精品免费网站在线观看| 老司机免费视频一区二区 | 日本三级韩国三级欧美三级| 99在线精品视频| 久久久久9999亚洲精品| 日本最新不卡在线| 在线免费观看视频一区| 中文在线资源观看网站视频免费不卡| 日韩精品午夜视频| 欧美亚洲动漫精品| 椎名由奈av一区二区三区| 国产黄色精品视频| 精品国产a毛片| 免费人成网站在线观看欧美高清| 国产一区二区三区免费在线观看 | 精品在线播放免费| 欧美三级韩国三级日本一级| 中文字幕一区在线观看| 韩国成人福利片在线播放| 欧美日韩成人一区二区| 一区二区在线观看视频在线观看| 成人免费视频app| 久久综合五月天婷婷伊人| 捆绑紧缚一区二区三区视频| 欧美久久久久久久久中文字幕| 一区二区三区久久久| 91在线视频网址| 亚洲免费资源在线播放| 99久久免费精品| 亚洲三级电影网站| 91色九色蝌蚪| 一区二区三区蜜桃| 欧美亚洲一区二区在线| 一区二区三区精品在线| 欧美综合视频在线观看| 亚洲国产综合91精品麻豆| 欧美系列一区二区| 亚洲国产成人高清精品| 欧美男男青年gay1069videost| 视频一区视频二区中文字幕| 337p亚洲精品色噜噜噜| 毛片不卡一区二区| 2021国产精品久久精品| 国产精品综合久久| 国产精品色哟哟| 99精品偷自拍| 亚洲另类春色国产| 欧美色图一区二区三区| 日本午夜一本久久久综合| 欧美岛国在线观看| 国产成人激情av| 亚洲欧美一区二区三区孕妇| 日本高清视频一区二区| 五月婷婷另类国产| 欧美videos大乳护士334| 国产精品综合一区二区三区| 国产精品毛片高清在线完整版| 97精品视频在线观看自产线路二| 一区二区三区在线免费观看| 7777精品伊人久久久大香线蕉的 | 91成人国产精品| 五月激情丁香一区二区三区| 日韩一区二区三区在线| 国内精品久久久久影院色| 日本一区二区动态图| 色视频一区二区| 轻轻草成人在线| 中文字幕精品—区二区四季| 色狠狠色噜噜噜综合网| 日产国产高清一区二区三区| 久久久久久久久久久久久久久99| 精品亚洲国内自在自线福利| 国产精品视频免费看| 欧美天堂一区二区三区| 狠狠色丁香久久婷婷综合丁香| 国产精品福利在线播放| 欧美日韩一区视频| 国产不卡视频一区| 亚洲高清在线精品| 久久亚洲春色中文字幕久久久| 色呦呦网站一区| 狠狠色狠狠色综合系列| 亚洲精品国产第一综合99久久 | 男男成人高潮片免费网站| 欧美国产成人精品| 欧美日韩国产色站一区二区三区| 国产一区在线视频| 亚洲福利视频一区| 欧美激情资源网| 欧美一区二区三区性视频| 国产69精品久久777的优势| 午夜不卡av在线| 亚洲欧美怡红院| 日韩精品一区国产麻豆| 91国在线观看| 成人午夜在线播放| 久久精品国产一区二区| 亚洲精品乱码久久久久久久久 | 国产成人超碰人人澡人人澡| 亚洲成av人在线观看| 国产精品久久福利| 精品伦理精品一区| 欧美网站大全在线观看| 成人短视频下载| 另类的小说在线视频另类成人小视频在线| 亚洲男人的天堂网| 国产女同互慰高潮91漫画| 欧美一区二区三区在| 欧美亚洲国产bt| av电影在线不卡| 国产成人av影院| 卡一卡二国产精品| 天天综合色天天综合| 亚洲精品视频自拍| 中文子幕无线码一区tr| 精品国产99国产精品| 这里是久久伊人| 欧美主播一区二区三区美女| av午夜精品一区二区三区| 国产精品一区二区男女羞羞无遮挡| 日韩精品1区2区3区| 亚洲一区二区免费视频| 亚洲美女屁股眼交3| 国产精品国产自产拍在线| 国产日韩欧美电影| 国产无遮挡一区二区三区毛片日本| 日韩欧美一级精品久久| 欧美一区二区在线免费观看| 欧美日韩国产中文| 欧美亚洲综合在线| 欧美最猛黑人xxxxx猛交| 99r国产精品| 91免费版在线| 97久久超碰精品国产| 99久久久无码国产精品| www.av亚洲| av亚洲产国偷v产偷v自拍| 成人a免费在线看| 成人黄色网址在线观看| 成人午夜av在线| www.欧美亚洲| 91视频免费播放| 色欧美片视频在线观看| 一本色道**综合亚洲精品蜜桃冫| av午夜一区麻豆| 色综合视频在线观看| 日本韩国一区二区三区视频| 91黄色免费版| 欧美日韩国产高清一区二区三区| 欧美视频中文字幕| 亚洲天堂av一区| 夜夜精品浪潮av一区二区三区| 亚洲精品少妇30p| 亚洲成人一区二区| 亚洲韩国精品一区| 亚洲成人精品在线观看| 午夜不卡av在线| 久久精品噜噜噜成人88aⅴ| 精品亚洲porn| 不卡的av电影在线观看| 色婷婷综合久久久久中文一区二区| 欧美性受xxxx| 欧美成人一区二区三区在线观看 | 国产麻豆精品视频|