Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
BrowserDiagnostics.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define NG_TRACE   1 ? (void)0 : NgTrace
#define NG_TRACE_METHOD(fn)
#define NG_TRACE_METHOD_ARGS(fn, pattern, args)
#define NG_ASSERT(X)
#define NG_ASSERT_POINTER(p, type)
#define NG_ASSERT_NULL_OR_POINTER(p, type)
#define NG_TRACE_ALWAYS   AtlTrace

Functions

void _cdecl NgTrace (LPCSTR lpszFormat,...)
BOOL NgIsValidAddress (const void *lp, UINT nBytes, BOOL bReadWrite=TRUE)

Define Documentation

#define NG_ASSERT (   X)

Definition at line 61 of file BrowserDiagnostics.h.

Definition at line 63 of file BrowserDiagnostics.h.

#define NG_ASSERT_POINTER (   p,
  type 
)

Definition at line 62 of file BrowserDiagnostics.h.

#define NG_TRACE   1 ? (void)0 : NgTrace

Definition at line 58 of file BrowserDiagnostics.h.

#define NG_TRACE_ALWAYS   AtlTrace

Definition at line 66 of file BrowserDiagnostics.h.

Definition at line 59 of file BrowserDiagnostics.h.

Definition at line 60 of file BrowserDiagnostics.h.


Function Documentation

BOOL NgIsValidAddress ( const void lp,
UINT  nBytes,
BOOL  bReadWrite = TRUE 
) [inline]

Definition at line 83 of file BrowserDiagnostics.h.

{
    return (lp != NULL && !IsBadReadPtr(lp, nBytes) &&
        (!bReadWrite || !IsBadWritePtr((LPVOID)lp, nBytes)));
}
void _cdecl NgTrace ( LPCSTR  lpszFormat,
  ... 
) [inline]

Definition at line 68 of file BrowserDiagnostics.h.

{
    va_list args;
    va_start(args, lpszFormat);

    int nBuf;
    char szBuffer[512];

    nBuf = _vsnprintf(szBuffer, sizeof(szBuffer), lpszFormat, args);
    NG_ASSERT(nBuf < sizeof(szBuffer)); //Output truncated as it was > sizeof(szBuffer)

    OutputDebugStringA(szBuffer);
    va_end(args);
}