AudRecordLib
Defines | Functions | Variables
AudRecordCLI/stdafx.h File Reference

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

Detailed Description

Precompiled header containing project wide definition macros and functions.


Define Documentation

#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,
  ... 
)
Value:
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)
Value:
__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


Function Documentation

template<class T >
void ThrowOnNullPtrArgument ( T^  arg,
LPCWSTR  argName,
DWORD  errorTextMessage 
)

If arg is null, throws a ArgumentNullException using the supplied name and error message

Template Parameters:
TThe type of the managed reference
Parameters:
argThe parameter to test for null
argNameThe name of the argument to the function
errorTextMessageThe id of the message in the dlls message resource

Variable Documentation

HMODULE g_hModule

The address of the module, copy of the value given to DllMain

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Defines