syelog.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Detours Test Program (syelog.h of syelog.lib)
  4. //
  5. // Microsoft Research Detours Package, Version 3.0.
  6. //
  7. // Copyright (c) Microsoft Corporation. All rights reserved.
  8. //
  9. #pragma once
  10. #ifndef _SYELOGD_H_
  11. #define _SYELOGD_H_
  12. #include <stdarg.h>
  13. #pragma pack(push, 1)
  14. #pragma warning(push)
  15. #pragma warning(disable: 4200)
  16. //////////////////////////////////////////////////////////////////////////////
  17. //
  18. //
  19. #define SYELOG_PIPE_NAMEA "\\\\.\\pipe\\syelog"
  20. #define SYELOG_PIPE_NAMEW L"\\\\.\\pipe\\syelog"
  21. #ifdef UNICODE
  22. #define SYELOG_PIPE_NAME SYELOG_PIPE_NAMEW
  23. #else
  24. #define SYELOG_PIPE_NAME SYELOG_PIPE_NAMEA
  25. #endif
  26. //////////////////////////////////////////////////////////////////////////////
  27. //
  28. #define SYELOG_MAXIMUM_MESSAGE 4086 // 4096 - sizeof(header stuff)
  29. typedef struct _SYELOG_MESSAGE
  30. {
  31. USHORT nBytes;
  32. BYTE nFacility;
  33. BYTE nSeverity;
  34. DWORD nProcessId;
  35. FILETIME ftOccurance;
  36. BOOL fTerminate;
  37. CHAR szMessage[SYELOG_MAXIMUM_MESSAGE];
  38. } SYELOG_MESSAGE, *PSYELOG_MESSAGE;
  39. // Facility Codes.
  40. //
  41. #define SYELOG_FACILITY_KERNEL 0x10 // OS Kernel
  42. #define SYELOG_FACILITY_SECURITY 0x20 // OS Security
  43. #define SYELOG_FACILITY_LOGGING 0x30 // OS Logging-internal
  44. #define SYELOG_FACILITY_SERVICE 0x40 // User-mode system daemon
  45. #define SYELOG_FACILITY_APPLICATION 0x50 // User-mode application
  46. #define SYELOG_FACILITY_USER 0x60 // User self-generated.
  47. #define SYELOG_FACILITY_LOCAL0 0x70 // Locally defined.
  48. #define SYELOG_FACILITY_LOCAL1 0x71 // Locally defined.
  49. #define SYELOG_FACILITY_LOCAL2 0x72 // Locally defined.
  50. #define SYELOG_FACILITY_LOCAL3 0x73 // Locally defined.
  51. #define SYELOG_FACILITY_LOCAL4 0x74 // Locally defined.
  52. #define SYELOG_FACILITY_LOCAL5 0x75 // Locally defined.
  53. #define SYELOG_FACILITY_LOCAL6 0x76 // Locally defined.
  54. #define SYELOG_FACILITY_LOCAL7 0x77 // Locally defined.
  55. #define SYELOG_FACILITY_LOCAL8 0x78 // Locally defined.
  56. #define SYELOG_FACILITY_LOCAL9 0x79 // Locally defined.
  57. // Severity Codes.
  58. //
  59. #define SYELOG_SEVERITY_FATAL 0x00 // System is dead.
  60. #define SYELOG_SEVERITY_ALERT 0x10 // Take action immediately.
  61. #define SYELOG_SEVERITY_CRITICAL 0x20 // Critical condition.
  62. #define SYELOG_SEVERITY_ERROR 0x30 // Error
  63. #define SYELOG_SEVERITY_WARNING 0x40 // Warning
  64. #define SYELOG_SEVERITY_NOTICE 0x50 // Significant condition.
  65. #define SYELOG_SEVERITY_INFORMATION 0x60 // Informational
  66. #define SYELOG_SEVERITY_AUDIT_FAIL 0x66 // Audit Failed
  67. #define SYELOG_SEVERITY_AUDIT_PASS 0x67 // Audit Succeeeded
  68. #define SYELOG_SEVERITY_DEBUG 0x70 // Debugging
  69. // Logging Functions.
  70. //
  71. VOID SyelogOpen(PCSTR pszIdentifier, BYTE nFacility);
  72. VOID Syelog(BYTE nSeverity, PCSTR pszMsgf, ...);
  73. VOID SyelogV(BYTE nSeverity, PCSTR pszMsgf, va_list args);
  74. VOID SyelogClose(BOOL fTerminate);
  75. #pragma warning(pop)
  76. #pragma pack(pop)
  77. #endif // _SYELOGD_H_
  78. //
  79. ///////////////////////////////////////////////////////////////// End of File.