ReactOS 0.4.16-dev-320-g3bd9ddc
verifierapi.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 VerifierApi.c
8
9Abstract:
10
11 This module implements various global verifier worker routines
12
13Author:
14
15
16
17Environment:
18
19 Both kernel and user mode
20
21Revision History:
22
23
24--*/
25
26#include "coreprivshared.hpp"
27
28//
29// extern "C" all APIs
30//
31extern "C" {
32
33//
34// Global triage Info for dbgeng and 0x9F work
35//
36extern WDF_TRIAGE_INFO g_WdfTriageInfo;
37
38
39VOID
41 __in
43 )
44
45/*++
46
47Routine Description:
48
49 Common Driver Frameworks DbgBreakPoint() function.
50
51 This will only break point if WdfVerifierDbgBreakOnError is defined, so
52 it's safe to call for production systems.
53
54Arguments:
55
56 DriverGlobals -
57
58Return Value:
59
60 None.
61
62--*/
63
64{
66
68
70
73 }
74}
75
76
77VOID
79 __in
81 __in
82 ULONG BugCheckCode,
83 __in
84 ULONG_PTR BugCheckParameter1,
85 __in
86 ULONG_PTR BugCheckParameter2,
87 __in
88 ULONG_PTR BugCheckParameter3,
89 __in
90 ULONG_PTR BugCheckParameter4
91 )
92
93/*++
94
95Routine Description:
96
97 Common Driver Frameworks KeBugCheckEx() function. Use this function rather
98 than the system one. This routine will indicate to the bugcheck callbacks
99 that the IFR data for this driver needs to be copied to the minidump file.
100
101Arguments:
102
103 DriverGlobals -
104
105 BugCheckCode - Specifies a value that indicates the reason for the bug check.
106
107 BugCheckParameter1 - Supply additional information, such as the address and
108 data where a memory-corruption error occurred, depending on the value of
109 BugCheckCode.
110
111 BugCheckParameter2 - Supply additional information, such as the address and
112 data where a memory-corruption error occurred, depending on the value of
113 BugCheckCode.
114
115 BugCheckParameter3 - Supply additional information, such as the address and
116 data where a memory-corruption error occurred, depending on the value of
117 BugCheckCode.
118
119 BugCheckParameter4 - Supply additional information, such as the address and
120 data where a memory-corruption error occurred, depending on the value of
121 BugCheckCode.
122
123Return Value:
124
125 None.
126
127--*/
128
129{
131
132 //
133 // Indicate to the BugCheck callback filter which IFR to dump.
134 //
136
139
140#pragma prefast(suppress:__WARNING_USE_OTHER_FUNCTION, "WDF wrapper to KeBugCheckEx.");
141 Mx::MxBugCheckEx(BugCheckCode,
142 BugCheckParameter1,
143 BugCheckParameter2,
144 BugCheckParameter3,
145 BugCheckParameter4);
146}
147
148VOID
150 __in
154 __in
155 ULONG BugCheckCode,
156 __in
157 ULONG_PTR BugCheckParameter1,
158 __in
159 ULONG_PTR BugCheckParameter2,
160 __in
161 ULONG_PTR BugCheckParameter3,
162 __in
163 ULONG_PTR BugCheckParameter4
164 )
165
166/*++
167
168Routine Description:
169
170 Common Driver Frameworks KeBugCheckEx() function. Cx should use this
171 function rather than the system one or WdfVerifierKeBugCheck. This routine
172 will indicate to the bugcheck callbacks that the IFR data for this driver or its
173 client driver needs to be copied to the minidump file.
174
175Arguments:
176
177 DriverGlobals -
178
179 Object - WDF uses this object to select which logs to write in the minidump.
180 Cx can pass an object from the client driver's hierarchy to force
181 the client driver's logs in the minidump.
182
183 BugCheckCode - Specifies a value that indicates the reason for the bug check.
184
185 BugCheckParameter1 - Supply additional information, such as the address and
186 data where a memory-corruption error occurred, depending on the value of
187 BugCheckCode.
188
189 BugCheckParameter2 - Supply additional information, such as the address and
190 data where a memory-corruption error occurred, depending on the value of
191 BugCheckCode.
192
193 BugCheckParameter3 - Supply additional information, such as the address and
194 data where a memory-corruption error occurred, depending on the value of
195 BugCheckCode.
196
197 BugCheckParameter4 - Supply additional information, such as the address and
198 data where a memory-corruption error occurred, depending on the value of
199 BugCheckCode.
200
201Return Value:
202
203 None.
204
205--*/
206
207{
209
212
213 if (NULL == Object) {
215 }
216 else {
218 Object,
220 (PVOID*)&pObject,
222 }
223
225
226 //
227 // Indicate to the BugCheck callback filter which IFR to dump.
228 //
230
231#pragma prefast(suppress:__WARNING_USE_OTHER_FUNCTION, "WDF wrapper to KeBugCheckEx.");
232 Mx::MxBugCheckEx(BugCheckCode,
233 BugCheckParameter1,
234 BugCheckParameter2,
235 BugCheckParameter3,
236 BugCheckParameter4);
237}
238
239
240PVOID
242 _In_
244 )
245
246/*++
247
248Routine Description:
249
250 Returns a pointer to the WDF triage info for dbgeng and 0x9F work.
251
252Arguments:
253
254 DriverGlobals -
255
256Return Value:
257
258 None.
259
260--*/
261
262{
263 DDI_ENTRY();
264
266 return &g_WdfTriageInfo;
267}
268
269} // extern "C"
static DECLSPEC_NORETURN VOID MxBugCheckEx(__in ULONG BugCheckCode, __in ULONG_PTR BugCheckParameter1, __in ULONG_PTR BugCheckParameter2, __in ULONG_PTR BugCheckParameter3, __in ULONG_PTR BugCheckParameter4)
Definition: mxgeneralkm.h:133
#define __in
Definition: dbghelp.h:35
#define __in_opt
Definition: dbghelp.h:38
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *)&pDevice, &pFxDriverGlobals)
PFX_DRIVER_GLOBALS pFxDriverGlobals
DriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
#define DDI_ENTRY_IMPERSONATION_OK()
Definition: fxglobalskm.h:55
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
#define WDFEXPORT(a)
Definition: fxmacros.hpp:157
FxObject * pObject
@ FX_TYPE_OBJECT
Definition: fxtypes.h:45
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define _In_
Definition: no_sal2.h:158
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
BOOLEAN FxForceLogsInMiniDump
Definition: fxglobals.h:477
BOOLEAN FxVerifierDbgBreakOnError
Definition: fxglobals.h:431
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
WDF_TRIAGE_INFO g_WdfTriageInfo
VOID WDFEXPORT() WdfVerifierKeBugCheck(__in PWDF_DRIVER_GLOBALS DriverGlobals, __in ULONG BugCheckCode, __in ULONG_PTR BugCheckParameter1, __in ULONG_PTR BugCheckParameter2, __in ULONG_PTR BugCheckParameter3, __in ULONG_PTR BugCheckParameter4)
Definition: verifierapi.cpp:78
VOID WDFEXPORT() WdfCxVerifierKeBugCheck(__in PWDF_DRIVER_GLOBALS DriverGlobals, __in_opt WDFOBJECT Object, __in ULONG BugCheckCode, __in ULONG_PTR BugCheckParameter1, __in ULONG_PTR BugCheckParameter2, __in ULONG_PTR BugCheckParameter3, __in ULONG_PTR BugCheckParameter4)
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
FORCEINLINE VOID WdfVerifierDbgBreakPoint()
Definition: wdfverifier.h:68
FORCEINLINE PVOID WdfGetTriageInfo()
Definition: wdfverifier.h:126