Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
debug.c
Package: shell.rar [view]
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 2k
Category:
Windows Kernel
Development Platform:
Visual C++
- #include <windows.h>
- #include "debug.h"
- // #define DEBUG_BREAK __try { _asm { int 3 } } __except (EXCEPTION_EXECUTE_HANDLER) {;}
- #define DEBUG_BREAK _try { DebugBreak(); } _except (EXCEPTION_EXECUTE_HANDLER) {;}
- #ifdef _DEBUG
- UINT g_fDebugMask = 0x00ff;
- UINT SetDebugMask(UINT mask)
- {
- UINT wOld = g_fDebugMask;
- g_fDebugMask = mask;
- return wOld;
- }
- UINT GetDebugMask()
- {
- return g_fDebugMask;
- }
- void AssertFailed(LPCSTR pszFile, int line)
- {
- LPCSTR psz;
- char ach[256];
- static char szAssertFailed[] = "Assertion failed in %s on line %drn";
- // Strip off path info from filename string, if present.
- //
- if (g_fDebugMask & DM_ASSERT)
- {
- for (psz = pszFile + lstrlen(pszFile); psz != pszFile; psz=AnsiPrev(pszFile, psz))
- {
- if ((AnsiPrev(pszFile, psz)!= (psz-2)) && *(psz - 1) == '\')
- break;
- }
- wsprintf(ach, szAssertFailed, psz, line);
- OutputDebugString(ach);
- DEBUG_BREAK
- }
- }
- void _cdecl _AssertMsg(BOOL f, LPCSTR pszMsg, ...)
- {
- char ach[256];
- if (!f && (g_fDebugMask & DM_ASSERT))
- {
- wvsprintf(ach, pszMsg, (LPVOID)(&pszMsg + 1));
- lstrcat(ach, "rn");
- OutputDebugString(ach);
- DEBUG_BREAK
- }
- }
- void _cdecl _DebugMsg(UINT mask, LPCSTR pszMsg, ...)
- {
- char ach[2*MAX_PATH+40]; // Handles 2*largest path + slop for message
- if (g_fDebugMask & mask)
- {
- wvsprintf(ach, pszMsg, (LPVOID)(&pszMsg + 1));
- lstrcat(ach, "rn");
- OutputDebugString(ach);
- }
- }
- #endif // _DEBUG