ReactOS 0.4.15-dev-8052-gc0e3179
vfprivkm.hpp File Reference
#include <ntddk.h>
#include "fx.hpp"
Include dependency graph for vfprivkm.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

__inline VOID VerifyIrqlEntry (__out KIRQL *Irql)
 
__inline VOID VerifyIrqlExit (__in PWDF_DRIVER_GLOBALS DriverGlobals, __in KIRQL PrevIrql)
 
__inline VOID VerifyCriticalRegionEntry (__out BOOLEAN *CritRegion)
 
__inline VOID VerifyCriticalRegionExit (__in PWDF_DRIVER_GLOBALS DriverGlobals, __in BOOLEAN OldCritRegion, __in PVOID Pfn)
 
FORCEINLINE VOID PerformanceAnalysisIOProcess (__in PFX_DRIVER_GLOBALS pFxDriverGlobals, __in WDFREQUEST Handle, __out FxRequest **ppReq, __inout GUID *pActivityId)
 
FORCEINLINE BOOLEAN PerfIoStart (__in WDFREQUEST Handle)
 
FORCEINLINE BOOLEAN PerfIoComplete (__in WDFREQUEST Handle)
 
FORCEINLINE PFN_WDF_DRIVER_DEVICE_ADD PerformanceGetDriverDeviceAdd (__in WDFOBJECT Handle)
 
__inline BOOLEAN PerfEvtDeviceD0EntryStart (__in WDFDEVICE Handle, __inout GUID *pActivityId)
 
__inline VOID PerfEvtDeviceD0EntryStop (__in WDFDEVICE Handle, __in GUID *pActivityId)
 
__inline BOOLEAN PerfEvtDeviceD0ExitStart (__in WDFDEVICE Handle, __inout GUID *pActivityId)
 
__inline VOID PerfEvtDeviceD0ExitStop (__in WDFDEVICE Handle, __in GUID *pActivityId)
 
__inline BOOLEAN PerfEvtDevicePrepareHardwareStart (__in WDFDEVICE Handle, __inout GUID *pActivityId)
 
__inline VOID PerfEvtDevicePrepareHardwareStop (__in WDFDEVICE Handle, __in GUID *pActivityId)
 
__inline BOOLEAN PerfEvtDeviceReleaseHardwareStart (__in WDFDEVICE Handle, __inout GUID *pActivityId)
 
__inline VOID PerfEvtDeviceReleaseHardwareStop (__in WDFDEVICE Handle, __in GUID *pActivityId)
 
__inline BOOLEAN PerfEvtIoStopStart (__in WDFQUEUE Queue, __inout GUID *pActivityId)
 
__inline VOID PerfEvtIoStopStop (__in WDFQUEUE Queue, __in GUID *pActivityId)
 

Function Documentation

◆ PerfEvtDeviceD0EntryStart()

__inline BOOLEAN PerfEvtDeviceD0EntryStart ( __in WDFDEVICE  Handle,
__inout GUID pActivityId 
)

Definition at line 184 of file vfprivkm.hpp.

188{
193
194 if(status) {
196 EtwActivityIdControl(EVENT_ACTIVITY_CTRL_CREATE_ID, pActivityId);
197 EventWriteFX_POWER_D0_ENTRY_START(pActivityId, pDriverDeviceAdd, Handle);
198 }
199
200 return status;
201}
unsigned char BOOLEAN
__inline PFN_WDF_DRIVER_DEVICE_ADD GetDriverDeviceAddMethod()
Definition: fxdriver.hpp:362
static FxObject * _GetObjectFromHandle(__in WDFOBJECT Handle, __inout PWDFOBJECT_OFFSET ObjectOffset)
Definition: fxobject.hpp:613
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
#define EVENT_ACTIVITY_CTRL_CREATE_ID
Definition: evntprov.h:44
PFX_DRIVER_GLOBALS pFxDriverGlobals
USHORT WDFOBJECT_OFFSET
Definition: fxobject.hpp:80
FxObject * pObject
__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
FxDriver * Driver
Definition: fxglobals.h:374
Definition: ps.c:97
EVT_WDF_DRIVER_DEVICE_ADD * PFN_WDF_DRIVER_DEVICE_ADD
Definition: wdfdriver.h:78

Referenced by VfEvtDeviceD0Entry().

◆ PerfEvtDeviceD0EntryStop()

__inline VOID PerfEvtDeviceD0EntryStop ( __in WDFDEVICE  Handle,
__in GUID pActivityId 
)

Definition at line 205 of file vfprivkm.hpp.

209{
210 EventWriteFX_POWER_D0_ENTRY_STOP(pActivityId, PerformanceGetDriverDeviceAdd(Handle), Handle);
211}
FORCEINLINE PFN_WDF_DRIVER_DEVICE_ADD PerformanceGetDriverDeviceAdd(__in WDFOBJECT Handle)
Definition: vfprivkm.hpp:171

Referenced by VfEvtDeviceD0Entry().

◆ PerfEvtDeviceD0ExitStart()

__inline BOOLEAN PerfEvtDeviceD0ExitStart ( __in WDFDEVICE  Handle,
__inout GUID pActivityId 
)

Definition at line 215 of file vfprivkm.hpp.

219{
224
225 if(status) {
227 EtwActivityIdControl(EVENT_ACTIVITY_CTRL_CREATE_ID, pActivityId);
228 EventWriteFX_POWER_D0_EXIT_START(pActivityId, pDriverDeviceAdd, Handle);
229 }
230 return status;
231}

Referenced by VfEvtDeviceD0Exit().

◆ PerfEvtDeviceD0ExitStop()

__inline VOID PerfEvtDeviceD0ExitStop ( __in WDFDEVICE  Handle,
__in GUID pActivityId 
)

Definition at line 235 of file vfprivkm.hpp.

239{
240 EventWriteFX_POWER_D0_EXIT_STOP(pActivityId, PerformanceGetDriverDeviceAdd(Handle), Handle);
241}

Referenced by VfEvtDeviceD0Exit().

◆ PerfEvtDevicePrepareHardwareStart()

__inline BOOLEAN PerfEvtDevicePrepareHardwareStart ( __in WDFDEVICE  Handle,
__inout GUID pActivityId 
)

Definition at line 245 of file vfprivkm.hpp.

249{
250
255
256 if(status) {
258 EtwActivityIdControl(EVENT_ACTIVITY_CTRL_CREATE_ID, pActivityId);
259 EventWriteFX_POWER_HW_PREPARE_START(pActivityId, pDriverDeviceAdd, Handle);
260 }
261 return status;
262}

Referenced by VfEvtDevicePrepareHardware().

◆ PerfEvtDevicePrepareHardwareStop()

__inline VOID PerfEvtDevicePrepareHardwareStop ( __in WDFDEVICE  Handle,
__in GUID pActivityId 
)

Definition at line 266 of file vfprivkm.hpp.

270{
271 EventWriteFX_POWER_HW_PREPARE_STOP(pActivityId, PerformanceGetDriverDeviceAdd(Handle), Handle);
272}

Referenced by VfEvtDevicePrepareHardware().

◆ PerfEvtDeviceReleaseHardwareStart()

__inline BOOLEAN PerfEvtDeviceReleaseHardwareStart ( __in WDFDEVICE  Handle,
__inout GUID pActivityId 
)

Definition at line 276 of file vfprivkm.hpp.

280{
285
286 if(status) {
288 EtwActivityIdControl(EVENT_ACTIVITY_CTRL_CREATE_ID, pActivityId);
289 EventWriteFX_POWER_HW_RELEASE_START(pActivityId, pDriverDeviceAdd, Handle);
290 }
291 return status;
292}

Referenced by VfEvtDeviceReleaseHardware().

◆ PerfEvtDeviceReleaseHardwareStop()

__inline VOID PerfEvtDeviceReleaseHardwareStop ( __in WDFDEVICE  Handle,
__in GUID pActivityId 
)

Definition at line 296 of file vfprivkm.hpp.

300{
301 EventWriteFX_POWER_HW_RELEASE_STOP(pActivityId, PerformanceGetDriverDeviceAdd(Handle), Handle);
302}

Referenced by VfEvtDeviceReleaseHardware().

◆ PerfEvtIoStopStart()

__inline BOOLEAN PerfEvtIoStopStart ( __in WDFQUEUE  Queue,
__inout GUID pActivityId 
)

Definition at line 307 of file vfprivkm.hpp.

311{
313 WDFDEVICE device;
315 PFN_WDF_DRIVER_DEVICE_ADD pDriverDeviceAdd;
316
320
321 if(status) {
323 Queue,
325 (PVOID*) &pQueue);
326 device = (WDFDEVICE) pQueue->GetDevice()->GetHandle();
327 pDriverDeviceAdd = pFxDriverGlobals->Driver->GetDriverDeviceAddMethod();
328 EtwActivityIdControl(EVENT_ACTIVITY_CTRL_CREATE_ID, pActivityId);
329 EventWriteFX_EVTIOSTOP_START(pActivityId, pDriverDeviceAdd, device);
330 }
331 return status;
332}
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
__inline CfxDevice * GetDevice(VOID)
Definition: fxioqueue.hpp:773
FxIoQueue * pQueue
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), Fdo, FX_TYPE_DEVICE,(PVOID *)&pFdo)
@ FX_TYPE_QUEUE
Definition: fxtypes.h:48
Definition: devices.h:37
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2225

Referenced by VfEvtIoStop().

◆ PerfEvtIoStopStop()

__inline VOID PerfEvtIoStopStop ( __in WDFQUEUE  Queue,
__in GUID pActivityId 
)

Definition at line 337 of file vfprivkm.hpp.

341{
343 WDFDEVICE device;
345 PFN_WDF_DRIVER_DEVICE_ADD pDriverDeviceAdd;
346
350 Queue,
352 (PVOID*) &pQueue);
353 device = (WDFDEVICE) pQueue->GetDevice()->GetHandle();
354 pDriverDeviceAdd = pFxDriverGlobals->Driver->GetDriverDeviceAddMethod();
355
356 EventWriteFX_EVTIOSTOP_STOP(pActivityId, pDriverDeviceAdd, device);
357}

Referenced by VfEvtIoStop().

◆ PerfIoComplete()

FORCEINLINE BOOLEAN PerfIoComplete ( __in WDFREQUEST  Handle)

Definition at line 145 of file vfprivkm.hpp.

148{
149 FxRequest* pReq;
150 GUID activityId = { 0 };
152
156
157 if(status)
158 {
161 &activityId);
162
163 EventWriteFX_REQUEST_COMPLETE(&activityId, pReq->GetFxIrp()->GetMajorFunction(),
164 pDriverDeviceAdd, pReq->GetCurrentQueue()->GetDevice()->GetHandle());
165 }
166 return status;
167}
UCHAR GetMajorFunction(VOID)
Definition: fxirpum.cpp:217
_Must_inspect_result_ FxIoQueue * GetCurrentQueue(VOID)
Definition: fxrequest.hpp:728
FxIrp * GetFxIrp(VOID)
Definition: fxrequest.hpp:957
FORCEINLINE VOID PerformanceAnalysisIOProcess(__in PFX_DRIVER_GLOBALS pFxDriverGlobals, __in WDFREQUEST Handle, __out FxRequest **ppReq, __inout GUID *pActivityId)
Definition: vfprivkm.hpp:97

◆ PerfIoStart()

FORCEINLINE BOOLEAN PerfIoStart ( __in WDFREQUEST  Handle)

Definition at line 119 of file vfprivkm.hpp.

122{
123 FxRequest* pReq;
124 GUID activityId = { 0 };
126
130
131 if(status)
132 {
135 &activityId);
136
137 EventWriteFX_REQUEST_START(&activityId, pReq->GetFxIrp()->GetMajorFunction(),
138 pDriverDeviceAdd, pReq->GetCurrentQueue()->GetDevice()->GetHandle());
139 }
140 return status;
141}

Referenced by if(), VfEvtIoDefault(), VfEvtIoDeviceControl(), VfEvtIoInternalDeviceControl(), VfEvtIoRead(), and VfEvtIoWrite().

◆ PerformanceAnalysisIOProcess()

FORCEINLINE VOID PerformanceAnalysisIOProcess ( __in PFX_DRIVER_GLOBALS  pFxDriverGlobals,
__in WDFREQUEST  Handle,
__out FxRequest **  ppReq,
__inout GUID pActivityId 
)

Definition at line 97 of file vfprivkm.hpp.

103{
104
106 Handle,
108 (PVOID *) ppReq);
109
110 if (IoGetActivityIdIrp((*ppReq)->GetFxIrp()->GetIrp(), pActivityId) == STATUS_NOT_FOUND)
111 {
112 EtwActivityIdControl(EVENT_ACTIVITY_CTRL_CREATE_ID, pActivityId);
113 IoSetActivityIdIrp((*ppReq)->GetFxIrp()->GetIrp(), pActivityId);
114 }
115}
@ FX_TYPE_REQUEST
Definition: fxtypes.h:53
#define STATUS_NOT_FOUND
Definition: shellext.h:72

Referenced by PerfIoComplete(), and PerfIoStart().

◆ PerformanceGetDriverDeviceAdd()

◆ VerifyCriticalRegionEntry()

◆ VerifyCriticalRegionExit()

__inline VOID VerifyCriticalRegionExit ( __in PWDF_DRIVER_GLOBALS  DriverGlobals,
__in BOOLEAN  OldCritRegion,
__in PVOID  Pfn 
)

Definition at line 76 of file vfprivkm.hpp.

81{
82 if (KeGetCurrentIrql() <= APC_LEVEL) {
83 if (OldCritRegion != KeAreApcsDisabled()) {
84 KdPrint(("WDF VERIFIER: Critical section entry and exit around event callback incorrect\n"));
87 (ULONG_PTR)Pfn,
88 0
89 );
90 }
91 }
92}
#define KdPrint(x)
Definition: env_spec_w32.h:288
DriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
@ WDF_VERIFIER_CRITICAL_REGION_MISMATCH
Definition: wdfbugcodes.h:72

Referenced by VfEvtDeviceD0Entry(), VfEvtDeviceD0EntryPostInterruptsEnabled(), VfEvtDeviceD0Exit(), VfEvtDeviceD0ExitPreInterruptsDisabled(), VfEvtDevicePrepareHardware(), VfEvtDeviceQueryRemove(), VfEvtDeviceQueryStop(), VfEvtDeviceRelationsQuery(), VfEvtDeviceReleaseHardware(), VfEvtDeviceSelfManagedIoCleanup(), VfEvtDeviceSelfManagedIoFlush(), VfEvtDeviceSelfManagedIoInit(), VfEvtDeviceSelfManagedIoRestart(), VfEvtDeviceSelfManagedIoSuspend(), VfEvtDeviceSurpriseRemoval(), VfEvtDeviceUsageNotification(), VfEvtDeviceUsageNotificationEx(), VfEvtIoCanceledOnQueue(), VfEvtIoDefault(), VfEvtIoDeviceControl(), VfEvtIoInternalDeviceControl(), VfEvtIoRead(), VfEvtIoResume(), VfEvtIoStop(), and VfEvtIoWrite().

◆ VerifyIrqlEntry()

◆ VerifyIrqlExit()