Table of Contents

This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS

Note: This is legacy API call. It is recommended to use 32-bit equivalent

2021/09/17 04:47 · prokushev · 0 Comments
2021/08/20 03:18 · prokushev · 0 Comments

DosSysTrace

Brief

Writes a trace record to the system trace buffer. It provides a high speed event recording mechanism which may be used by PM and non-PM threads in ring 3 and ring 2 and by detached processes.

Syntax

 APIRET APIENTRY16 DosSysTrace
        (USHORT major, USHORT cBuffer, USHORT minor, PCHAR pBuffer) 

Parameters

Return Code

ulrc (APIRET) returns

DosSysTrace returns one of the following values

Remarks

DosSysTrace creates a trace record that includes the following items:

To check is tracing enabled use DosGetInfoSeg. GlobalInfoSeg contains 256bit flags area. See DosGetInfoSeg for more info.

Example Code

int main(int argc, char *argv[], char *envp[]){
   APIRET rc=0;          /* default return code */
   USHORT major=255;       /* default major code */
   USHORT minor=1;         /* default minor code */
   USHORT cBuffer=0;       /* default buffer length */
   PCHAR  pBuffer=NULL;    /* default buffer address */
 
   if (argc>1)
   {
      pBuffer = argv[1];
      cBuffer = strlen(argv[1]);
   }
 
   if (argc>2) major = atol(argv[2]);
   if (argc>3) minor = atol(argv[3]);
 
   rc = Dos16SysTrace(major, cBuffer, minor, pBuffer);
 
   if (rc) printf("DosSysTrace retuned rc=%u\n", rc);
 
   return rc;
}