From EDM2
Jump to: navigation, search

This functions is part of the 16 Bit Error Logging API's for IBM OS/2 Version 2.1.

There are two major differences between the OS/2 2.0 version of DosLogEntry and the 1.3 version of the API:

  • Since the DosLogRegister API will only return a "default" Error Log record I.D. to its caller, the DosLogEntry caller must override this "default" record with the appropriately statically allocated record I.D. if the caller wishes to see the "correct" record I.D. in the Error Log record.
  • Since there is no explicit "Error Log record formatting DLL module name" field in the DosLogEntry log data packet, the API will attempt to interpret the 'Originator Name' field in the packet's header portion as a formatting DLL module name.


DosLogEntry (Function, LogData)


Function (USHORT)
specifies the type of log entry:
0H - Reserved
1H - Error Logging
2H-FFFFH - Reserved
LogData (PVOID)
is the address of the log data buffer that contains one or more variable length log packets.

Return Code

DosLogEntry returns the following values:
  • Success : non-zero
  • Failure : 0

Possible reasons for failure:

  • Invalid function
  • Facility unavailable
  • Facility suspended
  • Error Log buffer temporarily full


Error Log Data Buffer format description:

Multiple log packets can be included within a single log data buffer. In the following diagram, the size of each field is indicated in bytes:

│# of log packets (within the buffer)         2│
│length of the current log packet             2│<──┐
├──────────────────────────────────────────────┤   │
│Error Log record I.D.                        2│   │
├──────────────────────────────────────────────┤   │
│time of logging                              4│   │  multiple
├──────────────────────────────────────────────┤   │  log packets
│date of logging                              4│   │  within a
├──────────────────────────────────────────────┤   │  single log
│originator name                              8│   │  data buffer
├──────────────────────────────────────────────┤   │
│qualifier name                               4│   │
├──────────────────────────────────────────────┤   │
│Error Log entry data                   <= 1024│<──┘


'# of log packets' 
is the number of separate packets contained within the user's buffer
'length of the current log packet' 
is the number of bytes in the current log packet within the user's log data buffer (this length includes the length of all the log packet control fields and the size of the Error Log entry data).
'Error Log record I.D.' 
is the record I.D. for the current Error Log entry (I.D. registration will be statically registered by the OS/2 development organization).The caller may pass in the "default" Error Log record I.D. that is returned by the DosLogRegister API.
'time of logging' 
is filled in by the system Error Logging facility
'date of logging' 
is filled in by the system Error Logging facility
'originator name' 
is a primary name field that is provided by the caller
'qualifier name' 
is a secondary name field that is provided by the caller
Log entry data' is an optional variable length set of data that can be supplied by the caller (the format of the data is under the control of the caller).

In order to successfully resolve DosLogEntry function calls in your program, the following lines must be added to the Linker Definition (DEF) file: