home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / bcfamily / source / dup.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-12  |  699 b   |  27 lines

  1. //
  2. //      *******************************************************************
  3. //        JdeBP C++ Library Routines          General Public Licence v1.00
  4. //            Copyright (c) 1991,1992     Jonathan de Boyne Pollard
  5. //      *******************************************************************
  6. //
  7. // Part of FamAPI.LIB
  8. //
  9.  
  10. #include "famapi.h"
  11. #include "dosdos.h"
  12.  
  13. //
  14. //    Duplicate a file handle
  15. //
  16. USHORT _APICALL
  17. DosDupHandle ( unsigned short From, unsigned short far *To)
  18. {
  19.     if ((_CX = *To) == (unsigned short)-1)
  20.         _AX = 0x4500 ;                // Duplicate a handle
  21.     else
  22.         _AX = 0x4600 ;                // Force duplicate a handle
  23.     _BX = From ;
  24.     Dos3Call() ;
  25.     if (_FLAGS & 0x0001) return _AX ; else return NO_ERROR ;
  26. }
  27.