ReactOS  0.4.15-dev-3165-gdf6fff7
fxlibrarycommon.h File Reference

Go to the source code of this file.

Macros

#define _LIT_(a)   # a
 
#define LITERAL(a)   _LIT_(a)
 
#define __PrintUnfiltered(...)   DbgPrintEx(DPFLTR_DEFAULT_ID, DPFLTR_ERROR_LEVEL, __VA_ARGS__);
 
#define __Print(_x_)
 
#define WDF_ENHANCED_VERIFIER_OPTIONS_VALUE_NAME   L"EnhancedVerifierOptions"
 

Typedefs

typedef NTSTATUS(* PFN_RTL_GET_VERSION) (__out PRTL_OSVERSIONINFOW VersionInformation)
 

Functions

_Must_inspect_result_ NTSTATUS FxLibraryCommonCommission (VOID)
 
_Must_inspect_result_ NTSTATUS FxLibraryCommonDecommission (VOID)
 
_Must_inspect_result_ NTSTATUS FxLibraryCommonRegisterClient (__inout PWDF_BIND_INFO Info, __deref_out PWDF_DRIVER_GLOBALS *WdfDriverGlobals, __in_opt PCLIENT_INFO ClientInfo)
 
_Must_inspect_result_ NTSTATUS FxLibraryCommonUnregisterClient (__in PWDF_BIND_INFO Info, __in PWDF_DRIVER_GLOBALS WdfDriverGlobals)
 
VOID GetEnhancedVerifierOptions (__in PCLIENT_INFO ClientInfo, __out PULONG Options)
 
VOID LibraryLogEvent (__in PDRIVER_OBJECT DriverObject, __in NTSTATUS ErrorCode, __in NTSTATUS FinalStatus, __in PWSTR ErrorInsertionString, __in_bcount(RawDataLen) PVOID RawDataBuf, __in USHORT RawDataLen)
 

Variables

ULONG WdfLdrDbgPrintOn
 
PCHAR WdfLdrType
 
WDFVERSION WdfVersion
 
RTL_OSVERSIONINFOW gOsVersion
 

Macro Definition Documentation

◆ __Print

#define __Print (   _x_)
Value:
{ \
__PrintUnfiltered _x_ \
} \
}
#define DPFLTR_ERROR_LEVEL
Definition: main.cpp:32
PCHAR WdfLdrType
Definition: version.cpp:108
ULONG WdfLdrDbgPrintOn
Definition: version.cpp:106

Definition at line 24 of file fxlibrarycommon.h.

◆ __PrintUnfiltered

#define __PrintUnfiltered (   ...)    DbgPrintEx(DPFLTR_DEFAULT_ID, DPFLTR_ERROR_LEVEL, __VA_ARGS__);

Definition at line 21 of file fxlibrarycommon.h.

◆ _LIT_

#define _LIT_ (   a)    # a

Definition at line 18 of file fxlibrarycommon.h.

◆ LITERAL

#define LITERAL (   a)    _LIT_(a)

Definition at line 19 of file fxlibrarycommon.h.

◆ WDF_ENHANCED_VERIFIER_OPTIONS_VALUE_NAME

#define WDF_ENHANCED_VERIFIER_OPTIONS_VALUE_NAME   L"EnhancedVerifierOptions"

Definition at line 32 of file fxlibrarycommon.h.

Typedef Documentation

◆ PFN_RTL_GET_VERSION

typedef NTSTATUS(* PFN_RTL_GET_VERSION) (__out PRTL_OSVERSIONINFOW VersionInformation)

Definition at line 36 of file fxlibrarycommon.h.

Function Documentation

◆ FxLibraryCommonCommission()

_Must_inspect_result_ NTSTATUS FxLibraryCommonCommission ( VOID  )

Definition at line 224 of file fxlibrarycommon.cpp.

227 {
228  DECLARE_CONST_UNICODE_STRING(usName, L"RtlGetVersion");
229  PFN_RTL_GET_VERSION pRtlGetVersion = NULL;
231 
233 
234  //
235  // Commission this version's DLL globals.
236  //
238 
239  if (!NT_SUCCESS(status)) {
240  __Print(("FxLibraryGlobalsCommission failed %X\n", status));
241  return status;
242  }
243 
244  //
245  // register telemetry provider.
246  //
248 
249  //
250  // Initialize internal WPP tracing.
251  //
253  if (NT_SUCCESS(status)) {
255  }
256  else {
257  __Print(("Failed to initialize tracing for WDF\n"));
258 
259  //
260  // Failure to initialize is not critical enough to fail driver load.
261  //
263  }
264 
265  //
266  // Attempt to load RtlGetVersion (works for > w2k).
267  //
269  (PUNICODE_STRING) &usName
270  );
271 
272  //
273  // Now attempt to get this OS's version.
274  //
275  if (pRtlGetVersion != NULL) {
276  pRtlGetVersion(&gOsVersion);
277  }
278 
279  __Print(("OsVersion(%d.%d)\n",
282 
283  //
284  // Init triage info for 9f bugcheck analysis.
285  //
286  GetTriageInfo();
287 
288  return STATUS_SUCCESS;
289 }
NTSTATUS(* PFN_RTL_GET_VERSION)(__out PRTL_OSVERSIONINFOW VersionInformation)
RTL_OSVERSIONINFOW gOsVersion
Definition: version.cpp:104
BOOLEAN InternalTracingInitialized
Definition: fxglobals.h:804
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
VOID GetTriageInfo(VOID)
PVOID NTAPI MmGetSystemRoutineAddress(IN PUNICODE_STRING SystemRoutineName)
Definition: sysldr.c:3514
#define WDF_LIBRARY_COMMISSION
Definition: fxldr.h:110
#define LITERAL(a)
ULONG dwMajorVersion
Definition: rtltypes.h:247
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define DECLARE_CONST_UNICODE_STRING(_variablename, _string)
Definition: wdfcore.h:161
static const WCHAR L[]
Definition: oid.c:1250
_Must_inspect_result_ NTSTATUS FxTraceInitialize(VOID)
Definition: tracing.cpp:47
_Must_inspect_result_ NTSTATUS FxLibraryGlobalsCommission(VOID)
Definition: globals.cpp:494
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
#define NULL
Definition: types.h:112
ULONG dwMinorVersion
Definition: rtltypes.h:248
#define STATUS_SUCCESS
Definition: shellext.h:65
static SERVICE_STATUS status
Definition: service.c:31
VOID RegisterTelemetryProvider(VOID)
#define __Print(_x_)
Definition: ps.c:97

Referenced by WDF_LIBRARY_COMMISSION().

◆ FxLibraryCommonDecommission()

_Must_inspect_result_ NTSTATUS FxLibraryCommonDecommission ( VOID  )

Definition at line 293 of file fxlibrarycommon.cpp.

296 {
297  __Print((LITERAL(WDF_LIBRARY_DECOMMISSION) ": enter\n"));
298 
299  //
300  // Uninitialize WPP tracing.
301  //
305  }
306 
307  //
308  // Unregister telemetry provider.
309  //
311 
312  EventUnregisterMicrosoft_Windows_DriverFrameworks_KernelMode_Performance();
313 
314  //
315  // Decommission this version's DLL globals.
316  //
318 
319  //
320  // Note: This is the absolute last action from WDF library (dynamic or static).
321  // The image is likely to be deleted after returning.
322  //
324 
325  return STATUS_SUCCESS;
326 }
BOOLEAN InternalTracingInitialized
Definition: fxglobals.h:804
VOID FxLibraryGlobalsDecommission(VOID)
Definition: globals.cpp:742
#define FALSE
Definition: types.h:117
#define LITERAL(a)
#define WDF_LIBRARY_DECOMMISSION
Definition: fxldr.h:111
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
VOID UnregisterTelemetryProvider(VOID)
VOID TraceUninitialize(VOID)
Definition: tracing.cpp:79
#define STATUS_SUCCESS
Definition: shellext.h:65
#define __Print(_x_)

Referenced by WDF_LIBRARY_DECOMMISSION().

◆ FxLibraryCommonRegisterClient()

_Must_inspect_result_ NTSTATUS FxLibraryCommonRegisterClient ( __inout PWDF_BIND_INFO  Info,
__deref_out PWDF_DRIVER_GLOBALS WdfDriverGlobals,
__in_opt PCLIENT_INFO  ClientInfo 
)

Definition at line 330 of file fxlibrarycommon.cpp.

335 {
337  UNICODE_STRING serviceName = { 0 };
338 
340 
342 
343  if (Info == NULL || WdfDriverGlobals == NULL || Info->FuncTable == NULL) {
345  ": NULL parameter -- %s\n",
346  (Info == NULL) ? "PWDF_BIND_INFO" :
347  (WdfDriverGlobals == NULL) ? "PWDF_DRIVER_GLOBALS *" :
348  (Info->FuncTable == NULL) ? "PWDF_BIND_INFO->FuncTable" :
349  "unknown" ));
350  goto Done;
351  }
352 
353  ASSERT(Info->FuncCount);
354 
355 
357 
358  //
359  // WdfVersion.Count is initialized in FxDynamics.h and is never changed.
360  // Prefast is unable to make that determination.
361  //
362  __assume(WdfVersion.FuncCount == sizeof(WDFFUNCTIONS)/sizeof(PVOID));
363 
364  if (Info->FuncCount > WdfVersion.FuncCount) {
366  ": version mismatch detected in function table count: client"
367  "has 0x%x, library has 0x%x\n",
368  Info->FuncCount, WdfVersion.FuncCount));
369  goto Done;
370  }
371 
372  if (Info->FuncCount <= WdfFunctionTableNumEntries_V1_15) {
373  //
374  // Make sure table count matches exactly with previously
375  // released framework version table sizes.
376  //
377  switch (Info->FuncCount) {
378 
383  // case WdfFunctionTableNumEntries_V1_7: // both 1.7 and 1.5 have 387 functions
387  break;
388 
389  default:
391  ": Function table count 0x%x doesn't match any previously "
392  "released framework version table size\n",
393  Info->FuncCount));
394  goto Done;
395  }
396  }
397  else {
398 
399 
400 
401 
402 
403 
404 
405 
406  // Client version is same as framework version. Make
407  // sure table count is exact.
408  if (Info->FuncCount != WdfFunctionTableNumEntries) {
410 
412  GetNameFromPath(ClientInfo->RegistryPath, &serviceName);
413  }
414  else {
415  RtlInitUnicodeString(&serviceName, L"Unknown");
416  }
417 
418  //
419  // Report a DbgPrint message, telemetry event and an ETW event that
420  // will serve as diagnostic aid.
421  //
423  Info->FuncCount,
425 
426  //
427  // If loader diagnostics are enabled and KD is connected, break-in
428  //
431  DbgBreakPoint();
432  }
433  goto Done;
434  }
435  }
436 
437  //
438  // Allocate an new FxDriverGlobals area for this driver.
439  //
441 
442  if (*WdfDriverGlobals) {
443  BOOLEAN isFunctinTableHookingOn = FALSE;
444  BOOLEAN isPerformanceAnalysisOn = FALSE;
446 
447  //
448  // Check the registry to see if Enhanced verifier is on for this driver.
449  // if registry read fails, options value remains unchanged.
450  // store enhanced verifier options in driver globals
451  //
454  isFunctinTableHookingOn = IsFxVerifierFunctionTableHooking(fxDriverGlobals);
455  isPerformanceAnalysisOn = IsFxPerformanceAnalysis(fxDriverGlobals);
456 
457  //
458  // Set-up the function table. Enhanced verifier and Performance analysis is off by default.
459  //
460  if (isFunctinTableHookingOn == FALSE && isPerformanceAnalysisOn == FALSE) {
461 
462  //
463  // Starting in 1.15 we reference a copy of the DDI table in WDF01000,
464  // prior to that we copy the entire table to local memory.
465  //
466  if (Info->FuncCount <= WdfFunctionTableNumEntries_V1_13) {
467  RtlCopyMemory( Info->FuncTable,
469  Info->FuncCount * sizeof(PVOID) );
470  }
471  else {
472  //
473  // FuncTable arrives with a ptr to &WdfFunctions, so we update
474  // what WdfFunctions points to.
475  //
476  *((WDFFUNC**) Info->FuncTable) = (WDFFUNC*) &WdfVersion.Functions;
477  }
478  }
479  else {
481  ": Enhanced Verification is ON \n"));
482 
484 
485  if (Microsoft_Windows_DriverFrameworks_KernelMode_PerformanceHandle == NULL) {
486  EventRegisterMicrosoft_Windows_DriverFrameworks_KernelMode_Performance();
487  }
488 
489  //
490  // Enhanced verification is on. Return verifier function table
491  //
492  // Starting in 1.15 we reference a copy of the DDI table in WDF01000,
493  // prior to that we copy the entire table to local memory.
494  //
495  if (Info->FuncCount <= WdfFunctionTableNumEntries_V1_13) {
496  RtlCopyMemory( Info->FuncTable,
497  &VfWdfVersion.Functions,
498  Info->FuncCount * sizeof(PVOID) );
499  }
500  else {
501  //
502  // FuncTable arrives with a ptr to &WdfFunctions, so we update
503  // what WdfFunctions points to.
504  //
505  *((WDFFUNC**) Info->FuncTable) = (WDFFUNC*) &VfWdfVersion.Functions;
506  }
507  }
508 
510 
512  ": WdfFunctions %p\n", Info->FuncTable));
513  }
514 
515 Done:
517  ": exit: status %X\n", status));
518 
519  return status;
520 }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
struct _WDFFUNCTIONS WDFFUNCTIONS
LONG NTSTATUS
Definition: precomp.h:26
#define KD_DEBUGGER_NOT_PRESENT
Definition: kdfuncs.h:133
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
CLIENT_DATA ClientInfo
WDFFUNCTIONS Functions
Definition: fxdynamics.h:594
#define FALSE
Definition: types.h:117
VOID NTAPI DbgBreakPoint(VOID)
ULONG FxEnhancedVerifierOptions
Definition: fxglobals.h:518
unsigned char BOOLEAN
VOID GetEnhancedVerifierOptions(__in PCLIENT_INFO ClientInfo, __out PULONG Options)
__inline BOOLEAN IsFxVerifierFunctionTableHooking(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: fxverifier.h:127
#define LITERAL(a)
char serviceName[]
Definition: tftpd.cpp:34
VOID(* WDFFUNC)(VOID)
Definition: wdf.h:68
PWDF_DRIVER_GLOBALS WdfDriverGlobals
#define ASSERT(a)
Definition: mode.c:44
BOOLEAN IsClientInfoValid(_In_ PCLIENT_INFO ClientInfo)
#define KD_DEBUGGER_ENABLED
Definition: kdfuncs.h:130
static const WCHAR L[]
Definition: oid.c:1250
_Must_inspect_result_ PWDF_DRIVER_GLOBALS FxAllocateDriverGlobals(VOID)
Definition: globals.cpp:1052
VOID LockVerifierSection(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ PCUNICODE_STRING RegistryPath)
Definition: globals.cpp:783
PFX_DRIVER_GLOBALS fxDriverGlobals
#define NULL
Definition: types.h:112
VOID ReportDdiFunctionCountMismatch(_In_ PCUNICODE_STRING ServiceName, _In_ ULONG ActualFunctionCount, _In_ ULONG ExpectedFunctionCount)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_SUCCESS
Definition: shellext.h:65
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
ULONG WdfLdrDbgPrintOn
Definition: version.cpp:106
static SERVICE_STATUS status
Definition: service.c:31
WDFVERSION WdfVersion
ULONG FuncCount
Definition: fxdynamics.h:593
VOID GetNameFromPath(_In_ PCUNICODE_STRING Path, _Out_ PUNICODE_STRING Name)
Definition: fxtelemetry.cpp:54
#define WDF_LIBRARY_REGISTER_CLIENT
Definition: fxldr.h:112
#define __Print(_x_)
__inline BOOLEAN IsFxPerformanceAnalysis(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: fxverifier.h:250
Definition: ps.c:97

Referenced by WDF_LIBRARY_REGISTER_CLIENT().

◆ FxLibraryCommonUnregisterClient()

_Must_inspect_result_ NTSTATUS FxLibraryCommonUnregisterClient ( __in PWDF_BIND_INFO  Info,
__in PWDF_DRIVER_GLOBALS  WdfDriverGlobals 
)

Definition at line 524 of file fxlibrarycommon.cpp.

528 {
530 
532 
533  ASSERT(Info);
535 
536  if (Info != NULL && WdfDriverGlobals != NULL) {
538 
540 
542 
543  //
544  // Destroy this FxDriver instance, if its still indicated.
545  //
546  if (pFxDriverGlobals->Driver != NULL) {
547  //
548  // Association support, we are a root with no parent
549  //
551 
553  }
554 
555  //
556  // Stop IFR logging
557  //
559 
560  //
561  // unlock enhanced-verifier image sections
562  //
565  }
566 
567  //
568  // This will free the client's FxDriverGlobals area
569  //
571  }
572  else {
574  }
575 
577  ": exit: status %X\n", status));
578 
579  return status;
580 }
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
#define WDF_LIBRARY_UNREGISTER_CLIENT
Definition: fxldr.h:113
VOID FxFreeDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: globals.cpp:1181
FxDriver * Driver
Definition: fxglobals.h:374
__inline BOOLEAN IsFxVerifierFunctionTableHooking(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: fxverifier.h:127
#define LITERAL(a)
PWDF_DRIVER_GLOBALS WdfDriverGlobals
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define ASSERT(a)
Definition: mode.c:44
virtual VOID DeleteObject(VOID)
Definition: fxdriver.hpp:332
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
VOID FxIFRStop(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: tracing.cpp:297
VOID FxDestroy(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: globals.cpp:981
#define NULL
Definition: types.h:112
#define STATUS_SUCCESS
Definition: shellext.h:65
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
VOID UnlockVerifierSection(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: globals.cpp:827
static SERVICE_STATUS status
Definition: service.c:31
#define __Print(_x_)
Definition: ps.c:97

Referenced by WDF_LIBRARY_UNREGISTER_CLIENT().

◆ GetEnhancedVerifierOptions()

VOID GetEnhancedVerifierOptions ( __in PCLIENT_INFO  ClientInfo,
__out PULONG  Options 
)

Definition at line 583 of file fxlibrarycommon.cpp.

587 {
589  ULONG value;
590  FxAutoRegKey hKey, hWdf;
591  DECLARE_CONST_UNICODE_STRING(parametersPath, L"Parameters\\Wdf");
593 
594  *Options = 0;
596  Options == NULL) {
597 
599  ": Invalid ClientInfo received from wdfldr \n"));
600  return;
601  }
602 
603  status = FxRegKey::_OpenKey(NULL,
604  ClientInfo->RegistryPath,
605  &hWdf.m_Key,
606  KEY_READ);
607  if (!NT_SUCCESS(status)) {
608  return;
609  }
610 
611  status = FxRegKey::_OpenKey(hWdf.m_Key,
612  &parametersPath,
613  &hKey.m_Key,
614  KEY_READ);
615  if (!NT_SUCCESS(status)) {
616  return;
617  }
618 
619  status = FxRegKey::_QueryULong(
620  hKey.m_Key, &valueName, &value);
621 
622  //
623  // Examine key values and set Options only on success.
624  //
625  if (NT_SUCCESS(status)) {
626  if (value) {
627  *Options = value;
628  }
629  }
630 }
Definition: pdh_main.c:93
#define KEY_READ
Definition: nt_native.h:1023
LONG NTSTATUS
Definition: precomp.h:26
CLIENT_DATA ClientInfo
#define LITERAL(a)
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3531
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
BOOLEAN IsClientInfoValid(_In_ PCLIENT_INFO ClientInfo)
#define DECLARE_CONST_UNICODE_STRING(_variablename, _string)
Definition: wdfcore.h:161
static const WCHAR L[]
Definition: oid.c:1250
GLsizei const GLfloat * value
Definition: glext.h:6069
FxAutoRegKey hKey
#define WDF_ENHANCED_VERIFIER_OPTIONS_VALUE_NAME
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
static SERVICE_STATUS status
Definition: service.c:31
#define WDF_LIBRARY_REGISTER_CLIENT
Definition: fxldr.h:112
#define __Print(_x_)
Definition: ps.c:97

Referenced by FxLibraryCommonRegisterClient().

◆ LibraryLogEvent()

VOID LibraryLogEvent ( __in PDRIVER_OBJECT  DriverObject,
__in NTSTATUS  ErrorCode,
__in NTSTATUS  FinalStatus,
__in PWSTR  ErrorInsertionString,
__in_bcount(RawDataLen) PVOID  RawDataBuf,
__in USHORT  RawDataLen 
)

Definition at line 633 of file fxlibrarycommon.cpp.

662 {
663  PIO_ERROR_LOG_PACKET errorLogEntry;
664  size_t errorLogEntrySize; // [including null]
665  size_t errorInsertionStringByteSize = 0;
666 
667  if (ErrorInsertionString) {
668  errorInsertionStringByteSize = wcslen(ErrorInsertionString) * sizeof(WCHAR);
669  errorInsertionStringByteSize += sizeof(UNICODE_NULL);
670  }
671 
672  errorLogEntrySize = sizeof(IO_ERROR_LOG_PACKET) + RawDataLen + errorInsertionStringByteSize;
673 
674  //
675  // Log an error.
676  //
677  //
678  // prefast complains about comparison of constant with constant here
679  //
680 #pragma prefast(suppress:__WARNING_CONST_CONST_COMP, "If ErrorInsertionString is not null then this is not a constant")
681  if (errorLogEntrySize <= ERROR_LOG_MAXIMUM_SIZE) {
682 
684  (UCHAR)errorLogEntrySize);
685 
686  if (errorLogEntry != NULL) {
687 
688  RtlZeroMemory(errorLogEntry, errorLogEntrySize);
689 
690  errorLogEntry->ErrorCode = ErrorCode;
691  errorLogEntry->FinalStatus = FinalStatus;
692  errorLogEntry->NumberOfStrings = (ErrorInsertionString) ? 1 : 0;
693  errorLogEntry->DumpDataSize = RawDataLen;
694  errorLogEntry->StringOffset = (FIELD_OFFSET(IO_ERROR_LOG_PACKET, DumpData)) + errorLogEntry->DumpDataSize;
695 
696  //
697  // Insertion strings follow dumpdata and since there is no dumpdata we place the
698  // insertion string at the start offset of the dumpdata.
699  //
700  if (RawDataBuf) {
701  RtlCopyMemory(errorLogEntry->DumpData,
702  RawDataBuf,
703  RawDataLen);
704  }
705 
706  if (ErrorInsertionString) {
707  RtlCopyMemory(((PCHAR)errorLogEntry->DumpData) + RawDataLen,
708  ErrorInsertionString,
709  errorInsertionStringByteSize);
710  }
711 
712  IoWriteErrorLogEntry(errorLogEntry);
713  }
714  }
715 
716  return;
717 }
signed char * PCHAR
Definition: retypes.h:7
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
NTSTATUS FinalStatus
Definition: iotypes.h:2009
if(dx==0 &&dy==0)
Definition: linetemp.h:174
VOID NTAPI IoWriteErrorLogEntry(IN PVOID ElEntry)
Definition: error.c:628
NTSTATUS ErrorCode
Definition: iotypes.h:2007
#define UNICODE_NULL
struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET
#define ERROR_LOG_MAXIMUM_SIZE
Definition: iotypes.h:2042
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
PVOID NTAPI IoAllocateErrorLogEntry(IN PVOID IoObject, IN UCHAR EntrySize)
Definition: error.c:528
USHORT NumberOfStrings
Definition: iotypes.h:2004
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char UCHAR
Definition: xmlstorage.h:181
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
struct _IO_ERROR_LOG_PACKET * PIO_ERROR_LOG_PACKET
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263

Referenced by ReportDdiFunctionCountMismatch(), and WDF_LIBRARY_REGISTER_CLIENT().

Variable Documentation

◆ gOsVersion

RTL_OSVERSIONINFOW gOsVersion

Definition at line 104 of file version.cpp.

Referenced by FxLibraryCommonCommission().

◆ WdfLdrDbgPrintOn

ULONG WdfLdrDbgPrintOn

Definition at line 106 of file version.cpp.

Referenced by FxLibraryCommonRegisterClient().

◆ WdfLdrType

PCHAR WdfLdrType

Definition at line 108 of file version.cpp.

Referenced by FxInitializeBugCheckDriverInfo().

◆ WdfVersion