Leaked source code of windows server 2003
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.

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