用户管理  |   用户注册                                                                                    首 页软件下载教程中心办公指南flash动画文档下载办公公文

www.4oa.com - 中科软件园

投递文章 用户管理 投稿指南 资讯通告 :
站内搜索: 您的位置中科软件园 > 教程中心 > 操作系统 > Windows 2000 > 原理开发 > 教程内容

《Undocumented Windows 2000 Secrets》翻译 --- 第三章(2)

2005-5-21 8:48:03  来源:本站整理  作者:不详 【 投递文章
内容提要:第三章编写内核模式驱动程序翻译:Kendiv更新:Tuesday,February08,2005作为补充这里给出DrvInfo.h的内容://_____________________________...

第三章 编写内核模式驱动程序

翻译: Kendiv

更新: Tuesday, February 08, 2005

作为补充这里给出 DrvInfo.h 的内容:

// __________________________________________________________

//

// DrvInfo.h

// Driver Info Definitions V1.00

// 06-02-2000 Sven B. Schreiber

// sbs@orgon.com

// __________________________________________________________

#ifndef _DRVINFO_H_

#define _DRVINFO_H_

// =================================================================

// DISCLAIMER

// =================================================================

/*

This software is provided "as is" and any express or implied

warranties, including, but not limited to, the implied warranties of

merchantability and fitness for a particular purpose are disclaimed.

In no event shall the author Sven B. Schreiber be liable for any

direct, indirect, incidental, special, exemplary, or consequential

damages (including, but not limited to, procurement of substitute

goods or services; loss of use, data, or profits; or business

interruption) however caused and on any theory of liability,

whether in contract, strict liability, or tort (including negligence

or otherwise) arising in any way out of the use of this software,

even if advised of the possibility of such damage.

*/

// =================================================================

// REVISION HISTORY

// =================================================================

/*

05-26-2000 V1.00 Original version (SBS).

*/

// =================================================================

// BASIC TYPES

// =================================================================

typedef UCHAR BYTE, *PBYTE, **PPBYTE;

typedef USHORT WORD, *PWORD, **PPWORD;

typedef ULONG DWORD, *PDWORD, **PPDWORD;

typedef unsigned __int64 QWORD, *PQWORD, **PPQWORD;

typedef int BOOL, *PBOOL, **PPBOOL;

typedef void **PPVOID;

// -----------------------------------------------------------------

#define BYTE_ sizeof (BYTE)

#define WORD_ sizeof (WORD)

#define DWORD_ sizeof (DWORD)

#define QWORD_ sizeof (QWORD)

#define BOOL_ sizeof (BOOL)

#define PVOID_ sizeof (PVOID)

#define HANDLE_ sizeof (HANDLE)

#define PHYSICAL_ADDRESS_ sizeof (PHYSICAL_ADDRESS)

// =================================================================

// MACROS

// =================================================================

#define _DRV_DEVICE(_name) \\Device\\ ## _name

#define _DRV_LINK(_name) \\DosDevices\\ ## _name

#define _DRV_PATH(_name) \\\\.\\ ## _name

// -----------------------------------------------------------------

#define _CSTRING(_text) #_text

#define CSTRING(_text) _CSTRING (_text)

#define _USTRING(_text) L##_text

#define USTRING(_text) _USTRING (_text)

#define PRESET_UNICODE_STRING(_symbol,_buffer) \

UNICODE_STRING _symbol = \

{ \

sizeof (USTRING (_buffer)) - sizeof (WORD), \

sizeof (USTRING (_buffer)), \

USTRING (_buffer) \

};

// -----------------------------------------------------------------

#if DRV_VERSION_LOW < 10

#define _DRV_V2(_a,_b) _a ## .0 ## _b

#define _DRV_V2X(_a,_b) V ## _a ## .0 ## _b

#else // #if DRV_VERSION_LOW < 10

#define _DRV_V2(_a,_b) _a ## . ## _b

#define _DRV_V2X(_a,_b) V ## _a ## . ## _b

#endif // #if DRV_VERSION_LOW < 10 #else

#define DRV_V2(_a,_b) _DRV_V2(_a,_b)

#define DRV_V2X(_a,_b) _DRV_V2X(_a,_b)

// -----------------------------------------------------------------

#define _DRV_V4(_a,_b,_c) _a ## . ## _b ## .0. ## _c

#define DRV_V4(_a,_b,_c) _DRV_V4(_a,_b,_c)

// -----------------------------------------------------------------

#define DRV_V DRV_V2X (DRV_VERSION_HIGH, \

DRV_VERSION_LOW)

#define DRV_VERSION DRV_V2 (DRV_VERSION_HIGH, \

DRV_VERSION_LOW)

#define DRV_VERSION_QUAD DRV_V4 (DRV_VERSION_HIGH, \

DRV_VERSION_LOW, \

DRV_BUILD)

#define DRV_VERSION_BINARY ((DRV_VERSION_HIGH * 100) \

+ DRV_VERSION_LOW)

// =================================================================

// DRIVER INFORMATION

// =================================================================

#define DRV_ID DRV_PREFIX.DRV_MODULE

#define DRV_ID_VERSION DRV_ID.DRV_VERSION_HIGH

#define DRV_FILENAME DRV_MODULE.DRV_EXTENSION

#define DRV_CAPTION DRV_NAME DRV_V

#define DRV_COMMENT DRV_DATE DRV_AUTHOR

// -----------------------------------------------------------------

#define DRV_DEVICE _DRV_DEVICE (DRV_MODULE)

#define DRV_LINK _DRV_LINK (DRV_MODULE)

#define DRV_PATH _DRV_PATH (DRV_MODULE)

#define DRV_EXTENSION sys

// -----------------------------------------------------------------

#define DRV_CLASS DRV_MODULE.DRV_VERSION_QUAD

#define DRV_ICON DRV_MODULE.Icon

// -----------------------------------------------------------------

#define DRV_COPYRIGHT Copyright \xA9 DRV_YEAR

#define DRV_COPYRIGHT_EX DRV_COPYRIGHT DRV_COMPANY

// -----------------------------------------------------------------

#define DRV_DATE_US DRV_MONTH-DRV_DAY-DRV_YEAR

#defin

[1] [2] [3] [4]  下一页

(评论内容只代表网友观点,与本站立场无关!)[ 全部评论 ]

网友评论:

    用户名:

    评   分:100分 85分 70分 55分 40分 25分 10分 0分

    内 容:

                 (注“”为必填内容。) 验证码: 验证码,看不清楚?请点击刷新验证码

关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 -有事点这里