我在 Microsoft 驱动程序代码示例调试跟踪标志中看到:
#define DEBUG_TRACE_ERROR 0x00000001 // Errors - whenever we return a failure code
#define DEBUG_TRACE_LOAD_UNLOAD 0x00000002 // Loading/unloading of the filter
#define DEBUG_TRACE_INSTANCES 0x00000004 // Attach / detatch of instances
#define DEBUG_TRACE_METADATA_OPERATIONS 0x00000008 // Operation to access / modify in memory metadata
#define DEBUG_TRACE_ALL_IO 0x00000010 // All IO operations tracked by this filter
#define DEBUG_TRACE_INFO 0x00000020 // Misc. information
#define DEBUG_TRACE_ALL 0xFFFFFFFF // All flags
据我所知,标志应该是 2 的幂(如 1、2、4、8、16、32)才能不相交。 但为什么 DEBUG_TRACE_ALL_IO 是 10 而 DEBUG_TRACE_INFO 是 20 而不是 16 和 32?
最佳答案
因为这段代码中的值是十六进制的。 0x10 = 16。
关于c++ - 用于调试打印的 MS 标志中的奇怪值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35624310/