하드웨어 오류 이벤트에 대한 시스템 이벤트 로그 쿼리
하드웨어 오류 이벤트를 기록하는 공급자의 이름은 Microsoft-Windows-WHEA-Logger
이 공급자는 데스크톱 시나리오의 사용자를 위해 설계되었습니다. 사용자가 발생한 일에 대한 기본적인 아이디어를 얻을 수 있도록 이벤트의 주요 세부 정보와 함께 사람이 읽을 수 있는 메시지를 제공합니다.
다음 코드 예제에서는 시스템 이벤트 로그를 쿼리하여 이전에 WHEA(Windows 하드웨어 오류 아키텍처)에 의해 기록된 하드웨어 오류 이벤트를 검색하는 방법을 보여 줍니다.
// Function to query the event log for hardware error events
VOID QueryHwErrorEvents(VOID) {
EVT_HANDLE QueryHandle;
EVT_HANDLE EventHandle;
ULONG Returned;
// Obtain a query handle to the system event log
QueryHandle =
EvtQuery(
NULL,
L"System",
L"*[System/Provider[@Name=\"Microsoft-Windows-WHEA-Logger\"]]",
EvtQueryChannelPath | EvtQueryForwardDirection
);
// Check result
if (QueryHandle != NULL) {
// Get the next hardware error event
while (EvtNext(
QueryHandle,
1,
&EventHandle,
-1,
0,
&Returned
)) {
// Process the hardware error event
ProcessHwErrorEvent(EventHandle);
// Close the event handle
EvtClose(EventHandle);
}
// Close the query handle
EvtClose(QueryHandle);
}
}
메모
이전 예제에서 사용된 모든 Evt_Xxx_ 함수 및 EVT_XXX 데이터 형식은 Microsoft Windows SDK 설명서의 Windows 이벤트 로그 섹션에 설명되어 있습니다.