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.

378 lines
11 KiB

  1. // --------------------------------------------------------------------------
  2. //
  3. // WINDDI.H
  4. //
  5. // Win16 DDI header
  6. //
  7. // --------------------------------------------------------------------------
  8. #ifndef _WINDDI_
  9. #define _WINDDI_
  10. //
  11. // Display Driver ordinals
  12. //
  13. #define ORD_OEMINQUIRECURSOR 101
  14. #define ORD_OEMSETCURSOR 102
  15. #define ORD_OEMMOVECURSOR 103
  16. #define ORD_OEMCHECKCURSOR 104
  17. #define ORD_OEMSAVEBITS 92
  18. //
  19. // DDI patches
  20. //
  21. #define DDI_FIRST 0
  22. typedef enum
  23. {
  24. //
  25. // Screen Output routines
  26. //
  27. DDI_ARC = DDI_FIRST,
  28. DDI_BITBLT,
  29. DDI_CHORD,
  30. DDI_ELLIPSE,
  31. DDI_EXTFLOODFILL,
  32. DDI_EXTTEXTOUTA,
  33. DDI_EXTTEXTOUTW,
  34. DDI_FILLPATH,
  35. DDI_FILLRGN,
  36. DDI_FLOODFILL,
  37. DDI_FRAMERGN,
  38. DDI_INVERTRGN,
  39. DDI_LINETO,
  40. DDI_PAINTRGN,
  41. DDI_PATBLT,
  42. DDI_PIE,
  43. DDI_PLAYENHMETAFILERECORD,
  44. DDI_PLAYMETAFILE,
  45. DDI_PLAYMETAFILERECORD,
  46. DDI_POLYGON,
  47. DDI_POLYBEZIER,
  48. DDI_POLYBEZIERTO,
  49. DDI_POLYLINE,
  50. DDI_POLYLINETO,
  51. DDI_POLYPOLYLINE,
  52. DDI_POLYPOLYGON,
  53. DDI_RECTANGLE,
  54. DDI_ROUNDRECT,
  55. DDI_SETDIBITSTODEVICE,
  56. DDI_SETPIXEL,
  57. DDI_STRETCHBLT,
  58. DDI_STRETCHDIBITS,
  59. DDI_STROKEANDFILLPATH,
  60. DDI_STROKEPATH,
  61. DDI_TEXTOUTA,
  62. DDI_TEXTOUTW,
  63. DDI_UPDATECOLORS,
  64. //
  65. // SPB stuff
  66. //
  67. DDI_CREATESPB,
  68. DDI_DELETEOBJECT,
  69. // DDI_SETOBJECTOWNER for Memphis
  70. //
  71. // Display mode, dosbox stuff
  72. //
  73. DDI_DEATH,
  74. DDI_RESURRECTION,
  75. DDI_WINOLDAPPHACKOMATIC,
  76. DDI_GDIREALIZEPALETTE,
  77. DDI_REALIZEDEFAULTPALETTE,
  78. //
  79. // If we implement an SBC,
  80. // DDI_SETBITMAPBITS,
  81. // DDI_SETDIBCOLORTABLE,
  82. // DDI_SETDIBITS,
  83. // DDI_SYSDELETEOBJECT,
  84. //
  85. DDI_MAX
  86. } DDI_PATCH;
  87. //
  88. // IM Patches
  89. // We patch these DDIs when you are sharing and your machine is being
  90. // controlled by a remote. If a 16-bit shared app goes into a modal loop
  91. // on mouse/key down, we pulse the win16lock so our 32-bit thread can
  92. // play back the mouse/key moves and ups.
  93. //
  94. #define IM_FIRST 0
  95. typedef enum
  96. {
  97. //
  98. // Low level input processing
  99. //
  100. IM_MOUSEEVENT = IM_FIRST,
  101. IM_KEYBOARDEVENT,
  102. IM_SIGNALPROC32,
  103. //
  104. // Win16lock pulsing for 16-bit apps that do modal loops on mouse input
  105. //
  106. IM_GETASYNCKEYSTATE,
  107. IM_GETCURSORPOS,
  108. IM_MAX
  109. } IM_PATCH;
  110. //
  111. // DDI Routines
  112. //
  113. BOOL WINAPI DrvArc(HDC, int, int, int, int, int, int, int, int);
  114. BOOL WINAPI DrvBitBlt(HDC, int, int, int, int, HDC, int, int, DWORD);
  115. BOOL WINAPI DrvChord(HDC, int, int, int, int, int, int, int, int);
  116. BOOL WINAPI DrvEllipse(HDC, int, int, int, int);
  117. BOOL WINAPI DrvExtFloodFill(HDC, int, int, COLORREF, UINT);
  118. BOOL WINAPI DrvExtTextOutA(HDC, int, int, UINT, LPRECT, LPSTR, UINT, LPINT);
  119. BOOL WINAPI DrvExtTextOutW(HDC, int, int, UINT, LPRECT, LPWSTR, UINT, LPINT);
  120. BOOL WINAPI DrvFillPath(HDC);
  121. BOOL WINAPI DrvFillRgn(HDC, HRGN, HBRUSH);
  122. BOOL WINAPI DrvFloodFill(HDC, int, int, COLORREF);
  123. BOOL WINAPI DrvFrameRgn(HDC, HRGN, HBRUSH, int, int);
  124. BOOL WINAPI DrvInvertRgn(HDC, HRGN);
  125. BOOL WINAPI DrvLineTo(HDC, int, int);
  126. BOOL WINAPI DrvPaintRgn(HDC, HRGN);
  127. BOOL WINAPI DrvPatBlt(HDC, int, int, int, int, DWORD);
  128. BOOL WINAPI DrvPie(HDC, int, int, int, int, int, int, int, int);
  129. BOOL WINAPI DrvPlayEnhMetaFileRecord(HDC, LPHANDLETABLE, LPENHMETARECORD, DWORD);
  130. BOOL WINAPI DrvPlayMetaFile(HDC, HMETAFILE);
  131. void WINAPI DrvPlayMetaFileRecord(HDC, LPHANDLETABLE, METARECORD FAR*, UINT);
  132. BOOL WINAPI DrvPolyBezier(HDC, LPPOINT, UINT);
  133. BOOL WINAPI DrvPolyBezierTo(HDC, LPPOINT, UINT);
  134. BOOL WINAPI DrvPolygon(HDC, LPPOINT, int);
  135. BOOL WINAPI DrvPolyline(HDC, LPPOINT, int);
  136. BOOL WINAPI DrvPolylineTo(HDC, LPPOINT, int);
  137. BOOL WINAPI DrvPolyPolygon(HDC, LPPOINT, LPINT, int);
  138. BOOL WINAPI DrvPolyPolyline(DWORD, HDC, LPPOINT, LPINT, int);
  139. BOOL WINAPI DrvRectangle(HDC, int, int, int, int);
  140. BOOL WINAPI DrvRoundRect(HDC, int, int, int, int, int, int);
  141. int WINAPI DrvSetDIBitsToDevice(HDC, int, int, int, int, int, int, UINT, UINT,
  142. LPVOID, LPBITMAPINFO, UINT);
  143. COLORREF WINAPI DrvSetPixel(HDC, int, int, COLORREF);
  144. BOOL WINAPI DrvStretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD);
  145. int WINAPI DrvStretchDIBits(HDC, int, int, int, int, int,
  146. int, int, int, const void FAR*, LPBITMAPINFO, UINT, DWORD);
  147. BOOL WINAPI DrvStrokeAndFillPath(HDC);
  148. BOOL WINAPI DrvStrokePath(HDC);
  149. BOOL WINAPI DrvTextOutA(HDC, int, int, LPSTR, int);
  150. BOOL WINAPI DrvTextOutW(HDC, int, int, LPWSTR, int);
  151. int WINAPI DrvUpdateColors(HDC);
  152. void WINAPI DrvRealizeDefaultPalette(HDC);
  153. DWORD WINAPI DrvGDIRealizePalette(HDC);
  154. UINT WINAPI DrvCreateSpb(HDC, int, int);
  155. BOOL WINAPI DrvDeleteObject(HGDIOBJ);
  156. LONG WINAPI DrvSetBitmapBits(HBITMAP, DWORD, const void FAR*);
  157. UINT WINAPI DrvSetDIBColorTable(HDC, UINT, UINT, const RGBQUAD FAR*);
  158. int WINAPI DrvSetDIBits(HDC, HBITMAP, UINT, UINT, const void FAR*, BITMAPINFO FAR*, UINT);
  159. BOOL WINAPI DrvSysDeleteObject(HGDIOBJ);
  160. BOOL WINAPI DrvSetPointerShape(LPCURSORSHAPE lpcur);
  161. BOOL WINAPI DrvSaveBits(LPRECT lprc, UINT wSave);
  162. UINT WINAPI DrvDeath(HDC);
  163. UINT WINAPI DrvResurrection(HDC, DWORD, DWORD, DWORD);
  164. LONG WINAPI DrvWinOldAppHackoMatic(LONG flags);
  165. LONG WINAPI DrvChangeDisplaySettings(LPDEVMODE, DWORD);
  166. LONG WINAPI DrvChangeDisplaySettingsEx(LPCSTR, LPDEVMODE, HWND, DWORD, LPVOID);
  167. BOOL WINAPI DrvSignalProc32(DWORD, DWORD, DWORD, WORD);
  168. void WINAPI DrvMouseEvent(UINT regAX, UINT regBX, UINT regCX, UINT regDX,
  169. UINT regSI, UINT regDI);
  170. void WINAPI DrvKeyboardEvent(UINT regAX, UINT regBX, UINT regSI, UINT regDI);
  171. //
  172. // GetAsyncKeyState
  173. // GetCursorPos
  174. //
  175. int WINAPI DrvGetAsyncKeyState(int);
  176. BOOL WINAPI DrvGetCursorPos(LPPOINT);
  177. //
  178. // GDI STRUCTURES
  179. //
  180. typedef struct tagGDIHANDLE
  181. {
  182. PBYTE pGdiObj; // If not swapped out, in GDI ds
  183. // If swapped out, local32handle
  184. BYTE objFlags;
  185. } GDIHANDLE, FAR* LPGDIHANDLE;
  186. #define OBJFLAGS_SWAPPEDOUT 0x40
  187. #define OBJFLAGS_INVALID 0xFF
  188. //
  189. // More useful definition of RGNDATA
  190. //
  191. #define CRECTS_COMPLEX 32
  192. #define CRECTS_MAX ((0x4000 - sizeof(RDH)) / sizeof(RECTL))
  193. //
  194. // Keep RGNDATA <= 8K. WE can get a larger region then combine areas if
  195. // needed.
  196. //
  197. typedef struct tagRDH
  198. {
  199. DWORD dwSize;
  200. DWORD iType;
  201. DWORD nRectL; // Number of rect pieces
  202. DWORD nRgnSize;
  203. RECTL arclBounds;
  204. }
  205. RDH, FAR* LPRDH;
  206. typedef struct tagREAL_RGNDATA
  207. {
  208. RDH rdh;
  209. RECTL arclPieces[CRECTS_MAX];
  210. }
  211. REAL_RGNDATA, FAR* LPREAL_RGNDATA;
  212. //
  213. // DRAWMODE
  214. //
  215. typedef struct tagDRAWMODE
  216. {
  217. int Rop2; // 16-bit encoded logical op
  218. int bkMode; // Background mode (for text only)
  219. DWORD bkColorP; // Physical background color
  220. DWORD txColorP; // Physical foreground (text) color
  221. int TBreakExtra; // Total pixels to stuff into a line
  222. int BreakExtra; // div(TBreakExtra, BreakCount)
  223. int BreakErr; // Running error term
  224. int BreakRem; // mod(TBreakExtra, BreakCount)
  225. int BreakCount; // Number of breaks in the line
  226. int CharExtra; // Extra pixels to stuff after each char
  227. DWORD bkColorL; // Logical background color
  228. DWORD txColorL; // Logical foreground color
  229. DWORD ICMCXform; // Transform for DIC image color matching
  230. int StretchBltMode; // Stretch blt mode
  231. DWORD eMiterLimit; // Miter limit (single precision IEEE float)
  232. } DRAWMODE;
  233. typedef DRAWMODE FAR * LPDRAWMODE;
  234. typedef struct tagGDIOBJ_HEAD
  235. {
  236. LOCALHANDLE ilhphOBJ;
  237. UINT ilObjType;
  238. DWORD ilObjCount;
  239. UINT ilObjMetaList;
  240. UINT ilObjSelCount;
  241. UINT ilObjTask;
  242. } GDIOBJ_HEAD;
  243. typedef GDIOBJ_HEAD FAR* LPGDIOBJ_HEAD;
  244. typedef struct tagDC
  245. {
  246. GDIOBJ_HEAD MrDCHead;
  247. BYTE DCFlags;
  248. BYTE DCFlags2;
  249. HMETAFILE hMetaFile;
  250. HRGN hClipRgn;
  251. HRGN hMetaRgn;
  252. GLOBALHANDLE hPDevice; // Physical device handle
  253. HPEN hPen; // Current logical pen
  254. HBRUSH hBrush; // Current logical brush
  255. HFONT hFont; // Current logical font
  256. HBITMAP hBitmap; // Current logical bitmap
  257. HPALETTE hPal; // Current logical palette
  258. LOCALHANDLE hLDevice; // Logical device handle
  259. HRGN hRaoClip; // Intersection of clip regions
  260. LOCALHANDLE hPDeviceBlock; // DC phys instance data inc. GDIINFO
  261. LOCALHANDLE hPPen; // Current physical pen
  262. LOCALHANDLE hPBrush; // Current physical brush
  263. LOCALHANDLE hPFontTrans; // Current physical font transform
  264. LOCALHANDLE hPFont; // Current physical font
  265. LPBYTE lpPDevice; // Ptr to physical device or bitmap
  266. PBYTE pLDeviceBlock; // Near ptr to logical device block
  267. PBYTE hBitBits; // Handle of selected bitmap bits
  268. PBYTE pPDeviceBlock; // Near ptr to physical device block
  269. LPBYTE lpPPen; // Ptr to OEM pen data
  270. LPBYTE lpPBrush; // Ptr to OEM brush data
  271. PBYTE pPFontTrans; // Near ptr to text transform
  272. LPBYTE lpPFont; // Ptr to physical font
  273. UINT nPFTIndex; // PFT index for font/DEVICE_FONT
  274. POINT Translate;
  275. DRAWMODE DrawMode;
  276. HGLOBAL hPath;
  277. UINT fwPath;
  278. // ...
  279. } DC;
  280. typedef DC FAR* LPDC;
  281. //
  282. // Values for DCFlags
  283. //
  284. #define DC_IS_MEMORY 0x01
  285. #define DC_IS_DISPLAY 0x02
  286. #define DC_HAS_DIRTYVISRGN 0x04
  287. #define DC_IS_PARTIAL 0x80
  288. #define DC_HAS_DIRTYFONT 0x40
  289. #define DC_HAS_DIRTYPEN 0x20
  290. #define DC_HAS_DIRTYCLIP 0x10
  291. //
  292. // Values for DCFlags2
  293. //
  294. #define DRAFTFLAG 0x01
  295. #define ChkDispPal 0x02
  296. #define dfFont 0x04
  297. #define SimVectFont 0x08
  298. #define deFont 0x10
  299. #define TT_NO_DX_MOD 0x40 // DC is for Micrografx's metafile recorder
  300. #define DC_DIB 0x80 // memory DC is now a DIB DC.
  301. //
  302. // Values for fwPath
  303. //
  304. #define DCPATH_ACTIVE 0x0001
  305. #define DCPATH_SAVE 0x0002
  306. #define DCPATH_CLOCKWISE 0x0004
  307. //
  308. // BRUSH structure
  309. //
  310. typedef struct tagBRUSH
  311. {
  312. GDIOBJ_HEAD ilObjHead;
  313. LOGBRUSH ilBrushOverhead; // lbHatch is the HGLOBAL of the bitmap
  314. HBITMAP ilBrushBitmapOrg;
  315. } BRUSH;
  316. typedef BRUSH FAR* LPBRUSH;
  317. #endif // !_WINDDI_