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.

446 lines
11 KiB

  1. __foldwin32sstuff __foldwin32sstuff;
  2. foldstyleinitialization = true;
  3. enablemapdirect3216 = true;
  4. flatthunks = false; /* BUGBUG [KevinR] 31-Aug-1993 */
  5. #include "types.thk"
  6. #include "gditypes.thk"
  7. DWORD SetBrushOrg( HDC, INT, INT, LPPOINT lpPoint deleted) =
  8. DWORD ThkSetBrushOrgEx( HDC, INT, INT, LPPOINT lpPoint)
  9. {
  10. lpPoint = maptoretval;
  11. errorcode = 0;
  12. faulterrorcode = 4096 + 0;
  13. }
  14. LONG GetPath(HDC hdc, LPPOINT lpptl, LPBYTE lpby, LONG cptl) =
  15. LONG GetPath(HDC hdc, LPPOINT lpptl, LPBYTE lpby, LONG cptl)
  16. {
  17. lpptl = raw pack unpack;
  18. dwFreeInfo1 = local 4;
  19. lpby = raw pack unpack;
  20. dwFreeInfo2 = local 4;
  21. errorcode = -1;
  22. faulterrorcode = -1 + 4096;
  23. }
  24. BOOL GdiComment(HDC hdc, ULONG cby, LPBYTE lpby) =
  25. BOOL GdiComment(HDC hdc, ULONG cby, LPBYTE lpby)
  26. {
  27. lpby = raw pack unpack;
  28. dwFreeInfo = local 4;
  29. errorcode = 0;
  30. faulterrorcode = 4096 + 0;
  31. }
  32. ULONG GetEnhMetaFileBits(HEMF hemf, ULONG cby, LPBYTE lpby) =
  33. ULONG GetEnhMetaFileBits(HEMF hemf, ULONG cby, LPBYTE lpby)
  34. {
  35. lpby = raw pack unpack;
  36. dwFreeInfo = local 4;
  37. errorcode = 0;
  38. faulterrorcode = 4096 + 0;
  39. }
  40. ULONG GetEnhMetaFileDescription(HEMF hemf, ULONG cby, LPBYTE lpby) =
  41. ULONG GetEnhMetaFileDescriptionA(HEMF hemf, ULONG cby, LPBYTE lpby)
  42. {
  43. lpby = raw pack unpack;
  44. dwFreeInfo = local 4;
  45. errorcode = -1;
  46. faulterrorcode = 4096 - 1;
  47. }
  48. ULONG GetEnhMetaFilePaletteEntries(HEMF hemf, ULONG cby, LPBYTE lpby) =
  49. ULONG GetEnhMetaFilePaletteEntries(HEMF hemf, ULONG cby, LPBYTE lpby)
  50. {
  51. lpby = raw pack unpack;
  52. dwFreeInfo = local 4;
  53. errorcode = -1;
  54. faulterrorcode = 4096 - 1;
  55. }
  56. /*
  57. * The correct 16-bit definition is:
  58. * BOOL PlayEnhMetaFileRecord(HDC hdc, LPBYTE lpht, LPBYTE lpby, ULONG che)
  59. *
  60. * However, to avoid thunk compiler complaints, and because this
  61. * function has a hand-coded thunk body, the 16-bit definition is made the
  62. * same as the 32-bit one.
  63. *
  64. * lpht is a selector array and not the fastest thing in the world.
  65. * It doesn't really matter right now because the C code on the 16-bit
  66. * side won't handle more than 64k anyway.
  67. */
  68. BOOL PlayEnhMetaFileRecord(HDC hdc, LPBYTE lpht, LPBYTE lpby,
  69. ULONG che, ULONG cby) =
  70. BOOL ThkPlayEnhMetaFileRecord(HDC hdc, LPBYTE lpht, LPBYTE lpby,
  71. ULONG che, ULONG cby)
  72. {
  73. body = special;
  74. errorcode = 0;
  75. faulterrorcode = 4096 + 0;
  76. }
  77. HEMF SetEnhMetaFileBits(ULONG cby, LPSTR lpby) =
  78. HEMF SetEnhMetaFileBits(ULONG cby, LPSTR lpby)
  79. {
  80. lpby = raw pack unpack;
  81. dwFreeInfo = local 4;
  82. errorcode = 0;
  83. faulterrorcode = 4096 + 0;
  84. }
  85. BOOL DeleteMetaFile( HMF hMF) =
  86. BOOL DeleteMetaFile( HMF hMF)
  87. {
  88. /*
  89. * If hMF is a global memory handle allocated via GlobalAlloc32,
  90. * then free it via MyGlobalFree. Otherwise, call Win3.1.
  91. */
  92. body=special;
  93. errorcode = 0;
  94. faulterrorcode = 4096 + 0;
  95. }
  96. HBITMAP CreateBitmapIndirect( LPBITMAPINFO lpBitmap) =
  97. HBITMAP CreateBitmapIndirect( LPBITMAPINFO lpBitmap)
  98. {
  99. body=special;
  100. errorcode = 0;
  101. faulterrorcode = 4096 + 0;
  102. }
  103. DWORD GetBitmapBits( HBITMAP hBitmap, DWORD dwCount, LPSTR lpBits) =
  104. DWORD GetBitmapBits( HBITMAP hBitmap, DWORD dwCount, LPSTR lpBits)
  105. {
  106. lpBits = raw pack unpack;
  107. dwFreeInfo = local 4;
  108. errorcode = 0;
  109. faulterrorcode = 4096 + 0;
  110. }
  111. /*
  112. * LATER: adjust rc to cb16 from cb32
  113. *
  114. * LOGPEN widen
  115. * LOGBRUSH widen
  116. * LOGFONT same
  117. * bitmap ==> width, height, color info: BITMAP ( bmBits==0), widen
  118. * LOGPALETTE ==> # entries in palette, unchanged
  119. *
  120. */
  121. INT GetObject( HGDI hObject, INT nCount, LPSTR lpObject) =
  122. INT GetObjectA( HGDI hObject, INT nCount, LPSTR lpObject)
  123. {
  124. /*
  125. * hObject = special;
  126. * nCount = special;
  127. * lpObject = special;
  128. */
  129. body=special;
  130. errorcode = 0;
  131. faulterrorcode = 4096 + 0;
  132. }
  133. BOOL GetTextMetrics( HDC hDC, LPTEXTMETRIC16 lpMetrics) =
  134. BOOL GetTextMetricsA( HDC hDC, LPTEXTMETRIC32 lpMetrics)
  135. {
  136. /*
  137. * The macro UNPACK_GETTEXTMETRICS_lpMetrics does the unpacking.
  138. * The output semantic causes correct amount of space to be allocated
  139. * for 16-bit structure. The byname semantic turns off some error
  140. * checking.
  141. */
  142. lpMetrics = byname;
  143. lpMetrics = output;
  144. lpMetrics = unpack;
  145. errorcode = 0;
  146. faulterrorcode = 4096 + 0;
  147. }
  148. /*
  149. * The correct 16-bit definition is:
  150. * HMF SetMetaFileBits/Better( HANDLE hMF)
  151. *
  152. * However, to avoid thunk compiler complaints, and because this
  153. * function has a hand-coded thunk body, the 16-bit definition is made the
  154. * same as the 32-bit one.
  155. */
  156. HANDLE SetMetaFileBitsBetter( DWORD nSize, LPSTR lpData) =
  157. HANDLE SetMetaFileBitsEx( DWORD nSize, LPSTR lpData)
  158. {
  159. body=special;
  160. errorcode = 0;
  161. faulterrorcode = 4096 + 0;
  162. }
  163. /* LPBITMAPINFO lpBitsInfo, BITMAPINFO unchanged */
  164. INT SetDIBitsToDevice( HDC, INT, INT, UINT, UINT,
  165. INT, INT, UINT, UINT,
  166. LPSTR lpBits, LPBITMAPINFO lpBitsInfo, UINT) =
  167. INT SetDIBitsToDevice( HDC, INT, INT, UINT, UINT,
  168. INT, INT, UINT, UINT,
  169. LPSTR lpBits, LPBITMAPINFO lpBitsInfo, UINT)
  170. {
  171. lpBits = raw pack unpack;
  172. dwFreeInfo = local 4;
  173. errorcode = 0;
  174. faulterrorcode = 4096 + 0;
  175. }
  176. DWORD SetBitmapBits( HBITMAP hBitmap, DWORD dwCount, LPSTR lpBits) =
  177. DWORD SetBitmapBits( HBITMAP hBitmap, DWORD dwCount, LPSTR lpBits)
  178. {
  179. lpBits = raw pack unpack;
  180. dwFreeInfo = local 4;
  181. errorcode = 0;
  182. faulterrorcode = 4096 + 0;
  183. }
  184. HBITMAP CreateBitmap( int nWidth, int nHeight,
  185. BYTE nPlanes, BYTE nBitCount, LPSTR lpBits) =
  186. HBITMAP CreateBitmap( int nWidth, int nHeight,
  187. WORD nPlanes, WORD nBitCount, LPSTR lpBits)
  188. {
  189. body = special;
  190. errorcode = 0;
  191. faulterrorcode = 4096 + 0;
  192. }
  193. INT EnumObjects( HDC hDC, INT nObjectType, FARPROC lpObjectFunc, LONG lpData) =
  194. INT EnumObjects( HDC hDC, INT nObjectType, FARPROC lpObjectFunc, LONG lpData)
  195. {
  196. lpObjectFunc = raw pack unpack;
  197. errorcode = void;
  198. faulterrorcode = 4096 + 0;
  199. }
  200. int GetDIBits( HDC hDC, HBITMAP hBitmap, UINT nStartScan,
  201. UINT nNumScans, LPSTR lpBits,
  202. LPBITMAPINFO lpBitsInfo, UINT wUsage) =
  203. int GetDIBits( HDC hDC , HBITMAP hBitmap, UINT nStartScan,
  204. UINT nNumScans, LPSTR lpBits,
  205. LPBITMAPINFO lpBitsInfo, UINT wUsage)
  206. {
  207. lpBits = raw pack unpack;
  208. dwFreeInfo = local 4;
  209. errorcode = 0;
  210. faulterrorcode = 4096 + 0;
  211. }
  212. BOOL PlayMetaFileRecord32( HDC hDC, LPSTR lpHandletable,
  213. LPSTR lpMetaRecord, UINT nHandles) =
  214. special BOOL PlayMetaFileRecord( HDC hDC, LPSTR lpHandletable,
  215. LPSTR lpMetaRecord, UINT nHandles)
  216. {
  217. lpMetaRecord = raw pack unpack;
  218. dwFreeInfo = local 4;
  219. errorcode = void;
  220. faulterrorcode = 4096 + 0;
  221. }
  222. INT SetDIBits( HDC hDC, HBITMAP hBitmap, UINT nStartScan, UINT nNumScans,
  223. LPSTR lpBits, LPBITMAPINFO lpBitsInfo, UINT wUsage) =
  224. INT SetDIBits( HDC hDC, HBITMAP hBitmap, UINT nStartScan, UINT nNumScans,
  225. LPSTR lpBits, LPBITMAPINFO lpBitsInfo, UINT wUsage)
  226. {
  227. lpBits = raw pack unpack;
  228. dwFreeInfo = local 4;
  229. errorcode = 0;
  230. faulterrorcode = 4096 + 0;
  231. }
  232. INT StretchDIBits( HDC hDC, INT DestX, INT DestY, INT wDestWidth,
  233. INT wDestHeight, INT SrcX, INT SrcY, INT wSrcWidth,
  234. INT wSrcHeight, LPSTR lpBits, LPBITMAPINFO lpBitsInfo,
  235. UINT wUsage, DWORD dwRop) =
  236. INT StretchDIBits( HDC hDC, INT DestX, INT DestY, INT wDestWidth,
  237. INT wDestHeight, INT SrcX, INT SrcY, INT wSrcWidth,
  238. INT wSrcHeight, LPSTR lpBits, LPBITMAPINFO lpBitsInfo,
  239. UINT wUsage, DWORD dwRop)
  240. {
  241. lpBits = raw pack unpack;
  242. dwFreeInfo = local 4;
  243. errorcode = -1;
  244. faulterrorcode = 4096 - 1;
  245. }
  246. HBITMAP CreateDIBitmap( HDC hDC, LPBITMAPINFOHEADER lpInfoHeader,
  247. DWORD dwUsage, LPSTR lpInitBits,
  248. LPBITMAPINFO lpInitInfo, UINT wUsage) =
  249. HBITMAP ThkCreateDIBitmap( HDC hDC, LPBITMAPINFOHEADER lpInfoHeader,
  250. DWORD dwUsage, LPSTR lpInitBits,
  251. LPBITMAPINFO lpInitInfo, UINT wUsage)
  252. {
  253. lpInitBits = raw pack unpack;
  254. dwFreeInfo = local 4;
  255. errorcode = 0;
  256. faulterrorcode = 4096 + 0;
  257. }
  258. void LineDDA( int X1, int Y1, int X2, int Y2, FARPROC lpLineFunc, DWORD lpData)=
  259. void LineDDA( int X1, int Y1, int X2, int Y2, FARPROC lpLineFunc, DWORD lpData)
  260. {
  261. lpLineFunc = callback CBID_LINEDDA;
  262. errorcode = void;
  263. }
  264. int StartDoc(HDC hdc, LPDOCINFO16 lpdi) =
  265. int StartDocA(HDC hdc, LPDOCINFO32 lpdi)
  266. {
  267. lpdi = pack unpack;
  268. lpszDocNameTemp = local 4;
  269. lpszOutputTemp = local 4;
  270. lpszDatatypeTemp = local 4;
  271. errorcode = special;
  272. faulterrorcode = 4096 - 1;
  273. }
  274. int Escape(HDC hdc, int nEscape, int cbInput, LPSTR lpInData, LPSTR lpOutData) =
  275. int ThkEscape(HDC hdc, int nEscape, int cbInput, LPSTR lpInData, LPSTR lpOutData)
  276. {
  277. body = special;
  278. errorcode = special;
  279. faulterrorcode = 4096 + 0;
  280. }
  281. int SetAbortProc(HDC hdc, DWORD pfnAbort) =
  282. int SetAbortProc(HDC hdc, DWORD pfnAbort)
  283. {
  284. pfnAbort = push;
  285. errorcode = -1;
  286. faulterrorcode = 4096 - 1;
  287. }
  288. DWORD GetFontData(HDC, DWORD, DWORD, LPSTR lpvBuffer, DWORD cbData) =
  289. DWORD GetFontData(HDC, DWORD, DWORD, LPSTR lpvBuffer, DWORD cbData)
  290. {
  291. lpvBuffer = raw pack unpack;
  292. dwFreeInfo = local 4;
  293. errorcode = -1;
  294. faulterrorcode = 4096 - 1;
  295. }
  296. /*
  297. * Last param is really LPMAT2, but no repacking necessary.
  298. */
  299. DWORD GetGlyphOutline( HDC, UINT, UINT, LPGLYPHMETRICS16 lpgm, DWORD, LPSTR lpvBuffer, LPSTR) =
  300. DWORD GetGlyphOutlineA(HDC, UINT, UINT, LPGLYPHMETRICS32 lpgm, DWORD, LPSTR lpvBuffer, LPSTR)
  301. {
  302. lpgm = output;
  303. lpvBuffer = raw pack unpack;
  304. dwFreeInfo = local 4;
  305. errorcode = -1;
  306. faulterrorcode = 4096 - 1;
  307. }
  308. /*
  309. * lpotm is really LPOUTLINETEXTMETRIC
  310. */
  311. WORD GetOutlineTextMetrics(HDC, UINT cbData, LPSTR lpotm) =
  312. DWORD GetOutlineTextMetricsA(HDC, UINT cbData, LPSTR lpotm)
  313. {
  314. body=special;
  315. errorcode = 0;
  316. faulterrorcode = 4096 + 0;
  317. }
  318. int GetKerningPairs( HDC, int cPairs, LPKERNINGPAIR lpkp) =
  319. int GetKerningPairsA(HDC, int cPairs, LPKERNINGPAIR lpkp)
  320. {
  321. lpkp = raw pack unpack;
  322. dwFreeInfo = local 4;
  323. errorcode = 0;
  324. faulterrorcode = 4096 + 0;
  325. }
  326. BOOL GetTextExtentExPoint(HDC hdc,
  327. LPSTR lpszStr,
  328. int cchString,
  329. int nMaxExtent,
  330. LPINT lpnFit,
  331. LPINT alpDx,
  332. LPSIZE lpSize) =
  333. BOOL GetTextExtentExPointA(HDC hdc,
  334. LPSTR lpszStr,
  335. int cchString,
  336. int nMaxExtent,
  337. LPINT lpnFit,
  338. LPINT alpDx,
  339. LPSIZE lpSize)
  340. {
  341. body = special;
  342. faulterrorcode = 4096 + 0;
  343. }
  344. /* Private API: GDI32 must run this thunk before any other.
  345. *
  346. * The pointer params are linear addresses which are passed through
  347. * untouched.
  348. */
  349. VOID GdiThunkInit(DWORD pCB32Tab, DWORD ppData16, DWORD ppStockObj,
  350. DWORD ppHeap32, DWORD phHeap32) =
  351. VOID GdiThunkInit(DWORD pCB32Tab, DWORD ppData16, DWORD ppStockObj,
  352. DWORD ppHeap32, DWORD phHeap32)
  353. {}