LogAddEntries is a 32-bit system Error Logging facility high level API. It is used to allow application processes to add Error Log entries to the internal Error Log buffer that is maintained by the System Logging Service device driver.
The description of the LogAddEntries API call follows:
Syntax
APIRET APIENTRY LogAddEntries(HFILE hf, ULONG service, PVOID log_data_address);
Parameters
hf
0x0
Returns
Return code.
LogAddEntries return the following values:
non-zero
Possible reasons for failure are:
Remarks
Error Log Entry Buffer format description:
Multiple Error Log packets can be included within a single Error Log entry buffer. If multiple packets are included within a single buffer, each individual packet should be aligned on a double word boundary. In the following diagram, the size of each field is indicated in bytes:
┌──────────────────────────────────────────────┐ │packet revision number 2│ ├──────────────────────────────────────────────┤ │# of Error Log entry packets 2│ ├──────────────────────────────────────────────┤ │length of this Error Log entry packet 2│<──┐ ├──────────────────────────────────────────────┤ │ │Error Log record I.D. 2│ │ ├──────────────────────────────────────────────┤ │ │status flags 4│ │ ├──────────────────────────────────────────────┤ │ │qualifier name 4│ │ multiple ├──────────────────────────────────────────────┤ │ Error │reserved 4│ │ Log entry ├──────────────────────────────────────────────┤ │ packets │time of logging 4│ │ within a ├──────────────────────────────────────────────┤ │ single │date of logging 4│ │ Error Log ├──────────────────────────────────────────────┤ │ Entry Buffer │originator name 8 or 256│ │ ├──────────────────────────────────────────────┤ │ │process name (optional) 0 or 260│ │ ├──────────────────────────────────────────────┤ │ │formatting DLL module name (optional) 12│ │ ├──────────────────────────────────────────────┤ │ │Error Log entry data <= 3400│<──┘ └──────────────────────────────────────────────┘
Where
(BIT 0) is used to indicate whether the current Error Log entry packet contains space in which the Error Logging facility can place a long process name ("on" indicates YES, "off" indicates NO);
(BIT 1) is used to indicate whether the current Error Log entry packet contains an 8 byte originator name or a 256 byte originator name ("on" indicates a 256 byte originator name, "off" indicates an 8 byte originator name);
(BIT 2) is used to indicate that the caller has placed time and date values in the Error Log entry packet and does not wish to have those values modified during the logging process ("on" indicates that the Error Log entry packet already contains time and date values, "off" indicates the packet does not already contain time and date values);
All the other 29 bits in 'status flags' are considered reserved at this time and will be zeroed by the LogAddEntries API.
The format and function of the LogAddEntries API call is very similar to that of the 16-bit DosLogEntry call. There are several functional differences from the DosLogEntry call:
In order to resolve successfully LogAddEntries function calls in your program, the following lines must be added to the Linker Definition (DEF) file:
IMPORTS LogAddEntries=DOSCALL1.432