Debug.cpp
资源名称:ipfilter.zip [点击查看]
上传用户:nnxzhh
上传日期:2007-01-11
资源大小:742k
文件大小:2k
源码类别:
防火墙与安全工具
开发平台:
WINDOWS
- ///////////////////////////////////////////////////////////////////////////////
- //
- // (C) Copyright 1999 - 2000 Mark Roddy
- // All Rights Reserved
- //
- // Hollis Technology Solutions
- // 94 Dow Road
- // Hollis, NH 03049
- // info@hollistech.com
- //
- // Synopsis:
- //
- //
- // Version Information:
- //
- // $Header: /iphook/sys/driver/Debug.cpp 4 4/23/00 5:10p Markr $
- //
- ///////////////////////////////////////////////////////////////////////////////
- #include <stdarg.h>
- #include "stdio.h"
- #include "stddef.h"
- #include "htsglib.h"
- HTS_DEBUG_THIS_FILE
- ULONG HtsDebugLevel = HTS_DEBUG_LOW;
- #if DBG
- #define DEBUG_BUFFER_SIZE 256
- void
- HtsDebugPrint(
- ULONG Level,
- PCHAR Format,
- ...
- )
- {
- CHAR buffer[DEBUG_BUFFER_SIZE];
- va_list args;
- va_start(args, Format);
- if ((Level & HTS_DEBUG_MASK) >= HtsDebugLevel) {
- _vsnprintf(buffer, DEBUG_BUFFER_SIZE, Format, args);
- DbgPrint(buffer);
- }
- va_end(args);
- }
- #else
- void
- HtsDebugPrint(
- ULONG Level,
- PCHAR Format,
- ...
- )
- {
- }
- #endif
- ULONG HtsDriverId = 0;
- void HtsBugCheck(PCHAR message, ULONG param1, ULONG param2, ULONG param3, ULONG param4)
- {
- DbgPrint("nnKernel Failure: "%s" nnn"
- "[ System Halting ]n", message);
- KeBugCheckEx(BUGCODE_ID_DRIVER, param1, param2, param3, param4);
- }
- ULONG HtsExceptionFilter( ULONG Code, PEXCEPTION_POINTERS pointers)
- {
- PEXCEPTION_RECORD ExceptionRecord;
- PCONTEXT Context;
- ExceptionRecord = pointers->ExceptionRecord;
- Context = pointers->ContextRecord;
- #if DBG
- DbgPrint("*************** Exception Failure **************************n");
- DbgPrint("n");
- DbgPrint(" An unexpected exception occurred.n");
- DbgPrint(" Exception record at %x Context record at %xn",
- ExceptionRecord, Context);
- DbgPrint(" WindBag: execute "!cxr %x; !exr %x; !kb" for stacktracenn",
- Context, ExceptionRecord);
- DbgBreakPoint();
- #endif
- return EXCEPTION_EXECUTE_HANDLER;
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // Change History Log
- //
- // $Log: /iphook/sys/driver/Debug.cpp $
- //
- // 4 4/23/00 5:10p Markr
- //
- // 3 1/27/00 10:35p Markr
- // Prepare to release!
- //
- ///////////////////////////////////////////////////////////////////////////////