ReactOS 0.4.16-dev-340-g0540c21
vfprivum.hpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation. All rights reserved.
4
5Module Name:
6
7 vfpriv.hpp
8
9Abstract:
10
11 common header file for verifier
12
13Author:
14
15
16Environment:
17
18 User mode only
19
20Revision History:
21
22--*/
23
24#pragma once
25
26#include "fxmin.hpp"
27
29VOID
32 __in WDFREQUEST Handle,
33 __inout FxRequest** ppReq,
34 __inout GUID* pActivityId
35 )
36{
38 Handle,
40 (PVOID *) ppReq);
41
42 if ((*ppReq)->GetFxIrp()->GetIoIrp()->IsActivityIdSet() == FALSE) {
44 (*ppReq)->GetFxIrp()->GetIoIrp()->SetActivityId(pActivityId);
45 }
46 else {
47 *pActivityId = *(*ppReq)->GetFxIrp()->GetIoIrp()->GetActivityId();
48 }
49}
50
54 __in WDFREQUEST Handle
55)
56{
57 FxRequest* pReq;
58 GUID activityId = { 0 };
60
64
65 if(status) {
68 &activityId);
69
71 WDFDEVICE Device = pReq->GetCurrentQueue()->GetDevice()->GetHandle();
72 EVENT_DATA_DESCRIPTOR EventData[3];
73 EventDataDescCreate(&EventData[0], &Type, sizeof(const UCHAR));
74 EventDataDescCreate(&EventData[1], &pDriverDeviceAdd, sizeof(PVOID));
75 EventDataDescCreate(&EventData[2], &Device, sizeof(PVOID));
76
77 EventWriteTransfer(Microsoft_Windows_DriverFrameworks_UserMode_PerformanceHandle,
78 &FX_REQUEST_START,
79 &activityId,
80 NULL,
81 3,
82 &EventData[0]);
83 }
84 return status;
85}
86
90 __in WDFREQUEST Handle
91)
92{
93 FxRequest* pReq;
94 GUID activityId = { 0 };
96
100
101 if(status) {
104 &activityId);
105
106 UCHAR Type = pReq->GetFxIrp()->GetMajorFunction();
107 WDFDEVICE Device = pReq->GetCurrentQueue()->GetDevice()->GetHandle();
108 EVENT_DATA_DESCRIPTOR EventData[3];
109 EventDataDescCreate(&EventData[0], &Type, sizeof(const UCHAR));
110 EventDataDescCreate(&EventData[1], &pDriverDeviceAdd, sizeof(PVOID));
111 EventDataDescCreate(&EventData[2], &Device, sizeof(PVOID));
112
113 EventWriteTransfer(Microsoft_Windows_DriverFrameworks_UserMode_PerformanceHandle,
114 &FX_REQUEST_COMPLETE,
115 &activityId,
116 NULL,
117 3,
118 &EventData[0]);
119 }
120 return status;
121}
122
123__inline
127 __in GUID* pActivityId,
128 __in WDFDEVICE Handle
129)
130{
135
136 if(status) {
138
139 EVENT_DATA_DESCRIPTOR EventData[2];
140 EventDataDescCreate(&EventData[0], &pDriverDeviceAdd, sizeof(PVOID));
141 EventDataDescCreate(&EventData[1], &Handle, sizeof(PVOID));
142
143 EventWriteTransfer(Microsoft_Windows_DriverFrameworks_UserMode_PerformanceHandle,
145 pActivityId,
146 NULL,
147 2,
148 &EventData[0]);
149 }
150
151 return status;
152}
153
154__inline
157 __in WDFDEVICE Handle,
158 __inout GUID* pActivityId
159)
160{
162 return PerformanceAnalysisPowerProcess(&FX_POWER_D0_ENTRY_START, pActivityId, Handle);
163}
164
165__inline
166VOID
168 __in WDFDEVICE Handle,
169 __in GUID* pActivityId
170)
171{
172 PerformanceAnalysisPowerProcess(&FX_POWER_D0_ENTRY_STOP, pActivityId, Handle);
173}
174
175__inline
178 __in WDFDEVICE Handle,
179 __inout GUID* pActivityId
180)
181{
183 return PerformanceAnalysisPowerProcess(&FX_POWER_D0_EXIT_START, pActivityId, Handle);
184}
185
186__inline
187VOID
189 __in WDFDEVICE Handle,
190 __in GUID* pActivityId
191)
192{
193 PerformanceAnalysisPowerProcess(&FX_POWER_D0_EXIT_STOP, pActivityId, Handle);
194}
195
196__inline
199 __in WDFDEVICE Handle,
200 __inout GUID* pActivityId
201)
202{
204 return PerformanceAnalysisPowerProcess(&FX_POWER_HW_PREPARE_START, pActivityId, Handle);
205}
206
207__inline
208VOID
210 __in WDFDEVICE Handle,
211 __in GUID* pActivityId
212)
213{
214 PerformanceAnalysisPowerProcess(&FX_POWER_HW_PREPARE_STOP, pActivityId, Handle);
215}
216
217__inline
220 __in WDFDEVICE Handle,
221 __inout GUID* pActivityId
222)
223{
225 return PerformanceAnalysisPowerProcess(&FX_POWER_HW_RELEASE_START, pActivityId, Handle);
226}
227
228__inline
229VOID
231 __in WDFDEVICE Handle,
232 __in GUID* pActivityId
233)
234{
235 PerformanceAnalysisPowerProcess(&FX_POWER_HW_RELEASE_STOP, pActivityId, Handle);
236}
237
238// EvtIoStop callback started.
239__inline
242 __in WDFQUEUE Queue,
243 __inout GUID* pActivityId
244)
245{
248 WDFDEVICE device;
249
252
254 Queue,
256 (PVOID*) &pQueue);
257 device = (WDFDEVICE) pQueue->GetDevice()->GetHandle();
258
260 return PerformanceAnalysisPowerProcess(&FX_EVTIOSTOP_START, pActivityId, device);
261}
262
263// EvtIoStop callback returned.
264__inline
265VOID
267 __in WDFQUEUE Queue,
268 __in GUID* pActivityId
269)
270{
273 WDFDEVICE device;
274
277
279 Queue,
281 (PVOID*) &pQueue);
282 device = (WDFDEVICE) pQueue->GetDevice()->GetHandle();
283
284 PerformanceAnalysisPowerProcess(&FX_EVTIOSTOP_STOP, pActivityId, device);
285}
286
287__inline
288VOID
291 )
292{
293 DO_NOTHING();
294}
295
296__inline
297VOID
300 __in KIRQL PrevIrql
301 )
302{
303 DO_NOTHING();
304}
305
306__inline
307VOID
309 __out BOOLEAN *CritRegion
310 )
311{
312 DO_NOTHING();
313}
314
315__inline
316VOID
319 __in BOOLEAN OldCritRegion,
320 __in PVOID Pfn
321 )
322{
323 DO_NOTHING();
324}
325
unsigned char BOOLEAN
Type
Definition: Type.h:7
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
__inline PFN_WDF_DRIVER_DEVICE_ADD GetDriverDeviceAddMethod()
Definition: fxdriver.hpp:362
__inline CfxDevice * GetDevice(VOID)
Definition: fxioqueue.hpp:773
UCHAR GetMajorFunction(VOID)
Definition: fxirpum.cpp:217
static FxObject * _GetObjectFromHandle(__in WDFOBJECT Handle, __inout PWDFOBJECT_OFFSET ObjectOffset)
Definition: fxobject.hpp:613
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
_Must_inspect_result_ FxIoQueue * GetCurrentQueue(VOID)
Definition: fxrequest.hpp:728
FxIrp * GetFxIrp(VOID)
Definition: fxrequest.hpp:957
_Out_ PKIRQL Irql
Definition: csq.h:179
#define __in
Definition: dbghelp.h:35
#define __inout
Definition: dbghelp.h:50
#define __out
Definition: dbghelp.h:62
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
UCHAR KIRQL
Definition: env_spec_w32.h:591
FORCEINLINE VOID EventDataDescCreate(_Out_ PEVENT_DATA_DESCRIPTOR EventDataDescriptor, _In_reads_bytes_(DataSize) const VOID *DataPtr, _In_ ULONG DataSize)
Definition: evntprov.h:180
#define EVENT_ACTIVITY_CTRL_CREATE_ID
Definition: evntprov.h:44
ULONG EVNTAPI EventWriteTransfer(_In_ REGHANDLE RegHandle, _In_ PCEVENT_DESCRIPTOR EventDescriptor, _In_opt_ LPCGUID ActivityId, _In_opt_ LPCGUID RelatedActivityId, _In_ ULONG UserDataCount, _In_reads_opt_(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData)
ULONG EVNTAPI EventActivityIdControl(_In_ ULONG ControlCode, _Inout_ LPGUID ActivityId)
PFX_DRIVER_GLOBALS pFxDriverGlobals
FxIoQueue * pQueue
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), Fdo, FX_TYPE_DEVICE,(PVOID *)&pFdo)
DriverGlobals
USHORT WDFOBJECT_OFFSET
Definition: fxobject.hpp:80
FxObject * pObject
@ FX_TYPE_QUEUE
Definition: fxtypes.h:48
@ FX_TYPE_REQUEST
Definition: fxtypes.h:53
__inline BOOLEAN IsFxPerformanceAnalysis(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: fxverifier.h:250
ULONG Handle
Definition: gdb_input.c:15
GLintptr offset
Definition: glext.h:5920
#define DO_NOTHING()
Definition: mxgeneral.h:32
FxDriver * Driver
Definition: fxglobals.h:374
Definition: devices.h:37
Definition: ps.c:97
__inline BOOLEAN PerfEvtDevicePrepareHardwareStart(__in WDFDEVICE Handle, __inout GUID *pActivityId)
Definition: vfprivum.hpp:198
__inline BOOLEAN PerfEvtDeviceD0ExitStart(__in WDFDEVICE Handle, __inout GUID *pActivityId)
Definition: vfprivum.hpp:177
__inline BOOLEAN PerformanceAnalysisPowerProcess(__in PCEVENT_DESCRIPTOR EventDescriptor, __in GUID *pActivityId, __in WDFDEVICE Handle)
Definition: vfprivum.hpp:125
__inline VOID PerfEvtDevicePrepareHardwareStop(__in WDFDEVICE Handle, __in GUID *pActivityId)
Definition: vfprivum.hpp:209
FORCEINLINE BOOLEAN PerfIoStart(__in WDFREQUEST Handle)
Definition: vfprivum.hpp:53
__inline BOOLEAN PerfEvtIoStopStart(__in WDFQUEUE Queue, __inout GUID *pActivityId)
Definition: vfprivum.hpp:241
__inline VOID VerifyCriticalRegionEntry(__out BOOLEAN *CritRegion)
Definition: vfprivum.hpp:308
__inline VOID PerfEvtDeviceD0EntryStop(__in WDFDEVICE Handle, __in GUID *pActivityId)
Definition: vfprivum.hpp:167
__inline VOID VerifyCriticalRegionExit(__in PWDF_DRIVER_GLOBALS DriverGlobals, __in BOOLEAN OldCritRegion, __in PVOID Pfn)
Definition: vfprivum.hpp:317
__inline VOID VerifyIrqlEntry(__out KIRQL *Irql)
Definition: vfprivum.hpp:289
__inline VOID PerfEvtDeviceReleaseHardwareStop(__in WDFDEVICE Handle, __in GUID *pActivityId)
Definition: vfprivum.hpp:230
__inline BOOLEAN PerfEvtDeviceReleaseHardwareStart(__in WDFDEVICE Handle, __inout GUID *pActivityId)
Definition: vfprivum.hpp:219
FORCEINLINE VOID PerformanceAnalysisIOProcess(__in PFX_DRIVER_GLOBALS pFxDriverGlobals, __in WDFREQUEST Handle, __inout FxRequest **ppReq, __inout GUID *pActivityId)
Definition: vfprivum.hpp:30
__inline VOID VerifyIrqlExit(__in PWDF_DRIVER_GLOBALS DriverGlobals, __in KIRQL PrevIrql)
Definition: vfprivum.hpp:298
FORCEINLINE BOOLEAN PerfIoComplete(__in WDFREQUEST Handle)
Definition: vfprivum.hpp:89
__inline BOOLEAN PerfEvtDeviceD0EntryStart(__in WDFDEVICE Handle, __inout GUID *pActivityId)
Definition: vfprivum.hpp:156
__inline VOID PerfEvtDeviceD0ExitStop(__in WDFDEVICE Handle, __in GUID *pActivityId)
Definition: vfprivum.hpp:188
__inline VOID PerfEvtIoStopStop(__in WDFQUEUE Queue, __in GUID *pActivityId)
Definition: vfprivum.hpp:266
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2225
EVT_WDF_DRIVER_DEVICE_ADD * PFN_WDF_DRIVER_DEVICE_ADD
Definition: wdfdriver.h:78
#define FORCEINLINE
Definition: wdftypes.h:67
_In_ PCEVENT_DESCRIPTOR EventDescriptor
Definition: wmifuncs.h:93
unsigned char UCHAR
Definition: xmlstorage.h:181