ReactOS 0.4.16-dev-1946-g52006dd
fxlibrarycommon.cpp
Go to the documentation of this file.
1//
2// Copyright (C) Microsoft. All rights reserved.
3//
4
5extern "C" {
6#include <ntddk.h>
7}
8
9//
10// This will cause inclusion of VfWdfFunctions table implementation from header
11//
12// TODO: Uncomment when implement verified functions table
13//#define VF_FX_DYNAMICS_GENERATE_TABLE 1
14
15//
16// Compute the length based on the max. service name length and the rest of the
17// error string as seen in ReportDdiFunctionCountMismatch
18//
19// TODO: Fix this !!!
20#ifndef MAX_PATH
21#define MAX_PATH 260
22#endif
23#define EVTLOG_DDI_COUNT_ERROR_MAX_LEN (53 + MAX_PATH)
24
25#include "fx.hpp"
26#include "fxldr.h"
27#include "fxlibrarycommon.h"
28#include "fxtelemetry.hpp"
29#ifndef __REACTOS__
30#include "wdfversionlog.h"
31#include "minwindef.h"
32#else
33#include "reactos_special.h"
34#endif
35
36extern "C" {
37//
38// Global triage Info for dbgeng and 0x9F work
39//
49
51 //
52 // KMDF Version.
53 //
54 __WDF_MAJOR_VERSION,
55 __WDF_MINOR_VERSION,
56
57 //
58 // Table Version.
59 //
62
63 //
64 // Reserved ptr (set to NULL).
65 //
66 NULL,
67
68 //
69 // WDF objects triage info.
70 //
80};
81} // extern "C"
82
83VOID
85 VOID
86 )
87{
88 // Object
89 _WdfObjectTriageInfo.RawObjectSize = sizeof(FxObject);
90 _WdfObjectTriageInfo.ObjectType = FIELD_OFFSET(FxObject, m_Type);
91 _WdfObjectTriageInfo.TotalObjectSize = FIELD_OFFSET(FxObject, m_ObjectSize);
92 _WdfObjectTriageInfo.ChildListHead = FIELD_OFFSET(FxObject, m_ChildListHead);
93 _WdfObjectTriageInfo.ChildEntry = FIELD_OFFSET(FxObject, m_ChildEntry);
94 _WdfObjectTriageInfo.Globals = FIELD_OFFSET(FxObject, m_Globals);
95 _WdfObjectTriageInfo.ParentObject = FIELD_OFFSET(FxObject, m_ParentObject);
96
97 // Context Triage Info
98 _WdfContextTriageInfo.HeaderSize = sizeof(FxContextHeader);
99 _WdfContextTriageInfo.NextHeader = FIELD_OFFSET(FxContextHeader, NextHeader);
101 _WdfContextTriageInfo.TypeInfoPtr = FIELD_OFFSET(FxContextHeader, ContextTypeInfo);
103
104 // Context type Triage info
108
109 // WdfRequest Queue
110 _WdfQueueTriageInfo.QueueSize = sizeof(FxIoQueue);
111 _WdfQueueTriageInfo.IrpQueue1 = FIELD_OFFSET(FxIoQueue, m_Queue);
112 _WdfQueueTriageInfo.IrpQueue2 = FIELD_OFFSET(FxIoQueue, m_DriverCancelable);
113 _WdfQueueTriageInfo.RequestList1 = FIELD_OFFSET(FxIoQueue, m_Cancelled);
114 _WdfQueueTriageInfo.RequestList2 = FIELD_OFFSET(FxIoQueue, m_CanceledOnQueueList);
115 _WdfQueueTriageInfo.FwdProgressContext = FIELD_OFFSET(FxIoQueue, m_FwdProgContext);
117
118 // Forward Progress
119 _WdfFwdProgressTriageInfo.ReservedRequestList =
120 FIELD_OFFSET(FXIO_FORWARD_PROGRESS_CONTEXT, m_ReservedRequestList);
121 _WdfFwdProgressTriageInfo.ReservedRequestInUseList =
122 FIELD_OFFSET(FXIO_FORWARD_PROGRESS_CONTEXT, m_ReservedRequestInUseList);
123 _WdfFwdProgressTriageInfo.PendedIrpList =
125
126 // Irp Queue
127 _WdfIrpQueueTriageInfo.IrpQueueSize = sizeof(FxIrpQueue);
128 _WdfIrpQueueTriageInfo.IrpListHeader = FIELD_OFFSET(FxIrpQueue, m_Queue);
129 _WdfIrpQueueTriageInfo.IrpListEntry = FIELD_OFFSET(IRP, Tail.Overlay.ListEntry);
131 Tail.Overlay.DriverContext[FX_IRP_QUEUE_CSQ_CONTEXT_ENTRY]);
132
133 // WdfRequest
134 _WdfRequestTriageInfo.RequestSize = sizeof(FxRequest);
135 _WdfRequestTriageInfo.CsqContext = FIELD_OFFSET(FxRequest, m_CsqContext);
137 _WdfRequestTriageInfo.ListEntryQueueOwned =
138 FIELD_OFFSET(FxRequest, m_OwnerListEntry);
139 _WdfRequestTriageInfo.ListEntryQueueOwned2 =
140 FIELD_OFFSET(FxRequest, m_OwnerListEntry2);
141 _WdfRequestTriageInfo.RequestListEntry =
142 FIELD_OFFSET(FxRequest, m_ListEntry);
143 _WdfRequestTriageInfo.FwdProgressList =
144 FIELD_OFFSET(FxRequest, m_ForwardProgressList);
145
146 // WdfDevice
147 _WdfDeviceTriageInfo.DeviceInitSize = sizeof(WDFDEVICE_INIT);
148 _WdfDeviceTriageInfo.DeviceDriver = FIELD_OFFSET(FxDevice, m_Driver);
149
150 // FxIrp
151 _WdfIrpTriageInfo.FxIrpSize = sizeof(FxIrp);
152 _WdfIrpTriageInfo.IrpPtr = FIELD_OFFSET(FxIrp, m_Irp);
153}
154
158 )
159{
160 if (ClientInfo == NULL ||
161 ClientInfo->Size != sizeof(CLIENT_INFO) ||
162 ClientInfo->RegistryPath == NULL ||
163 ClientInfo->RegistryPath->Length == 0 ||
164 ClientInfo->RegistryPath->Buffer == NULL) {
165 return FALSE;
166 }
167 return TRUE;
168}
169
170VOID
173 _In_ ULONG ActualFunctionCount,
174 _In_ ULONG ExpectedFunctionCount
175 )
176{
177 WCHAR insertString[EVTLOG_DDI_COUNT_ERROR_MAX_LEN] = { 0 };
179
180 //
181 // NOTE: Any single call to DbgPrintEx will only transmit 512 bytes of
182 // information.
183 //
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"
189 );
190
192 "* Service name : %wZ\n"
193 "* Actual function table count : %d \n"
194 "* Expected function table count: %d \n"
195 "*************************** \n\n",
197 ActualFunctionCount,
198 ExpectedFunctionCount
199 );
200
201 //
202 // Report a warning level ETW event to the system event log. "Wdf01000" is
203 // the listed event provider.
204 //
205 status = RtlStringCchPrintfW(insertString,
206 RTL_NUMBER_OF(insertString),
207 L"Service:%wZ Count:Actual %d Expected %d",
209 ActualFunctionCount,
210 ExpectedFunctionCount);
211 if (NT_SUCCESS(status)) {
215 insertString,
216 NULL,
217 0);
218 }
219
220 //
221 // Report a telemetry event that can be used to proactively fix drivers
222 //
223#ifndef __REACTOS__
224 TraceLoggingWrite(g_TelemetryProvider,
225 "KmdfClientFunctionCountMismatch",
227 TraceLoggingUnicodeString(ServiceName, "ServiceName"),
228 TraceLoggingUInt32(ActualFunctionCount, "FunctionCount"),
229 TraceLoggingUInt32(ExpectedFunctionCount, "ExpectedCount"));
230#endif
231}
232
235NTAPI
237 VOID
238 )
239{
240 DECLARE_CONST_UNICODE_STRING(usName, L"RtlGetVersion");
241 PFN_RTL_GET_VERSION pRtlGetVersion = NULL;
243
245
246 //
247 // Commission this version's DLL globals.
248 //
250
251 if (!NT_SUCCESS(status)) {
252 __Print(("FxLibraryGlobalsCommission failed %X\n", status));
253 return status;
254 }
255
256 //
257 // register telemetry provider.
258 //
259#ifndef __REACTOS__
261
262 //
263 // Initialize internal WPP tracing.
264 //
266 if (NT_SUCCESS(status)) {
268 }
269 else {
270 __Print(("Failed to initialize tracing for WDF\n"));
271
272 //
273 // Failure to initialize is not critical enough to fail driver load.
274 //
276 }
277#endif
278 //
279 // Attempt to load RtlGetVersion (works for > w2k).
280 //
282 (PUNICODE_STRING) &usName
283 );
284
285 //
286 // Now attempt to get this OS's version.
287 //
288 if (pRtlGetVersion != NULL) {
289 pRtlGetVersion(&gOsVersion);
290 }
291
292 __Print(("OsVersion(%d.%d)\n",
295
296 //
297 // Init triage info for 9f bugcheck analysis.
298 //
300
301 return STATUS_SUCCESS;
302}
303
306NTAPI
308 VOID
309 )
310{
312
313 //
314 // Uninitialize WPP tracing.
315 //
317 //TraceUninitialize(); __REACTOS__ : not compiled
319 }
320
321 //
322 // Unregister telemetry provider.
323 //
324 //UnregisterTelemetryProvider(); __REACTOS__ : not compiled
325
326#ifndef __REACTOS__
327 EventUnregisterMicrosoft_Windows_DriverFrameworks_KernelMode_Performance();
328#endif // __REACTOS__
329 //
330 // Decommission this version's DLL globals.
331 //
333
334 //
335 // Note: This is the absolute last action from WDF library (dynamic or static).
336 // The image is likely to be deleted after returning.
337 //
339
340 return STATUS_SUCCESS;
341}
342
345NTAPI
350 )
351{
354
356
358
359 if (Info == NULL || WdfDriverGlobals == NULL || Info->FuncTable == NULL) {
361 ": NULL parameter -- %s\n",
362 (Info == NULL) ? "PWDF_BIND_INFO" :
363 (WdfDriverGlobals == NULL) ? "PWDF_DRIVER_GLOBALS *" :
364 (Info->FuncTable == NULL) ? "PWDF_BIND_INFO->FuncTable" :
365 "unknown" ));
366 goto Done;
367 }
368
369 ASSERT(Info->FuncCount);
370
371
373
374 //
375 // WdfVersion.Count is initialized in FxDynamics.h and is never changed.
376 // Prefast is unable to make that determination.
377 //
378 __assume(WdfVersion.FuncCount == sizeof(WDFFUNCTIONS)/sizeof(PVOID));
379
380 if (Info->FuncCount > WdfVersion.FuncCount) {
382 ": version mismatch detected in function table count: client"
383 "has 0x%x, library has 0x%x\n",
384 Info->FuncCount, WdfVersion.FuncCount));
385 goto Done;
386 }
387
388 if (Info->FuncCount <= WdfFunctionTableNumEntries_V1_15) {
389 //
390 // Make sure table count matches exactly with previously
391 // released framework version table sizes.
392 //
393 switch (Info->FuncCount) {
394
399 // case WdfFunctionTableNumEntries_V1_7: // both 1.7 and 1.5 have 387 functions
403 break;
404
405 default:
407 ": Function table count 0x%x doesn't match any previously "
408 "released framework version table size\n",
409 Info->FuncCount));
410 goto Done;
411 }
412 }
413 else {
414
415
416
417
418
419
420
421
422 // Client version is same as framework version. Make
423 // sure table count is exact.
424 if (Info->FuncCount != WdfFunctionTableNumEntries) {
426
428 GetNameFromPath(ClientInfo->RegistryPath, &serviceName);
429 }
430 else {
432 }
433
434 //
435 // Report a DbgPrint message, telemetry event and an ETW event that
436 // will serve as diagnostic aid.
437 //
439 Info->FuncCount,
441
442 //
443 // If loader diagnostics are enabled and KD is connected, break-in
444 //
448 }
449 goto Done;
450 }
451 }
452
453 //
454 // Allocate an new FxDriverGlobals area for this driver.
455 //
457
458 if (*WdfDriverGlobals) {
459 BOOLEAN isFunctinTableHookingOn = FALSE;
460 BOOLEAN isPerformanceAnalysisOn = FALSE;
462
463 //
464 // Check the registry to see if Enhanced verifier is on for this driver.
465 // if registry read fails, options value remains unchanged.
466 // store enhanced verifier options in driver globals
467 //
470 isFunctinTableHookingOn = IsFxVerifierFunctionTableHooking(fxDriverGlobals);
471 isPerformanceAnalysisOn = IsFxPerformanceAnalysis(fxDriverGlobals);
472
473 //
474 // Set-up the function table. Enhanced verifier and Performance analysis is off by default.
475 //
476 if (isFunctinTableHookingOn == FALSE && isPerformanceAnalysisOn == FALSE) {
477
478 //
479 // Starting in 1.15 we reference a copy of the DDI table in WDF01000,
480 // prior to that we copy the entire table to local memory.
481 //
482 if (Info->FuncCount <= WdfFunctionTableNumEntries_V1_13) {
483 RtlCopyMemory( Info->FuncTable,
485 Info->FuncCount * sizeof(PVOID) );
486 }
487 else {
488 //
489 // FuncTable arrives with a ptr to &WdfFunctions, so we update
490 // what WdfFunctions points to.
491 //
492 *((WDFFUNC**) Info->FuncTable) = (WDFFUNC*) &WdfVersion.Functions;
493 }
494 }
495 else {
497 "Verifier functions table NOT IMPLEMENTED\n"));
498
500
502 ": Enhanced Verification is ON\n"));
503
504#ifndef __REACTOS__
506
507 if (Microsoft_Windows_DriverFrameworks_KernelMode_PerformanceHandle == NULL) {
508 EventRegisterMicrosoft_Windows_DriverFrameworks_KernelMode_Performance();
509 }
510
511 //
512 // Enhanced verification is on. Return verifier function table
513 //
514 // Starting in 1.15 we reference a copy of the DDI table in WDF01000,
515 // prior to that we copy the entire table to local memory.
516 //
517 if (Info->FuncCount <= WdfFunctionTableNumEntries_V1_13) {
518 RtlCopyMemory( Info->FuncTable,
519 &VfWdfVersion.Functions,
520 Info->FuncCount * sizeof(PVOID) );
521 }
522 else {
523 //
524 // FuncTable arrives with a ptr to &WdfFunctions, so we update
525 // what WdfFunctions points to.
526 //
527 *((WDFFUNC**) Info->FuncTable) = (WDFFUNC*) &VfWdfVersion.Functions;
528 }
529#endif // __REACTOS__
530 }
531
533
535 ": WdfFunctions %p\n", Info->FuncTable));
536 }
537
538Done:
540 ": exit: status %X\n", status));
541
542 return status;
543}
544
547NTAPI
551 )
552{
554
556
557 ASSERT(Info);
559
560 if (Info != NULL && WdfDriverGlobals != NULL) {
562
564
566
567 //
568 // Destroy this FxDriver instance, if its still indicated.
569 //
570 if (pFxDriverGlobals->Driver != NULL) {
571 //
572 // Association support, we are a root with no parent
573 //
575
577 }
578
579 //
580 // Stop IFR logging
581 //
583
584 //
585 // unlock enhanced-verifier image sections
586 //
589 }
590
591 //
592 // This will free the client's FxDriverGlobals area
593 //
595 }
596 else {
598 }
599
601 ": exit: status %X\n", status));
602
603 return status;
604}
605
606VOID
610 )
611{
613 ULONG value;
614 FxAutoRegKey hKey, hWdf;
615 DECLARE_CONST_UNICODE_STRING(parametersPath, L"Parameters\\Wdf");
617
618 *Options = 0;
620 Options == NULL) {
621
623 ": Invalid ClientInfo received from wdfldr \n"));
624 return;
625 }
626
627 status = FxRegKey::_OpenKey(NULL,
628 ClientInfo->RegistryPath,
629 &hWdf.m_Key,
630 KEY_READ);
631 if (!NT_SUCCESS(status)) {
632 return;
633 }
634
635 status = FxRegKey::_OpenKey(hWdf.m_Key,
636 &parametersPath,
637 &hKey.m_Key,
638 KEY_READ);
639 if (!NT_SUCCESS(status)) {
640 return;
641 }
642
643 status = FxRegKey::_QueryULong(
644 hKey.m_Key, &valueName, &value);
645
646 //
647 // Examine key values and set Options only on success.
648 //
649 if (NT_SUCCESS(status)) {
650 if (value) {
651 *Options = value;
652 }
653 }
654}
655
656VOID
660 __in NTSTATUS FinalStatus,
661 __in PWSTR ErrorInsertionString,
662 __in_bcount(RawDataLen) PVOID RawDataBuf,
663 __in USHORT RawDataLen
664 )
665/*++
666
667
668Routine Description:
669
670 Logs an error to the system event log.
671
672 Arguments:
673
674 DriverObject - Pointer to driver object reporting the error.
675
676 ErrorCode - Indicates the type of error, system or driver-defined.
677
678 ErrorInsertionString - Null-terminated Unicode string inserted into error
679 description, as defined by error code.
680
681Return Value:
682
683None.
684
685--*/
686{
687 PIO_ERROR_LOG_PACKET errorLogEntry;
688 size_t errorLogEntrySize; // [including null]
689 size_t errorInsertionStringByteSize = 0;
690
691 if (ErrorInsertionString) {
692 errorInsertionStringByteSize = wcslen(ErrorInsertionString) * sizeof(WCHAR);
693 errorInsertionStringByteSize += sizeof(UNICODE_NULL);
694 }
695
696 errorLogEntrySize = sizeof(IO_ERROR_LOG_PACKET) + RawDataLen + errorInsertionStringByteSize;
697
698 //
699 // Log an error.
700 //
701 //
702 // prefast complains about comparison of constant with constant here
703 //
704#pragma prefast(suppress:__WARNING_CONST_CONST_COMP, "If ErrorInsertionString is not null then this is not a constant")
705 if (errorLogEntrySize <= ERROR_LOG_MAXIMUM_SIZE) {
706
708 (UCHAR)errorLogEntrySize);
709
710 if (errorLogEntry != NULL) {
711
712 RtlZeroMemory(errorLogEntry, errorLogEntrySize);
713
714 errorLogEntry->ErrorCode = ErrorCode;
715 errorLogEntry->FinalStatus = FinalStatus;
716 errorLogEntry->NumberOfStrings = (ErrorInsertionString) ? 1 : 0;
717 errorLogEntry->DumpDataSize = RawDataLen;
718 errorLogEntry->StringOffset = (FIELD_OFFSET(IO_ERROR_LOG_PACKET, DumpData)) + errorLogEntry->DumpDataSize;
719
720 //
721 // Insertion strings follow dumpdata and since there is no dumpdata we place the
722 // insertion string at the start offset of the dumpdata.
723 //
724 if (RawDataBuf) {
725 RtlCopyMemory(errorLogEntry->DumpData,
726 RawDataBuf,
727 RawDataLen);
728 }
729
730 if (ErrorInsertionString) {
731 RtlCopyMemory(((PCHAR)errorLogEntry->DumpData) + RawDataLen,
732 ErrorInsertionString,
733 errorInsertionStringByteSize);
734 }
735
736 IoWriteErrorLogEntry(errorLogEntry);
737 }
738 }
739
740 return;
741}
unsigned char BOOLEAN
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define DPFLTR_ERROR_LEVEL
Definition: main.cpp:32
LONG NTSTATUS
Definition: precomp.h:26
static WCHAR ServiceName[]
Definition: browser.c:20
virtual VOID DeleteObject(VOID)
Definition: fxdriver.hpp:332
Definition: fxirp.hpp:28
#define __in
Definition: dbghelp.h:35
#define __in_bcount(x)
Definition: dbghelp.h:41
#define __deref_out
Definition: dbghelp.h:26
#define __inout
Definition: dbghelp.h:50
#define __in_opt
Definition: dbghelp.h:38
#define __out
Definition: dbghelp.h:62
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
@ DPFLTR_DEFAULT_ID
Definition: dpfilter.h:129
#define L(x)
Definition: resources.c:13
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T ContextSize
Definition: fltkernel.h:1444
PFX_DRIVER_GLOBALS pFxDriverGlobals
PFX_DRIVER_GLOBALS fxDriverGlobals
FxAutoRegKey hKey
VOID FxLibraryGlobalsDecommission(VOID)
Definition: globals.cpp:742
_Must_inspect_result_ NTSTATUS FxLibraryGlobalsCommission(VOID)
Definition: globals.cpp:494
VOID LockVerifierSection(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ PCUNICODE_STRING RegistryPath)
Definition: globals.cpp:783
VOID UnlockVerifierSection(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: globals.cpp:827
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
VOID FxDestroy(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: globals.cpp:981
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
#define FX_IRP_QUEUE_CSQ_CONTEXT_ENTRY
Definition: fxirpqueue.hpp:47
#define WDF_LIBRARY_COMMISSION
Definition: fxldr.h:110
#define WDF_LIBRARY_UNREGISTER_CLIENT
Definition: fxldr.h:113
#define WDF_LIBRARY_DECOMMISSION
Definition: fxldr.h:111
#define WDF_LIBRARY_REGISTER_CLIENT
Definition: fxldr.h:112
VOID FxFreeDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: globals.cpp:1179
_Must_inspect_result_ PWDF_DRIVER_GLOBALS FxAllocateDriverGlobals(VOID)
Definition: globals.cpp:1052
VOID RegisterTelemetryProvider(VOID)
VOID GetNameFromPath(_In_ PCUNICODE_STRING Path, _Out_ PUNICODE_STRING Name)
Definition: fxtelemetry.cpp:54
#define WDF_TELEMETRY_EVT_KEYWORDS
__inline BOOLEAN IsFxPerformanceAnalysis(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: fxverifier.h:250
__inline BOOLEAN IsFxVerifierFunctionTableHooking(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: fxverifier.h:127
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
CLIENT_DATA ClientInfo
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define DbgPrintEx(cmpid, lvl, fmt,...)
Definition: kdinit.c:24
NTSTATUS(NTAPI * PFN_RTL_GET_VERSION)(__out PRTL_OSVERSIONINFOW VersionInformation)
WDFVERSION WdfVersion
#define __Print(_x_)
#define WDF_ENHANCED_VERIFIER_OPTIONS_VALUE_NAME
#define LITERAL(a)
ULONG WdfLdrDbgPrintOn
Definition: version.cpp:113
RTL_OSVERSIONINFOW gOsVersion
Definition: version.cpp:111
_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
VOID GetTriageInfo(VOID)
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
if(dx< 0)
Definition: linetemp.h:194
#define __assume(x)
Definition: intrin.h:108
#define ASSERT(a)
Definition: mode.c:44
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define _Must_inspect_result_
Definition: no_sal2.h:62
#define _In_
Definition: no_sal2.h:158
#define KEY_READ
Definition: nt_native.h:1026
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define UNICODE_NULL
VOID NTAPI IoWriteErrorLogEntry(IN PVOID ElEntry)
Definition: error.c:628
PVOID NTAPI IoAllocateErrorLogEntry(IN PVOID IoObject, IN UCHAR EntrySize)
Definition: error.c:528
NTSTRSAFEVAPI RtlStringCchPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
Definition: ntstrsafe.h:1110
unsigned short USHORT
Definition: pedump.c:61
#define WDF_TRIAGE_INFO
#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
#define STATUS_SUCCESS
Definition: shellext.h:65
PDRIVER_OBJECT DriverObject
Definition: fxglobals.h:719
BOOLEAN InternalTracingInitialized
Definition: fxglobals.h:804
FxDriver * Driver
Definition: fxglobals.h:374
ULONG FxEnhancedVerifierOptions
Definition: fxglobals.h:518
NTSTATUS ErrorCode
Definition: iotypes.h:2007
USHORT NumberOfStrings
Definition: iotypes.h:2004
NTSTATUS FinalStatus
Definition: iotypes.h:2009
ULONG dwMinorVersion
Definition: rtltypes.h:248
ULONG dwMajorVersion
Definition: rtltypes.h:247
ULONG FuncCount
Definition: fxdynamics.h:478
WDFFUNCTIONS Functions
Definition: fxdynamics.h:479
Definition: ps.c:97
PVOID NTAPI MmGetSystemRoutineAddress(IN PUNICODE_STRING SystemRoutineName)
Definition: sysldr.c:3615
char serviceName[]
Definition: tftpd.cpp:34
VOID FxIFRStop(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: tracing.cpp:299
_Must_inspect_result_ NTSTATUS FxTraceInitialize(VOID)
Definition: tracing.cpp:47
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Definition: pdh_main.c:96
@ WdfFunctionTableNumEntries_V1_0
Definition: wdf10.h:9
@ WdfFunctionTableNumEntries_V1_11
Definition: wdf111.h:6
@ WdfFunctionTableNumEntries_V1_13
Definition: wdf113.h:6
@ WdfFunctionTableNumEntries_V1_15
Definition: wdf115.h:6
@ WdfFunctionTableNumEntries_V1_1
Definition: wdf11.h:9
@ WdfFunctionTableNumEntries_V1_5
Definition: wdf15.h:9
@ WdfFunctionTableNumEntries_V1_9
Definition: wdf19.h:9
VOID(NTAPI * WDFFUNC)(VOID)
Definition: wdf.h:68
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
#define DECLARE_CONST_UNICODE_STRING(_variablename, _string)
Definition: wdfcore.h:161
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3540
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
PWDF_DRIVER_GLOBALS WdfDriverGlobals
@ WdfFunctionTableNumEntries
Definition: wdffuncenum.h:469
struct _WDF_OBJECT_CONTEXT_TYPE_INFO WDF_OBJECT_CONTEXT_TYPE_INFO
#define ERROR_LOG_MAXIMUM_SIZE
Definition: iotypes.h:2042
struct _IO_ERROR_LOG_PACKET * PIO_ERROR_LOG_PACKET
struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET
#define KD_DEBUGGER_ENABLED
Definition: kdfuncs.h:130
#define KD_DEBUGGER_NOT_PRESENT
Definition: kdfuncs.h:133
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180