📄 dbg.c
字号:
//===========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1996 - 1998 Microsoft Corporation. All Rights Reserved.
//
//===========================================================================
/*++
Module Name:
dbg.c
Abstract:
Debug Code for 1394 drivers.
Environment:
kernel mode only
Notes:
Revision History:
5-Sep-95
--*/
#include "wdm.h"
#include "dbg.h"
#if DBG
struct LOG_ENTRY {
CHAR le_name[4]; // Identifying string
ULONG le_info1; // entry specific info
ULONG le_info2; // entry specific info
ULONG le_info3; // entry specific info
};
struct LOG_ENTRY *LogStart = 0; // No log yet
struct LOG_ENTRY *LogPtr;
struct LOG_ENTRY *LogEnd;
#endif
VOID
Debug_LogEntry(
__in CHAR *Name,
__in ULONG Info1,
__in ULONG Info2,
__in ULONG Info3
)
/*++
Routine Description:
Adds an Entry to log.
Arguments:
Return Value:
None.
--*/
{
#if DBG
if (LogStart == 0)
return;
if (LogPtr > LogStart)
LogPtr -= 1; // Decrement to next entry
else
LogPtr = LogEnd;
RtlCopyMemory(LogPtr->le_name, Name, 4);
LogPtr->le_info1 = Info1;
LogPtr->le_info2 = Info2;
LogPtr->le_info3 = Info3;
#endif
return;
}
VOID
Debug_LogInit(
)
/*++
Routine Description:
Init the debug log - remember interesting information in a circular buffer
Arguments:
Return Value:
None.
--*/
{
ULONG logSize = 4096; //1 page of log entries
#if DBG
LogStart = ExAllocatePoolWithTag(NonPagedPool, logSize, 'macd');
if (LogStart) {
LogPtr = LogStart;
// Point the end (and first entry) 1 entry from the end of the segment
LogEnd = LogStart + (logSize / sizeof(struct LOG_ENTRY)) - 1;
}
#endif
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -