Commit graph

20 commits

Author SHA1 Message Date
Colin Finck c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
Hermès Bélusca-Maïto 0dfecf815d [NTOS:IO][INCLUDES][EVENTLOG]: Fix support for event logging through the "ErrorLogPort" LPC. See the details in CORE-12301 #resolve
svn path=/trunk/; revision=73167
2016-11-07 13:29:09 +00:00
Hermès Bélusca-Maïto 1f9c38b3b9 [EVTLIB]: Create a EvtLib library for manipulating the event log file format from anywhere.
[EVENTLOG]: Make usage of this library.
CORE-11868 #resolve #comment Committed in r73035.

[EVENTLOG]: Protect the global handle table with a lock as it seems to me that this needs serialization. Please notify me if you think this is not actually necessary (and I'll revert that in case).

svn path=/trunk/; revision=73035
2016-10-25 23:50:31 +00:00
Hermès Bélusca-Maïto 34a06851d3 [EVENTLOG]
- Update code source files headers.
- Use explicit unicode functions for RegOpen/Query/SetXXX and safe-string APIs.
- Use GetSystemWindowsDirectoryW where needed instead of GetWindowsDirectoryW (TS-safe).
- Fix some variable names & types.
- Improve some DPRINTs.

svn path=/trunk/; revision=73034
2016-10-25 23:32:20 +00:00
Hermès Bélusca-Maïto a2b693dfc4 [EVENTLOG]
- Get rid of MyHeap.
- Continue using safe string functions.
- Allow event logs themselves to be their own source. And store the full list of log sources in the "Sources" registry multi-string value.
- Correctly compute the number of records.
- Correctly return the event number and the write timestamp of reported events.
- Use a helper function for ElfrReportEventW/A and for ElfrReportEventAndSourceW that is now implemented.
- Rewrite the file.c functions using NT-APIs almost exclusively for file operations.
- Modify the logic of LogfReadEvents so that a RecordNumber == 0 in sequential read mode means we need to determine where to start the read operation, depending on whether a forwards-read or a backwards-read is performed. The log handle's CurrentRecord member is therefore initialized to 0 before usage.
- Adjust LogfAllocAndBuildNewRecord to take in input the event generation timestamp.
- Do not "compute" the RecordNumber of the new event in LogfAllocAndBuildNewRecord; it will be consistently assigned by LogfWriteRecord.
- Correctly initialize the OldestRecordNumber to zero for new (empty) logs.
- Perform extensive log validity checks when opening existing logs: log header and EOF record as well as boundary checks.
- Rewrite almost of the functions to support event log wrapping (see https://msdn.microsoft.com/en-us/library/windows/desktop/bb309026(v=vs.85).aspx ) and splitted records. Now our event logs are not corrupted anymore, and are readable under Windows 2k/xp/2k3/Vista+.
- As a consequence of supporting wrapping event logs we need to iterate through them at loading time in order to locate the valid EOF record (indeed it may happen that the log header is not correctly synced, and its Start/EndOffsets are invalid. The EOF record offsets contain on the other way the correct values).

The file.c fixes are a bit still work-in-progress, but the bulk of the code works. It is extensively tested in situ in my local VM since 2 months now.

CORE-11843 #resolve

svn path=/trunk/; revision=72236
2016-08-16 21:08:15 +00:00
Hermès Bélusca-Maïto f7cb5ca5c0 [EVENTLOG]
- Use NT functions to retrieve timestamps for events.
- Log kernel events with the current computer name.
- Don't hardcode variables types for sizeofs.
- Add type-checks for the data to be retrieved from the registry, and use default values in case the values do not exist or are invalid.
- Use ULONG_PTR to perform pointer arithmetics.
- Use string-safe functions for copy/concatenation.
- Cache EventLog source for eventlog service self-logging.
- Unlock the LogFile in LogfClearFile.
- Fix rounding in LogfAllocAndBuildNewRecord.
- Verify ELF handle validity in ElfrGetLogInformation.
- Implement IELF_HANDLE_rundown to correctly cleanup ELF handles when client apps shut down. Adapt also the parameter of ElfDeleteEventLogHandle for reusing it there.
- Update some code formatting.
CORE-11842 #resolve

I don't completely touch file.c as it contains most of my upcoming eventlog fixes...

svn path=/trunk/; revision=72213
2016-08-12 19:14:55 +00:00
Amine Khaldi 37b4177aee [SERVICES] Improve the FILE header section. Brought to you by Adam Stachowicz. CORE-10114
svn path=/trunk/; revision=69194
2015-09-12 10:58:07 +00:00
Amine Khaldi 427ef54d29 [EVENTLOG]
* Remove one time inclusions from the main header and put them back where they belong.
CORE-7716

svn path=/trunk/; revision=61604
2014-01-13 12:46:06 +00:00
Amine Khaldi 359a887df3 [EVENTLOG]
* Do not include debug.h into the main header.
CORE-7716

svn path=/trunk/; revision=61315
2013-12-21 13:45:16 +00:00
Eric Kohl 846be7ac13 [EVENTLOG]
Partially revert r54678.

svn path=/trunk/; revision=54751
2011-12-25 00:57:16 +00:00
Eric Kohl 8da34d541e [ADVAPI33/EVENTLOG]
- Determine the event generation time in ReportEventA/W and use it.
- Replace magic values by proper type size.

svn path=/trunk/; revision=54678
2011-12-17 23:47:28 +00:00
Michael Martin 21c30014ed - Update structs and flags to correct names based on documentation.
svn path=/trunk/; revision=38327
2008-12-24 12:14:30 +00:00
Dmitry Gorbachev c63a203efa Put inline functions into header files.
svn path=/trunk/; revision=37921
2008-12-07 23:40:23 +00:00
Stefan Ginsberg b137725c9a - Kill off more STDCALL
svn path=/trunk/; revision=37762
2008-11-30 11:16:55 +00:00
Daniel Reimer ae7da04787 Delete all Trailing spaces in code.
svn path=/trunk/; revision=29690
2007-10-19 23:21:45 +00:00
Dmitry Gorbachev 761de0042d - Fix a bug in "close all log files" code.
- Replace custom list functions by RTL ones.
- Fix indentation.

svn path=/trunk/; revision=26626
2007-05-03 07:47:12 +00:00
Saveliy Tretiakov 36e0982b7e Reduce code dublication
svn path=/trunk/; revision=22737
2006-07-01 06:52:41 +00:00
Saveliy Tretiakov df5296300e Read configuration from registry
svn path=/trunk/; revision=22712
2006-06-30 14:53:24 +00:00
Saveliy Tretiakov 3f4ded7db8 Don't create files when booting from CD
Implement EventLogOpenA (wrapper over unimplemented EventLogOpenW)

svn path=/trunk/; revision=21224
2006-03-04 17:04:42 +00:00
Maarten Bosma 24092de24f 3.) Move services into base
svn path=/trunk/; revision=21082
2006-02-17 14:24:04 +00:00
Renamed from reactos/services/eventlog/logport.c (Browse further)