Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

183 lines
6.3 KiB

  1. /***
  2. *dos.h - definitions for MS-DOS interface routines
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Defines the structs and unions used for the direct DOS interface
  8. * routines; includes macros to access the segment and offset
  9. * values of far pointers, so that they may be used by the routines; and
  10. * provides function prototypes for direct DOS interface functions.
  11. *
  12. * [Public]
  13. *
  14. *Revision History:
  15. * 06-11-87 JCR Added find_t
  16. * 06-15-87 JCR Added O_NOINHERIT
  17. * 06-18-87 JCR Added some DOS function prototypes
  18. * 06-19-87 JCR Moved O_NOINHERIT to fcntl.h
  19. * 06-25-87 JMB Added _HARDERR_* constants
  20. * 06-25-87 SKS Added diskfree_t, dosdate_t, dostime_t structures
  21. * 06-25-87 JCR Added _A_NORMAL, etc. constants
  22. * 07-17-87 JCR Added _chain_intr, also the "interrupt" type to
  23. * _dos_setvec and _dos_getvec.
  24. * 07-27-87 SKS Added several _dos_*() functions, _disable()/_enable()
  25. * 08-17-87 PHG Fixed bad prototype for _dos_getdiskfree()
  26. * 10-08-87 JCR Added _CDECL to prototypes with "interrupt" declaration
  27. * (needed for compiling with -Gc switch).
  28. * 09-27-88 JCR 386 version
  29. * 10-03-88 GJF Use M_I386, not I386
  30. * 05-03-89 JCR Added _INTERNAL_IFSTRIP for relinc usage
  31. * 07-25-89 GJF Major cleanup. Alignment of struct fields is now
  32. * protected by pack pragmas. Now specific to 386.
  33. * 10-30-89 GJF Fixed copyright
  34. * 11-02-89 JCR Changed "DLL" to "_DLL"
  35. * 02-28-90 GJF Added #ifndef _INC_DOS and #include <cruntime.h>
  36. * stuff. Also, removed some (now) useless preprocessor
  37. * directives.
  38. * 03-22-90 GJF Replaced _cdecl with _CALLTYPE1 in prototype and with
  39. * _VARTYPE1 in variable declaration.
  40. * 12-28-90 SRW Added _CRUISER_ conditional around pack pragmas
  41. * 01-23-91 GJF Removed segread() prototype.
  42. * 04-04-91 GJF Added version info variables (_WIN32_).
  43. * 08-20-91 JCR C++ and ANSI naming
  44. * 08-26-91 BWM Added _peek, poke, and _getvideoaddr (_DOSX32_).
  45. * 08-26-91 BWM Removed _harderr constants, replaced by _seterrormode.
  46. * 08-26-91 BWM Removed datetime prototypes, replaced by systime functions.
  47. * 09-05-91 JCR Added missing #endif (bug fix), removed obsolete stuff
  48. * 09-16-91 BWM Fixed reversed #ifdef on screen address constants.
  49. * 01-22-92 GJF Fixed up definitions of global variables for build of,
  50. * and users of, crtdll.dll.
  51. * 03-30-92 DJM POSIX support.
  52. * 06-02-92 SKS Fix typo in DLL declaration of _osmajor
  53. * Add declartion of _pgmptr
  54. * 08-07-92 GJF Function calling type and variable type macros.
  55. * 01-21-93 GJF Removed support for C6-386's _cdecl.
  56. * 04-06-93 SKS Replace _CRTAPI1/2 with __cdecl, _CRTVAR1 with nothing
  57. * Remove support for DOSX32, OS/2, etc.
  58. * Remove obsolete vars and vars moved to STDLIB.H
  59. * Remove duplicate references to _osver, etc.
  60. * Remove obsolete functions peek, poke, etc.
  61. * 04-07-93 SKS Add _CRTIMP keyword for CRT DLL model
  62. * 06-15-93 GJF Restored prototypes for _enable, _disable.
  63. * 09-01-93 GJF Merged Cuda and NT SDK versions.
  64. * 11-19-93 CFW Add _wpgmptr.
  65. * 11-03-94 GJF Ensure 8 byte alignment.
  66. * 12-15-94 XY merged with mac header
  67. * 02-11-95 CFW Add _CRTBLD to avoid users getting wrong headers.
  68. * 02-14-95 CFW Clean up Mac merge.
  69. * 12-14-95 JWM Add "#pragma once".
  70. * 01-23-97 GJF Cleaned out obsolete support for _NTSDK and _CRTAPI*.
  71. * Also, detab-ed.
  72. * 09-30-97 JWM Restored not-so-obsolete _CRTAPI1 support.
  73. * 10-07-97 RDL Added IA64.
  74. * 05-13-99 PML Remove _CRTAPI1
  75. * 05-17-99 PML Remove all Macintosh support.
  76. *
  77. ****/
  78. #if _MSC_VER > 1000 /*IFSTRIP=IGN*/
  79. #pragma once
  80. #endif
  81. #ifndef _INC_DOS
  82. #define _INC_DOS
  83. #if !defined(_WIN32)
  84. #error ERROR: Only Win32 target supported!
  85. #endif
  86. #ifndef _CRTBLD
  87. /* This version of the header files is NOT for user programs.
  88. * It is intended for use when building the C runtimes ONLY.
  89. * The version intended for public use will not have this message.
  90. */
  91. #error ERROR: Use of C runtime library internal header file.
  92. #endif /* _CRTBLD */
  93. #ifdef _MSC_VER
  94. /*
  95. * Currently, all MS C compilers for Win32 platforms default to 8 byte
  96. * alignment.
  97. */
  98. #pragma pack(push,8)
  99. #endif /* _MSC_VER */
  100. #ifdef __cplusplus
  101. extern "C" {
  102. #endif
  103. #ifndef _INTERNAL_IFSTRIP_
  104. #include <cruntime.h>
  105. #endif /* _INTERNAL_IFSTRIP_ */
  106. /* Define _CRTIMP */
  107. #ifndef _CRTIMP
  108. #ifdef CRTDLL
  109. #define _CRTIMP __declspec(dllexport)
  110. #else /* ndef CRTDLL */
  111. #ifdef _DLL
  112. #define _CRTIMP __declspec(dllimport)
  113. #else /* ndef _DLL */
  114. #define _CRTIMP
  115. #endif /* _DLL */
  116. #endif /* CRTDLL */
  117. #endif /* _CRTIMP */
  118. /* Define __cdecl for non-Microsoft compilers */
  119. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  120. #define __cdecl
  121. #endif
  122. #ifndef _WCHAR_T_DEFINED
  123. typedef unsigned short wchar_t;
  124. #define _WCHAR_T_DEFINED
  125. #endif
  126. #ifndef _DISKFREE_T_DEFINED
  127. /* _getdiskfree structure (duplicated in DIRECT.H) */
  128. struct _diskfree_t {
  129. unsigned total_clusters;
  130. unsigned avail_clusters;
  131. unsigned sectors_per_cluster;
  132. unsigned bytes_per_sector;
  133. };
  134. #define _DISKFREE_T_DEFINED
  135. #endif
  136. /* File attribute constants */
  137. #define _A_NORMAL 0x00 /* Normal file - No read/write restrictions */
  138. #define _A_RDONLY 0x01 /* Read only file */
  139. #define _A_HIDDEN 0x02 /* Hidden file */
  140. #define _A_SYSTEM 0x04 /* System file */
  141. #define _A_SUBDIR 0x10 /* Subdirectory */
  142. #define _A_ARCH 0x20 /* Archive file */
  143. /* Function prototypes */
  144. _CRTIMP unsigned __cdecl _getdiskfree(unsigned, struct _diskfree_t *);
  145. #ifdef _M_IX86
  146. void __cdecl _disable(void);
  147. void __cdecl _enable(void);
  148. #endif /* _M_IX86 */
  149. #if !__STDC__
  150. /* Non-ANSI name for compatibility */
  151. #define diskfree_t _diskfree_t
  152. #endif /* __STDC__ */
  153. #ifdef __cplusplus
  154. }
  155. #endif
  156. #ifdef _MSC_VER
  157. #pragma pack(pop)
  158. #endif /* _MSC_VER */
  159. #endif /* _INC_DOS */