ReactOS 0.4.16-dev-91-g764881a
wdfassert.h
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation. All rights reserved.
4
5_WdfVersionBuild_
6
7Module Name:
8
9 WdfAssert.h
10
11Abstract:
12
13 Contains prototypes for dealing with run time asserts
14
15Author:
16
17Environment:
18
19 kernel mode only
20
21Revision History:
22
23--*/
24
25//
26// NOTE: This header is generated by stubwork. Please make any
27// modifications to the corresponding template files
28// (.x or .y) and use stubwork to regenerate the header
29//
30
31#ifndef _WDFASSERT_H_
32#define _WDFASSERT_H_
33
34#ifndef WDF_EXTERN_C
35 #ifdef __cplusplus
36 #define WDF_EXTERN_C extern "C"
37 #define WDF_EXTERN_C_START extern "C" {
38 #define WDF_EXTERN_C_END }
39 #else
40 #define WDF_EXTERN_C
41 #define WDF_EXTERN_C_START
42 #define WDF_EXTERN_C_END
43 #endif
44#endif
45
47
48
49
50
51#if (NTDDI_VERSION >= NTDDI_WIN2K)
52
53//
54// Including here because RtlAssert is not declared in XP and Win2K headers for
55// free builds
56//
58VOID
61 _In_ PVOID FailedAssertion,
65 );
66
67
68
69//
70// WDFVERIFY is active both on checked and free build only if
71// the wdf verifier is tuned on
72//
73#define WDFVERIFY(exp) { \
74 if ((WdfDriverGlobals->DriverFlags & WdfVerifyOn) && !(exp)) { \
75 RtlAssert( #exp, __FILE__, __LINE__, NULL ); \
76 } \
77}
78
79#define VERIFY_IS_IRQL_PASSIVE_LEVEL() WDFVERIFY(KeGetCurrentIrql() == PASSIVE_LEVEL)
80
81//
82// Following macro is obsolete and it will be phased out in due course
83//
84#define IS_AT_PASSIVE() WDFVERIFY(KeGetCurrentIrql() == PASSIVE_LEVEL)
85
86//
87// Compile time active "assert". File will not compile if this assert is FALSE.
88//
89// This compile time assert is designed to catch mismatch in the values of the
90// declared constants. So suppress the OACR warning #6326 generated about the
91// potential comparison of constants.
92//
93#define WDFCASSERT(c) { \
94 __pragma(warning(suppress: 6326)) \
95 switch(0) case (c): case 0: ; \
96 }
97
98
99
100
101
102#endif // (NTDDI_VERSION >= NTDDI_WIN2K)
103
105
106#endif // _WDFASSERT_H_
107
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
Definition: acpixf.h:1220
#define NTSYSAPI
Definition: ntoskrnl.h:12
static const WCHAR Message[]
Definition: register.c:74
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
char * PSTR
Definition: typedefs.h:51
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG
Definition: typedefs.h:59
#define WDF_EXTERN_C_END
Definition: wdfassert.h:42
WDF_EXTERN_C_START NTSYSAPI VOID NTAPI RtlAssert(_In_ PVOID FailedAssertion, _In_ PVOID FileName, _In_ ULONG LineNumber, _In_opt_ PSTR Message)
#define WDF_EXTERN_C_START
Definition: wdfassert.h:41