|
OpenCBM
|
Debug helper functions for kernel-mode drivers. More...
Go to the source code of this file.
Data Structures | |
| struct | NTSTATUS_DEBUGCODE |
Macros | |
| #define | min(_x, _y) ( ((_x) < (_y)) ? (_x) : (_y) ) |
| #define | REPORT_BUG(_no, _a, _b, _c, _d, _str) |
| @@@ More... | |
| #define | DEFINE_STATUSCODE(_x) { #_x, _x } |
| #define | _MARKLASTENTRY ((NTSTATUS) -1) |
| #define | _LASTENTRY { "", _MARKLASTENTRY } |
| #define | USE_SPINLOCK 1 |
| use a spinlock for the debugging buffer implementation | |
| #define | DBG_SIZE_MEMORY_BUFFER 0x20000u |
| the size of the memory buffer used for the debugging buffer | |
Typedefs | |
| typedef struct NTSTATUS_DEBUGCODE | NTSTATUS_DEBUGCODE |
Functions | |
| const UCHAR * | DebugNtStatus (NTSTATUS Value) |
| Return the description of an NTSTATUS code. More... | |
| VOID | DbgInit (VOID) |
| Initialise debugging system. More... | |
| VOID | DbgAllocateMemoryBuffer (VOID) |
| Get storage area for debugging output. More... | |
| VOID | DbgFreeMemoryBuffer (VOID) |
| Free storage area for debugging output. More... | |
| VOID | DbgOutputMemoryBuffer (const char *String) |
| Output into the debugging buffer. More... | |
| NTSTATUS | cbm_dbg_readbuffer (IN PDEVICE_EXTENSION Pdx, OUT PCHAR ReturnBuffer, IN OUT PULONG ReturnLength) |
| Give the debug buffer contents to the installer. More... | |
Variables | |
| const NTSTATUS_DEBUGCODE | text [] |
| #define _LASTENTRY { "", _MARKLASTENTRY } |
this marks the last entry of the array
Definition at line 81 of file sys/libcommon/debug.c.
| #define _MARKLASTENTRY ((NTSTATUS) -1) |
This mark is used as value for the last entry of the array
Definition at line 78 of file sys/libcommon/debug.c.
Referenced by DebugNtStatus().
| #define DEFINE_STATUSCODE | ( | _x | ) | { #_x, _x } |
Define one NTSTATUS entry
Definition at line 75 of file sys/libcommon/debug.c.
| #define min | ( | _x, | |
| _y | |||
| ) | ( ((_x) < (_y)) ? (_x) : (_y) ) |
Mark: This file is DEBUG.C, thus, some variables and functions should not be defined as "extern"
find the minimum of both parameters
Definition at line 31 of file sys/libcommon/debug.c.
Referenced by cbm_dbg_readbuffer().
| #define REPORT_BUG | ( | _no, | |
| _a, | |||
| _b, | |||
| _c, | |||
| _d, | |||
| _str | |||
| ) |
@@@
| _no | |
| _a | |
| _b | |
| _c | |
| _d | |
| _str |
Definition at line 53 of file sys/libcommon/debug.c.
Referenced by DbgOutputMemoryBuffer().
| typedef struct NTSTATUS_DEBUGCODE NTSTATUS_DEBUGCODE |
one descriptional entry for the NTSTATUS codes
| NTSTATUS cbm_dbg_readbuffer | ( | IN PDEVICE_EXTENSION | Pdx, |
| OUT PCHAR | ReturnBuffer, | ||
| IN OUT PULONG | ReturnLength | ||
| ) |
Give the debug buffer contents to the installer.
This function is used to get the contents of the debug buffer for the use of the installer.
| Pdx | Pointer to the device extension. |
| ReturnBuffer | Pointer to a buffer which will contain the result. |
| ReturnLength | Pointer to a ULONG which contains the length of the ReturnBuffer on entry, and which will contain the length of the written ReturnBuffer on exit. |
This function copies the last ReturnLength bytes into the buffer.
Definition at line 1416 of file sys/libcommon/debug.c.
References FUNC_ENTER, and min.
Referenced by cbm_execute_devicecontrol().
| VOID DbgAllocateMemoryBuffer | ( | VOID | ) |
Get storage area for debugging output.
This function allocates memory for the debugging output storage.
Definition at line 1192 of file sys/libcommon/debug.c.
References DBG_SIZE_MEMORY_BUFFER, and MTAG_DBGBUFFER.
Referenced by DriverEntry().
| VOID DbgFreeMemoryBuffer | ( | VOID | ) |
Free storage area for debugging output.
This function frees the memory of the debugging output.
Definition at line 1214 of file sys/libcommon/debug.c.
Referenced by DriverUnload().
| VOID DbgInit | ( | VOID | ) |
Initialise debugging system.
This function performs initialisation which does not need any undoing.
Definition at line 1177 of file sys/libcommon/debug.c.
| VOID DbgOutputMemoryBuffer | ( | const char * | String | ) |
Output into the debugging buffer.
This function outputs a string into the debugging output buffer.
| String | Pointer to the string which is to be output |
Definition at line 1241 of file sys/libcommon/debug.c.
References DBG_SIZE_MEMORY_BUFFER, and REPORT_BUG.
| const UCHAR* DebugNtStatus | ( | NTSTATUS | Value | ) |
Return the description of an NTSTATUS code.
Searches in the NTSTATUS array for the supplied value, and returns a description for it if it finds some.
| Value | The NTSTATUS value to be searched for |
Definition at line 1027 of file sys/libcommon/debug.c.
References _MARKLASTENTRY, and NTSTATUS_DEBUGCODE::Name.
Referenced by AddDevice(), cbmiec_i_raw_write(), ParPortSetModeWdm(), and ParPortUnsetModeWdm().
| const NTSTATUS_DEBUGCODE text[] |
The array of NTSTATUS codes
Definition at line 85 of file sys/libcommon/debug.c.
1.8.8