Leaked source code of windows server 2003
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.

265 lines
5.9 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 USHORT nDrives;
  101. extern PUSHORT pusCurrentPDB;
  102. extern PDEMEXTERR pExtendedError;
  103. #include "demexp.h"
  104. #if DEVL
  105. extern CHAR demDebugBuffer [];
  106. #endif
  107. /** DEM Macros **/
  108. #define GETULONG(hi,lo) (DWORD)((((int) hi) << 16) + ((int) lo))
  109. #define GETHANDLE(hi,lo) (HANDLE)(GETULONG(hi,lo))
  110. #define IS_ASCII_PATH_SEPARATOR(ch) (((ch) == '/') || ((ch) == '\\'))
  111. /** Function Prototypes */
  112. VOID demChgFilePtr (VOID);
  113. VOID demChMod (VOID);
  114. VOID demClose (VOID);
  115. VOID demCloseFCB (VOID);
  116. VOID demCreate (VOID);
  117. VOID demCreateFCB (VOID);
  118. VOID demCreateDir (VOID);
  119. VOID demCreateNew (VOID);
  120. VOID demDate16 (VOID);
  121. VOID demDelete (VOID);
  122. VOID demDeleteDir (VOID);
  123. VOID demDeleteFCB (VOID);
  124. VOID demFCBIO (VOID);
  125. VOID demFileTimes (VOID);
  126. VOID demFindFirst (VOID);
  127. VOID demFindFirstFCB (VOID);
  128. VOID demFindNext (VOID);
  129. VOID demFindNextFCB (VOID);
  130. VOID demGetBootDrive (VOID);
  131. VOID demGetDriveFreeSpace (VOID);
  132. VOID demGetDrives (VOID);
  133. VOID demGetFileInfo (VOID);
  134. VOID demGSetMediaID (VOID);
  135. VOID demIOCTL (VOID);
  136. VOID demLoadDos (VOID);
  137. VOID demLockOper (VOID);
  138. VOID demOpen (VOID);
  139. VOID demOpenFCB (VOID);
  140. VOID demQueryCurrentDir (VOID);
  141. VOID demQueryDate (VOID);
  142. VOID demQueryTime (VOID);
  143. VOID demRead (VOID);
  144. VOID demRename (VOID);
  145. VOID demRenameFCB (VOID);
  146. VOID demRetry (VOID);
  147. VOID demSetCurrentDir (VOID);
  148. VOID demSetDate (VOID);
  149. VOID demSetDefaultDrive (VOID);
  150. VOID demSetDTALocation (VOID);
  151. VOID demSetHardErrorInfo(VOID);
  152. VOID demSetTime (VOID);
  153. VOID demSetV86KernelAddr(VOID);
  154. VOID demWrite (VOID);
  155. VOID demGetDriveInfo (VOID);
  156. VOID demDiskReset (VOID);
  157. VOID demLoadDosAppSym (VOID);
  158. VOID demFreeDosAppSym (VOID);
  159. VOID demEntryDosApp (VOID);
  160. VOID demDOSDispCall (VOID);
  161. VOID demDOSDispRet (VOID);
  162. VOID demOutputString (VOID);
  163. VOID demInputString (VOID);
  164. VOID demIsDebug (VOID);
  165. VOID demTerminatePDB (VOID);
  166. VOID demExitVDM (VOID);
  167. VOID demWOWFiles (VOID);
  168. VOID demGetComputerName (VOID);
  169. VOID demCheckPath (VOID);
  170. VOID demSystemSymbolOp (VOID);
  171. VOID demCommit (VOID);
  172. VOID demClientError (HANDLE,CHAR);
  173. ULONG demClientErrorEx (HANDLE,CHAR,BOOL);
  174. VOID demCreateCommon (ULONG);
  175. BOOL demGetMiscInfo (HANDLE, LPWORD, LPWORD, LPDWORD);
  176. VOID demFCBCommon (ULONG);
  177. VOID demIoctlChangeable (VOID);
  178. VOID demIoctlInvalid (VOID);
  179. VOID demSaveHardErrInfo (VOID);
  180. VOID demRestoreHardErrInfo (VOID);
  181. VOID demAbsRead (VOID);
  182. VOID demAbsWrite (VOID);
  183. VOID demIoctlDiskGeneric (VOID);
  184. VOID demIoctlDiskQuery (VOID);
  185. VOID demGetDPB (VOID);
  186. VOID demGetDPBList (VOID);
  187. VOID demNotYetImplemented (VOID);
  188. BOOL GetDiskSpaceInformation(CHAR chDrive, PDISKINFO pDiskInfo);
  189. BOOL demGetDiskFreeSpace(BYTE Drive, WORD * BytesPerSector,
  190. WORD * SectorsPerCluster, WORD * TotalClusters,
  191. WORD * FreeClusters);
  192. BOOL IsCdRomFile (PSTR pszPath);
  193. BOOL GetMediaId( CHAR DriveNum, PVOLINFO pVolInfo);
  194. VOID demPipeFileDataEOF (VOID);
  195. VOID demPipeFileEOF (VOID);
  196. VOID demLFNEntry (VOID);
  197. VOID demSetDosVarLocation (VOID);
  198. #ifdef FE_SB /* ConvNwPathToDosPath() */
  199. VOID ConvNwPathToDosPath (CHAR *,CHAR *,ULONG);
  200. #endif /* FE_SB */
  201. /** Debug Function Prototypes */
  202. #if DBG
  203. VOID demPrintMsg (ULONG iMsg);
  204. #else
  205. #define demPrintMsg(x)
  206. #endif
  207. /* Label functions and constants */
  208. USHORT demDeleteLabel(BYTE Drive);
  209. USHORT demCreateLabel(BYTE Drive, LPSTR szName);
  210. #define DRIVEBYTE 0
  211. #define LABELOFF 3
  212. extern BOOL cmdPipeFileDataEOF (HANDLE,BOOL *);
  213. extern BOOL cmdPipeFileEOF(HANDLE);
  214. #endif /* _DEMINCLUDED_ */