// debug.c
//
// Generated by C DriverWizard 3.2.0 (Build 2485)
// Requires DDK Only
// File created on 8/30/2008
//

#include "pch.h"
#ifdef YFRSFTGYHU_WMI_TRACE
#include "debug.tmh"
#else

#if DBG

// debug level and debug area mask
ULONG   g_DebugLevel = DBG_INFO;
ULONG   g_DebugArea = DBG_ALL;

///////////////////////////////////////////////////////////////////////////////////////////////////
//  yfrsftgyhuDebugPrint
//      Debug messages output routine.
//
//  Arguments:
//      IN  Area
//              Debug area (DBG_PNP, DBG_POWER, etc..)
//
//      IN  Level
//              Debug Level (DBG_ERR, DBG_INFO, etc..)
//
//      IN  Format
//              Debug Message Format
//
//  Return Value:
//      None.
//
VOID yfrsftgyhuDebugPrint(
    IN ULONG    Area,
    IN ULONG    Level,
    IN PCCHAR   Format,
    IN          ...
    )
{
    va_list     vaList;
    CHAR        buffer[1024];
    NTSTATUS    status;

    va_start(vaList, Format);

    // check mask for debug area and debug level
    if ((g_DebugArea & Area) && (Level <= g_DebugLevel))
    {
        status = RtlStringCbVPrintfA(
                    buffer, 
                    sizeof(buffer),
                    Format,
                    vaList
                    );

        if (Level == DBG_ERR)
        {
            DbgPrint("YFRSFTGYHU: ERROR %s !!!!!\n", buffer); 
        }
        else if (Level == DBG_WARN)
        {
            DbgPrint("YFRSFTGYHU: WARNING %s\n", buffer); 
        }
        else if (Level == DBG_INFO)
        {
            DbgPrint("YFRSFTGYHU:     %s\n", buffer); 
        }
        else
        {
            DbgPrint("YFRSFTGYHU: %s\n", buffer); 
        }
    }

    va_end(vaList);
}

#endif	// DBG
#endif	// YFRSFTGYHU_WMI_TRACE

