Source code of Windows XP (NT5)
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

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1999, Microsoft Corporation
  4. //
  5. // File: log.cxx
  6. //
  7. // Contents: Event logging for Dfs service
  8. //
  9. // Functions:
  10. //
  11. // History: 2-1-99 Jharper created
  12. //
  13. //-----------------------------------------------------------------------------
  14. #include <headers.hxx>
  15. #pragma hdrstop
  16. extern "C" {
  17. #include <stdio.h>
  18. #include <windows.h>
  19. #include <lm.h>
  20. #include <lmwksta.h>
  21. #include <malloc.h>
  22. }
  23. extern "C" VOID
  24. LogWriteMessage(
  25. ULONG UniqueErrorCode,
  26. DWORD dwErr,
  27. ULONG nStrings,
  28. LPCWSTR *pwStr)
  29. {
  30. HANDLE h;
  31. h = RegisterEventSource(NULL, L"DfsSvc");
  32. if (h != NULL) {
  33. ReportEvent(
  34. h,
  35. // EVENTLOG_ERROR_TYPE, // vs EVENTLOG_WARNING_TYPE, EVENTLOG_INFORMATION_TYPE
  36. EVENTLOG_INFORMATION_TYPE,
  37. 0,
  38. UniqueErrorCode,
  39. NULL,
  40. (USHORT)nStrings,
  41. sizeof(dwErr),
  42. pwStr,
  43. &dwErr);
  44. DeregisterEventSource(h);
  45. }
  46. }