home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 4.ddi / TOOLS.4 / TCTSRC1.EXE / PRINSTLD.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  1.2 KB  |  55 lines

  1. /**
  2. *
  3. * Name        PRINSTLD -- Determines whether print spooler is
  4. *                installed.
  5. *
  6. * Synopsis    instld = prinstld ();
  7. *
  8. *        int instld  Return code -- 0 (boolean false) if not
  9. *                installed, not 0 (boolean true) if
  10. *                installed.
  11. *
  12. * Description    This function determines if the DOS print spooler
  13. *        (usually PRINT.COM) has been installed.
  14. *
  15. * Special    If the DOS the machine is running is older than 3.00,
  16. * Cases     then PRINSTLD always returns 0.
  17. *
  18. * Returns    Returns 1 if print spooler installed, 0 if not installed
  19. *        or DOS older than 3.00.
  20. *
  21. * Version    6.00  (C)Copyright Blaise Computing Inc. 1987,1989
  22. *
  23. **/
  24.  
  25.  
  26. #include <dos.h>
  27.  
  28. #include <bprint.h>
  29. #include <butil.h>
  30.  
  31. #define FALSE 0
  32.  
  33.  
  34. int prinstld ()
  35. {
  36.     union REGS regs;
  37.  
  38.         /* If DOS version is older than 3.00, we know that  */
  39.         /* there is no spooler we can talk to.            */
  40.     if (utdosmajor < 3)
  41.     return (FALSE);
  42.  
  43.     else
  44.     {        /* When we put 0x0100 in AX, we are telling the     */
  45.         /* request processor that we mean device 1 (print   */
  46.         /* spooler), request 0 (installed??).            */
  47.     regs.x.ax    = 0x0100;
  48.  
  49.         /* Do the request.                    */
  50.     int86 (PR_DOS_INT, ®s, ®s);
  51.  
  52.     return ((regs.x.ax & 0xff) == 0xff);
  53.     }
  54. }
  55.