Click here to Skip to main content
15,880,469 members
Articles / Programming Languages / ASM

Hook Interrupts and Call Kernel Routines in User Mode

Rate me:
Please Sign up or sign in to vote.
4.92/5 (12 votes)
20 May 2009CPOL9 min read 75.4K   1.5K   65  
Inject user mode routine into kernel space and execute
//////////////////////////////////////////////////////////////////////////////
//	Copyright � 1998,1999 PHD Computer Consultants Ltd
//	DebugPrint code header to add to a test driver
//
/////////////////////////////////////////////////////////////////////////////

#ifdef __cplusplus
extern "C"
{
#endif

#define DEBUGPRINT 0	// Set to 1 to do DebugPrints in free version

/////////////////////////////////////////////////////////////////////////////

#if DBG || DEBUGPRINT
#define DODEBUGPRINT 1
#else
#define DODEBUGPRINT 0
#endif

#if DODEBUGPRINT

void DebugPrintInit(char*);
void DebugPrintClose();
void DebugPrintMsg(char*);

#else

#define DebugPrintInit(x)
#define DebugPrintClose()
#define DebugPrintMsg(x)

#endif

void DebugPrint2(int max, const char *format, ... );
void DebugPrint(const char *format, ... );

/////////////////////////////////////////////////////////////////////////////

#ifdef __cplusplus
}
#endif

/////////////////////////////////////////////////////////////////////////////

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
China China
From Shanghai, China

Comments and Discussions