📄 cdrom.tmh
字号:
#if !defined(WPP_CONTROL_GUIDS)
# pragma message(__FILE__ " : error : Please define control model via WPP_CONTROL_GUIDS or WPP_DEFAULT_CONTROL_GUID macros")
# pragma message(__FILE__ " : error : don't forget to call WPP_INIT_TRACING and WPP_CLEANUP in your main, DriverEntry or DllInit")
# pragma message(__FILE__ " : error : see tracewpp.doc for further information")
stop.
#endif
// a set of macro to convert a guid in a form x(81b20fea,73a8,4b62,95bc,354477c97a6f)
// into either a a struct or text string
#define _WPPW(x) L ## x
#define WPP_GUID_TEXT(l,w1,w2,w3,ll) #l "-" #w1 "-" #w2 "-" #w3 "-" #ll
#define WPP_GUID_WTEXT(l,w1,w2,w3,ll) _WPPW(#l) L"-" _WPPW(#w1) L"-" _WPPW(#w2) L"-" _WPPW(#w3) L"-" _WPPW(#ll)
#define WPP_EXTRACT_BYTE(val,n) ( ((0x ## val) >> (8 * n)) & 0xFF )
#define WPP_GUID_STRUCT(l,w1,w2,w3,ll) {0x ## l, 0x ## w1, 0x ## w2,\
{WPP_EXTRACT_BYTE(w3, 1), WPP_EXTRACT_BYTE(w3, 0), \
WPP_EXTRACT_BYTE(ll, 5), WPP_EXTRACT_BYTE(ll, 4), \
WPP_EXTRACT_BYTE(ll, 3), WPP_EXTRACT_BYTE(ll, 2), \
WPP_EXTRACT_BYTE(ll, 1), WPP_EXTRACT_BYTE(ll, 0)} }
// define annotation record that will carry control intormation to pdb (in case somebody needs it)
__forceinline void WPP_CONTROL_ANNOTATION() {
#if !defined(WPP_NO_ANNOTATIONS)
#if !defined(WPP_ANSI_ANNOTATION)
# define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) __annotation(L"TMC:", WPP_GUID_WTEXT Guid, _WPPW(#Name) Bits);
# define WPP_DEFINE_BIT(Name) , _WPPW(#Name)
#else
# define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) __annotation("TMC:", WPP_GUID_TEXT Guid, #Name Bits);
# define WPP_DEFINE_BIT(Name) , #Name
#endif
WPP_CONTROL_GUIDS
# undef WPP_DEFINE_BIT
# undef WPP_DEFINE_CONTROL_GUID
#endif
}
// define an enum of control block names
//////
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) WPP_CTL_ ## Name,
enum WPP_CTL_NAMES { WPP_CONTROL_GUIDS WPP_LAST_CTL};
#undef WPP_DEFINE_CONTROL_GUID
// define control guids
//////
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) \
extern __declspec(selectany) const GUID WPP_ ## ThisDir ## _CTLGUID_ ## Name = WPP_GUID_STRUCT Guid;
WPP_CONTROL_GUIDS
#undef WPP_DEFINE_CONTROL_GUID
// define enums of individual bits
/////
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) \
WPP_BLOCK_START_ ## Name = WPP_CTL_ ## Name * 0x10000, Bits WPP_BLOCK_END_ ## Name,
# define WPP_DEFINE_BIT(Name) WPP_BIT_ ## Name,
enum WPP_DEFINE_BIT_NAMES { WPP_CONTROL_GUIDS };
# undef WPP_DEFINE_BIT
#undef WPP_DEFINE_CONTROL_GUID
#define WPP_MASK(CTL) (1 << ( ((CTL)-1) & 31 ))
#define WPP_FLAG_NO(CTL) ( (0xFFFF & ((CTL)-1) ) / 32)
#define WPP_CTRL_NO(CTL) ((CTL) >> 16)
// calculate how many DWORDs we need to get the required number of bits
// upper estimate. Sometimes will be off by one
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) | WPP_BLOCK_END_ ## Name
enum _WPP_FLAG_LEN_ENUM { WPP_FLAG_LEN = 1 | ((0 WPP_CONTROL_GUIDS) & 0xFFFF) / 32 };
#undef WPP_DEFINE_CONTROL_GUID
#ifndef WPP_CB
# define WPP_CB WPP_GLOBAL_Control
#endif
#ifndef WPP_CB_TYPE
#define WPP_CB_TYPE WPP_PROJECT_CONTROL_BLOCK
#endif
typedef union {
WPP_REGISTRATION_BLOCK Registration; // need this only to register
WPP_TRACE_CONTROL_BLOCK Control;
UCHAR ReserveSpace[ sizeof(WPP_TRACE_CONTROL_BLOCK) + sizeof(ULONG) * (WPP_FLAG_LEN - 1) ];
} WPP_CB_TYPE ;
#define WPP_NEXT(Name) ((WPP_REGISTRATION_BLOCK*) \
(WPP_CTL_ ## Name + 1 == WPP_LAST_CTL ? 0:WPP_CB + WPP_CTL_ ## Name + 1))
// WPP_CONTROL structure has two extra fields in the kernel
// mode. We will use WPPKM_NULL to initalize them
#if defined(WPP_KERNEL_MODE)
# define WPPKM_NULL 0,
#else
# define WPPKM_NULL
#endif
#if defined(WPP_DLL)
extern __declspec(selectany) WPP_CB_TYPE WPP_CB[WPP_LAST_CTL];
__inline void WPP_INIT_CONTROL_ARRAY(WPP_CB_TYPE* Arr) {
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) \
Arr->Registration.Next = WPP_NEXT(Name); \
Arr->Registration.ControlGuid = &WPP_ ## ThisDir ## _CTLGUID_ ## Name; \
Arr->Registration.FriendlyName = L ## #Name; \
Arr->Registration.BitNames = Bits; \
Arr->Registration.FlagsLen = WPP_FLAG_LEN; \
Arr->Registration.RegBlockLen = WPP_LAST_CTL; ++Arr;
#define WPP_DEFINE_BIT(BitName) L" " L ## #BitName
WPP_CONTROL_GUIDS
#undef WPP_DEFINE_BIT
#undef WPP_DEFINE_CONTROL_GUID
}
#define WPP_INIT_STATIC_DATA WPP_INIT_CONTROL_ARRAY(WPP_CB)
#else
extern __declspec(selectany) WPP_CB_TYPE WPP_CB[WPP_LAST_CTL] = {
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) {{WPPKM_NULL WPP_NEXT(Name), \
&WPP_ ## ThisDir ## _CTLGUID_ ## Name, L ## #Name, Bits, WPPKM_NULL WPP_FLAG_LEN, WPP_LAST_CTL}},
#define WPP_DEFINE_BIT(BitName) L" " L ## #BitName
WPP_CONTROL_GUIDS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -