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.

201 lines
4.3 KiB

  1. /***
  2. *dos.h - definitions for MS-DOS interface routines
  3. *
  4. * Copyright (c) 1985-1995, 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. ****/
  15. #ifndef _INC_DOS
  16. #define _INC_DOS
  17. #if !defined(_WIN32) && !defined(_MAC)
  18. #error ERROR: Only Mac or Win32 targets supported!
  19. #endif
  20. #ifdef _MSC_VER
  21. /*
  22. * Currently, all MS C compilers for Win32 platforms default to 8 byte
  23. * alignment.
  24. */
  25. #pragma pack(push,8)
  26. #endif /* _MSC_VER */
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  31. #ifndef _CRTAPI1
  32. #if _MSC_VER >= 800 && _M_IX86 >= 300
  33. #define _CRTAPI1 __cdecl
  34. #else
  35. #define _CRTAPI1
  36. #endif
  37. #endif
  38. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  39. #ifndef _CRTAPI2
  40. #if _MSC_VER >= 800 && _M_IX86 >= 300
  41. #define _CRTAPI2 __cdecl
  42. #else
  43. #define _CRTAPI2
  44. #endif
  45. #endif
  46. /* Define _CRTIMP */
  47. #ifndef _CRTIMP
  48. #ifdef _NTSDK
  49. /* definition compatible with NT SDK */
  50. #define _CRTIMP
  51. #else /* ndef _NTSDK */
  52. /* current definition */
  53. #ifdef _DLL
  54. #define _CRTIMP __declspec(dllimport)
  55. #else /* ndef _DLL */
  56. #define _CRTIMP
  57. #endif /* _DLL */
  58. #endif /* _NTSDK */
  59. #endif /* _CRTIMP */
  60. /* Define __cdecl for non-Microsoft compilers */
  61. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  62. #define __cdecl
  63. #endif
  64. #ifndef _MAC
  65. #ifndef _WCHAR_T_DEFINED
  66. typedef unsigned short wchar_t;
  67. #define _WCHAR_T_DEFINED
  68. #endif
  69. #endif /* ndef _MAC */
  70. #ifndef _MAC
  71. #ifndef _DISKFREE_T_DEFINED
  72. /* _getdiskfree structure (duplicated in DIRECT.H) */
  73. struct _diskfree_t {
  74. unsigned total_clusters;
  75. unsigned avail_clusters;
  76. unsigned sectors_per_cluster;
  77. unsigned bytes_per_sector;
  78. };
  79. #define _DISKFREE_T_DEFINED
  80. #endif
  81. #endif /* ndef _MAC */
  82. /* File attribute constants */
  83. #define _A_NORMAL 0x00 /* Normal file - No read/write restrictions */
  84. #define _A_RDONLY 0x01 /* Read only file */
  85. #define _A_HIDDEN 0x02 /* Hidden file */
  86. #define _A_SYSTEM 0x04 /* System file */
  87. #define _A_SUBDIR 0x10 /* Subdirectory */
  88. #define _A_ARCH 0x20 /* Archive file */
  89. #ifdef _NTSDK
  90. /* External variable declarations */
  91. /*
  92. * WARNING! The _osversion, _osmajor, _osminor, _baseversion, _basemajor and
  93. * _baseminor variables were never meaningfully defined in the C runtime
  94. * libraries for Win32 platforms. Any code which references these variables
  95. * should be revised (see the declarations for version information variables
  96. * in stdlib.h).
  97. */
  98. #ifdef _DLL
  99. /* --------- The following block is OBSOLETE --------- */
  100. #define _osversion (*_osversion_dll)
  101. #define _osmajor (*_osmajor_dll)
  102. #define _osminor (*_osminor_dll)
  103. #define _baseversion (*_baseversion_dll)
  104. #define _basemajor (*_basemajor_dll)
  105. #define _baseminor (*_baseminor_dll)
  106. extern unsigned int * _osversion_dll;
  107. extern unsigned int * _osmajor_dll;
  108. extern unsigned int * _osminor_dll;
  109. extern unsigned int * _baseversion_dll;
  110. extern unsigned int * _basemajor_dll;
  111. extern unsigned int * _baseminor_dll;
  112. /* --------- The preceding block is OBSOLETE --------- */
  113. #define _pgmptr (*_pgmptr_dll)
  114. extern char ** _pgmptr_dll;
  115. #ifndef _MAC
  116. #define _wpgmptr (*_wpgmptr_dll)
  117. extern wchar_t ** _wpgmptr_dll;
  118. #endif /* ndef _MAC */
  119. #else /* ndef _DLL */
  120. /* --------- The following block is OBSOLETE --------- */
  121. extern unsigned int _osversion;
  122. extern unsigned int _osmajor;
  123. extern unsigned int _osminor;
  124. extern unsigned int _baseversion;
  125. extern unsigned int _basemajor;
  126. extern unsigned int _baseminor;
  127. /* --------- The preceding block is OBSOLETE --------- */
  128. extern char * _pgmptr;
  129. #ifndef _MAC
  130. extern wchar_t * _wpgmptr;
  131. #endif /* ndef _MAC */
  132. #endif /* _DLL */
  133. #endif /* _NTSDK */
  134. #ifndef _MAC
  135. /* Function prototypes */
  136. _CRTIMP unsigned __cdecl _getdiskfree(unsigned, struct _diskfree_t *);
  137. #endif /* ndef _MAC */
  138. #ifdef _M_IX86
  139. void __cdecl _disable(void);
  140. void __cdecl _enable(void);
  141. #endif /* _M_IX86 */
  142. #ifndef _MAC
  143. #if !__STDC__
  144. /* Non-ANSI name for compatibility */
  145. #define diskfree_t _diskfree_t
  146. #endif /* __STDC__ */
  147. #endif /* ndef _MAC */
  148. #ifdef __cplusplus
  149. }
  150. #endif
  151. #ifdef _MSC_VER
  152. #pragma pack(pop)
  153. #endif /* _MSC_VER */
  154. #endif /* _INC_DOS */