home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 4.ddi / C / QYSCOUN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  993 b   |  51 lines

  1. /**
  2. *
  3. * Name        qyscoun -- Set DOS country code.
  4. *
  5. * Synopsis    error = qyscoun(country);
  6. *
  7. *        int     error    0 if OK, nonzero if error (see below)
  8. *        unsigned country
  9. *                Country code to set.  This is ignored on
  10. *                    DOS 2.x.
  11. *
  12. * Description    This function sets the current country as known by DOS.
  13. *        This affects later calls to DOS function 0x38 (see also
  14. *        QYGCOUN).
  15. *
  16. *        This function is for use with DOS 3.0 and greater.  It
  17. *        has no effect if used with older versions of DOS.
  18. *
  19. * Returns    error        0 if OK
  20. *                1 if old version of DOS
  21. *                2 if unknown country
  22. *
  23. * Version    3.0 (C)Copyright Blaise Computing Inc.    1986
  24. *
  25. **/
  26.  
  27. #include <bquery.h>
  28.  
  29. int qyscoun(country)
  30. unsigned country;
  31. {
  32.     DOSREG regs;
  33.     int    al,minor;
  34.  
  35.     if (qydosver(&minor) < 3)
  36.     return 1;
  37.  
  38.     if (country < 255)
  39.     al = country;
  40.     else
  41.     {
  42.     al = 0xff;
  43.     regs.bx = country;
  44.     }
  45.  
  46.     regs.ax = utbyword(0x38,al);
  47.     regs.dx = 0xffff;
  48.  
  49.     return dos(®s);
  50. }
  51.