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.

170 lines
3.7 KiB

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