IoWriteErrorLogEntry產生Event Log

來源:互聯網
上載者:User

Eventlog Blog:http://driverentry.com.br/en/blog/?p=348

字串處理函數:http://mzf2008.blog.163.com/blog/static/3559978620101112115510592/

1.寫mc檔案

MessageIdTypedef = NTSTATUS

SeverityNames =
(
    Success         = 0x0:STATUS_SEVERITY_SUCCESS
    Informational   = 0x1:STATUS_SEVERITY_INFORMATIONAL
    Warning         = 0x2:STATUS_SEVERITY_WARNING
    Error           = 0x3:STATUS_SEVERITY_ERROR
)

FacilityNames =
(
    System          = 0x0
    DriverEntryLogs = 0x2A:DRIVERENTRY_FACILITY_CODE
)

LanguageNames =
(
    English     = 0x0409:msg00002
)

MessageId = 0x0001
Facility = DriverEntryLogs
Severity = Informational
SymbolicName = EVT_HELLO_MESSAGE

Language = English
Hello world!
.

MessageId = 0x0002
Facility = DriverEntryLogs
Severity = Warning
SymbolicName = EVT_DEIOS_MESSAGE

Language = English
The  %2 Deios function/module KdPrint:%3.
.

詳述:MSDN

http://msdn.microsoft.com/en-us/library/windows/hardware/ff543017(v=vs.85).aspx#ddk_compiling_the_error_message_text_file_kg

2. mc.exe將mc檔案生產rc、bin和.h檔案,利用IO_ERROR_LOG_PACKET structure、IoAllocateErrorLogEntry和IoWriteErrorLogEntry函數產生Event日誌

Event Log的構成

詳述:MSDN

http://msdn.microsoft.com/en-us/library/windows/hardware/ff550571(v=vs.85).aspx

http://msdn.microsoft.com/en-us/library/windows/hardware/ff566411(v=vs.85).aspx

3.載入完驅動後需要在註冊表中載入sys作為image file正常方可正常顯示日誌內容

詳述:MSDN

http://msdn.microsoft.com/en-us/library/windows/hardware/ff560866(v=vs.85).aspx

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.