⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 config.h

📁 一个用wdm模型实现mode驱动的很好的程序
💻 H
字号:
///////////////////////////////////////////////////////////////////////////////
//
//  (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: config.h $
//
//	ABSTRACT:
//
//    This module contains the declarations for init.c
//
//	AUTHOR:
//
//		Open Systems Resources, Inc.
// 
//	REVISION:   
//
//
///////////////////////////////////////////////////////////////////////////////

#ifndef CONFIG_H
#define CONFIG_H

//
// These structures are the main configuration structures used in
// device initilaization
//
// Fixed disk parameter table structure
//

#pragma pack(1)                                 // This structure is packed
typedef struct _FIXED_DISK_PARAMETER_TABLE {
    USHORT MaxCylinders;
    UCHAR  MaxHeads;
    UCHAR  Signature;
    UCHAR  TranslatedSectorsPerTrack;
    USHORT StartWritePrecomp;
    CCHAR  EccBurstLength;
    CCHAR  ControlFlags;
    USHORT TranslatedMaxCylinders;
    UCHAR  TranslatedMaxHeads;
    USHORT LandingZone;
    CCHAR  SectorsPerTrack;
    UCHAR  ReservedForFuture;
    } FIXED_DISK_PARAMETER_TABLE;

typedef FIXED_DISK_PARAMETER_TABLE *PFIXED_DISK_PARAMETER_TABLE;

#pragma pack()

//
// Drive configuration data
//

typedef struct _DRIVE_DATA {
    PFIXED_DISK_PARAMETER_TABLE ParameterTableAddress;
    USHORT NumberOfCylinders;
    USHORT TracksPerCylinder;
    USHORT SectorsPerTrack;
    USHORT PretendNumberOfCylinders;
    USHORT PretendTracksPerCylinder;
    USHORT PretendSectorsPerTrack;
    USHORT IdentifyNumberOfCylinders;
    USHORT IdentifyTracksPerCylinder;
    USHORT IdentifySectorsPerTrack;
    USHORT BytesPerSector;
    USHORT BytesPerInterrupt;
    USHORT WritePrecomp;
    UCHAR DriveType;
    CCHAR ReadCommand;
    CCHAR WriteCommand;
    CCHAR VerifyCommand;
} DRIVE_DATA, *PDRIVE_DATA;

//
// This structure holds all of the configuration data; it's filled in by
// IdeGetConfigInfo() and read by other initialization routines.
//

typedef struct _CONFIG_DATA {
    PULONG HardDiskCount;
    DRIVE_DATA Disk;
    PUCHAR ControllerBaseAddress;
    PUCHAR ControlPortAddress;
    PHYSICAL_ADDRESS OriginalControllerBaseAddress;
    PHYSICAL_ADDRESS OriginalControlPortAddress;
    KAFFINITY ProcessorNumber;
    INTERFACE_TYPE InterfaceType;
    ULONG BusNumber;
    ULONG RangeOfControllerBase;
    ULONG RangeOfControlPort;
    BOOLEAN ControllerBaseMapped;
    BOOLEAN ControlPortMapped;
    BOOLEAN OkToUseThisController;
    KIRQL ControllerIrql;
    KIRQL OriginalControllerIrql;
    ULONG ControllerVector;
    CCHAR ControlFlags;
    UCHAR OriginalControllerVector;
} CONFIG_DATA, *PCONFIG_DATA;

//
// External declarations
//

NTSTATUS
IdeGetConfigData(
    IN PDRIVER_OBJECT DriverObject,
    IN PUNICODE_STRING RegistryPath,
    IN OUT PCONFIG_DATA ConfigData
   );


#endif  /* CONFIG_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -