|
#include "Sdk.h"
#include "StringMgr.h"
#include "DbgTrace.h"
#define MAX_TRACE_STRING_LENGTH (1024)
static
VOID
NDAPI
FDbgTrace_SetLevel(
DbgTrace *This,
int Level
) {
This->Level = Level;
return;
}
static
VOID
NDAPI
FDbgTrace_Track(
DbgTrace *This,
int Level,
LPCWSTR Msg
) {
if(Level > This->Level) {
return;
}
OutputDebugStringW(Msg);
if(IsDebuggerPresent()) {
OutputDebugStringW(L"\r\n");
}
}
static
VOID
NDAPIV
FDbgTrace_TrackV(
DbgTrace *This,
int Level,
LPCWSTR Msg,
...
) {
WCHAR MsgV[MAX_TRACE_STRING_LENGTH] = L"";
va_list ap;
if(Level > This->Level) {
return;
}
va_start(ap, Msg);
SzStringFormatV(MsgV,
Msg,
ap
);
va_end(ap);
This->Track(This,
Level,
MsgV
);
}
static
DbgTrace
__DbgTrace = {
&FDbgTrace_SetLevel,
&FDbgTrace_Track,
&FDbgTrace_TrackV,
#ifdef _DEBUG
TRACE_LEVEL_DEBUG
#else
TRACE_LEVEL_NONE
#endif
};
DbgTrace*
DbgTrace_GetObject(
VOID
) {
return &__DbgTrace;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.