📄 sec.tmh
字号:
//d41d8cd98f00b204e9800998ecf8427e Generated File. Do not edit.
// File created by WPP compiler version 0.01-Wed May 2 11:22:25 2001
// on 02/29/2008 at 05:02:16 UTC from a template C:\WINDDK\2600\bin\wppconfig\rev1\km-default.tpl
// template C:\WINDDK\2600\bin\wppconfig\rev1\km-header.tpl
#define WPP_KERNEL_MODE
#define WPP_THIS_FILE sec_c
#include <stddef.h>
#include <stdarg.h>
#include <wmistr.h>
#if !defined(_NTRTL_)
// fake RTL_TIME_ZONE_INFORMATION //
typedef int RTL_TIME_ZONE_INFORMATION;
# define _WMIKM_
#endif
#define WPP_TRACE WmiTraceMessage
__inline TRACEHANDLE WppQueryLogger(PWSTR LoggerName)
{
ULONG ReturnLength ;
NTSTATUS Status ;
TRACEHANDLE TraceHandle ;
UNICODE_STRING Buffer ;
if (!LoggerName) {
LoggerName = L"stdout";
}
RtlInitUnicodeString(&Buffer, LoggerName);
if ((Status = WmiQueryTraceInformation(TraceHandleByNameClass,
(PVOID)&TraceHandle,
sizeof(TraceHandle),
&ReturnLength,
(PVOID)&Buffer)) != STATUS_SUCCESS) {
return 0 ;
}
return TraceHandle ;
}
typedef NTSTATUS (*WMIENTRY_NEW)(
IN UCHAR ActionCode,
IN PVOID DataPath,
IN ULONG BufferSize,
IN OUT PVOID Buffer,
IN PVOID Context,
OUT PULONG Size
);
typedef struct _WPP_TRACE_CONTROL_BLOCK
{
WMIENTRY_NEW Callback;
struct _WPP_TRACE_CONTROL_BLOCK *Next;
__int64 Logger;
UCHAR FlagsLen; UCHAR Level; USHORT Reserved;
ULONG Flags[1];
} WPP_TRACE_CONTROL_BLOCK, *PWPP_TRACE_CONTROL_BLOCK;
typedef struct _WPP_REGISTRATION_BLOCK
{
WMIENTRY_NEW Callback;
struct _WPP_REGISTRATION_BLOCK *Next;
LPCGUID ControlGuid;
LPCWSTR FriendlyName;
LPCWSTR BitNames;
PUNICODE_STRING RegistryPath;
UCHAR FlagsLen, RegBlockLen;
} WPP_REGISTRATION_BLOCK, *PWPP_REGISTRATION_BLOCK;
// template C:\WINDDK\2600\bin\wppconfig\rev1\control.tpl
//
// Defines a set of macro that expand control model specified
// with WPP_CONTROL_GUIDS (example shown below)
// into an enum of trace levels and required structures that
// contain the mask of levels, logger handle and some information
// required for registration.
//
///////////////////////////////////////////////////////////////////////////////////
//
// #define WPP_CONTROL_GUIDS \
// WPP_DEFINE_CONTROL_GUID(Regular,(81b20fea,73a8,4b62,95bc,354477c97a6f), \
// WPP_DEFINE_BIT(Error) \
// WPP_DEFINE_BIT(Unusual) \
// WPP_DEFINE_BIT(Noise) \
// ) \
// WPP_DEFINE_CONTROL_GUID(HiFreq,(91b20fea,73a8,4b62,95bc,354477c97a6f), \
// WPP_DEFINE_BIT(Entry) \
// WPP_DEFINE_BIT(Exit) \
// WPP_DEFINE_BIT(ApiCalls) \
// WPP_DEFINE_BIT(RandomJunk) \
// WPP_DEFINE_BIT(LovePoem) \
// )
#if !defined(WPP_NO_CONTROL_GUIDS)
#if defined(WPP_DEFAULT_CONTROL_GUID)
# if defined(WPP_CONTROL_GUIDS)
# pragma message(__FILE__ " : error : WPP_DEFAULT_CONTROL_GUID cannot be used together with WPP_CONTROL_GUIDS")
# stop
# else
# define WPP_CONTROL_GUIDS \
WPP_DEFINE_CONTROL_GUID(Default,(WPP_DEFAULT_CONTROL_GUID), \
WPP_DEFINE_BIT(Error) \
WPP_DEFINE_BIT(Unusual) \
WPP_DEFINE_BIT(Noise) \
)
# endif
#endif
#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
#undef WPP_DEFINE_BIT
#undef WPP_DEFINE_CONTROL_GUID
};
#define WPP_INIT_STATIC_DATA 0
#endif
#define WPP_CONTROL(CTL) (WPP_CB[WPP_CTRL_NO(CTL)].Control)
#define WPP_REGISTRATION(CTL) (WPP_CB[WPP_CTRL_NO(CTL)].Registration)
#define WPP_SET_FORWARD_PTR(CTL, FLAGS, PTR) (\
(WPP_REGISTRATION(WPP_BIT_ ## CTL ).Options = (FLAGS)),\
(WPP_REGISTRATION(WPP_BIT_ ## CTL ).Ptr = (PTR)) )
#if !defined(WPP_LEVEL_LOGGER)
# define WPP_LEVEL_LOGGER(CTL) (WPP_CONTROL(WPP_BIT_ ## CTL).Logger),
#endif
#if !defined(WPP_LEVEL_ENABLED)
# define WPP_LEVEL_ENABLED(CTL) (WPP_CONTROL(WPP_BIT_ ## CTL).Flags[WPP_FLAG_NO(WPP_BIT_ ## CTL)] & WPP_MASK(WPP_BIT_ ## CTL))
#endif
#if !defined(WPP_LOGGER_ARG)
# define WPP_LOGGER_ARG TRACEHANDLE Logger,
#endif
#if !defined(WPP_GET_LOGGER)
# define WPP_GET_LOGGER Logger
#endif
#ifndef WPP_ENABLED
# define WPP_ENABLED() 1
#endif
#ifndef WPP_LOGGER
# define WPP_LOGGER() (WPP_CB[0].Control.Logger),
#endif
#endif // WPP_NO_CONTROL_GUIDS
#if !defined(WPP_KERNEL_MODE)
#if defined(__cplusplus)
extern "C" {
#endif
VOID WppInitUm(LPCWSTR AppName, PWPP_REGISTRATION_BLOCK Registration);
VOID WppCleanupUm(PWPP_REGISTRATION_BLOCK Registration);
#if defined(__cplusplus)
};
#endif
# define WPP_INIT_TRACING(AppName) (WPP_CONTROL_ANNOTATION(),WPP_INIT_STATIC_DATA,\
WppInitUm(AppName, &WPP_CB[0].Registration))
# define WPP_CLEANUP() WppCleanupUm(&WPP_CB[0].Registration)
#else
#if defined(__cplusplus)
extern "C" {
#endif
VOID WppInitKm(PUNICODE_STRING RegistryPath, PWPP_REGISTRATION_BLOCK Registration);
VOID WppCleanupKm(PWPP_REGISTRATION_BLOCK Registration);
#if defined(__cplusplus)
};
#endif
# define WPP_INIT_TRACING(DrvObj, RegPath) (WPP_CONTROL_ANNOTATION(),WPP_INIT_STATIC_DATA,\
WppInitKm(RegPath, &WPP_CB[0].Registration))
# define WPP_CLEANUP(DrvObj) WppCleanupKm(&WPP_CB[0].Registration)
#endif
// template C:\WINDDK\2600\bin\wppconfig\rev1\trmacro.tpl
// expects:
// WPP_THIS_FILE defined (see header.tpl)
// WPP_LOGGER_ARG defined
// WPP_GET_LOGGER defined
// WPP_ENABLED() defined
#define WPP_EVAL(_value_) _value_
#define WPP_(Id) WPP_EVAL(WPP_) ## WPP_EVAL(Id) ## WPP_EVAL(_) ## WPP_EVAL(WPP_THIS_FILE) ## WPP_EVAL(__LINE__)
#if !defined(WPP_INLINE)
# define WPP_INLINE __inline
#endif
#if !defined(WPP_NO_ANNOTATIONS)
#if !defined(WPP_ANSI_ANNOTATION)
#else
#endif
# define WPP_ANNOTATE WPP_(ANNOTATE),
#else
# define WPP_ANNOTATE
#endif
#if 0
static const GUID WPP_LOCAL_TraceGuids[] = {};
#endif
#if !defined(WPP_TRACE_OPTIONS)
enum {WPP_TRACE_OPTIONS = TRACE_MESSAGE_SEQUENCE | TRACE_MESSAGE_GUID
| TRACE_MESSAGE_SYSTEMINFO | TRACE_MESSAGE_TIMESTAMP };
#endif
#if !defined(WPP_LOGPAIR)
# define WPP_LOGPAIR(_Size, _Addr) (_Addr),(_Size),
#endif
#define WPP_LOGTYPEVAL(_Type, _Value) WPP_LOGPAIR(sizeof(_Type), &(_Value))
#define WPP_LOGTYPEPTR(_Value) WPP_LOGPAIR(sizeof(*(_Value)), (_Value))
// Marshalling macros.
#if !defined(WPP_LOGASTR)
# if !defined(WPP_CHECK_FOR_NULL_STRING)
# define WPP_LOGASTR(_value) WPP_LOGPAIR(strlen(_value) + 1, _value )
# else
# define WPP_LOGASTR(_value) WPP_LOGPAIR( (_value)?strlen(_value) + 1:5, (_value)?(_value):"NULL" )
# endif
#endif
#if !defined(WPP_LOGWSTR)
# if !defined(WPP_CHECK_FOR_NULL_STRING)
# define WPP_LOGWSTR(_value) WPP_LOGPAIR( (wcslen(_value)+1) * sizeof(WCHAR), _value)
# else
# define WPP_LOGWSTR(_value) WPP_LOGPAIR( (_value)?(wcslen(_value) + 1)* sizeof(WCHAR):5 * sizeof(WCHAR), (_value)?(_value):L"NULL")
# endif
#endif
#if !defined(WPP_LOGPGUID)
# define WPP_LOGPGUID(_value) WPP_LOGPAIR( sizeof(GUID), (_value) )
#endif
#if !defined(WPP_LOGPSID)
# define WPP_LOGPSID(_value) WPP_LOGPAIR( GetLengthSid(_value), (_value) )
#endif
#if !defined(WPP_LOGCSTR)
# define WPP_LOGCSTR(_x) \
WPP_LOGPAIR( sizeof((_x).Length), &(_x).Length ) WPP_LOGPAIR( (_x).Length, (_x).Buffer )
#endif
#if !defined(WPP_LOGUSTR)
# define WPP_LOGUSTR(_x) \
WPP_LOGPAIR( sizeof((_x).Length), &(_x).Length ) WPP_LOGPAIR( (_x).Length, (_x).Buffer )
#endif
#if !defined(WPP_LOGPUSTR)
# define WPP_LOGPUSTR(_x) WPP_LOGUSTR(*(_x))
#endif
#if !defined(WPP_LOGPCSTR)
# define WPP_LOGPCSTR(_x) WPP_LOGCSTR(*(_x))
#endif
#if !defined(WPP_LOGSTDSTR)
#define WPP_LOGSTDSTR(_value) WPP_LOGPAIR( (_value).size()+1, (_value).c_str() )
#endif
#ifdef WPP_DEBUG
#else
#endif
// NoMsgArgs
#undef DoTraceMessage
#define DoTraceMessage WPP_ANNOTATE WPP_(CALL)
#undef TraceLog
#define TraceLog(ARGS) WPP_ANNOTATE WPP_(CALL) ARGS
// MsgArgs
#ifdef WPP_DEBUG
#else
#endif
/// more stuff
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -