Jump to content

DosLogEntry

From EDM2
Revision as of 16:27, 25 February 2017 by Ak120 (talk | contribs) (Ak120 moved page OS2 API:CPI:LEGACY:DosLogEntry to DosLogEntry)

Description

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.


Syntax

APIRET16 APIENTRY16 DosLogEntry((USHORT) Function,
                                       (PVOID) LogData)

Parameters

Function
specifies the type of log entry:
0H              Reserved 
1H              Error Logging 
2H-FFFFH        Reserved 
LogData
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

Remarks

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³<ÄÄÙ
      ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

Where:

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

'Error : 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:

IMPORTS
DOSLOGENTRY=DOSCALL1.193

Example Code

Related Functions