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.

266 lines
5.7 KiB

  1. /* dem.h - main include file for dem
  2. *
  3. * Modification History
  4. *
  5. * Sudeepb 31-Mar-1991 Created
  6. */
  7. #ifndef _DEMINCLUDED_
  8. #define _DEMINCLUDED_
  9. /*
  10. #define WIN
  11. #define FLAT_32
  12. #include <nt.h>
  13. #include <ntrtl.h>
  14. #include <nturtl.h>
  15. #define _WINDOWS
  16. #include <windows.h>
  17. */
  18. #ifdef DOS
  19. #define SIGNALS
  20. #endif
  21. #ifdef OS2_16
  22. #define OS2
  23. #define SIGNALS
  24. #endif
  25. #ifdef OS2_32
  26. #define OS2
  27. #define FLAT_32
  28. #endif
  29. #include <stdarg.h>
  30. #include <stdio.h>
  31. #include <stdlib.h>
  32. #include <string.h>
  33. #include <malloc.h>
  34. #include <process.h>
  35. #ifdef WIN_16
  36. #define WIN
  37. #define API16
  38. #endif
  39. #ifdef WIN_32
  40. #define WIN
  41. #define FLAT_32
  42. #define TRUE_IF_WIN32 1
  43. #include <nt.h>
  44. #include <ntrtl.h>
  45. #include <nturtl.h>
  46. #include <ntdddisk.h>
  47. #else
  48. #define TRUE_IF_WIN32 0
  49. #endif
  50. #ifdef FLAT_32
  51. #ifndef i386
  52. #define ALIGN_32
  53. #else
  54. #define NOALIGN_32
  55. #endif
  56. #endif
  57. #ifdef WIN
  58. #define _WINDOWS
  59. #include <windows.h>
  60. #endif
  61. #ifdef SIGNALS
  62. #include <conio.h>
  63. #include <signal.h>
  64. #endif
  65. #ifdef OS2_32
  66. #include <excpt.h>
  67. #define XCPT_SIGNAL 0xC0010003
  68. #endif
  69. #define SIGHIT(flChk) ((iSigCheck++ & 0x7FF)?(flSignals & (flChk)):(kbhit(),(flSignals & (flChk))))
  70. #include <oemuni.h>
  71. /** Basic Typedefs of DEM **/
  72. typedef VOID (*PFNSVC)(VOID);
  73. typedef struct _SAVEDEMWORLD {
  74. USHORT ax;
  75. USHORT bx;
  76. USHORT cx;
  77. USHORT dx;
  78. USHORT ds;
  79. USHORT es;
  80. USHORT si;
  81. USHORT di;
  82. USHORT bp;
  83. ULONG iSVC;
  84. } SAVEDEMWORLD, *PSAVEDEMWORLD;
  85. typedef struct _DISKINFO {
  86. WORD wSectorsPerCluster;
  87. WORD wBytesPerSector;
  88. WORD wFreeClusters;
  89. WORD wTotalClusters;
  90. } DISKINFO, *PDISKINFO;
  91. #include "dosdef.h"
  92. #include "dossvc.h"
  93. /** DEM Externs **/
  94. extern ULONG UNALIGNED *pulDTALocation;
  95. extern BOOL VDMForWOW;
  96. extern PVHE pHardErrPacket;
  97. extern ULONG CurrentISVC;
  98. extern PCHAR aSVCNames[];
  99. extern PFNSVC apfnSVC[];
  100. extern PSZ pszDefaultDOSDirectory;
  101. extern USHORT nDrives;
  102. extern PUSHORT pusCurrentPDB;
  103. extern PDEMEXTERR pExtendedError;
  104. #include "demexp.h"
  105. #if DEVL
  106. extern CHAR demDebugBuffer [];
  107. #endif
  108. /** DEM Macros **/
  109. #define GETULONG(hi,lo) (DWORD)((((int) hi) << 16) + ((int) lo))
  110. #define GETHANDLE(hi,lo) (HANDLE)(GETULONG(hi,lo))
  111. #define IS_ASCII_PATH_SEPARATOR(ch) (((ch) == '/') || ((ch) == '\\'))
  112. /** Function Prototypes */
  113. VOID demChgFilePtr (VOID);
  114. VOID demChMod (VOID);
  115. VOID demClose (VOID);
  116. VOID demCloseFCB (VOID);
  117. VOID demCreate (VOID);
  118. VOID demCreateFCB (VOID);
  119. VOID demCreateDir (VOID);
  120. VOID demCreateNew (VOID);
  121. VOID demDate16 (VOID);
  122. VOID demDelete (VOID);
  123. VOID demDeleteDir (VOID);
  124. VOID demDeleteFCB (VOID);
  125. VOID demFCBIO (VOID);
  126. VOID demFileTimes (VOID);
  127. VOID demFindFirst (VOID);
  128. VOID demFindFirstFCB (VOID);
  129. VOID demFindNext (VOID);
  130. VOID demFindNextFCB (VOID);
  131. VOID demGetBootDrive (VOID);
  132. VOID demGetDriveFreeSpace (VOID);
  133. VOID demGetDrives (VOID);
  134. VOID demGetFileInfo (VOID);
  135. VOID demGSetMediaID (VOID);
  136. VOID demIOCTL (VOID);
  137. VOID demLoadDos (VOID);
  138. VOID demLockOper (VOID);
  139. VOID demOpen (VOID);
  140. VOID demOpenFCB (VOID);
  141. VOID demQueryCurrentDir (VOID);
  142. VOID demQueryDate (VOID);
  143. VOID demQueryTime (VOID);
  144. VOID demRead (VOID);
  145. VOID demRename (VOID);
  146. VOID demRenameFCB (VOID);
  147. VOID demRetry (VOID);
  148. VOID demSetCurrentDir (VOID);
  149. VOID demSetDate (VOID);
  150. VOID demSetDefaultDrive (VOID);
  151. VOID demSetDTALocation (VOID);
  152. VOID demSetHardErrorInfo(VOID);
  153. VOID demSetTime (VOID);
  154. VOID demSetV86KernelAddr(VOID);
  155. VOID demWrite (VOID);
  156. VOID demGetDriveInfo (VOID);
  157. VOID demDiskReset (VOID);
  158. VOID demLoadDosAppSym (VOID);
  159. VOID demFreeDosAppSym (VOID);
  160. VOID demEntryDosApp (VOID);
  161. VOID demDOSDispCall (VOID);
  162. VOID demDOSDispRet (VOID);
  163. VOID demOutputString (VOID);
  164. VOID demInputString (VOID);
  165. VOID demIsDebug (VOID);
  166. VOID demTerminatePDB (VOID);
  167. VOID demExitVDM (VOID);
  168. VOID demWOWFiles (VOID);
  169. VOID demGetComputerName (VOID);
  170. VOID demCheckPath (VOID);
  171. VOID demSystemSymbolOp (VOID);
  172. VOID demCommit (VOID);
  173. VOID demClientError (HANDLE,CHAR);
  174. ULONG demClientErrorEx (HANDLE,CHAR,BOOL);
  175. VOID demCreateCommon (ULONG);
  176. BOOL demGetMiscInfo (HANDLE, LPWORD, LPWORD, LPDWORD);
  177. VOID demFCBCommon (ULONG);
  178. VOID demIoctlChangeable (VOID);
  179. VOID demIoctlInvalid (VOID);
  180. VOID demSaveHardErrInfo (VOID);
  181. VOID demRestoreHardErrInfo (VOID);
  182. VOID demAbsRead (VOID);
  183. VOID demAbsWrite (VOID);
  184. VOID demIoctlDiskGeneric (VOID);
  185. VOID demIoctlDiskQuery (VOID);
  186. VOID demGetDPB (VOID);
  187. VOID demGetDPBList (VOID);
  188. VOID demNotYetImplemented (VOID);
  189. BOOL GetDiskSpaceInformation(CHAR chDrive, PDISKINFO pDiskInfo);
  190. BOOL demGetDiskFreeSpace(BYTE Drive, WORD * BytesPerSector,
  191. WORD * SectorsPerCluster, WORD * TotalClusters,
  192. WORD * FreeClusters);
  193. BOOL IsCdRomFile (PSTR pszPath);
  194. BOOL GetMediaId( CHAR DriveNum, PVOLINFO pVolInfo);
  195. VOID demPipeFileDataEOF (VOID);
  196. VOID demPipeFileEOF (VOID);
  197. VOID demLFNEntry (VOID);
  198. VOID demSetDosVarLocation (VOID);
  199. #ifdef FE_SB /* ConvNwPathToDosPath() */
  200. VOID ConvNwPathToDosPath (CHAR *,CHAR *);
  201. #endif /* FE_SB */
  202. /** Debug Function Prototypes */
  203. #if DBG
  204. VOID demPrintMsg (ULONG iMsg);
  205. #else
  206. #define demPrintMsg(x)
  207. #endif
  208. /* Label functions and constants */
  209. USHORT demDeleteLabel(BYTE Drive);
  210. USHORT demCreateLabel(BYTE Drive, LPSTR szName);
  211. #define DRIVEBYTE 0
  212. #define LABELOFF 3
  213. extern BOOL cmdPipeFileDataEOF (HANDLE,BOOL *);
  214. extern BOOL cmdPipeFileEOF(HANDLE);
  215. #endif /* _DEMINCLUDED_ */