ReactOS 0.4.15-dev-8145-ga541a46
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//
45
46
47__inline
48VOID
50 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
52 )
53/*++
54
55Routine 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__
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
Definition: Header.h:9
#define __in
Definition: dbghelp.h:35
#define FALSE
Definition: types.h:117
#define PAGE_SIZE
Definition: env_spec_w32.h:49
FxVerifierDbgBreakPoint(pFxDriverGlobals)
_Must_inspect_result_ BOOLEAN __inline FxIsEqualGuid(__in CONST GUID *Lhs, __in CONST GUID *Rhs)
Definition: fxglobals.h:977
#define WDF_IFR_RECORD_SIGNATURE
Definition: fxifr.h:109
#define WDF_IFR_HEADER_NAME_LEN
Definition: fxifr.h:42
#define FX_IFR_AVG_BUFFER_SIZE
Definition: fxifrkm.h:12
FxIFRValues
Definition: fxifrkm.h:18
@ FxIFRMaxLogSize
Definition: fxifrkm.h:24
@ FxIFRMaxLogPages
Definition: fxifrkm.h:20
@ FxIFRMinLogPages
Definition: fxifrkm.h:19
@ FxIFRMinLogSize
Definition: fxifrkm.h:23
@ FxIFRAvgLogPages
Definition: fxifrkm.h:21
@ FxIFRAvgLogSize
Definition: fxifrkm.h:25
@ FxIFRMaxMessageSize
Definition: fxifrkm.h:27
@ FxIFRRecordSignature
Definition: fxifrkm.h:29
#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 C_ASSERT(e)
Definition: intsafe.h:73
unsigned char * PUCHAR
Definition: typedefs.h:53
#define WDFCASSERT(c)
Definition: wdfassert.h:93
#define WDF_DRIVER_GLOBALS_NAME_LEN
Definition: wdfglobals.h:51