WDK Mini Filter Example
userscan.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) 2011 Microsoft Corporation
4 
5 Module Name:
6 
7  userscan.h
8 
9 Abstract:
10 
11  The scanning module. This module defines the thread contexts,
12  and user scan contexts, and the definitions of functions.
13 
14 Environment:
15 
16  User mode
17 
18 --*/
19 
20 #ifndef __USERSCAN_H__
21 #define __USERSCAN_H__
22 
23 #include <windows.h>
24 #include <fltUser.h>
25 #include "avlib.h"
26 
27 #ifndef MAKE_HRESULT
28 #define MAKE_HRESULT(sev,fac,code) \
29  ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
30 #endif
31 
32 typedef struct _SCANNER_THREAD_CONTEXT {
33 
34  //
35  // Threand Handle
36  //
37 
38  HANDLE Handle;
39 
40  //
41  // Threand Id
42  //
43 
44  DWORD ThreadId;
45 
46  //
47  // We need to remember scan id to know which task to abort.
48  //
49 
50  LONGLONG ScanId;
51 
52  //
53  // A flag that indicates that if this scan thread has received cancel callback from the driver
54  //
55 
56  BOOLEAN Aborted;
57 
58  //
59  // A critical section that synchronize the read/write of ScanId and Aborted.
60  //
61 
62  CRITICAL_SECTION Lock;
63 
65 
66 typedef struct _USER_SCAN_CONTEXT {
67 
68  //
69  // Scan thread contexts
70  //
71 
72  PSCANNER_THREAD_CONTEXT ScanThreadCtxes;
73 
74  //
75  // The abortion thread handle
76  //
77 
79 
80  //
81  // Finalize flag, set at UserScanFinalize(...)
82  //
83 
84  BOOLEAN Finalized;
85 
86  //
87  // Handle of connection port to the filter.
88  //
89 
91 
92  //
93  // Completion port for asynchronous message passing
94  //
95 
96  HANDLE Completion;
97 
99 
100 HRESULT UserScanInit (
101  _Inout_ PUSER_SCAN_CONTEXT Context
102  );
103 
104 HRESULT UserScanFinalize (
105  _In_ PUSER_SCAN_CONTEXT Context
106  );
107 
108 #endif
109 
HANDLE Completion
Definition: userscan.h:96
struct _USER_SCAN_CONTEXT USER_SCAN_CONTEXT
BOOLEAN Finalized
Definition: userscan.h:84
struct _SCANNER_THREAD_CONTEXT SCANNER_THREAD_CONTEXT
HANDLE AbortThreadHandle
Definition: userscan.h:78
HANDLE ConnectionPort
Definition: userscan.h:90
HRESULT UserScanInit(_Inout_ PUSER_SCAN_CONTEXT Context)
Definition: userscan.c:138
HRESULT UserScanFinalize(_In_ PUSER_SCAN_CONTEXT Context)
Definition: userscan.c:362
struct _SCANNER_THREAD_CONTEXT * PSCANNER_THREAD_CONTEXT
PSCANNER_THREAD_CONTEXT ScanThreadCtxes
Definition: userscan.h:72
struct _USER_SCAN_CONTEXT * PUSER_SCAN_CONTEXT
CRITICAL_SECTION Lock
Definition: userscan.h:62

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