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.

502 lines
7.8 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. elfproto.h
  5. Abstract:
  6. This file contains the prototypes for the Eventlog service.
  7. Author:
  8. Rajen Shah (rajens) 12-Aug-1991
  9. Revision History:
  10. --*/
  11. #ifndef _ELFPROTO_
  12. #define _ELFPROTO
  13. //
  14. // Other prototypes
  15. //
  16. VOID
  17. ElfpCreateHeap(
  18. VOID
  19. );
  20. PVOID
  21. ElfpAllocateBuffer(
  22. ULONG size
  23. );
  24. BOOLEAN
  25. ElfpFreeBuffer(
  26. PVOID BufPtr
  27. );
  28. VOID
  29. ElfPerformRequest(
  30. PELF_REQUEST_RECORD Request
  31. );
  32. PLOGMODULE
  33. GetModuleStruc (
  34. PUNICODE_STRING ModuleName
  35. );
  36. PLOGMODULE
  37. FindModuleStrucFromAtom (
  38. ATOM Atom
  39. );
  40. VOID
  41. ElfControlResponse(
  42. DWORD
  43. );
  44. VOID
  45. IELF_HANDLE_rundown(
  46. IELF_HANDLE ElfHandle
  47. );
  48. VOID
  49. LinkContextHandle(
  50. IELF_HANDLE LogHandle
  51. );
  52. VOID
  53. UnlinkContextHandle (
  54. IELF_HANDLE LogHandle
  55. );
  56. VOID
  57. LinkLogModule (
  58. PLOGMODULE pLogModule,
  59. ANSI_STRING * pModuleNameA
  60. );
  61. VOID
  62. UnlinkLogModule (
  63. PLOGMODULE pLogModule
  64. );
  65. VOID
  66. LinkLogFile (
  67. PLOGFILE pLogFile
  68. );
  69. VOID
  70. UnlinkLogFile (
  71. PLOGFILE pLogFile
  72. );
  73. VOID
  74. GetGlobalResource (
  75. DWORD Type
  76. );
  77. VOID
  78. ReleaseGlobalResource(
  79. VOID
  80. );
  81. NTSTATUS
  82. SetUpDataStruct (
  83. PUNICODE_STRING LogFileName,
  84. ULONG MaxFileSize,
  85. ULONG Retention,
  86. PUNICODE_STRING ModuleName,
  87. HANDLE hLogFile,
  88. ELF_LOG_TYPE LogType,
  89. LOGPOPUP logpLogPopup,
  90. DWORD dwAutoBackup
  91. );
  92. NTSTATUS
  93. SetUpModules (
  94. HANDLE hLogFile,
  95. PLOGFILE pLogFile,
  96. BOOLEAN bAllowDupes
  97. );
  98. BOOL
  99. StartLPCThread (
  100. VOID
  101. );
  102. VOID
  103. StopLPCThread (
  104. VOID
  105. );
  106. BOOL
  107. ElfStartRegistryMonitor (
  108. VOID
  109. );
  110. VOID
  111. StopRegistryMonitor (
  112. VOID
  113. );
  114. NTSTATUS
  115. ReadRegistryInfo (
  116. HANDLE hLogFiles,
  117. PUNICODE_STRING SubKeyName,
  118. PLOG_FILE_INFO LogFileInfo
  119. );
  120. NTSTATUS
  121. ElfOpenLogFile (
  122. PLOGFILE pLogFile,
  123. ELF_LOG_TYPE LogType
  124. );
  125. NTSTATUS
  126. ElfpCloseLogFile (
  127. PLOGFILE pLogFile,
  128. DWORD Flags,
  129. BOOL bFreeResources
  130. );
  131. BOOL
  132. ValidFilePos (
  133. PVOID Position,
  134. PVOID BeginningRecord,
  135. PVOID EndingRecord,
  136. PVOID PhysicalEOF,
  137. PVOID BaseAddress,
  138. BOOL fCheckBeginEndRange
  139. );
  140. VOID
  141. ElfpCleanUp (
  142. ULONG EventFlags
  143. );
  144. NTSTATUS
  145. ElfpCopyFile (
  146. IN HANDLE SourceHandle,
  147. IN PUNICODE_STRING TargetFileName
  148. );
  149. VOID
  150. FreeModuleAndLogFileStructs (VOID);
  151. NTSTATUS
  152. ElfpFlushFiles (BOOL bShutdown);
  153. VOID
  154. InvalidateContextHandlesForLogFile (
  155. PLOGFILE pLogFile
  156. );
  157. VOID
  158. FixContextHandlesForRecord (
  159. DWORD RecordOffset,
  160. DWORD NewRecordOffset,
  161. PLOGFILE pLogFile
  162. );
  163. PLOGFILE
  164. FindLogFileFromName (
  165. PUNICODE_STRING LogFileName
  166. );
  167. BOOL
  168. SendAdminAlert (
  169. ULONG MessageID,
  170. ULONG NumStrings,
  171. UNICODE_STRING *pStrings
  172. );
  173. PVOID
  174. NextRecordPosition (
  175. ULONG ReadFlags,
  176. PVOID CurrPosition,
  177. ULONG CurrRecordLength,
  178. PVOID BeginRecord,
  179. PVOID EndRecord,
  180. PVOID PhysicalEOF,
  181. PVOID PhysStart
  182. );
  183. VOID
  184. NotifyChange (
  185. PLOGFILE pLogFile
  186. );
  187. VOID
  188. WriteQueuedEvents (
  189. VOID
  190. );
  191. VOID
  192. FlushQueuedEvents (
  193. VOID
  194. );
  195. VOID
  196. PerformWriteRequest (
  197. PELF_REQUEST_RECORD Request
  198. );
  199. NTSTATUS
  200. ElfpCreateLogFileObject(
  201. PLOGFILE LogFile,
  202. DWORD Type,
  203. HANDLE hLogRegKey,
  204. BOOL bFirstTime,
  205. BOOL * pbSDChanged
  206. );
  207. VOID
  208. ElfpCloseAudit(
  209. IN LPWSTR SubsystemName,
  210. IN IELF_HANDLE ContextHandle
  211. );
  212. NTSTATUS
  213. ElfpAccessCheckAndAudit(
  214. IN LPWSTR SubsystemName,
  215. IN LPWSTR ObjectTypeName,
  216. IN LPWSTR ObjectName,
  217. IN OUT IELF_HANDLE ContextHandle,
  218. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  219. IN ACCESS_MASK DesiredAccess,
  220. IN PGENERIC_MAPPING GenericMapping,
  221. IN BOOL ForSecurityLog
  222. );
  223. NTSTATUS
  224. ElfCreateWellKnownSids(
  225. VOID
  226. );
  227. VOID
  228. ElfFreeWellKnownSids(
  229. VOID
  230. );
  231. NTSTATUS
  232. ElfCreateAndSetSD(
  233. IN PRTL_ACE_DATA AceData,
  234. IN ULONG AceCount,
  235. IN PSID OwnerSid OPTIONAL,
  236. IN PSID GroupSid OPTIONAL,
  237. OUT PSECURITY_DESCRIPTOR *NewDescriptor
  238. );
  239. NTSTATUS
  240. ElfCreateUserSecurityObject(
  241. IN PRTL_ACE_DATA AceData,
  242. IN ULONG AceCount,
  243. IN PSID OwnerSid,
  244. IN PSID GroupSid,
  245. IN BOOLEAN IsDirectoryObject,
  246. IN PGENERIC_MAPPING GenericMapping,
  247. OUT PSECURITY_DESCRIPTOR *NewDescriptor
  248. );
  249. VOID
  250. ElfpCreateElfEvent(
  251. IN ULONG EventId,
  252. IN USHORT EventType,
  253. IN USHORT EventCategory,
  254. IN USHORT NumStrings,
  255. IN LPWSTR * Strings,
  256. IN LPVOID Data,
  257. IN ULONG DataSize,
  258. IN USHORT Flags,
  259. IN BOOL ForSecurity
  260. );
  261. VOID
  262. ElfpCreateQueuedAlert(
  263. DWORD MessageId,
  264. DWORD NumberOfStrings,
  265. LPWSTR Strings[]
  266. );
  267. VOID
  268. ElfpCreateQueuedMessage(
  269. DWORD MessageId,
  270. DWORD NumberOfStrings,
  271. LPWSTR Strings[]
  272. );
  273. NTSTATUS
  274. ElfpInitCriticalSection(
  275. PRTL_CRITICAL_SECTION pCritsec
  276. );
  277. NTSTATUS
  278. ElfpInitResource(
  279. PRTL_RESOURCE pResource
  280. );
  281. DWORD
  282. ElfStatusUpdate(
  283. IN DWORD NewState
  284. );
  285. DWORD
  286. GetElState (
  287. VOID
  288. );
  289. VOID
  290. ElfpGenerateLogClearedEvent(
  291. IELF_HANDLE LogHandle,
  292. LPWSTR pwsClientSidString,
  293. LPWSTR pwsComputerName,
  294. PTOKEN_USER pToken
  295. );
  296. NTSTATUS
  297. ElfpInitStatus(
  298. VOID
  299. );
  300. VOID
  301. ElCleanupStatus(
  302. VOID
  303. );
  304. DWORD
  305. ElfBeginForcedShutdown(
  306. IN BOOL PendingCode,
  307. IN DWORD ExitCode,
  308. IN DWORD ServiceSpecificCode
  309. );
  310. NTSTATUS
  311. ElfpTestClientPrivilege(
  312. IN ULONG ulPrivilege,
  313. IN HANDLE hThreadToken OPTIONAL
  314. );
  315. //SS: added to extend clustering support
  316. NTSTATUS
  317. FindSizeofEventsSinceStart (
  318. OUT PULONG pulTotalEventSize,
  319. IN PULONG pulNumLogFiles,
  320. OUT PPROPLOGFILEINFO *ppPropLogFileInfo
  321. );
  322. NTSTATUS
  323. GetEventsToProp(
  324. IN PEVENTLOGRECORD pEventLogRecords,
  325. IN PPROPLOGFILEINFO pPropLogFileInfo
  326. );
  327. NTSTATUS
  328. ElfCheckForComputerNameChange(
  329. );
  330. NTSTATUS
  331. ElfpInitializeBatchingSupport(
  332. VOID
  333. );
  334. NTSTATUS
  335. ElfpSaveEventBuffer(
  336. IN PLOGMODULE pModule,
  337. IN PVOID pEventBuffer,
  338. IN DWORD dwRecordLength
  339. );
  340. VOID CALLBACK
  341. ElfpBatchEventsAndPropagate(
  342. IN PVOID pContext,
  343. IN BOOLEAN fTimerFired
  344. );
  345. NTSTATUS
  346. ElfpClusterRpcAccessCheck(
  347. VOID
  348. );
  349. //SS: end of changes for clustering
  350. VOID
  351. ElfWriteTimeStamp(
  352. TIMESTAMPEVENT EventType,
  353. BOOLEAN Append
  354. );
  355. VOID CALLBACK
  356. ElfWriteLastAliveTimeStamp(
  357. UINT uID,
  358. UINT uMsg,
  359. DWORD dwUser,
  360. DWORD dw1,
  361. DWORD dw2
  362. );
  363. DWORD EstimateEventSize(
  364. DWORD dwStringEst,
  365. DWORD dwDataEst,
  366. LPWSTR pwsModuleName
  367. );
  368. //
  369. // NoonEvent related Functions.
  370. //
  371. ULONG
  372. GetNoonEventSystemUptime(
  373. );
  374. ULONG GetNextNoonEventDelay(
  375. );
  376. DWORD GetNoonEventHotFixInfo(
  377. LPWSTR* ppszHotFixes
  378. );
  379. VOID BuildNoonEventPData(
  380. );
  381. ULONG GetNoonEventTimeStamp(
  382. );
  383. NTSTATUS
  384. VerifyUnicodeString(
  385. IN PUNICODE_STRING pUString
  386. );
  387. LPWSTR
  388. ElfpGetComputerName(
  389. VOID
  390. );
  391. NTSTATUS
  392. ElfpGetClientSidString(
  393. LPWSTR * ppwsClientSidString,
  394. PTOKEN_USER * ppToken
  395. );
  396. NTSTATUS
  397. VerifyFileIsFile (
  398. IN PUNICODE_STRING pUFileName
  399. );
  400. DWORD
  401. GetModuleType(LPWSTR pwsModuleName);
  402. PLOGFILE FindLogFileByModName(LPWSTR pwsLogDefModName);
  403. NTSTATUS
  404. FlushLogFile(
  405. PLOGFILE pLogFile
  406. );
  407. #endif // ifndef _ELFPROTO_