Jump to content

Query the DosError() state: Difference between revisions

From EDM2
Created page with "By SEG. Source: comp.os.os2.programmer.misc: The reason is that there is no way to undo DosError(), since there is no way to query what is the state of error-reporting was w..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 4: Line 4:


The reason is that there is no way to undo DosError(), since there is no way to query what is the state of error-reporting was when your function is called.
The reason is that there is no way to undo DosError(), since there is no way to query what is the state of error-reporting was when your function is called.
 
Umm, not well-documented, but a little poking revealed this (won't work in Warp 3 or Warp 4 prior to FP13):
Umm, not well-documented, but a little poking revealed this (won't work in Warp 3 or Warp 4 prior to FP13):
  APIRET APIENTRY DosSysCtl(ULONG func, ULONG p);
  APIRET APIENTRY DosSysCtl(ULONG func, ULONG p);
   
   
Line 15: Line 13:
  ...
  ...
         DosError(SavedDosError);
         DosError(SavedDosError);
Hope this helps.
Hope this helps.


[[Category: Languages Articles]]
[[Category: Languages Articles]]

Latest revision as of 12:34, 9 November 2021

By SEG.

Source: comp.os.os2.programmer.misc:

The reason is that there is no way to undo DosError(), since there is no way to query what is the state of error-reporting was when your function is called.

Umm, not well-documented, but a little poking revealed this (won't work in Warp 3 or Warp 4 prior to FP13):

APIRET APIENTRY DosSysCtl(ULONG func, ULONG p);

        ULONG SavedDosError = 1;
        DosSysCtl((ULONG)27, (ULONG)&SavedDosError);
        DosError(0L);    //FERR_DISABLEHARDERROR
...
        DosError(SavedDosError);

Hope this helps.