syelog.h
上传用户:tianheyiqi
上传日期:2010-04-16
资源大小:282k
文件大小:4k
源码类别:

外挂编程

开发平台:

Visual C++

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