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.

248 lines
7.8 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: geni386.c *
  3. * *
  4. * This module implements a program which generates structure offset *
  5. * definitions for kernel structures that are accessed in assembly code. *
  6. * *
  7. * Copyright (c) 1992-1999 Microsoft Corporation *
  8. \**************************************************************************/
  9. #include "precomp.hxx"
  10. extern "C" {
  11. // needed until we cleanup the floating point stuff in ntgdistr.h
  12. #define __CPLUSPLUS
  13. };
  14. include(BASE_INC_PATH\genxx.h)
  15. define(`pcomment',`genCom($1)')
  16. define(`pblank',`genSpc($1)')
  17. define(`pequate',`{ SEF_EQUATE, $2, $1 },')
  18. define(`pstruct',`{ SEF_STRUCTURE, $2, $1 },')
  19. STRUC_ELEMENT ElementList[] = {
  20. START_LIST
  21. //
  22. // Default object type.
  23. //
  24. pcomment("Object Type Information")
  25. pblank()
  26. pequate("DEF_TYPE ",DEF_TYPE )
  27. pequate("KernelMode ",KernelMode )
  28. // pequate("ThUniqueProcess ",OFFSET(ETHREAD,Cid.UniqueProcess))
  29. // Stuff from: \nt\private\windows\gdi\gre\hmgr.h
  30. pblank()
  31. pcomment("Handle Manager Structures")
  32. pblank()
  33. pequate("UNIQUE_BITS ",UNIQUE_BITS )
  34. pequate("NONINDEX_BITS ",NONINDEX_BITS)
  35. pequate("INDEX_BITS ",INDEX_BITS )
  36. pequate("INDEX_MASK ",INDEX_MASK )
  37. pequate("VALIDUNIQUEMASK ",(USHORT)~FULLUNIQUE_MASK )
  38. pequate("OBJECT_OWNER_PUBLIC",OBJECT_OWNER_PUBLIC )
  39. pequate("TYPE_SHIFT ",TYPE_SHIFT )
  40. pblank()
  41. pstruct("OBJECT",sizeof(OBJECT))
  42. pequate("object_ulShareCount ",OFFSET(OBJECT,ulShareCount))
  43. pequate("object_cExclusiveLock ",OFFSET(OBJECT,cExclusiveLock))
  44. pequate("object_Tid ",OFFSET(OBJECT,Tid))
  45. pblank()
  46. pstruct("ENTRY",sizeof(ENTRY))
  47. pblank()
  48. pequate("entry_einfo ",OFFSET(ENTRY,einfo ))
  49. pequate("entry_ObjectOwner ",OFFSET(ENTRY,ObjectOwner))
  50. pequate("entry_FullUnique ",OFFSET(ENTRY,FullUnique ))
  51. pequate("entry_Objt ",OFFSET(ENTRY,Objt ))
  52. pblank()
  53. // Stuff from: \nt\private\windows\gdi\gre\patblt.hxx
  54. pcomment("PatBlt Structures")
  55. pblank()
  56. pstruct("FETCHFRAME",sizeof(FETCHFRAME))
  57. pblank()
  58. pequate("ff_pvTrg ",OFFSET(FETCHFRAME,pvTrg ))
  59. pequate("ff_pvPat ",OFFSET(FETCHFRAME,pvPat ))
  60. pequate("ff_xPat ",OFFSET(FETCHFRAME,xPat ))
  61. pequate("ff_cxPat ",OFFSET(FETCHFRAME,cxPat ))
  62. pequate("ff_culFill ",OFFSET(FETCHFRAME,culFill ))
  63. pequate("ff_culWidth ",OFFSET(FETCHFRAME,culWidth ))
  64. pequate("ff_culFillTmp ",OFFSET(FETCHFRAME,culFillTmp))
  65. pblank()
  66. // Stuff from: \nt\public\sdk\inc\ntdef.h
  67. pcomment("Math Structures")
  68. pblank()
  69. pstruct("LARGE_INTEGER",sizeof(LARGE_INTEGER))
  70. pblank()
  71. pequate("li_LowPart ",OFFSET(LARGE_INTEGER,u.LowPart))
  72. pequate("li_HighPart",OFFSET(LARGE_INTEGER,u.HighPart))
  73. pblank()
  74. // Stuff from: \nt\public\sdk\inc\windef.h
  75. pstruct("POINTL",sizeof(POINTL))
  76. pblank()
  77. pequate("ptl_x",OFFSET(POINTL,x))
  78. pequate("ptl_y",OFFSET(POINTL,y))
  79. pblank()
  80. pstruct("SIZEL",sizeof(SIZEL))
  81. pblank()
  82. pequate("sizl_cx",OFFSET(SIZEL,cx))
  83. pequate("sizl_cy",OFFSET(SIZEL,cy))
  84. pblank()
  85. pstruct("RECTL",sizeof(RECTL))
  86. pblank()
  87. pequate("xLeft",OFFSET(RECTL,left))
  88. pequate("yTop",OFFSET(RECTL,top))
  89. pequate("xRight",OFFSET(RECTL,right))
  90. pequate("yBottom",OFFSET(RECTL,bottom))
  91. pblank()
  92. // Stuff from \nt\public\oak\inc\winddi.h
  93. pequate("dsurf_lNextScan",OFFSET(SURFOBJ,lDelta))
  94. // Stuff from: \nt\private\windows\gdi\gre\xformobj.hxx
  95. pblank()
  96. pcomment("Xform Structures")
  97. pblank()
  98. pequate("XFORM_SCALE ",XFORM_SCALE)
  99. pequate("XFORM_UNITY ",XFORM_UNITY)
  100. pequate("XFORM_Y_NEG ",XFORM_Y_NEG)
  101. pequate("XFORM_FORMAT_LTOFX",XFORM_FORMAT_LTOFX)
  102. pblank()
  103. // Stuff from: \nt\private\windows\gdi\gre\engine.hxx
  104. pstruct("MATRIX",sizeof(MATRIX))
  105. pblank()
  106. pequate("mx_efM11 ",OFFSET(MATRIX,efM11 ))
  107. pequate("mx_efM12 ",OFFSET(MATRIX,efM12 ))
  108. pequate("mx_efM21 ",OFFSET(MATRIX,efM21 ))
  109. pequate("mx_efM22 ",OFFSET(MATRIX,efM22 ))
  110. pequate("mx_efDx ",OFFSET(MATRIX,efDx ))
  111. pequate("mx_efDy ",OFFSET(MATRIX,efDy ))
  112. pequate("mx_fxDx ",OFFSET(MATRIX,fxDx ))
  113. pequate("mx_fxDy ",OFFSET(MATRIX,fxDy ))
  114. pequate("mx_flAccel",OFFSET(MATRIX,flAccel))
  115. pblank()
  116. pstruct("VECTORL",sizeof(VECTORL))
  117. pblank()
  118. pequate("vl_x",OFFSET(VECTORL,x))
  119. pequate("vl_y",OFFSET(VECTORL,y))
  120. pblank()
  121. // Stuff from: \nt\private\windows\gdi\gre\epointfl.hxx
  122. pstruct("VECTORFL",sizeof(VECTORFL))
  123. pblank()
  124. pequate("vfl_x",OFFSET(VECTORFL,x))
  125. pequate("vfl_y",OFFSET(VECTORFL,y))
  126. pblank()
  127. //
  128. // Structures from \nt\private\windows\gdi\gre\strdir.hxx
  129. //
  130. pblank()
  131. pstruct("STR_BLT",sizeof(STR_BLT))
  132. pequate("str_pjSrcScan",OFFSET(STR_BLT,pjSrcScan))
  133. pequate("str_lDeltaSrc",OFFSET(STR_BLT,lDeltaSrc))
  134. pequate("str_XSrcStart",OFFSET(STR_BLT,XSrcStart))
  135. pequate("str_pjDstScan",OFFSET(STR_BLT,pjDstScan))
  136. pequate("str_lDeltaDst",OFFSET(STR_BLT,lDeltaDst))
  137. pequate("str_XDstStart",OFFSET(STR_BLT,XDstStart))
  138. pequate("str_XDstEnd",OFFSET(STR_BLT,XDstEnd))
  139. pequate("str_YDstCount",OFFSET(STR_BLT,YDstCount))
  140. pequate("str_ulXDstToSrcIntCeil",OFFSET(STR_BLT,ulXDstToSrcIntCeil))
  141. pequate("str_ulXDstToSrcFracCeil",OFFSET(STR_BLT,ulXDstToSrcFracCeil))
  142. pequate("str_ulYDstToSrcIntCeil",OFFSET(STR_BLT,ulYDstToSrcIntCeil))
  143. pequate("str_ulYDstToSrcFracCeil",OFFSET(STR_BLT,ulYDstToSrcFracCeil))
  144. pequate("str_ulXFracAccumulator",OFFSET(STR_BLT,ulXFracAccumulator))
  145. pequate("str_ulYFracAccumulator",OFFSET(STR_BLT,ulYFracAccumulator))
  146. // Stuff from: \nt\private\windows\gdi\gre\rfntobj.hxx
  147. pcomment("Font structures")
  148. pblank()
  149. pequate("prfnt", OFFSET(RFONTOBJ, prfnt))
  150. pequate("wcgp", OFFSET(RFONT, wcgp))
  151. pequate("ulContent", OFFSET(RFONT, ulContent))
  152. pequate("FO_HGLYPHS", FO_HGLYPHS)
  153. pequate("agprun", OFFSET(WCGP, agpRun))
  154. pequate("pgdDefault", OFFSET(WCGP, pgdDefault))
  155. pequate("wcLow", OFFSET(GPRUN, wcLow))
  156. pequate("cGlyphs", OFFSET(GPRUN, cGlyphs))
  157. pequate("apgd", OFFSET(GPRUN, apgd))
  158. pequate("gd_hg", OFFSET(GLYPHDATA, hg))
  159. pequate("gd_gdf", OFFSET(GLYPHDATA, gdf))
  160. pequate("gp_hg", OFFSET(GLYPHPOS, hg))
  161. pequate("gp_pgdf", OFFSET(GLYPHPOS, pgdf))
  162. pequate("gp_x", OFFSET(GLYPHPOS,ptl.x))
  163. pequate("gp_y", OFFSET(GLYPHPOS,ptl.y))
  164. pequate("SIZE_GLYPHPOS", sizeof(GLYPHPOS))
  165. pequate("gdf_pgb",OFFSET(GLYPHDEF,pgb))
  166. pequate("gb_x",OFFSET(GLYPHBITS,ptlOrigin.x))
  167. pequate("gb_y",OFFSET(GLYPHBITS,ptlOrigin.y))
  168. pequate("gb_cx",OFFSET(GLYPHBITS,sizlBitmap.cx))
  169. pequate("gb_cy",OFFSET(GLYPHBITS,sizlBitmap.cy))
  170. pequate("gb_aj",OFFSET(GLYPHBITS,aj))
  171. /***********\
  172. * i386 ONLY *
  173. \***********/
  174. // Stuff from: \nt\private\windows\gdi\gre\i386\efloat.hxx
  175. pcomment("Math Structures")
  176. pblank()
  177. pstruct("EFLOAT",sizeof(EFLOAT))
  178. pblank()
  179. pequate("ef_lMant",OFFSET(EFLOAT,i.lMant))
  180. pequate("ef_lExp ",OFFSET(EFLOAT,i.lExp))
  181. pblank()
  182. // check stack
  183. pcomment("Check stack defines")
  184. pblank()
  185. pequate("CSWINDOWSIZE",0x10000)
  186. pblank()
  187. // defines
  188. #ifdef _GDIPLUS_
  189. pequate("GDIPLUS",1)
  190. #else
  191. pequate("GDIPLUS",0)
  192. #endif
  193. pblank()
  194. END_LIST
  195. };