36#if defined(EVENT_TRACING)
37#include "verifier.tmh"
41#pragma alloc_text(FX_ENHANCED_VERIFIER_SECTION_NAME, \
42 AddEventHooksWdfDeviceCreate, \
43 AddEventHooksWdfIoQueueCreate, \
44 VfAddContextToHandle, \
46 VfWdfObjectGetTypedContext \
98 HookProcessInfo->DonotCallKmdfLib =
FALSE;
117 HookProcessInfo->DonotCallKmdfLib =
FALSE;
171 HookProcessInfo->DonotCallKmdfLib =
TRUE;
172 HookProcessInfo->DdiCallStatus =
status;
199 &
context->PnpPowerEventCallbacksOriginal,
200 &pnpPowerEvtsOriginal,
214 ASSERTMSG(
"KMDF Enhanced Verifier failed to add context to object "
217 if (contextHeader !=
NULL) {
235 &pnpPowerEvtsOriginal,
240 if (contextHeader !=
NULL) {
291 HookProcessInfo->DonotCallKmdfLib =
FALSE;
308 HookProcessInfo->DonotCallKmdfLib =
FALSE;
357 HookProcessInfo->DonotCallKmdfLib =
TRUE;
358 HookProcessInfo->DdiCallStatus =
status;
385 &
context->IoQueueConfigOriginal,
400 ASSERTMSG(
"KMDF Enhanced Verifier failed to add context to object "
403 if (contextHeader !=
NULL) {
413 if (contextHeader !=
NULL) {
494 "Attempting to get context type %s from WDFOBJECT 0x%p",
546 "Attributes %p ContextTypeInfo is NULL, %!STATUS!",
616 "WDFHANDLE %p cannot have contexts added to it, %!STATUS!",
635 "WDFHANDLE %p failed to add context, %!STATUS!",
static FxObject * _GetObjectFromHandle(__in WDFOBJECT Handle, __inout PWDFOBJECT_OFFSET ObjectOffset)
_Must_inspect_result_ NTSTATUS AddContext(__in FxContextHeader *Header, __in PVOID *Context, __in PWDF_OBJECT_ATTRIBUTES Attributes)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
__inline FxContextHeader * GetContextHeader(VOID)
#define NT_SUCCESS(StatCode)
static void cleanup(void)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
PFX_DRIVER_GLOBALS pFxDriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
_Must_inspect_result_ NTSTATUS FxCalculateObjectTotalSize(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USHORT RawObjectSize, __in USHORT ExtraSize, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out size_t *Total)
VOID FxContextHeaderInit(__in FxContextHeader *Header, __in FxObject *Object, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes)
#define FxPointerNotNull(FxDriverGlobals, Ptr)
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
@ FX_VALIDATE_OPTION_ATTRIBUTES_REQUIRED
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
__in WDFOBJECT __in PCWDF_OBJECT_CONTEXT_TYPE_INFO TypeInfo
FxContextHeader * pHeader
#define _Must_inspect_result_
#define ASSERTMSG(msg, exp)
#define STATUS_OBJECT_PATH_INVALID
#define TRACE_LEVEL_WARNING
WDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks
PFN_WDFDEVICECREATE pfnWdfDeviceCreate
PFN_WDFIOQUEUECREATE pfnWdfIoQueueCreate
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_OBJECT_NAME_INVALID
#define STATUS_INSUFFICIENT_RESOURCES
_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)
_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)
_Must_inspect_result_ NTSTATUS VfAllocateContext(__in PWDF_DRIVER_GLOBALS DriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __out PVOID *ContextHeader)
_Must_inspect_result_ NTSTATUS VfAddContextToHandle(__in PVOID ContextHeader, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in WDFOBJECT Handle, __out_opt PVOID *Context)
_Must_inspect_result_ PVOID FASTCALL VfWdfObjectGetTypedContext(__in WDFOBJECT Handle, __in PCWDF_OBJECT_CONTEXT_TYPE_INFO TypeInfo)
#define SET_HOOK_IF_CALLBACK_PRESENT(Source, Target, Name)
_Must_inspect_result_ _In_ WDFDEVICE Device
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_In_ PWDFDEVICE_INIT DeviceInit
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
_Must_inspect_result_ _Inout_ PWDFDEVICE_INIT _In_opt_ PWDF_OBJECT_ATTRIBUTES DeviceAttributes
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_IO_QUEUE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES QueueAttributes
#define WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(_attributes, _contexttype)
#define PAGED_CODE_LOCKED()