mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.1 KiB
55 lines
1.1 KiB
//+----------------------------------------------------------------------------
|
|
//
|
|
// Copyright (C) 1999, Microsoft Corporation
|
|
//
|
|
// File: log.cxx
|
|
//
|
|
// Contents: Event logging for Dfs service
|
|
//
|
|
// Functions:
|
|
//
|
|
// History: 2-1-99 Jharper created
|
|
//
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#include <headers.hxx>
|
|
#pragma hdrstop
|
|
|
|
extern "C" {
|
|
#include <stdio.h>
|
|
#include <windows.h>
|
|
#include <lm.h>
|
|
#include <lmwksta.h>
|
|
#include <malloc.h>
|
|
}
|
|
|
|
extern "C" VOID
|
|
LogWriteMessage(
|
|
ULONG UniqueErrorCode,
|
|
DWORD dwErr,
|
|
ULONG nStrings,
|
|
LPCWSTR *pwStr)
|
|
{
|
|
HANDLE h;
|
|
|
|
h = RegisterEventSource(NULL, L"DfsSvc");
|
|
|
|
if (h != NULL) {
|
|
|
|
ReportEvent(
|
|
h,
|
|
// EVENTLOG_ERROR_TYPE, // vs EVENTLOG_WARNING_TYPE, EVENTLOG_INFORMATION_TYPE
|
|
EVENTLOG_INFORMATION_TYPE,
|
|
0,
|
|
UniqueErrorCode,
|
|
NULL,
|
|
(USHORT)nStrings,
|
|
sizeof(dwErr),
|
|
pwStr,
|
|
&dwErr);
|
|
|
|
DeregisterEventSource(h);
|
|
|
|
}
|
|
|
|
}
|