Jump to content

DosError (FAPI): Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Legacy
|RepFunc=[[DosError]]
|Remarks=Part of the [[Family API]].
}}
This call allows an OS/2 process to receive hard error notification without generating a hard error signal.
This call allows an OS/2 process to receive hard error notification without generating a hard error signal.


Line 9: Line 5:


==Parameters==
==Parameters==
;Flags (USHORT) - input : Bit field, defined in the following example (the unused high-order bits are reserved and must be set to zero).
;Flags (USHORT) - input: Bit field, defined in the following example (the unused high-order bits are reserved and must be set to zero).
 
::15-2 Reserved, set to zero.
    Bit        Description
::1
15-2       Reserved, set to zero.
:::0 = Enable exception popups.
 
:::1 = Disable exception popups.  
1        0 = Enable exception popups.
::0
          1 = Disable exception popups.  
:::0 = Disable hard error popups (fail requests).
:::1 = Enable hard error popups.
0        0 = Disable hard error popups (fail requests).
          1 = Enable hard error popups.


==Return Code==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return code descriptions are:
Return code descriptions are:
*0 NO_ERROR
*0         NO_ERROR  
*87 ERROR_INVALID_PARAMETER
* 87       ERROR_INVALID_PARAMETER


==Remarks==
==Remarks==
Line 33: Line 26:
===Family API Considerations===
===Family API Considerations===
Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restriction applies to DosError when coding for the DOS mode:
Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restriction applies to DosError when coding for the DOS mode:
:For Flag, a value of 0000 causes all subsequent INT 24s to be failed until a subsequent call with a value of 1 is issued.


For Flag, a value of 0000 causes all subsequent INT 24s to be failed until a subsequent call with a value of 1 is issued.
;Note: Since INT 24 is not issued in DOS mode, this call has no effect when running in DOS mode.


Note: Since INT 24 is not issued in DOS mode, this call has no effect when running in DOS mode.
==Bindings==
 
===C===
==Example Code==
===C Binding===
<PRE>
<PRE>
#define INCL_DOSMISC
#define INCL_DOSMISC


USHORT  rc = DosError(Flag);
USHORT  rc = DosError(Flag);
USHORT  Flags;        /* Action flags */


USHORT           Flags;         /* Action flags */
USHORT rc;           /* return code */
</PRE>


USHORT          rc;           /* return code */
===MASM===
<PRE>
EXTRN  DosError:FAR
INCL_DOSMISC  EQU 1
 
PUSH  WORD    Flags    ;Action flags
CALL  DosError
 
Returns WORD
</PRE>
</PRE>
==Example Code==
This example disables hard error popups and exception popups, then re-enables them.  
This example disables hard error popups and exception popups, then re-enables them.  
<PRE>
<PRE>
Line 62: Line 66:
USHORT rc;
USHORT rc;


  rc = DosError(DISABLE_ERRORPOPUPS); /* Action flag */
rc = DosError(DISABLE_ERRORPOPUPS); /* Action flag */
  rc = DosError(ENABLE_ERRORPOPUPS);  /* Action flag */
rc = DosError(ENABLE_ERRORPOPUPS);  /* Action flag */
</PRE>
</PRE>


 
[[Category:Dos16]]
===MASM Binding===
<PRE>
EXTRN  DosError:FAR
INCL_DOSMISC      EQU 1
 
PUSH  WORD    Flags        ;Action flags
CALL  DosError
 
Returns WORD
</PRE>
 
==Related Functions==
*
 
[[Category:Dos]]

Latest revision as of 02:08, 26 January 2020

This call allows an OS/2 process to receive hard error notification without generating a hard error signal.

Syntax

DosError (Flag)

Parameters

Flags (USHORT) - input
Bit field, defined in the following example (the unused high-order bits are reserved and must be set to zero).
15-2 Reserved, set to zero.
1
0 = Enable exception popups.
1 = Disable exception popups.
0
0 = Disable hard error popups (fail requests).
1 = Enable hard error popups.

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 0 NO_ERROR
  • 87 ERROR_INVALID_PARAMETER

Remarks

DosError allows an OS/2 process to disable user notification if a program (or untrapped numeric processor) exception occurs. If end user notification is disabled, and if one of these exceptions occurs, the process is terminated.

Hard errors generated under a process that has issued a DosError call are failed, and the appropriate error code is returned. The default situation is both hard error pop-ups and exception pop-ups are enabled, if DosError is not issued.

Family API Considerations

Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restriction applies to DosError when coding for the DOS mode:

For Flag, a value of 0000 causes all subsequent INT 24s to be failed until a subsequent call with a value of 1 is issued.
Note
Since INT 24 is not issued in DOS mode, this call has no effect when running in DOS mode.

Bindings

C

#define INCL_DOSMISC

USHORT  rc = DosError(Flag);
USHORT  Flags;        /* Action flags */

USHORT  rc;            /* return code */

MASM

EXTRN  DosError:FAR
INCL_DOSMISC   EQU 1

PUSH   WORD    Flags    ;Action flags
CALL   DosError

Returns WORD

Example Code

This example disables hard error popups and exception popups, then re-enables them.

#define INCL_DOSQUEUES

#define ENABLE_EXCEPTION 0
#define DISABLE_EXCEPTION 2
#define ENABLE_HARDERROR 1
#define DISABLE_HARDERROR 0
#define DISABLE_ERRORPOPUPS DISABLE_EXCEPTION | DISABLE_HARDERROR
#define ENABLE_ERRORPOPUPS ENABLE_EXCEPTION | ENABLE_HARDERROR

USHORT rc;

 rc = DosError(DISABLE_ERRORPOPUPS); /* Action flag */
 rc = DosError(ENABLE_ERRORPOPUPS);  /* Action flag */