ReactOS  0.4.15-dev-2700-g4b4ffa9
wdfassert.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation. All rights reserved.
4 
5 _WdfVersionBuild_
6 
7 Module Name:
8 
9  WdfAssert.h
10 
11 Abstract:
12 
13  Contains prototypes for dealing with run time asserts
14 
15 Author:
16 
17 Environment:
18 
19  kernel mode only
20 
21 Revision 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 //
58 VOID
59 NTAPI
60 RtlAssert(
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 
#define NTSYSAPI
Definition: ntoskrnl.h:14
#define _In_opt_
Definition: no_sal2.h:212
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define WDF_EXTERN_C_END
Definition: wdfassert.h:42
CHAR Message[80]
Definition: alive.c:5
WDF_EXTERN_C_START NTSYSAPI VOID NTAPI RtlAssert(_In_ PVOID FailedAssertion, _In_ PVOID FileName, _In_ ULONG LineNumber, _In_opt_ PSTR Message)
#define _In_
Definition: no_sal2.h:158
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:1216
#define WDF_EXTERN_C_START
Definition: wdfassert.h:41
signed char * PSTR
Definition: retypes.h:7
unsigned int ULONG
Definition: retypes.h:1