ReactOS  0.4.15-dev-2704-gd5265b0
vfpriv.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation. All rights reserved.
4 
5 Module Name:
6 
7  vfpriv.hpp
8 
9 Abstract:
10 
11  common header file for verifier
12 
13 Author:
14 
15 
16 
17 Environment:
18 
19  user/kernel mode
20 
21 Revision History:
22 
23 --*/
24 
25 #if FX_CORE_MODE==FX_CORE_KERNEL_MODE
26 #include "vfprivkm.hpp"
27 #else if ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
28 #include "vfprivum.hpp"
29 #endif
30 
31 extern "C" {
32 #include "fxdynamics.h"
33 }
34 #include "vfeventhooks.hpp"
35 
36 
37 #define FX_ENHANCED_VERIFIER_SECTION_NAME WDF_FX_VF_SECTION_NAME
38 
39 #define GET_CONTEXT(_objectHandle, _type) \
40  (_type *)VfWdfObjectGetTypedContext(_objectHandle, WDF_GET_CONTEXT_TYPE_INFO(_type));
41 
42 #define SET_HOOK_IF_CALLBACK_PRESENT(Source, Target, Name) \
43  if ((Source)-> ## Name != NULL) { \
44  (Target)-> ## Name = Vf ## Name; \
45  }
46 
47 typedef struct _VF_HOOK_PROCESS_INFO {
48  //
49  // Return status of the DDI of called by hook routine.
50  // this will be returned by stub if it does not call the DDI (since
51  // hook already called.
52  //
54 
55  //
56  // Whether kmdf lib needs to be called after hook functin returns
57  //
59 
61 
62 typedef struct _VF_COMMON_CONTEXT_HEADER {
63 
65 
67 
69 
71 
73 
75 
77 
79 
81 
83 
85 
87 
88 extern "C" {
89 
91 PVOID
94  __in
96  __in
98  );
99 
101 NTSTATUS
105  __out PVOID* ContextHeader
106  );
107 
109 NTSTATUS
111  __in PVOID ContextHeader,
115  );
116 
118 NTSTATUS
120  __inout PVF_HOOK_PROCESS_INFO HookProcessInfo,
124  __out WDFDEVICE* Device
125  );
126 
128 NTSTATUS
130  __inout PVF_HOOK_PROCESS_INFO HookProcessInfo,
132  __in WDFDEVICE Device,
135  __out WDFQUEUE* Queue
136  );
137 
138 } // extern "C"
VF_COMMON_CONTEXT_HEADER CommonHeader
Definition: vfpriv.hpp:70
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_IO_QUEUE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES QueueAttributes
Definition: wdfio.h:613
#define _Must_inspect_result_
Definition: no_sal2.h:62
__in WDFOBJECT __in PCWDF_OBJECT_CONTEXT_TYPE_INFO TypeInfo
Definition: handleapi.cpp:601
PWDF_DRIVER_GLOBALS DriverGlobals
Definition: vfpriv.hpp:64
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2221
struct _VF_COMMON_CONTEXT_HEADER * PVF_COMMON_CONTEXT_HEADER
VF_COMMON_CONTEXT_HEADER CommonHeader
Definition: vfpriv.hpp:80
LONG NTSTATUS
Definition: precomp.h:26
struct _VF_WDFIOQUEUECREATE_CONTEXT VF_WDFIOQUEUECREATE_CONTEXT
DriverGlobals
#define FASTCALL
Definition: nt_native.h:50
#define __out_opt
Definition: dbghelp.h:65
_Must_inspect_result_ _Inout_ PWDFDEVICE_INIT _In_opt_ PWDF_OBJECT_ATTRIBUTES DeviceAttributes
Definition: wdfdevice.h:3561
_Must_inspect_result_ PVOID FASTCALL VfWdfObjectGetTypedContext(__in WDFOBJECT Handle, __in PCWDF_OBJECT_CONTEXT_TYPE_INFO TypeInfo)
Definition: verifier.cpp:424
#define __out
Definition: dbghelp.h:62
unsigned char BOOLEAN
struct _VF_HOOK_PROCESS_INFO * PVF_HOOK_PROCESS_INFO
struct _VF_COMMON_CONTEXT_HEADER VF_COMMON_CONTEXT_HEADER
struct _VF_WDFDEVICECREATE_CONTEXT * PVF_WDFDEVICECREATE_CONTEXT
struct _VF_HOOK_PROCESS_INFO VF_HOOK_PROCESS_INFO
_Must_inspect_result_ NTSTATUS AddEventHooksWdfIoQueueCreate(__inout PVF_HOOK_PROCESS_INFO HookProcessInfo, __in PWDF_DRIVER_GLOBALS DriverGlobals, __in WDFDEVICE Device, __in PWDF_IO_QUEUE_CONFIG Config, __in PWDF_OBJECT_ATTRIBUTES QueueAttributes, __out WDFQUEUE *Queue)
Definition: verifier.cpp:250
struct _VF_WDFIOQUEUECREATE_CONTEXT * PVF_WDFIOQUEUECREATE_CONTEXT
BOOLEAN DonotCallKmdfLib
Definition: vfpriv.hpp:58
#define __inout
Definition: dbghelp.h:50
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
_Must_inspect_result_ NTSTATUS AddEventHooksWdfDeviceCreate(__inout PVF_HOOK_PROCESS_INFO HookProcessInfo, __in PWDF_DRIVER_GLOBALS DriverGlobals, __in PWDFDEVICE_INIT *DeviceInit, __in PWDF_OBJECT_ATTRIBUTES DeviceAttributes, __out WDFDEVICE *Device)
Definition: verifier.cpp:52
WDF_IO_QUEUE_CONFIG IoQueueConfigOriginal
Definition: vfpriv.hpp:82
_Must_inspect_result_ NTSTATUS VfAddContextToHandle(__in PVOID ContextHeader, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in WDFOBJECT Handle, __out_opt PVOID *Context)
Definition: verifier.cpp:576
WDF_DECLARE_CONTEXT_TYPE(VF_WDFDEVICECREATE_CONTEXT)
_In_ HANDLE Handle
Definition: extypes.h:390
unsigned int ULONG
Definition: retypes.h:1
_In_ PWDFDEVICE_INIT DeviceInit
Definition: wdfcontrol.h:113
struct _VF_WDFDEVICECREATE_CONTEXT VF_WDFDEVICECREATE_CONTEXT
#define __in
Definition: dbghelp.h:35
_Must_inspect_result_ NTSTATUS VfAllocateContext(__in PWDF_DRIVER_GLOBALS DriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __out PVOID *ContextHeader)
Definition: verifier.cpp:502
WDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacksOriginal
Definition: vfpriv.hpp:72
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes