-
大小: 410KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-06-01
- 语言: 其他
- 标签: miniFilter
资源简介
miniFilter(所有框架代码以及对应的PPT资料,可以直接拿来进行修改即可完成各种驱动)
代码片段和文件信息
/*++
Copyright (c) 1999 - 2002 Microsoft Corporation
Module Name:
cancelSafe.c
Abstract:
This is the main module of the cancelSafe miniFilter driver.
Environment:
Kernel mode
--*/
#include
#include
#include
//
// Debug flags and helper functions
//
#define CSQ_TRACE_ERROR 0x00000001
#define CSQ_TRACE_LOAD_UNLOAD 0x00000002
#define CSQ_TRACE_INSTANCE_CALLBACK 0x00000004
#define CSQ_TRACE_CONTEXT_CALLBACK 0x00000008
#define CSQ_TRACE_CBDQ_CALLBACK 0x00000010
#define CSQ_TRACE_PRE_READ 0x00000020
#define CSQ_TRACE_ALL 0xFFFFFFFF
#define DebugTrace(Level Data) \
if ((Level) & Globals.DebugLevel) { \
DbgPrint Data; \
}
//
// Memory Pool Tags
//
#define INSTANCE_CONTEXT_TAG ‘IqsC‘
#define QUEUE_CONTEXT_TAG ‘QqsC‘
//
// Magic file name
//
const UNICODE_STRING CsqFile = RTL_CONSTANT_STRING( L“csqdemo.txt“ );
//
// Prototypes
//
//
// Queue context data structure
//
typedef struct _QUEUE_CONTEXT {
FLT_CALLBACK_DATA_QUEUE_IO_CONTEXT CbdqIoContext;
} QUEUE_CONTEXT *PQUEUE_CONTEXT;
//
// Instance context data structure
//
typedef struct _INSTANCE_CONTEXT {
//
// Instance for this context.
//
PFLT_INSTANCE Instance;
//
// Cancel safe queue members
//
FLT_CALLBACK_DATA_QUEUE Cbdq;
LIST_ENTRY QueueHead;
FAST_MUTEX Lock;
//
// Flag to control the life/death of the work item thread
//
volatile LONG WorkerThreadFlag;
//
// Notify the worker thread that the instance is being torndown
//
KEVENT TeardownEvent;
} INSTANCE_CONTEXT *PINSTANCE_CONTEXT;
typedef struct _CSQ_GLOBAL_DATA {
ULONG DebugLevel;
PFLT_FILTER FilterHandle;
NPAGED_LOOKASIDE_LIST OueueContextLookaside;
} CSQ_GLOBAL_DATA;
//
// Global variables
//
CSQ_GLOBAL_DATA Globals;
//
// Local function prototypes
//
NTSTATUS
DriverEntry (
__in PDRIVER_object Driverobject
__in PUNICODE_STRING RegistryPath
);
NTSTATUS
Unload (
__in FLT_FILTER_UNLOAD_FLAGS Flags
);
VOID
ContextCleanup (
__in PFLT_CONTEXT Context
__in FLT_CONTEXT_TYPE ContextType
);
NTSTATUS
InstanceSetup (
__in PCFLT_RELATED_objectS Fltobjects
__in FLT_INSTANCE_SETUP_FLAGS Flags
__in DEVICE_TYPE VolumeDeviceType
__in FLT_FILESYSTEM_TYPE VolumeFilesystemType
);
NTSTATUS
InstanceQueryTeardown (
__in PCFLT_RELATED_objectS Fltobjects
__in FLT_INSTANCE_QUERY_TEARDOWN_FLAGS Flags
);
VOID
InstanceTeardownStart (
__in PCFLT_RELATED_objectS Fltobjects
__in FLT_INSTANCE_TEARDOWN_FLAGS Flags
);
VOID
InstanceTeardownComple
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 39718 2006-11-02 00:37 miniFilter\miniFilter\cancelSafe\cancelSafe.c
....... 2359 2006-11-02 00:37 miniFilter\miniFilter\cancelSafe\cancelSafe.inf
....... 266 2006-11-02 00:37 miniFilter\miniFilter\cancelSafe\cancelSafe.rc
....... 374 2006-11-02 00:37 miniFilter\miniFilter\cancelSafe\makefile
....... 257 2006-11-02 00:37 miniFilter\miniFilter\cancelSafe\sources
目录 0 2008-02-24 20:46 miniFilter\miniFilter\cancelSafe
....... 2318 2006-11-02 00:37 miniFilter\miniFilter\cdo\cdo.inf
....... 275 2006-11-02 00:37 miniFilter\miniFilter\cdo\cdo.rc
....... 8146 2006-11-02 00:37 miniFilter\miniFilter\cdo\cdoinit.c
....... 64866 2006-11-02 00:37 miniFilter\miniFilter\cdo\cdooperations.c
....... 7380 2006-11-02 00:37 miniFilter\miniFilter\cdo\cdoproc.h
....... 3032 2006-11-02 00:37 miniFilter\miniFilter\cdo\cdostruct.h
....... 374 2006-11-02 00:37 miniFilter\miniFilter\cdo\makefile
....... 940 2006-11-02 00:37 miniFilter\miniFilter\cdo\pch.h
....... 196 2006-11-02 00:37 miniFilter\miniFilter\cdo\sources
目录 0 2008-02-24 20:46 miniFilter\miniFilter\cdo
....... 27051 2006-11-02 00:37 miniFilter\miniFilter\ctx\context.c
....... 2281 2006-11-02 00:37 miniFilter\miniFilter\ctx\ctx.inf
....... 261 2006-11-02 00:37 miniFilter\miniFilter\ctx\ctx.rc
....... 24742 2006-11-02 00:37 miniFilter\miniFilter\ctx\ctxinit.c
....... 4429 2006-11-02 00:37 miniFilter\miniFilter\ctx\ctxproc.h
....... 4485 2006-11-02 00:37 miniFilter\miniFilter\ctx\ctxstruc.h
....... 374 2006-11-02 00:37 miniFilter\miniFilter\ctx\makefile
....... 34711 2006-11-02 00:37 miniFilter\miniFilter\ctx\operations.c
....... 833 2006-11-02 00:37 miniFilter\miniFilter\ctx\pch.h
....... 233 2006-11-02 00:37 miniFilter\miniFilter\ctx\sources
....... 1906 2006-11-02 00:37 miniFilter\miniFilter\ctx\support.c
目录 0 2008-02-24 20:46 miniFilter\miniFilter\ctx
....... 163 2008-02-24 20:46 miniFilter\miniFilter\dirs
....... 31480 2006-11-02 00:37 miniFilter\miniFilter\me
............此处省略88个文件信息
- 上一篇:权限管理后台管理系统原型
- 下一篇:IRF3205中文数据手册
评论
共有 条评论