Difference between revisions of "DosSuppressPopUps"

From EDM2
Jump to: navigation, search
m
m
Line 2: Line 2:
  
 
==Syntax==
 
==Syntax==
<PRE>
+
  DosSuppressPopUps (flag, char)  
#define INCL_DOSPROCESS
+
#include <os2.h>
+
 
+
ULONG    flag;  /* A flag that indicating whether pop-up suppression should be enabled or disabled. */
+
CHAR      char;  /* The drive letter for the log file (used only when pop-up suppression is enabled). */
+
APIRET    ulrc; /* Return Code. */
+
 
+
ulrc = DosSuppressPopUps(flag, char);
+
 
</PRE>
 
</PRE>
  
Line 17: Line 9:
 
:The flag can either be:
 
:The flag can either be:
 
:* SPU_DISABLESUPPRESSION Disable pop-up suppression.  
 
:* SPU_DISABLESUPPRESSION Disable pop-up suppression.  
:* SPU_ENABLESUPPRESSION   Enable pop-up suppression.  
+
:* SPU_ENABLESUPPRESSION Enable pop-up suppression.  
 
;char (CHAR) - input :The drive letter for the log file (used only when pop-up suppression is enabled).
 
;char (CHAR) - input :The drive letter for the log file (used only when pop-up suppression is enabled).
  

Revision as of 21:44, 6 March 2017

Suppresses application trap popups and logs them to the file POPUPLOG.OS2.

Syntax

DosSuppressPopUps (flag, char) 

</PRE>

Parameters

flag (ULONG) - input 
A flag that indicating whether pop-up suppression should be enabled or disabled.
The flag can either be:
  • SPU_DISABLESUPPRESSION Disable pop-up suppression.
  • SPU_ENABLESUPPRESSION Enable pop-up suppression.
char (CHAR) - input 
The drive letter for the log file (used only when pop-up suppression is enabled).

Return Code

ulrc (APIRET) - returns

DosSuppressPopUps returns one of the following values:

  • 0 NO_ERROR
  • 87 ERROR_INVALID_PARAMETER

Linkage Definition

IMPORTS DosSuppressPopUps = DOSCALLS.114 

Remarks

When pop-ups are suppressed through DosSuppressPopUps, the system does not display trap screens on the user's terminal. The user will not be required to respond to the abort, retry, continue message. Instead, the system displays message SYS3571 and logs the name of the process to the POPUPLOG.OS2 log file in the root directory of the specified drive. The system will also log the message inserts in the log file.

If the log file does not exist, the system will create it. If the log file exists, the system appends to it. If the system cannot open the file (for example, because the drive does not exist), the system will not log the pop-up information.

When pop-up suppression is enabled, the system overrides any settings established by DosError on a per-process basis.

To specify the drive for the log file at system initialization, add the following to your CONFIG.SYS file:

SUPPRESSPOPUPS=a

a, the drive letter, must be a valid upper- or lowercase letter or the system will ignore the line.

The drive letter for the log file can also be specified on the DosSuppressPopUps API.

If an invalid flag (a flag other than SPU_ENABLESUPPRESSION or SPU_DISABLESUPPRESSION) or an invalid drive (a drive other than an upper- or lowercase letter) is specified on DosSuppressPopUps, the system returns error code ERROR_INVALID_PARAMETER. Otherwise, the system returns NO_ERROR.

The following is an example of an entry from the pop-up suppression log:

08-19-1994  12:56:31  SYS3188  PID 0007
D:\EXMG\XCPT001Z.EXE
c0000024
1a02c2ea
EAX=00000000  EBX=00040000  ECX=00044854  EDX=00000000
ESI=00044b2c  EDI=000428ec
DS=0053  DSACC=d0f3  DSLIM=1bffffff
ES=0053  ESACC=d0f3  ESLIM=1bffffff
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:1a02c2ea  CSACC=d0df  CSLIM=1bffffff
SS:ESP=0053:0004487c  SSACC=d0f3  SSLIM=1bffffff
EBP=000448c0  FLG=00002202

DOSCALL1.DLL 0002:0000c2ea

The log contains information as follows:

  • Line one contains:
    • The date and time that the pop-up was written to the log file
    • The message number
    • The PID of the process that ended
  • Line two contains the name of the process that ended.
  • Subsequent lines display the message inserts, each on a separate line.

In this example, the process was ended due to an unhandled fatal exception, so there are four inserts:

  1. Exception number (1 line)
  2. Linearized address of faulting EIP (1 line)
  3. Register dump (9 lines)
  4. Name of module, object number, and offset of faulting EIP (1 line)

Example Code

An example of enabling pop-up suppression is:

DosSuppressPopUps(SPU_ENABLESUPPRESSION, 'A');

An example of disabling pop-up suppression is:

DosSuppressPopUps(SPU_DISABLESUPPRESSION, 0);

Related Functions