23#define EVTLOG_DDI_COUNT_ERROR_MAX_LEN (53 + MAX_PATH)
27#include "fxlibrarycommon.h"
30#include "wdfversionlog.h"
185 "\n\n************************* \n"
186 "* DDI function table mismatch detected in KMDF driver. The \n"
187 "* driver will not load until it is re-compiled using a \n"
188 "* newer version of the Windows Driver Kit (WDK). \n"
192 "* Service name : %wZ\n"
193 "* Actual function table count : %d \n"
194 "* Expected function table count: %d \n"
195 "*************************** \n\n",
198 ExpectedFunctionCount
207 L"Service:%wZ Count:Actual %d Expected %d",
210 ExpectedFunctionCount);
224 TraceLoggingWrite(g_TelemetryProvider,
225 "KmdfClientFunctionCountMismatch",
227 TraceLoggingUnicodeString(
ServiceName,
"ServiceName"),
228 TraceLoggingUInt32(ActualFunctionCount,
"FunctionCount"),
229 TraceLoggingUInt32(ExpectedFunctionCount,
"ExpectedCount"));
270 __Print((
"Failed to initialize tracing for WDF\n"));
288 if (pRtlGetVersion !=
NULL) {
327 EventUnregisterMicrosoft_Windows_DriverFrameworks_KernelMode_Performance();
361 ": NULL parameter -- %s\n",
364 (
Info->FuncTable ==
NULL) ?
"PWDF_BIND_INFO->FuncTable" :
382 ": version mismatch detected in function table count: client"
383 "has 0x%x, library has 0x%x\n",
393 switch (
Info->FuncCount) {
407 ": Function table count 0x%x doesn't match any previously "
408 "released framework version table size\n",
476 if (isFunctinTableHookingOn ==
FALSE && isPerformanceAnalysisOn ==
FALSE) {
497 "Verifier functions table NOT IMPLEMENTED\n"));
502 ": Enhanced Verification is ON\n"));
507 if (Microsoft_Windows_DriverFrameworks_KernelMode_PerformanceHandle ==
NULL) {
508 EventRegisterMicrosoft_Windows_DriverFrameworks_KernelMode_Performance();
519 &VfWdfVersion.Functions,
535 ": WdfFunctions %p\n",
Info->FuncTable));
540 ": exit: status %X\n",
status));
601 ": exit: status %X\n",
status));
623 ": Invalid ClientInfo received from wdfldr \n"));
643 status = FxRegKey::_QueryULong(
688 size_t errorLogEntrySize;
689 size_t errorInsertionStringByteSize = 0;
691 if (ErrorInsertionString) {
692 errorInsertionStringByteSize =
wcslen(ErrorInsertionString) *
sizeof(
WCHAR);
696 errorLogEntrySize =
sizeof(
IO_ERROR_LOG_PACKET) + RawDataLen + errorInsertionStringByteSize;
704#pragma prefast(suppress:__WARNING_CONST_CONST_COMP, "If ErrorInsertionString is not null then this is not a constant")
708 (
UCHAR)errorLogEntrySize);
710 if (errorLogEntry !=
NULL) {
730 if (ErrorInsertionString) {
732 ErrorInsertionString,
733 errorInsertionStringByteSize);
#define DPFLTR_ERROR_LEVEL
static WCHAR ServiceName[]
virtual VOID DeleteObject(VOID)
#define NT_SUCCESS(StatCode)
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T ContextSize
PFX_DRIVER_GLOBALS pFxDriverGlobals
PFX_DRIVER_GLOBALS fxDriverGlobals
VOID FxLibraryGlobalsDecommission(VOID)
_Must_inspect_result_ NTSTATUS FxLibraryGlobalsCommission(VOID)
VOID LockVerifierSection(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ PCUNICODE_STRING RegistryPath)
VOID UnlockVerifierSection(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals)
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
VOID FxDestroy(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
FxLibraryGlobalsType FxLibraryGlobals
#define FX_IRP_QUEUE_CSQ_CONTEXT_ENTRY
#define WDF_LIBRARY_COMMISSION
#define WDF_LIBRARY_UNREGISTER_CLIENT
#define WDF_LIBRARY_DECOMMISSION
#define WDF_LIBRARY_REGISTER_CLIENT
VOID FxFreeDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
_Must_inspect_result_ PWDF_DRIVER_GLOBALS FxAllocateDriverGlobals(VOID)
VOID RegisterTelemetryProvider(VOID)
VOID GetNameFromPath(_In_ PCUNICODE_STRING Path, _Out_ PUNICODE_STRING Name)
#define WDF_TELEMETRY_EVT_KEYWORDS
__inline BOOLEAN IsFxPerformanceAnalysis(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
__inline BOOLEAN IsFxVerifierFunctionTableHooking(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define DbgPrintEx(cmpid, lvl, fmt,...)
NTSTATUS(NTAPI * PFN_RTL_GET_VERSION)(__out PRTL_OSVERSIONINFOW VersionInformation)
#define WDF_ENHANCED_VERIFIER_OPTIONS_VALUE_NAME
RTL_OSVERSIONINFOW gOsVersion
_Must_inspect_result_ NTSTATUS NTAPI FxLibraryCommonCommission(VOID)
_Must_inspect_result_ NTSTATUS NTAPI FxLibraryCommonRegisterClient(__inout PWDF_BIND_INFO Info, __deref_out PWDF_DRIVER_GLOBALS *WdfDriverGlobals, __in_opt PCLIENT_INFO ClientInfo)
BOOLEAN IsClientInfoValid(_In_ PCLIENT_INFO ClientInfo)
static WDFIRPQUEUE_TRIAGE_INFO _WdfIrpQueueTriageInfo
VOID LibraryLogEvent(__in PDRIVER_OBJECT DriverObject, __in NTSTATUS ErrorCode, __in NTSTATUS FinalStatus, __in PWSTR ErrorInsertionString, __in_bcount(RawDataLen) PVOID RawDataBuf, __in USHORT RawDataLen)
_Must_inspect_result_ NTSTATUS NTAPI FxLibraryCommonUnregisterClient(__in PWDF_BIND_INFO Info, __in PWDF_DRIVER_GLOBALS WdfDriverGlobals)
static WDFCONTEXT_TRIAGE_INFO _WdfContextTriageInfo
WDF_TRIAGE_INFO g_WdfTriageInfo
static WDFDEVICE_TRIAGE_INFO _WdfDeviceTriageInfo
static WDFCONTEXTTYPE_TRIAGE_INFO _WdfContextTypeTriageInfo
static WDFREQUEST_TRIAGE_INFO _WdfRequestTriageInfo
static WDFOBJECT_TRIAGE_INFO _WdfObjectTriageInfo
VOID ReportDdiFunctionCountMismatch(_In_ PCUNICODE_STRING ServiceName, _In_ ULONG ActualFunctionCount, _In_ ULONG ExpectedFunctionCount)
VOID GetEnhancedVerifierOptions(__in PCLIENT_INFO ClientInfo, __out PULONG Options)
static WDFFWDPROGRESS_TRIAGE_INFO _WdfFwdProgressTriageInfo
static WDFIRP_TRIAGE_INFO _WdfIrpTriageInfo
#define EVTLOG_DDI_COUNT_ERROR_MAX_LEN
_Must_inspect_result_ NTSTATUS NTAPI FxLibraryCommonDecommission(VOID)
static WDFQUEUE_TRIAGE_INFO _WdfQueueTriageInfo
_In_ NDIS_ERROR_CODE ErrorCode
#define _Must_inspect_result_
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
VOID NTAPI IoWriteErrorLogEntry(IN PVOID ElEntry)
PVOID NTAPI IoAllocateErrorLogEntry(IN PVOID IoObject, IN UCHAR EntrySize)
NTSTRSAFEVAPI RtlStringCchPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
#define WDFFWDPROGRESS_TRIAGE_INFO
#define WDFREQUEST_TRIAGE_INFO
#define WDFOBJECT_TRIAGE_INFO
#define WDFIRP_TRIAGE_INFO
#define WDF_01_TRIAGE_INFO_MINOR_VERSION
#define WDFVER_CLIENT_INVALID_DDI_COUNT
#define WDF_01_TRIAGE_INFO_MAJOR_VERSION
#define WDFCONTEXT_TRIAGE_INFO
#define WDFCONTEXTTYPE_TRIAGE_INFO
#define WDFDEVICE_TRIAGE_INFO
#define WDFIRPQUEUE_TRIAGE_INFO
#define WDFQUEUE_TRIAGE_INFO
PDRIVER_OBJECT DriverObject
BOOLEAN InternalTracingInitialized
ULONG FxEnhancedVerifierOptions
PVOID NTAPI MmGetSystemRoutineAddress(IN PUNICODE_STRING SystemRoutineName)
VOID FxIFRStop(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
_Must_inspect_result_ NTSTATUS FxTraceInitialize(VOID)
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
@ WdfFunctionTableNumEntries_V1_0
@ WdfFunctionTableNumEntries_V1_11
@ WdfFunctionTableNumEntries_V1_13
@ WdfFunctionTableNumEntries_V1_15
@ WdfFunctionTableNumEntries_V1_1
@ WdfFunctionTableNumEntries_V1_5
@ WdfFunctionTableNumEntries_V1_9
VOID(NTAPI * WDFFUNC)(VOID)
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
#define DECLARE_CONST_UNICODE_STRING(_variablename, _string)
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
PWDF_DRIVER_GLOBALS WdfDriverGlobals
@ WdfFunctionTableNumEntries
struct _WDF_OBJECT_CONTEXT_TYPE_INFO WDF_OBJECT_CONTEXT_TYPE_INFO
#define ERROR_LOG_MAXIMUM_SIZE
struct _IO_ERROR_LOG_PACKET * PIO_ERROR_LOG_PACKET
struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET
#define KD_DEBUGGER_ENABLED
#define KD_DEBUGGER_NOT_PRESENT