home *** CD-ROM | disk | FTP | other *** search
- /*---------------------------------------------------------------------------
- * filename - dosext.cas
- *
- * function(s)
- * dosexterr - gets extended error
- *--------------------------------------------------------------------------*/
-
- /*[]------------------------------------------------------------[]*/
- /*| |*/
- /*| Turbo C Run Time Library - Version 3.0 |*/
- /*| |*/
- /*| |*/
- /*| Copyright (c) 1987,1988,1990 by Borland International |*/
- /*| All Rights Reserved. |*/
- /*| |*/
- /*[]------------------------------------------------------------[]*/
-
- #pragma inline
- #include <asmrules.h>
- #include <dos.h>
-
- /* DOS 3.0 only */
-
- /*--------------------------------------------------------------------------*
-
- Name dosexterr - gets extended error
-
- Usage int dosexterr(struct DOSERR *eblkp);
-
- Prototype in dos.h
-
- Description this function fills the DOSERR structure pointed to by
- eblkp with extended error information after an MS-DOS
- call has failed. The values obtained to fill the
- structure are obtained via DOS call 0x59.
-
- Return value Extended error value
-
- *---------------------------------------------------------------------------*/
- int dosexterr(struct DOSERROR *eblkp)
- {
- /* WARNING: SI,DI and DS are destroyed by the DOS */
- SaveSI
- SaveDI
-
- #if !defined(__HUGE__)
- asm push ds
- #endif
- asm mov ah, 059h
- asm int 021h
- asm LDS_ di, eblkp
- asm mov [di].de_exterror, ax
- asm mov [di].de_class, bh
- asm mov [di].de_action, bl
- asm mov [di].de_locus, ch
- #if !defined(__HUGE__)
- asm pop ds
- #endif
- return _AX;
- }
-