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.

356 lines
9.4 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. ELF.IDL
  5. Abstract:
  6. Contains the Elfr APIs which are used to remote the Elf APIs to
  7. the local or remote server via RPC.
  8. Also contains the RPC specific data structures for these API.
  9. Author:
  10. Rajen Shah (rajens) 02-Apr-1991
  11. Revision History:
  12. 02-Apr-1991 RajenS
  13. created
  14. --*/
  15. //
  16. // Interface Attributes
  17. //
  18. [
  19. uuid(82273FDC-E32A-18C3-3F78-827929DC23EA),
  20. version(0.0),
  21. #ifdef __midl
  22. ms_union,
  23. #endif // __midl
  24. pointer_default(unique)
  25. ]
  26. //
  27. // Interface Keyword
  28. //
  29. interface eventlog
  30. //
  31. // Interface Body
  32. //
  33. {
  34. import "imports.idl"; // import all the include files
  35. #include "event.h"
  36. //
  37. // ELF Generic Handle used to bind from client to server.
  38. //
  39. typedef [handle,unique] LPWSTR EVENTLOG_HANDLE_W;
  40. typedef [handle,unique] LPSTR EVENTLOG_HANDLE_A;
  41. //
  42. // ELF RPC Context Handle (Internal definition of ELF_HANDLE)
  43. //
  44. typedef [context_handle] struct _IELF_HANDLE {
  45. LIST_ENTRY Next;
  46. ULONG Signature; // BUGBUG - For debug only
  47. ULONG Flags; // e.g. "invalid"
  48. ULONG GrantedAccess;
  49. ATOM Atom;
  50. ULONG SeekRecordPos;
  51. ULONG SeekBytePos;
  52. ULONG MajorVersion; // To identify caller
  53. ULONG MinorVersion;
  54. DWORD dwNotifyRequests;
  55. ULONG NameLength;
  56. [size_is(NameLength)] WCHAR Name[]; // Keep this as last field
  57. } *IELF_HANDLE;
  58. typedef IELF_HANDLE *PIELF_HANDLE;
  59. //
  60. // UNICODE Function Prototypes
  61. //
  62. //
  63. // Only OpenEL and CloseEL need to take PIELF_HANDLE
  64. // parameters since they are the only ones to modify the handle.
  65. // The others will take IELF_HANDLE parameters instead.
  66. //
  67. // NOTE:
  68. // The names of the functions are short so that when RPC
  69. // prepends the interface name to the names, they are still
  70. // unique.
  71. //
  72. NTSTATUS
  73. ElfrClearELFW (
  74. [in] IELF_HANDLE LogHandle,
  75. [in,unique] PRPC_UNICODE_STRING BackupFileName
  76. );
  77. NTSTATUS
  78. ElfrBackupELFW (
  79. [in] IELF_HANDLE LogHandle,
  80. [in] PRPC_UNICODE_STRING BackupFileName
  81. );
  82. NTSTATUS
  83. ElfrCloseEL (
  84. [in,out] PIELF_HANDLE LogHandle
  85. );
  86. NTSTATUS
  87. ElfrDeregisterEventSource (
  88. [in,out] PIELF_HANDLE LogHandle
  89. );
  90. NTSTATUS
  91. ElfrNumberOfRecords(
  92. [in] IELF_HANDLE LogHandle,
  93. [out] PULONG NumberOfRecords
  94. );
  95. NTSTATUS
  96. ElfrOldestRecord(
  97. [in] IELF_HANDLE LogHandle,
  98. [out] PULONG OldestRecordNumber
  99. );
  100. NTSTATUS
  101. ElfrChangeNotify(
  102. [in] IELF_HANDLE LogHandle,
  103. [in] RPC_CLIENT_ID ClientId,
  104. [in] ULONG Event
  105. );
  106. //
  107. // The ModuleName is the one passed in by the caller of the API. This is
  108. // the one that is written to the log file.
  109. //
  110. // RegModuleName is generated by the client stub, and is the name that is
  111. // used to determine the default log file name from the registry. For
  112. // NT Product1, this will be "Application". NOTE: It is necessary to do this
  113. // now so that we can support viewing logs from a Product 2 system in the
  114. // future if we change our logging mechanism.
  115. //
  116. NTSTATUS
  117. ElfrOpenELW (
  118. [in] EVENTLOG_HANDLE_W UNCServerName,
  119. [in] PRPC_UNICODE_STRING ModuleName, // Passed in API call
  120. [in] PRPC_UNICODE_STRING RegModuleName, // Used for registry
  121. [in] ULONG MajorVersion,
  122. [in] ULONG MinorVersion,
  123. [out] PIELF_HANDLE LogHandle
  124. );
  125. NTSTATUS
  126. ElfrRegisterEventSourceW (
  127. [in] EVENTLOG_HANDLE_W UNCServerName,
  128. [in] PRPC_UNICODE_STRING ModuleName, // Passed in API call
  129. [in] PRPC_UNICODE_STRING RegModuleName, // Used for registry info
  130. [in] ULONG MajorVersion,
  131. [in] ULONG MinorVersion,
  132. [out] PIELF_HANDLE LogHandle
  133. );
  134. NTSTATUS
  135. ElfrOpenBELW (
  136. [in] EVENTLOG_HANDLE_W UNCServerName,
  137. [in] PRPC_UNICODE_STRING BackupFileName, // Passed in API call
  138. [in] ULONG MajorVersion,
  139. [in] ULONG MinorVersion,
  140. [out] PIELF_HANDLE LogHandle
  141. );
  142. //
  143. // BUGBUG - Fix this interface once RPC supports the ability to return
  144. // zero bytes. Then, Buffer will have a length_is(*NumberOfBytesRead)
  145. // added to it. For now, always transfer NumberOfBytesToRead bytes!
  146. //
  147. // The LogHandle is an [in,out] since the server side stores information
  148. // in it that pertains to the current seek position.
  149. //
  150. NTSTATUS
  151. ElfrReadELW (
  152. [in] IELF_HANDLE LogHandle,
  153. [in] ULONG ReadFlags,
  154. [in] ULONG RecordOffset,
  155. [in] ULONG NumberOfBytesToRead,
  156. [out,size_is(NumberOfBytesToRead)] PBYTE Buffer,
  157. [out] PULONG NumberOfBytesRead,
  158. [out] PULONG MinNumberOfBytesNeeded
  159. );
  160. NTSTATUS
  161. ElfrReportEventW (
  162. [in] IELF_HANDLE LogHandle,
  163. [in] ULONG Time,
  164. [in] USHORT EventType,
  165. [in] USHORT EventCategory,
  166. [in] ULONG EventID,
  167. [in] USHORT NumStrings,
  168. [in] ULONG DataSize,
  169. [in] PRPC_UNICODE_STRING ComputerName,
  170. [in, unique] PRPC_SID UserSID,
  171. [in, size_is(NumStrings), unique] PRPC_UNICODE_STRING Strings[*],
  172. [in, size_is(DataSize), unique] PBYTE Data,
  173. [in] USHORT Flags,
  174. [in,out,unique] PULONG RecordNumber,
  175. [in,out,unique] PULONG TimeWritten
  176. );
  177. //
  178. // ANSI Function Prototypes
  179. //
  180. //
  181. // Only OpenEL needs to take PIELF_HANDLE
  182. // parameters since they are the only ones to modify the handle.
  183. // The others will take IELF_HANDLE parameters instead.
  184. //
  185. // NOTE that there is only one api for CloseEL since there are no
  186. // strings involved.
  187. //
  188. NTSTATUS
  189. ElfrClearELFA (
  190. [in] IELF_HANDLE LogHandle,
  191. [in,unique] PRPC_STRING BackupFileName
  192. );
  193. NTSTATUS
  194. ElfrBackupELFA (
  195. [in] IELF_HANDLE LogHandle,
  196. [in] PRPC_STRING BackupFileName
  197. );
  198. //
  199. // The ModuleName is the one passed in by the caller of the API. This is
  200. // the one that is written to the log file.
  201. //
  202. // RegModuleName is generated by the client stub, and is the name that is
  203. // used to determine the default log file name from the registry. For
  204. // NT Product1, this will be "Application". NOTE: It is necessary to do this
  205. // now so that we can support viewing logs from a Product 2 system in the
  206. // future if we change our logging mechanism.
  207. //
  208. NTSTATUS
  209. ElfrOpenELA (
  210. [in] EVENTLOG_HANDLE_A UNCServerName,
  211. [in] PRPC_STRING ModuleName, // Passed in API call
  212. [in] PRPC_STRING RegModuleName, // Used for registry info
  213. [in] ULONG MajorVersion,
  214. [in] ULONG MinorVersion,
  215. [out] PIELF_HANDLE LogHandle
  216. );
  217. NTSTATUS
  218. ElfrRegisterEventSourceA (
  219. [in] EVENTLOG_HANDLE_A UNCServerName,
  220. [in] PRPC_STRING ModuleName, // Passed in API call
  221. [in] PRPC_STRING RegModuleName, // Used for registry info
  222. [in] ULONG MajorVersion,
  223. [in] ULONG MinorVersion,
  224. [out] PIELF_HANDLE LogHandle
  225. );
  226. NTSTATUS
  227. ElfrOpenBELA (
  228. [in] EVENTLOG_HANDLE_A UNCServerName,
  229. [in] PRPC_STRING FileName, // Passed in API call
  230. [in] ULONG MajorVersion,
  231. [in] ULONG MinorVersion,
  232. [out] PIELF_HANDLE LogHandle
  233. );
  234. //
  235. // BUGBUG - Fix this interface once RPC supports the ability to return
  236. // zero bytes. Then, Buffer will have a length_is(*NumberOfBytesRead)
  237. // added to it. For now, always transfer NumberOfBytesToRead bytes!
  238. //
  239. // The LogHandle is an [in,out] since the server side stores information
  240. // in it that pertains to the current seek position.
  241. //
  242. NTSTATUS
  243. ElfrReadELA (
  244. [in] IELF_HANDLE LogHandle,
  245. [in] ULONG ReadFlags,
  246. [in] ULONG RecordOffset,
  247. [in] ULONG NumberOfBytesToRead,
  248. [out,size_is(NumberOfBytesToRead)] PBYTE Buffer,
  249. [out] PULONG NumberOfBytesRead,
  250. [out] PULONG MinNumberOfBytesNeeded
  251. );
  252. NTSTATUS
  253. ElfrReportEventA (
  254. [in] IELF_HANDLE LogHandle,
  255. [in] ULONG Time,
  256. [in] USHORT EventType,
  257. [in] USHORT EventCategory,
  258. [in] ULONG EventID,
  259. [in] USHORT NumStrings,
  260. [in] ULONG DataSize,
  261. [in] PRPC_STRING ComputerName,
  262. [in, unique] PRPC_SID UserSID,
  263. [in, size_is(NumStrings), unique] PRPC_STRING Strings[*],
  264. [in, size_is(DataSize), unique] PBYTE Data,
  265. [in] USHORT Flags,
  266. [in,out,unique] PULONG RecordNumber,
  267. [in,out,unique] PULONG TimeWritten
  268. );
  269. NTSTATUS
  270. ElfrRegisterClusterSvc(
  271. [in] EVENTLOG_HANDLE_W UNCServerName,
  272. [out] PULONG pulSize,
  273. [out, size_is(,*pulSize)] BYTE **ppPackedEventInfo );
  274. NTSTATUS
  275. ElfrDeregisterClusterSvc(
  276. [in] EVENTLOG_HANDLE_W UNCServerName
  277. );
  278. NTSTATUS
  279. ElfrWriteClusterEvents(
  280. [in] EVENTLOG_HANDLE_W UNCServerName,
  281. [in] ULONG ulSize,
  282. [in,size_is(ulSize)] BYTE *pBuffer
  283. );
  284. /////////////////////////////////////////////////////////////////////////////
  285. // Functions below this point are not in Windows NT version 4.0 or earlier
  286. //
  287. // (Note that new functions must always be added at the end, otherwise
  288. // function calls are mismatched when client and server talk different
  289. // versions of the interface)
  290. /////////////////////////////////////////////////////////////////////////////
  291. NTSTATUS
  292. ElfrGetLogInformation(
  293. [in] IELF_HANDLE LogHandle,
  294. [in] ULONG InfoLevel,
  295. [out, size_is(cbBufSize)] PBYTE lpBuffer,
  296. [in] ULONG cbBufSize,
  297. [out] PULONG pcbBytesNeeded
  298. );
  299. }