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