WDK Mini Filter Example
CdoStruct.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) 1999 - 2003 Microsoft Corporation
4 
5 Module Name:
6 
7  CdoStruct.h
8 
9 Abstract:
10 
11  This is the header file defining the data structures used by the kernel mode
12  filter driver implementing the control device object sample.
13 
14 
15 Environment:
16 
17  Kernel mode
18 
19 
20 --*/
21 
22 //
23 // CDO sample filter global data
24 //
25 
26 //
27 // GLOBAL_DATA_F_xxx flags
28 //
29 
30 //
31 // Indicates that there is a open reference to the CDO
32 //
33 #define GLOBAL_DATA_F_CDO_OPEN_REF 0x00000001
34 
35 //
36 // Indicates that there is a open handle to the CDO
37 //
38 
39 #define GLOBAL_DATA_F_CDO_OPEN_HANDLE 0x00000002
40 
41 //
42 // Globals
43 //
44 
45 typedef struct _CDO_GLOBAL_DATA {
46 
47  //
48  // Handle to minifilter returned from FltRegisterFilter()
49  //
50 
51  PFLT_FILTER Filter;
52 
53  //
54  // Driver object for this filter
55  //
56 
57  PDRIVER_OBJECT FilterDriverObject;
58 
59  //
60  // Control Device Object for this filter
61  //
62 
63  PDEVICE_OBJECT FilterControlDeviceObject;
64 
65  //
66  // Flags - GLOBAL_DATA_F_xxx
67  //
68 
69  ULONG Flags;
70 
71  //
72  // Resource to synchronize access to flags
73  //
74 
75  ERESOURCE Resource;
76 
77 #if DBG
78 
79  //
80  // Field to control nature of debug output
81  //
82 
83  ULONG DebugLevel;
84 #endif
85 
87 
89 
90 //
91 // The name of the CDO created by this filter
92 //
93 
94 #define CONTROL_DEVICE_OBJECT_NAME L"\\FileSystem\\Filters\\CdoSample"
95 
96 //
97 // Macro to test if this is my control device object
98 //
99 
100 #define IS_MY_CONTROL_DEVICE_OBJECT(_devObj) \
101  (((_devObj) == Globals.FilterControlDeviceObject) ? \
102  (FLT_ASSERT(((_devObj)->DriverObject == Globals.FilterDriverObject) && \
103  ((_devObj)->DeviceExtension == NULL)), TRUE) : \
104  FALSE)
105 
106 
107 //
108 // Debug helper functions
109 //
110 
111 #if DBG
112 
113 
114 #define DEBUG_TRACE_ERROR 0x00000001 // Errors - whenever we return a failure code
115 #define DEBUG_TRACE_LOAD_UNLOAD 0x00000002 // Loading/unloading of the filter
116 
117 #define DEBUG_TRACE_CDO_CREATE_DELETE 0x00000004 // Creation/Deletion of CDO
118 #define DEBUG_TRACE_CDO_SUPPORTED_OPERATIONS 0x00000008 // Supported operations on CDO
119 #define DEBUG_TRACE_CDO_FASTIO_OPERATIONS 0x00000010 // FastIO operations on CDO
120 #define DEBUG_TRACE_CDO_ALL_OPERATIONS 0x00000020 // All operations on CDO
121 
122 #define DEBUG_TRACE_ALL 0xFFFFFFFF // All flags
123 
124 
125 #define DebugTrace(Level, Data) \
126  if ((Level) & Globals.DebugLevel) { \
127  DbgPrint Data; \
128  }
129 
130 
131 #else
132 
133 #define DebugTrace(Level, Data) {NOTHING;}
134 
135 #endif
136 
137 
PFLT_FILTER Filter
Definition: CdoStruct.h:51
CDO_GLOBAL_DATA Globals
Definition: avscan.h:152
struct _CDO_GLOBAL_DATA * PCDO_GLOBAL_DATA
PDEVICE_OBJECT FilterControlDeviceObject
Definition: CdoStruct.h:63
ERESOURCE Resource
Definition: CdoStruct.h:75
PDRIVER_OBJECT FilterDriverObject
Definition: CdoStruct.h:57
struct _CDO_GLOBAL_DATA CDO_GLOBAL_DATA

Social Network


Services Overview

Architect, implement and test file system filter drivers for a wide range of functionality. We can offer several levels of assistance to meet your specific.

Contact Us

You are welcome to contact us for salse or partnership.

Sales: sales@easefilter.com
Support: support@easefilter.com
Info: info@easefilter.com