Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <dos.h>
    int dosexterr( struct DOSERROR *err_info );

    struct _DOSERROR {
            int exterror;   /* contents of AX register */
            char errclass;  /* contents of BH register */
            char action;    /* contents of BL register */
            char locus;     /* contents of CH register */
    };

Description:
    The dosexterr function extracts extended error information following a
    failed DOS function.  This information is placed in the structure
    located by err_info.  This function is only useful with DOS version 3.0
    or later.

    You should consult the technical documentation for the DOS system on
    your computer for an interpretation of the error information.

Returns:
    The function returns an unpredictable result when the preceding DOS call
    did not result in an error.  Otherwise, the function returns the number
    of the extended error.

See Also:
    perror

Example:
    #include <stdio.h>
    #include <dos.h>
    #include <fcntl.h>

    struct _DOSERROR dos_err;

    void main()
      {
        int handle;

        /* Try to open "stdio.h" and then close it */
        if( _dos_open( "stdio.h", O_RDONLY, &handle ) != 0 ){
          dosexterr( &dos_err );
          printf( "Unable to open file\n" );
          printf( "exterror (AX) = %d\n", dos_err.exterror );
          printf( "errclass (BH) = %d\n", dos_err.errclass );
          printf( "action   (BL) = %d\n", dos_err.action );
          printf( "locus    (CH) = %d\n", dos_err.locus );
        } else {
          printf( "Open succeeded\n" );
          if( _dos_close( handle ) != 0 ) {
            printf( "Close failed\n" );
          } else {
            printf( "Close succeeded\n" );
          }
        }
      }

    produces the following:

    Unable to open file
    exterror (AX) = 2
    errclass (BH) = 8
    action   (BL) = 3
    locus    (CH) = 2

Classification:
    DOS

Systems:
    DOS, Win, DOS/PM

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson