AudRecordLib
|
Precompiled header containing project wide definition macros and functions. More...
#include <windows.h>
#include "../macroutils.h"
#include "../exports.h"
#include "../scoped.h"
#include <vcclr.h>
#include "resource.h"
#include <intrin.h>
#include "../ETWEvents.h"
Go to the source code of this file.
Defines | |
#define | WIN32_LEAN_AND_MEAN |
#define | _WIN32_WINNT 0x0600 |
#define | NOMINMAX |
#define | THROW_ON_NULL_ARG(arg, messageId) ThrowOnNullPtrArgument(arg, L#arg, messageId) |
#define | LOG_TEXT(Function, string,...) |
#define | SEVERE_TEXT(string,...) LOG_TEXT(LogSevereEvent, string, __VA_ARGS__) |
#define | DBG_TEXT(string,...) LOG_TEXT(LogDebugEvent, string, __VA_ARGS__) |
#define | MANAGED_PRAGMA(type) |
#define | MANAGED_PRAGMA_RESTORE() __pragma(managed(pop)) |
Functions | |
template<class T > | |
void | ThrowOnNullPtrArgument (T^ arg, LPCWSTR argName, DWORD errorTextMessage) |
Variables | |
HMODULE | g_hModule |
Precompiled header containing project wide definition macros and functions.
#define DBG_TEXT | ( | string, | |
... | |||
) | LOG_TEXT(LogDebugEvent, string, __VA_ARGS__) |
Equivalent to the SEVERE_TEXT macro except that it logs to the debug channel instead of the severe one.
#define LOG_TEXT | ( | Function, | |
string, | |||
... | |||
) |
do \ { \ C_ASSERT(sizeof(*string) == sizeof(char)); \ char buffer[300]; \ char fnName[] = __FUNCTION__; \ LogFormat(buffer, __FUNCTION__ " " string "\n", __VA_ARGS__); \ /* The function name is already in the buffer for the ODPrint buffer */ \ /* So we skip it when passing it to the 'Function' function */ \ Function(__FILE__, __LINE__, __FUNCTION__, buffer + ARRAYSIZE(fnName) + 1); \ OutputDebugStringA(buffer); \ } \ while(0)
Formats string and the additional args in a sprintf manner and outputs it to the debug stream using ODPrint() and to an ETW event stream using Function. String must be a narrow string literal, this is asserted by the macro
#define MANAGED_PRAGMA | ( | type | ) |
__pragma(managed(push)) \ __pragma(managed(type))
Pushes and sets the managed pragma to type Should be followed by the MANAGED_PRAGMA_RESTORE() which will restore the original managed pragma setting
#define MANAGED_PRAGMA_RESTORE | ( | ) | __pragma(managed(pop)) |
Pops the managed pragma setting set by a previous incantation of MANAGED_PRAGMA()
#define SEVERE_TEXT | ( | string, | |
... | |||
) | LOG_TEXT(LogSevereEvent, string, __VA_ARGS__) |
Formats string and the additional args in a sprintf manner and outputs it to the ETW event and debug streams using LogSevereEvent() and ODPrint(). String must be a narrow string literal, this is asserted by the macro
#define THROW_ON_NULL_ARG | ( | arg, | |
messageId | |||
) | ThrowOnNullPtrArgument(arg, L#arg, messageId) |
Calls ThrowOnNullPointerArg passing in arg, a stringified version of arg (hence why this is a macro), and messageId
void ThrowOnNullPtrArgument | ( | T^ | arg, |
LPCWSTR | argName, | ||
DWORD | errorTextMessage | ||
) |
If arg is null, throws a ArgumentNullException using the supplied name and error message
T | The type of the managed reference |
arg | The parameter to test for null |
argName | The name of the argument to the function |
errorTextMessage | The id of the message in the dlls message resource |
HMODULE g_hModule |
The address of the module, copy of the value given to DllMain