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.

186 lines
7.7 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: pantheios/backends/bec.WindowsEventLog.h
  3. *
  4. * Purpose: Declaration of the Pantheios WindowsEventLog Stock Back-end API.
  5. *
  6. * Created: 8th May 2006
  7. * Updated: 26th December 2010
  8. *
  9. * Home: http://www.pantheios.org/
  10. *
  11. * Copyright (c) 2006-2010, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are
  16. * met:
  17. *
  18. * - Redistributions of source code must retain the above copyright notice,
  19. * this list of conditions and the following disclaimer.
  20. * - Redistributions in binary form must reproduce the above copyright
  21. * notice, this list of conditions and the following disclaimer in the
  22. * documentation and/or other materials provided with the distribution.
  23. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
  24. * names of any contributors may be used to endorse or promote products
  25. * derived from this software without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  28. * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  29. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  30. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  31. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  32. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  33. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  34. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  35. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  36. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  37. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. * ////////////////////////////////////////////////////////////////////// */
  40. /** \file pantheios/backends/bec.WindowsEventLog.h
  41. *
  42. * [C, C++] Pantheios Windows EventLog Back-end Common API
  43. */
  44. #ifndef PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_WINDOWSEVENTLOG
  45. #define PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_WINDOWSEVENTLOG
  46. /* /////////////////////////////////////////////////////////////////////////
  47. * Version information
  48. */
  49. #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
  50. # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_WINDOWSEVENTLOG_MAJOR 1
  51. # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_WINDOWSEVENTLOG_MINOR 2
  52. # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_WINDOWSEVENTLOG_REVISION 2
  53. # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_WINDOWSEVENTLOG_EDIT 27
  54. #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
  55. /* /////////////////////////////////////////////////////////////////////////
  56. * Includes
  57. */
  58. #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
  59. # include <pantheios/pantheios.h>
  60. #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS */
  61. #ifndef PANTHEIOS_INCL_PANTHEIOS_H_BACKEND
  62. # include <pantheios/backend.h>
  63. #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_BACKEND */
  64. /* /////////////////////////////////////////////////////////////////////////
  65. * Documentation
  66. */
  67. /** \defgroup group__backend__stock_backends__WindowsEventLog Pantheios Windows EventLog Stock Back-end
  68. * \ingroup group__backend__stock_backends
  69. * Back-end library that writes to the Windows event log.
  70. */
  71. /* /////////////////////////////////////////////////////////////////////////
  72. * Application-defined Functions
  73. */
  74. #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
  75. struct Pantheios_be_WindowsEventLog_no_longer_uses_the_symbol_BE_WINDOWSEVENTLOG_EVENTID_it_now_uses_the_function_pantheios_be_WindowsEventLog_calcCategoryAndEventId_;
  76. # define BE_WINDOWSEVENTLOG_EVENTID Pantheios_be_WindowsEventLog_no_longer_uses_the_symbol_BE_WINDOWSEVENTLOG_EVENTID_it_now_uses_the_function_pantheios_be_WindowsEventLog_calcCategoryAndEventId_()
  77. struct Pantheios_be_WindowsEventLog_no_longer_uses_the_symbol_pantheios_be_WindowsEventLog_calcCategory_it_now_uses_the_function_pantheios_be_WindowsEventLog_calcCategoryAndEventId_;
  78. # define pantheios_be_WindowsEventLog_calcCategory struct Pantheios_be_WindowsEventLog_no_longer_uses_the_symbol_pantheios_be_WindowsEventLog_calcCategory_it_now_uses_the_function_pantheios_be_WindowsEventLog_calcCategoryAndEventId_
  79. struct Pantheios_be_WindowsEventLog_no_longer_uses_the_symbol_pantheios_be_WindowsEventLog_calcEventId_it_now_uses_the_function_pantheios_be_WindowsEventLog_calcCategoryAndEventId_;
  80. # define pantheios_be_WindowsEventLog_calcEventId struct Pantheios_be_WindowsEventLog_no_longer_uses_the_symbol_pantheios_be_WindowsEventLog_calcEventId_it_now_uses_the_function_pantheios_be_WindowsEventLog_calcCategoryAndEventId_
  81. #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
  82. /** Evaluates the appropriate category and event identifiers for a given
  83. * back-end identifier and Pantheios severity level.
  84. *
  85. * \note This is an application-specified function.
  86. *
  87. * \ingroup group__backend__stock_backends__WindowsEventLog
  88. */
  89. PANTHEIOS_CALL(void) pantheios_be_WindowsEventLog_calcCategoryAndEventId(
  90. int backEndId
  91. , int severity
  92. #if !defined(PANTHEIOS_NO_NAMESPACE)
  93. , pantheios::uint16_t* category
  94. , pantheios::uint32_t* eventId
  95. #else /* ? !PANTHEIOS_NO_NAMESPACE */
  96. , pan_uint16_t* category
  97. , pan_uint32_t* eventId
  98. #endif /* !PANTHEIOS_NO_NAMESPACE */
  99. ) /* throw() */;
  100. /* /////////////////////////////////////////////////////////////////////////
  101. * API
  102. */
  103. /** Implements the functionality for pantheios_be_init() over the Windows EventLog API.
  104. *
  105. * \ingroup group__backend__stock_backends__WindowsEventLog
  106. */
  107. PANTHEIOS_CALL(int) pantheios_be_WindowsEventLog_init(
  108. PAN_CHAR_T const* processIdentity
  109. , int id
  110. , void* unused
  111. , void* reserved
  112. , void** ptoken
  113. );
  114. /** Implements the functionality for pantheios_be_uninit() over the Windows EventLog API.
  115. * \ingroup group__backend__stock_backends__WindowsEventLog
  116. */
  117. PANTHEIOS_CALL(void) pantheios_be_WindowsEventLog_uninit(
  118. void* token
  119. );
  120. /** Implements the functionality for pantheios_be_logEntry() over the Windows EventLog API.
  121. * \ingroup group__backend__stock_backends__WindowsEventLog
  122. */
  123. PANTHEIOS_CALL(int) pantheios_be_WindowsEventLog_logEntry(
  124. void* feToken
  125. , void* beToken
  126. , int severity
  127. , PAN_CHAR_T const* entry
  128. , size_t cchEntry
  129. );
  130. #if 0
  131. /* TODO: Implement these in 1.0.1 beta 162+
  132. */
  133. /** This helper function can be used to defer
  134. */
  135. PANTHEIOS_CALL(void) pantheios_be_WindowsEventLog_getPantheiosDotComCategoryAndEventId(
  136. int backEndId
  137. , int severity
  138. #if !defined(PANTHEIOS_NO_NAMESPACE)
  139. , pantheios::uint16_t* category
  140. , pantheios::uint32_t* eventId
  141. #else /* ? !PANTHEIOS_NO_NAMESPACE */
  142. , pan_uint16_t* category
  143. , pan_uint32_t* eventId
  144. #endif /* !PANTHEIOS_NO_NAMESPACE */
  145. ) /* throw() */;
  146. /** Registers an event source for use with Pantheios.COM
  147. */
  148. PANTHEIOS_CALL(int) pantheios_be_WindowsEventLog_registerEventSourceUsingPantheiosDotCom(PAN_CHAR_T const* sourceName, PAN_CHAR_T const* pantheiosDotComPath);
  149. /** Unregisters an event source for use with Pantheios.COM
  150. */
  151. PANTHEIOS_CALL(int) pantheios_be_WindowsEventLog_unregisterEventSourceUsingPantheiosDotCom(PAN_CHAR_T const* sourceName, PAN_CHAR_T const* pantheiosDotComPath);
  152. #endif /* 0 */
  153. /* ////////////////////////////////////////////////////////////////////// */
  154. #endif /* PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_WINDOWSEVENTLOG */
  155. /* ///////////////////////////// end of file //////////////////////////// */