现在的位置: 首页 > 综合 > 正文

驱动程序中使用系统日志

2011年09月11日 ⁄ 综合 ⁄ 共 741字 ⁄ 字号 评论关闭

其中的errorLogEntry->ErrorCode = 100会在

 

------------------------------------------------------------------

void Test(PDRIVER_OBJECT pDriverObject)
{
	KdPrint(("Test()!\n"));

	PIO_ERROR_LOG_PACKET errorLogEntry = (PIO_ERROR_LOG_PACKET)
		IoAllocateErrorLogEntry(pDriverObject,
			(UCHAR) sizeof(IO_ERROR_LOG_PACKET));

    if (errorLogEntry) {
        errorLogEntry->ErrorCode = 100;
        errorLogEntry->DumpDataSize = 0;
        errorLogEntry->SequenceNumber = 0;
        errorLogEntry->MajorFunctionCode = 0;
        errorLogEntry->IoControlCode = 0;
        errorLogEntry->RetryCount = 0;
        errorLogEntry->UniqueErrorValue = 0;
        errorLogEntry->FinalStatus =  STATUS_DEVICE_NOT_CONNECTED;

        IoWriteErrorLogEntry(errorLogEntry);
		IoFreeErrorLogEntry(errorLogEntry);
		errorLogEntry = NULL;
    }
}

------------------------------------------------------------------

2010.3.24.1

抱歉!评论已关闭.