1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 ModuleName:
6 
7     DbgMacros.h
8 
9 Abstract:
10 
11     This file contains debug macros
12     to make sure that an object is intialized
13 
14     This is useful in mode agnostic primitives
15     where initialization is important in user mode
16     but not in kernel mode (e.g. for a lock)
17 
18 Author:
19 
20 
21 
22 Revision History:
23 
24 
25 
26 --*/
27 
28 #pragma once
29 
30 #if DBG_WDF
31 #define DECLARE_DBGFLAG_INITIALIZED \
32     protected: \
33         BOOLEAN m_DbgFlagIsInitialized;
34 
35 #define ASSERT_DBGFLAG_INITIALIZED \
36 { \
37     ASSERT(m_DbgFlagIsInitialized == TRUE); \
38 }
39 
40 #define SET_DBGFLAG_INITIALIZED \
41 { \
42     m_DbgFlagIsInitialized = TRUE; \
43 }
44 
45 #define CLEAR_DBGFLAG_INITIALIZED \
46 { \
47     m_DbgFlagIsInitialized = FALSE; \
48 }
49 
50 #define ASSERT_DBGFLAG_NOT_INITIALIZED \
51 { \
52     ASSERT(m_DbgFlagIsInitialized == FALSE); \
53 }
54 
55 #else
56 
57 #define DECLARE_DBGFLAG_INITIALIZED
58 #define ASSERT_DBGFLAG_INITIALIZED
59 #define SET_DBGFLAG_INITIALIZED
60 #define CLEAR_DBGFLAG_INITIALIZED
61 #define ASSERT_DBGFLAG_NOT_INITIALIZED
62 
63 #endif
64