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.

830 lines
20 KiB

  1. /****************************************************************************
  2. *
  3. * Win16 Metafile emitter routines
  4. *
  5. * Date: 7/19/91
  6. * Author: Jeffrey Newman (c-jeffn)
  7. *
  8. ***************************************************************************/
  9. #include "precomp.h"
  10. #pragma hdrstop
  11. /****************************************************************************
  12. * bW16Emit0 - This is the base routine to emit a Win16 drawing order
  13. * with 0 parameters.
  14. ***************************************************************************/
  15. BOOL bW16Emit0
  16. (
  17. PLOCALDC pLocalDC,
  18. WORD RecordID
  19. )
  20. {
  21. BOOL b;
  22. METARECORD0 mr;
  23. mr.rdSize = sizeof(mr) / sizeof(WORD);
  24. mr.rdFunction = RecordID;
  25. b = bEmit(pLocalDC, &mr, sizeof(mr));
  26. // Update the global max record size.
  27. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  28. return(b);
  29. }
  30. /****************************************************************************
  31. * bW16Emit1 - This is the base routine to emit a Win16 drawing order
  32. * with 1 parameter.
  33. ***************************************************************************/
  34. BOOL bW16Emit1
  35. (
  36. PLOCALDC pLocalDC,
  37. WORD RecordID,
  38. WORD x1
  39. )
  40. {
  41. BOOL b;
  42. METARECORD1 mr;
  43. mr.rdSize = sizeof(mr) / sizeof(WORD);
  44. mr.rdFunction = RecordID;
  45. mr.rdParm[0] = x1;
  46. b = bEmit(pLocalDC, &mr, sizeof(mr));
  47. // Update the global max record size.
  48. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  49. return(b);
  50. }
  51. /****************************************************************************
  52. * bW16Emit2 - This is the base routine to emit a Win16 drawing order
  53. * with 2 parameters.
  54. ***************************************************************************/
  55. BOOL bW16Emit2
  56. (
  57. PLOCALDC pLocalDC,
  58. WORD RecordID,
  59. WORD x1,
  60. WORD x2
  61. )
  62. {
  63. BOOL b;
  64. METARECORD2 mr;
  65. mr.rdSize = sizeof(mr) / sizeof(WORD);
  66. mr.rdFunction = RecordID;
  67. mr.rdParm[0] = x2;
  68. mr.rdParm[1] = x1;
  69. b = bEmit(pLocalDC, &mr, sizeof(mr));
  70. // Update the global max record size.
  71. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  72. return(b);
  73. }
  74. /****************************************************************************
  75. * bW16Emit4 - This is the base routine to emit a Win16 drawing order
  76. * with 4 parameters.
  77. ***************************************************************************/
  78. BOOL bW16Emit4
  79. (
  80. PLOCALDC pLocalDC,
  81. WORD RecordID,
  82. WORD x1,
  83. WORD x2,
  84. WORD x3,
  85. WORD x4
  86. )
  87. {
  88. BOOL b;
  89. METARECORD4 mr;
  90. mr.rdSize = sizeof(mr) / sizeof(WORD);
  91. mr.rdFunction = RecordID;
  92. mr.rdParm[0] = x4;
  93. mr.rdParm[1] = x3;
  94. mr.rdParm[2] = x2;
  95. mr.rdParm[3] = x1;
  96. b = bEmit(pLocalDC, &mr, sizeof(mr));
  97. // Update the global max record size.
  98. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  99. return(b);
  100. }
  101. /****************************************************************************
  102. * bW16Emit5 - This is the base routine to emit a Win16 drawing order
  103. * with 5 parameters.
  104. ***************************************************************************/
  105. BOOL bW16Emit5
  106. (
  107. PLOCALDC pLocalDC,
  108. WORD RecordID,
  109. WORD x1,
  110. WORD x2,
  111. WORD x3,
  112. WORD x4,
  113. WORD x5
  114. )
  115. {
  116. BOOL b;
  117. METARECORD5 mr;
  118. mr.rdSize = sizeof(mr) / sizeof(WORD);
  119. mr.rdFunction = RecordID;
  120. mr.rdParm[0] = x5;
  121. mr.rdParm[1] = x4;
  122. mr.rdParm[2] = x3;
  123. mr.rdParm[3] = x2;
  124. mr.rdParm[4] = x1;
  125. b = bEmit(pLocalDC, &mr, sizeof(mr));
  126. // Update the global max record size.
  127. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  128. return(b);
  129. }
  130. /****************************************************************************
  131. * bW16Emit6 - This is the base routine to emit a Win16 drawing order
  132. * with 6 parameters.
  133. ***************************************************************************/
  134. BOOL bW16Emit6
  135. (
  136. PLOCALDC pLocalDC,
  137. WORD RecordID,
  138. WORD x1,
  139. WORD x2,
  140. WORD x3,
  141. WORD x4,
  142. WORD x5,
  143. WORD x6
  144. )
  145. {
  146. BOOL b;
  147. METARECORD6 mr;
  148. mr.rdSize = sizeof(mr) / sizeof(WORD);
  149. mr.rdFunction = RecordID;
  150. mr.rdParm[0] = x6;
  151. mr.rdParm[1] = x5;
  152. mr.rdParm[2] = x4;
  153. mr.rdParm[3] = x3;
  154. mr.rdParm[4] = x2;
  155. mr.rdParm[5] = x1;
  156. b = bEmit(pLocalDC, &mr, sizeof(mr));
  157. // Update the global max record size.
  158. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  159. return(b);
  160. }
  161. /****************************************************************************
  162. * bW16Emit8 - This is the base routine to emit a Win16 drawing order
  163. * with 8 parameters.
  164. ***************************************************************************/
  165. BOOL bW16Emit8
  166. (
  167. PLOCALDC pLocalDC,
  168. WORD RecordID,
  169. WORD x1,
  170. WORD x2,
  171. WORD x3,
  172. WORD x4,
  173. WORD x5,
  174. WORD x6,
  175. WORD x7,
  176. WORD x8
  177. )
  178. {
  179. BOOL b;
  180. METARECORD8 mr;
  181. mr.rdSize = sizeof(mr) / sizeof(WORD);
  182. mr.rdFunction = RecordID;
  183. mr.rdParm[0] = x8;
  184. mr.rdParm[1] = x7;
  185. mr.rdParm[2] = x6;
  186. mr.rdParm[3] = x5;
  187. mr.rdParm[4] = x4;
  188. mr.rdParm[5] = x3;
  189. mr.rdParm[6] = x2;
  190. mr.rdParm[7] = x1;
  191. b = bEmit(pLocalDC, &mr, sizeof(mr));
  192. // Update the global max record size.
  193. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  194. return(b);
  195. }
  196. /****************************************************************************
  197. * bW16Emit9 - This is the base routine to emit a Win16 drawing order
  198. * with 9 parameters.
  199. ***************************************************************************/
  200. BOOL bW16Emit9
  201. (
  202. PLOCALDC pLocalDC,
  203. WORD RecordID,
  204. WORD x1,
  205. WORD x2,
  206. WORD x3,
  207. WORD x4,
  208. WORD x5,
  209. WORD x6,
  210. WORD x7,
  211. WORD x8,
  212. WORD x9
  213. )
  214. {
  215. BOOL b;
  216. METARECORD9 mr;
  217. mr.rdSize = sizeof(mr) / sizeof(WORD);
  218. mr.rdFunction = RecordID;
  219. mr.rdParm[0] = x9;
  220. mr.rdParm[1] = x8;
  221. mr.rdParm[2] = x7;
  222. mr.rdParm[3] = x6;
  223. mr.rdParm[4] = x5;
  224. mr.rdParm[5] = x4;
  225. mr.rdParm[6] = x3;
  226. mr.rdParm[7] = x2;
  227. mr.rdParm[8] = x1;
  228. b = bEmit(pLocalDC, &mr, sizeof(mr));
  229. // Update the global max record size.
  230. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  231. return(b);
  232. }
  233. /****************************************************************************
  234. * CreateFontIndirect - Win16 Metafile Emitter
  235. ***************************************************************************/
  236. BOOL bEmitWin16CreateFontIndirect
  237. (
  238. PLOCALDC pLocalDC,
  239. LPWIN16LOGFONT lpWin16LogFont
  240. )
  241. {
  242. BOOL b;
  243. METARECORD_CREATEFONTINDIRECT mr;
  244. mr.rdSize = sizeof(mr) / sizeof(WORD);
  245. mr.rdFunction = META_CREATEFONTINDIRECT;
  246. mr.lf16 = *lpWin16LogFont;
  247. b = bEmit(pLocalDC, &mr, sizeof(mr));
  248. // Update the global max record size.
  249. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  250. return(b);
  251. }
  252. /****************************************************************************
  253. * Polyline/Polygon - Win16 Metafile Emitter
  254. ***************************************************************************/
  255. BOOL bEmitWin16Poly
  256. (
  257. PLOCALDC pLocalDC,
  258. LPPOINTS ppt,
  259. SHORT cpt,
  260. WORD metaType
  261. )
  262. {
  263. BOOL b ;
  264. WORD nSize ;
  265. METARECORD_POLY mr;
  266. // Caculate the size of the points array
  267. nSize = (WORD) (cpt * sizeof(POINTS));
  268. // Build up the header of the Win16 poly record
  269. mr.rdSize = (sizeof(mr) + nSize) / sizeof(WORD);
  270. mr.rdFunction = metaType;
  271. mr.cpt = cpt;
  272. // Emit the Header, then if it succeds emit the points.
  273. b = bEmit(pLocalDC, &mr, sizeof(mr));
  274. if (b)
  275. {
  276. b = bEmit(pLocalDC, ppt, nSize);
  277. }
  278. // Update the global max record size.
  279. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  280. return(b);
  281. }
  282. /****************************************************************************
  283. * PolyPolygon - Win16 Metafile Emitter
  284. ***************************************************************************/
  285. BOOL bEmitWin16PolyPolygon
  286. (
  287. PLOCALDC pLocalDC,
  288. PPOINTS ppt,
  289. PWORD pcpt,
  290. WORD cpt,
  291. WORD ccpt
  292. )
  293. {
  294. BOOL b ;
  295. WORD nSize ;
  296. METARECORD_POLYPOLYGON mr;
  297. nSize = cpt * sizeof(POINTS);
  298. nSize += ccpt * sizeof(WORD);
  299. nSize += sizeof(mr);
  300. // Build up the header of the Win16 polyline record
  301. mr.rdSize = nSize / sizeof(WORD);
  302. mr.rdFunction = META_POLYPOLYGON;
  303. mr.ccpt = ccpt;
  304. // Emit the Header, then if it succeds emit the Point counts,
  305. // then if it succeds emit the points.
  306. b = bEmit(pLocalDC, &mr, sizeof(mr));
  307. if (b)
  308. {
  309. b = bEmit(pLocalDC, pcpt, ccpt * sizeof(WORD));
  310. if (b)
  311. {
  312. b = bEmit(pLocalDC, ppt, cpt * sizeof(POINTS));
  313. }
  314. }
  315. // Update the global max record size.
  316. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  317. return(b);
  318. }
  319. /****************************************************************************
  320. * StretchBlt - Win16 Metafile Emitter
  321. ***************************************************************************/
  322. BOOL bEmitWin16StretchBlt
  323. (
  324. PLOCALDC pLocalDC,
  325. SHORT x,
  326. SHORT y,
  327. SHORT cx,
  328. SHORT cy,
  329. SHORT xSrc,
  330. SHORT ySrc,
  331. SHORT cxSrc,
  332. SHORT cySrc,
  333. DWORD rop,
  334. PBITMAPINFO lpbmi,
  335. DWORD cbbmi,
  336. PBYTE lpBits,
  337. DWORD cbBits
  338. )
  339. {
  340. BOOL b ;
  341. DWORD nSize ;
  342. METARECORD_DIBSTRETCHBLT mr;
  343. // Need to make real sure the plane count is 1,
  344. // otherwise this is not a DIB.
  345. if (lpbmi->bmiHeader.biPlanes != 1)
  346. {
  347. RIP("MF3216: bEmitWin16StretchBlt, Invalid biPlanes in DIB\n") ;
  348. return (FALSE) ;
  349. }
  350. // Create the static portion of the
  351. // Win 3.0 StretchBlt metafile record.
  352. nSize = sizeof(mr) + cbbmi + cbBits;
  353. mr.rdSize = nSize / sizeof(WORD);
  354. mr.rdFunction = META_DIBSTRETCHBLT;
  355. mr.rop = rop;
  356. mr.cySrc = cySrc;
  357. mr.cxSrc = cxSrc;
  358. mr.ySrc = ySrc;
  359. mr.xSrc = xSrc;
  360. mr.cy = cy;
  361. mr.cx = cx;
  362. mr.y = y;
  363. mr.x = x;
  364. b = bEmit(pLocalDC, &mr, sizeof(mr));
  365. if (b)
  366. {
  367. // Emit the bitmap info
  368. b = bEmit(pLocalDC, lpbmi, cbbmi);
  369. if (b)
  370. {
  371. // Emit the actual bits, if any.
  372. b = bEmit(pLocalDC, lpBits, cbBits);
  373. }
  374. }
  375. // Update the global max record size.
  376. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  377. return(b);
  378. }
  379. /****************************************************************************
  380. * ExtTextOut - Win16 Metafile Emitter
  381. ***************************************************************************/
  382. BOOL bEmitWin16ExtTextOut
  383. (
  384. PLOCALDC pLocalDC,
  385. SHORT x,
  386. SHORT y,
  387. WORD fwOpts,
  388. PRECTS prcts,
  389. PSTR ach,
  390. SHORT nCount,
  391. PWORD lpDx
  392. )
  393. {
  394. BOOL b ;
  395. DWORD i, nBaseRecord ;
  396. WORD awRecord[11] ;
  397. // Calculate the size of the record
  398. i = ((WORD) nCount + 1) / 2 * 2; // i = size of string in bytes
  399. if (lpDx)
  400. i += (WORD) nCount * sizeof(WORD); // add in size of Dx vector
  401. i += sizeof(awRecord); // add in size of basic record
  402. if (!(fwOpts & (ETO_OPAQUE | ETO_CLIPPED)))
  403. i -= sizeof(RECTS); // adjust for a rectangle being present
  404. i /= sizeof(WORD) ; // change to word count
  405. // Set the record size, type,
  406. // x & y position, character count, and options.
  407. awRecord[0] = LOWORD(i) ;
  408. awRecord[1] = HIWORD(i) ;
  409. awRecord[2] = META_EXTTEXTOUT ;
  410. awRecord[3] = y ;
  411. awRecord[4] = x ;
  412. awRecord[5] = nCount ;
  413. awRecord[6] = fwOpts ;
  414. // Only if there is a opaque / clipping rectangle present
  415. // do we copy it over, other wise it is nonexistent.
  416. // We need to adjust the size of the Record emitted based upon
  417. // the existence of the opaque / clipping rectangle.
  418. nBaseRecord = 7 * sizeof(WORD) ;
  419. if (fwOpts & (ETO_OPAQUE | ETO_CLIPPED))
  420. {
  421. awRecord[7] = prcts->left ;
  422. awRecord[8] = prcts->top ;
  423. awRecord[9] = prcts->right ;
  424. awRecord[10] = prcts->bottom ;
  425. nBaseRecord += 4 * sizeof(WORD) ;
  426. }
  427. // Emit the record.
  428. b = bEmit(pLocalDC, awRecord, nBaseRecord) ;
  429. if (b)
  430. {
  431. // Emit the character string.
  432. i = ((WORD) nCount + 1) / 2 * 2 ;
  433. b = bEmit(pLocalDC, ach, i) ;
  434. if (b)
  435. {
  436. if (lpDx)
  437. {
  438. // Emit the intercharacter spacing array
  439. i = (WORD) (nCount * sizeof(WORD)) ;
  440. b = bEmit(pLocalDC, lpDx, i) ;
  441. }
  442. }
  443. }
  444. // Update the global max record size.
  445. vUpdateMaxRecord(pLocalDC, (PMETARECORD) awRecord) ;
  446. return(b) ;
  447. }
  448. /****************************************************************************
  449. * Create Region - Win16 Metafile Emitter
  450. ***************************************************************************/
  451. BOOL bEmitWin16CreateRegion
  452. (
  453. PLOCALDC pLocalDC,
  454. DWORD cbRgn,
  455. PVOID pRgn
  456. )
  457. {
  458. BOOL b;
  459. METARECORD0 mr;
  460. mr.rdSize = (sizeof(mr) + cbRgn) / sizeof(WORD);
  461. mr.rdFunction = META_CREATEREGION;
  462. // Emit the header.
  463. b = bEmit(pLocalDC, &mr, sizeof(mr));
  464. // Emit the region data.
  465. b = bEmit(pLocalDC, pRgn, cbRgn);
  466. // Update the global max record size.
  467. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  468. return(b);
  469. }
  470. /****************************************************************************
  471. * SetPaletteEntries - Win16 Metafile Emitter
  472. ***************************************************************************/
  473. BOOL bEmitWin16SetPaletteEntries
  474. (
  475. PLOCALDC pLocalDC,
  476. DWORD iStart,
  477. DWORD cEntries,
  478. LPPALETTEENTRY pPalEntries
  479. )
  480. {
  481. BOOL b ;
  482. DWORD cbPalEntries ;
  483. METARECORD_SETPALENTRIES mr;
  484. cbPalEntries = cEntries * sizeof(PALETTEENTRY);
  485. mr.rdSize = (sizeof(mr) + cbPalEntries) / sizeof(WORD);
  486. mr.rdFunction = META_SETPALENTRIES;
  487. mr.iStart = (WORD) iStart;
  488. mr.cEntries = (WORD) cEntries;
  489. // Emit the header.
  490. b = bEmit(pLocalDC, &mr, sizeof(mr));
  491. // Emit the actual palette entries.
  492. b = bEmit(pLocalDC, pPalEntries, cbPalEntries) ;
  493. // Update the global max record size.
  494. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  495. return(b);
  496. }
  497. /****************************************************************************
  498. * CreatePalette - Win16 Metafile Emitter
  499. ***************************************************************************/
  500. BOOL bEmitWin16CreatePalette
  501. (
  502. PLOCALDC pLocalDC,
  503. LPLOGPALETTE lpLogPal
  504. )
  505. {
  506. BOOL b;
  507. DWORD cbLogPal;
  508. METARECORD0 mr;
  509. cbLogPal = sizeof(LOGPALETTE) - sizeof(PALETTEENTRY)
  510. + lpLogPal->palNumEntries * sizeof(PALETTEENTRY) ;
  511. mr.rdSize = (sizeof(mr) + cbLogPal) / sizeof(WORD);
  512. mr.rdFunction = META_CREATEPALETTE;
  513. // Emit the header.
  514. b = bEmit(pLocalDC, &mr, sizeof(mr));
  515. // Emit the actual logpalette.
  516. b = bEmit(pLocalDC, lpLogPal, cbLogPal);
  517. // Update the global max record size.
  518. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  519. return (b) ;
  520. }
  521. /****************************************************************************
  522. * CreateBrushIndirect - Win16 Metafile Emitter
  523. ***************************************************************************/
  524. BOOL bEmitWin16CreateBrushIndirect
  525. (
  526. PLOCALDC pLocalDC,
  527. LPWIN16LOGBRUSH lpLogBrush16
  528. )
  529. {
  530. BOOL b;
  531. METARECORD_CREATEBRUSHINDIRECT mr;
  532. mr.rdSize = sizeof(mr) / sizeof(WORD);
  533. mr.rdFunction = META_CREATEBRUSHINDIRECT;
  534. mr.lb16 = *lpLogBrush16;
  535. b = bEmit(pLocalDC, &mr, sizeof(mr));
  536. // Update the global max record size.
  537. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  538. return(b);
  539. }
  540. /****************************************************************************
  541. * CreateDIPatternBrush - Win16 Metafile Emitter
  542. ***************************************************************************/
  543. BOOL bEmitWin16CreateDIBPatternBrush
  544. (
  545. PLOCALDC pLocalDC,
  546. PBITMAPINFO pBitmapInfo,
  547. DWORD cbBitmapInfo,
  548. PBYTE pBits,
  549. DWORD cbBits,
  550. WORD iUsage,
  551. WORD iType
  552. )
  553. {
  554. BOOL b ;
  555. METARECORD_DIBCREATEPATTERNBRUSH mr;
  556. mr.rdSize = (sizeof(mr) + cbBitmapInfo + cbBits + 1) / sizeof(WORD);
  557. mr.rdFunction = META_DIBCREATEPATTERNBRUSH;
  558. mr.iType = iType;
  559. mr.iUsage = iUsage;
  560. // On NT, the packed DIB is dword aligned. But on win3x, it is word aligned.
  561. // Therefore, we emit the bitmap info followed by the bitmap bits in two
  562. // separate stages.
  563. ASSERTGDI(cbBitmapInfo % 2 == 0,
  564. "MF3216: bEmitWin16CreateDIBPatternBrush, bad bitmap info size");
  565. // Emit the static portion of the record.
  566. b = bEmit(pLocalDC, &mr, sizeof(mr));
  567. if (b == FALSE)
  568. goto error_exit ;
  569. // Emit the bitmap info.
  570. b = bEmit(pLocalDC, pBitmapInfo, cbBitmapInfo) ;
  571. if (b == FALSE)
  572. goto error_exit ;
  573. // Emit the bitmap bits.
  574. b = bEmit(pLocalDC, pBits, (cbBits + 1) / sizeof(WORD) * sizeof(WORD)) ;
  575. // Update the global max record size.
  576. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  577. error_exit:
  578. return(b);
  579. }
  580. /****************************************************************************
  581. * CreatePen - Win16 Metafile Emitter
  582. ***************************************************************************/
  583. BOOL bEmitWin16CreatePen
  584. (
  585. PLOCALDC pLocalDC,
  586. WORD iPenStyle,
  587. PPOINTS pptsWidth,
  588. COLORREF crColor
  589. )
  590. {
  591. BOOL b;
  592. METARECORD_CREATEPENINDIRECT mr;
  593. mr.rdSize = sizeof(mr) / sizeof(WORD);
  594. mr.rdFunction = META_CREATEPENINDIRECT;
  595. mr.lopn16.lopnStyle = iPenStyle;
  596. mr.lopn16.lopnWidth = *pptsWidth;
  597. mr.lopn16.lopnColor = crColor;
  598. b = bEmit(pLocalDC, &mr, sizeof(mr));
  599. // Update the global max record size.
  600. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  601. return(b);
  602. }
  603. #if 0
  604. /****************************************************************************
  605. * Escape - Win16 Metafile Emitter
  606. ***************************************************************************/
  607. BOOL bEmitWin16Escape
  608. (
  609. PLOCALDC pLocalDC,
  610. SHORT wEscape,
  611. SHORT wCount,
  612. LPSTR lpInData,
  613. LPSTR lpOutData
  614. )
  615. {
  616. BOOL b ;
  617. METARECORD_ESCAPE mr;
  618. NOTUSED(lpOutData) ;
  619. // Init the type & length field of the metafile record.
  620. // Then emit the header of the escape record to the Win16 metafile.
  621. mr.rdSize = (sizeof(mr) + (WORD) wCount) / sizeof(WORD);
  622. mr.rdFunction = META_ESCAPE;
  623. mr.wEscape = wEscape;
  624. mr.wCount = (WORD) wCount;
  625. b = bEmit(pLocalDC, &mr, sizeof(mr));
  626. if (b)
  627. {
  628. // Emit the actual data.
  629. b = bEmit(pLocalDC, lpInData, (DWORD) (WORD) wCount) ;
  630. }
  631. // Update the global max record size.
  632. vUpdateMaxRecord(pLocalDC, (PMETARECORD) &mr);
  633. return(b);
  634. }
  635. #endif // 0
  636. /****************************************************************************
  637. * Escape - Win16 Metafile Emitter for enhanced metafile comment
  638. ***************************************************************************/
  639. BOOL bEmitWin16EscapeEnhMetaFile
  640. (
  641. PLOCALDC pLocalDC,
  642. PMETARECORD_ESCAPE pmfe,
  643. LPBYTE lpEmfData
  644. )
  645. {
  646. BOOL b ;
  647. PMETA_ESCAPE_ENHANCED_METAFILE pmfeEnhMF = (PMETA_ESCAPE_ENHANCED_METAFILE) pmfe;
  648. // Emit the header of the escape record to the Win16 metafile.
  649. b = bEmit(pLocalDC, (PVOID) pmfeEnhMF, sizeof(META_ESCAPE_ENHANCED_METAFILE));
  650. if (b)
  651. {
  652. // Emit the enhanced metafile data.
  653. b = bEmit(pLocalDC, lpEmfData, pmfeEnhMF->cbCurrent);
  654. }
  655. // Update the global max record size.
  656. vUpdateMaxRecord(pLocalDC, (PMETARECORD) pmfeEnhMF);
  657. return(b);
  658. }