ReactOS  0.4.15-dev-2972-gda2a567
fxifrkm.h
Go to the documentation of this file.
1 //
2 // Copyright (C) Microsoft. All rights reserved.
3 //
4 #ifndef __FXIFRKM_H__
5 #define __FXIFRKM_H__
6 
7 #define FX_IFR_MAX_BUFFER_SIZE (0x10000) // 64k
8 
9 #if (PAGE_SIZE > 0x1000)
10 #define FX_IFR_AVG_BUFFER_SIZE (3 * PAGE_SIZE) // ia64
11 #else
12 #define FX_IFR_AVG_BUFFER_SIZE (5 * PAGE_SIZE) // x86, amd64
13 #endif
14 
15 //
16 // Log Size should be in whole pages.
17 //
22 
26 
28 
30 };
31 
32 //
33 // Verify the following:
34 // - max_log_size must be <= 64k.
35 // - min_log_size must be >= page_size.
36 // - max_log_size >= avg_log_size >= min_log_size.
37 // - max_log_pages >= avg_log_pages >= min_log_pages.
38 //
39 C_ASSERT(FxIFRMaxLogSize <= 0x10000);
45 
46 
47 __inline
48 VOID
50  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
52  )
53 /*++
54 
55 Routine Description:
56  This routine is added to track the down IFR header corruption
57 
58 
59 
60 --*/
61 {
63 
64  if (FxDriverGlobals->FxVerifierOn
65  &&
66  (strncmp(Header->DriverName, FxDriverGlobals->Public.DriverName,
68  ||
69  FxIsEqualGuid((LPGUID)&(Header->Guid), (LPGUID)&WdfTraceGuid) == FALSE
70  ||
71  Header->Base != (PUCHAR) &Header[1]
72  ||
73  Header->Offset.u.s.Current > Header->Size
74  ||
75  Header->Offset.u.s.Previous > Header->Size
76  ||
77  Header->Size >= FxIFRMaxLogSize)) // size doesn't include header.
78  {
79  FxVerifierDbgBreakPoint(FxDriverGlobals);
80  }
81 }
82 
83 #endif // __FXIFRKM_H__
WDFCASSERT(sizeof(WDF_DRIVER_CONFIG_V1_0)==sizeof(WDF_DRIVER_CONFIG_V1_1))
unsigned char * PUCHAR
Definition: retypes.h:3
FxIFRValues
Definition: fxifrkm.h:18
C_ASSERT(FxIFRMaxLogSize<=0x10000)
_Must_inspect_result_ BOOLEAN __inline FxIsEqualGuid(__in CONST GUID *Lhs, __in CONST GUID *Rhs)
Definition: fxglobals.h:977
#define FX_IFR_MAX_BUFFER_SIZE
Definition: fxifrkm.h:7
__inline VOID FxVerifyLogHeader(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_IFR_HEADER Header)
Definition: fxifrkm.h:49
#define FALSE
Definition: types.h:117
Definition: Header.h:8
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define WDF_IFR_HEADER_NAME_LEN
Definition: fxifr.h:42
#define WDF_IFR_RECORD_SIGNATURE
Definition: fxifr.h:109
#define FX_IFR_AVG_BUFFER_SIZE
Definition: fxifrkm.h:12
#define __in
Definition: dbghelp.h:35
#define WDF_DRIVER_GLOBALS_NAME_LEN
Definition: wdfglobals.h:51
FxVerifierDbgBreakPoint(pFxDriverGlobals)