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.

4144 lines
144 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: fontexts.cxx
  3. *
  4. * Created: 29-Aug-1994 08:42:10
  5. * Author: Kirk Olynyk [kirko]
  6. *
  7. * Copyright (c) 1994-2000 Microsoft Corporation
  8. *
  9. \**************************************************************************/
  10. #include "precomp.hxx"
  11. // TODO: Break this file up grouping close knit extensions together.
  12. // LOGFONTW
  13. #define GetLOGFONTWField(field) \
  14. GetLOGFONTWSubField(#field, field)
  15. #define GetLOGFONTWSubField(field,local) \
  16. GetFieldData(offLOGFONTW, GDIType(LOGFONTW), field, sizeof(local), &local)
  17. #define GetLOGFONTWOffset(field) \
  18. GetFieldOffset(GDIType(LOGFONTW), #field, &offset)
  19. #define GetLOGFONTWFieldAndOffset(field) { \
  20. GetLOGFONTWField(field); \
  21. GetLOGFONTWOffset(field); \
  22. }
  23. // RFONT
  24. #define GetRFONTField(field) \
  25. GetRFONTSubField(#field, field)
  26. #define GetRFONTSubField(field,local) \
  27. GetFieldData(foSrc, GDIType(RFONT), field, sizeof(local), &local)
  28. #define GetRFONTOffset(field) \
  29. GetFieldOffset(GDIType(RFONT), #field, &offset)
  30. #define GetRFONTFieldAndOffset(field) { \
  31. GetRFONTField(field); \
  32. GetRFONTOffset(field); \
  33. }
  34. // FONTOBJ
  35. #define GetFONTOBJField(field) \
  36. GetFONTOBJSubField(#field, field)
  37. #define GetFONTOBJSubField(field,local) \
  38. GetFieldData(foSrc, GDIType(FONTOBJ), field, sizeof(local), &local)
  39. #define GetFONTOBJOffset(field) \
  40. GetFieldOffset(GDIType(FONTOBJ), #field, &offset)
  41. #define GetFONTOBJFieldAndOffset(field) { \
  42. GetFONTOBJField(field); \
  43. GetFONTOBJOffset(field); \
  44. }
  45. // PFE
  46. #define GetPFEField(field) \
  47. GetPFESubField(#field, field)
  48. #define GetPFESubField(field,local) \
  49. GetFieldData(pfeSrc, GDIType(PFE), field, sizeof(local), &local)
  50. #define GetPFEOffset(field) \
  51. GetFieldOffset(GDIType(PFE), #field, &offset)
  52. #define GetPFEFieldAndOffset(field) { \
  53. GetPFEField(field); \
  54. GetPFEOffset(field); \
  55. }
  56. // IFIMETRICS
  57. #define GetIFIMETRICSField(field) \
  58. GetIFIMETRICSSubField(#field, field)
  59. #define GetIFIMETRICSSubField(field,local) \
  60. GetFieldData(pifiSrc, GDIType(IFIMETRICS), field, sizeof(local), &local)
  61. #define GetIFIMETRICSOffset(field) \
  62. GetFieldOffset(GDIType(IFIMETRICS), #field, &offset)
  63. #define GetIFIMETRICSFieldAndOffset(field) { \
  64. GetIFIMETRICSField(field); \
  65. GetIFIMETRICSOffset(field); \
  66. }
  67. // PFF
  68. #define GetPFFField(field) \
  69. GetPFFSubField(#field, field)
  70. #define GetPFFSubField(field,local) \
  71. GetFieldData(pffSrc, GDIType(PFF), field, sizeof(local), &local)
  72. #define GetPFFOffset(field) \
  73. GetFieldOffset(GDIType(PFF), #field, &offset)
  74. #define GetPFFFieldAndOffset(field) { \
  75. GetPFFField(field); \
  76. GetPFFOffset(field); \
  77. }
  78. // ESTROBJ
  79. #define GetESTROBJField(field) \
  80. GetESTROBJSubField(#field, field)
  81. #define GetESTROBJSubField(field,local) \
  82. GetFieldData(estrobjSrc, GDIType(ESTROBJ), field, sizeof(local), &local)
  83. #define GetESTROBJOffset(field) \
  84. GetFieldOffset(GDIType(ESTROBJ), #field, &offset)
  85. #define GetESTROBJFieldAndOffset(field) { \
  86. GetESTROBJField(field); \
  87. GetESTROBJOffset(field); \
  88. }
  89. // GLYPHPOS
  90. #define GetGLYPHPOSField(field) \
  91. GetGLYPHPOSSubField(#field, field)
  92. #define GetGLYPHPOSSubField(field,local) \
  93. GetFieldData(glyphposSrc, GDIType(GLYPHPOS), field, sizeof(local), &local)
  94. #define GetGLYPHPOSOffset(field) \
  95. GetFieldOffset(GDIType(GLYPHPOS), #field, &offset)
  96. #define GetGLYPHPOSFieldAndOffset(field) { \
  97. GetGLYPHPOSField(field); \
  98. GetGLYPHPOSOffset(field); \
  99. }
  100. // GLYPHBITS
  101. #define GetGLYPHBITSField(field) \
  102. GetGLYPHBITSSubField(#field, field)
  103. #define GetGLYPHBITSSubField(field,local) \
  104. GetFieldData(glyphbitsSrc, GDIType(GLYPHBITS), field, sizeof(local), &local)
  105. #define GetGLYPHBITSOffset(field) \
  106. GetFieldOffset(GDIType(GLYPHBITS), #field, &offset)
  107. #define GetGLYPHBITSFieldAndOffset(field) { \
  108. GetGLYPHBITSField(field); \
  109. GetGLYPHBITSOffset(field); \
  110. }
  111. // GLYPHDEF
  112. #define GetGLYPHDEFField(field) \
  113. GetGLYPHDEFSubField(#field, field)
  114. #define GetGLYPHDEFSubField(field,local) \
  115. GetFieldData(glyphdefSrc, GDIType(GLYPHDEF), field, sizeof(local), &local)
  116. #define GetGLYPHDEFOffset(field) \
  117. GetFieldOffset(GDIType(GLYPHDEF), #field, &offset)
  118. #define GetGLYPHDEFFieldAndOffset(field) { \
  119. GetGLYPHDEFField(field); \
  120. GetGLYPHDEFOffset(field); \
  121. }
  122. // CACHE
  123. #define GetCACHEField(field) \
  124. GetCACHESubField(#field, field)
  125. #define GetCACHESubField(field,local) \
  126. GetFieldData(cacheSrc, GDIType(CACHE), field, sizeof(local), &local)
  127. #define GetCACHEOffset(field) \
  128. GetFieldOffset(GDIType(CACHE), #field, &offset)
  129. #define GetCACHEFieldAndOffset(field) { \
  130. GetCACHEField(field); \
  131. GetCACHEOffset(field); \
  132. }
  133. DWORD adw[4*1024]; // scratch buffer
  134. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  135. #include <winfont.h>
  136. #define WOW_EMBEDING 2
  137. VOID Gdidpft(PFT *);
  138. void vDumpFONTHASH(FONTHASH*,FONTHASH*);
  139. void vDumpCOLORADJUSTMENT(COLORADJUSTMENT*, COLORADJUSTMENT*);
  140. void vDumpLINEATTRS(LINEATTRS*, LINEATTRS*);
  141. void vDumpIFIMETRICS(IFIMETRICS*, IFIMETRICS*);
  142. void vDumpPFF(PFF*, PFF*);
  143. void vDumpGlyphMemory(RFONT*);
  144. unsigned cjGLYPHBITS(GLYPHBITS*, RFONT*);
  145. void vDumpRFONTList(RFONT*,unsigned*,unsigned*,unsigned*,unsigned*);
  146. #endif // DOES NOT SUPPORT API64
  147. void vDumpLOGFONTW(ULONG64);
  148. void vDumpCACHE(ULONG64);
  149. #define tmalloc(a,b) (a *) LocalAlloc(LMEM_FIXED, (b))
  150. #define tfree(b) LocalFree((b))
  151. /******************************Public*Routine******************************\
  152. *
  153. * Routine Name:
  154. *
  155. * wcsncpy
  156. *
  157. * Routine Description:
  158. *
  159. * Copies a zero terminated Unicode from the source on the remote
  160. * address space to a destination in the local address space.
  161. *
  162. * Arguments:
  163. *
  164. * pwszDst - local address
  165. *
  166. * pwszSrc - remote address
  167. *
  168. * c - maximum count of characters in destination
  169. *
  170. * Called by:
  171. *
  172. * Return Value:
  173. *
  174. \**************************************************************************/
  175. LPWSTR wcsncpy(
  176. LPWSTR pwszDst,
  177. ULONG64 pwszSrc,
  178. size_t c)
  179. {
  180. LPWSTR pwszRet = pwszDst;
  181. ULONG cbRead;
  182. if (c)
  183. {
  184. WCHAR wc;
  185. __try {
  186. ReadMemory( pwszSrc, &wc, sizeof(wc), &cbRead );
  187. }
  188. __except (EXCEPTION_EXECUTE_HANDLER) {
  189. return(NULL);
  190. }
  191. while (wc && c && cbRead) {
  192. pwszSrc += sizeof(wc);
  193. *pwszDst++ = wc;
  194. ReadMemory( pwszSrc, &wc, sizeof(wc), &cbRead );
  195. --c;
  196. }
  197. // Add trailing 0 if we have room.
  198. if (c)
  199. *pwszDst = 0;
  200. }
  201. return(pwszRet);
  202. }
  203. /******************************Public*Routine******************************\
  204. *
  205. * Routine Name:
  206. *
  207. * vDumpHFONT
  208. *
  209. \**************************************************************************/
  210. void vDumpHFONT(ULONG64 hf)
  211. {
  212. ULONG64 pobj, plfwSrc;
  213. ULONG offset;
  214. if (GetObjectAddress(NULL,hf,&pobj) != S_OK) return;
  215. GetFieldOffset("LFONT", "elfw", &offset);
  216. plfwSrc = pobj + offset;
  217. vDumpLOGFONTW(plfwSrc);
  218. }
  219. /******************************Public*Routine******************************\
  220. *
  221. * Routine Name:
  222. *
  223. * tstats
  224. *
  225. * Routine Description:
  226. *
  227. * Returns statistics for TextOut
  228. * It gives you the distibution of character counts for
  229. * GreExtTextOutW calls.
  230. *
  231. \**************************************************************************/
  232. DECLARE_API( tstats )
  233. {
  234. dprintf("Extension 'tstats' not converted.\n");
  235. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  236. typedef struct _TSTATENTRY {
  237. int c; // number observed
  238. } TSTATENTRY;
  239. typedef struct _TSTAT {
  240. TSTATENTRY NO; // pdx == 0, opaque
  241. TSTATENTRY DO; // pdx != 0, opaque
  242. TSTATENTRY NT; // pdx == 0, transparent
  243. TSTATENTRY DT; // pdx != 0, transparent
  244. } TSTAT;
  245. typedef struct _TEXTSTATS {
  246. int cchMax;
  247. TSTAT ats[1];
  248. } TEXTSTATS;
  249. TEXTSTATS *pTS, TS;
  250. TSTAT *ats, *pts, *ptsBin;
  251. int cj, binsize, cLast, cMin, cNO, cDO, cNT, cDT, cBins;
  252. PARSE_ARGUMENTS(tstats_help);
  253. if(ntok==0) {
  254. binsize=1;
  255. } else {
  256. tok_pos = parse_FindNonSwitch(tokens, ntok);
  257. if(tok_pos==-1) { goto tstats_help; }
  258. //check this and see if it makes more sense to use GetValue() or GetExpression()
  259. sscanf(tokens[tok_pos], "%d", &binsize);
  260. if( (binsize<0) || (binsize>50) ) { goto tstats_help; }
  261. }
  262. pTS = 0;
  263. GetAddress(pTS,"win32k!gTS");
  264. if (pTS == 0) {
  265. dprintf("Could not find address of win32k!gTS\n");
  266. return;
  267. }
  268. move2(&TS,pTS,sizeof(TS));
  269. if (TS.ats == 0) {
  270. dprintf("No statistics are available\n");
  271. return;
  272. }
  273. cj = (TS.cchMax + 2) * sizeof(TSTAT);
  274. if (!(ats = tmalloc(TSTAT,cj))) {
  275. dprintf("memory allocation failure\n");
  276. return;
  277. }
  278. move2(ats, &(pTS->ats), cj);
  279. dprintf("\n\n\n");
  280. dprintf(" +------------+------ OPAQUE -------+----- TRANSPARENT ---+\n");
  281. dprintf(" | strlen | pdx == 0 | pdx != 0 | pdx == 0 | pdx != 0 |\n");
  282. dprintf(" +------------+----------+----------+----------+----------+\n");
  283. // I will partition TS.cchMax+2 entries into bins with
  284. // binsize enties each. The total number of bins needed
  285. // to get everything is ceil((TS.cchMax+2)/binsize)
  286. // which is equal to floor((TS.cchMax+1)/binsize) + 1
  287. // The last one is dealt with separately. Thus the number
  288. // of entries in the very last bin is equal to
  289. //
  290. // cLast = TS.cchMax + 2 - (floor((TS.cchMax+1)/binsize)+1)
  291. //
  292. // which is equal to 1 + (TS.cchMax+1) mod binsize
  293. cLast = 1 + ((TS.cchMax + 1) % binsize);
  294. for (cMin=0,pts=ptsBin=ats; pts<ats+(TS.cchMax+2-cLast); cMin+=binsize) {
  295. ptsBin += binsize;
  296. for (cNO=cDO=cNT=cDT=0 ; pts < ptsBin ; pts++) {
  297. cNO += pts->NO.c;
  298. cDO += pts->DO.c;
  299. cNT += pts->NT.c;
  300. cDT += pts->DT.c;
  301. }
  302. if (binsize == 1)
  303. dprintf(
  304. " %-5d %10d %10d %10d %10d\n" ,
  305. cMin, cNO, cDO, cNT, cDT
  306. );
  307. else
  308. dprintf(
  309. " %5d--%-5d %10d %10d %10d %10d\n" ,
  310. cMin, cMin+binsize-1, cNO, cDO, cNT, cDT
  311. );
  312. }
  313. // do the last bin which may or may not be full
  314. for (cNO=cDO=cNT=cDT=0 ; cLast ; cLast--, pts++) {
  315. cNO += pts->NO.c;
  316. cDO += pts->DO.c;
  317. cNT += pts->NT.c;
  318. cDT += pts->DT.c;
  319. }
  320. dprintf(" %5d--Inf %10d %10d %10d %10d\n\n\n",cMin,cNO,cDO,cNT,cDT);
  321. tfree(ats);
  322. return;
  323. tstats_help:
  324. dprintf("Usage: tstats [-?] [1..50]\n");
  325. dprintf("tstats can be used without parameters in which case the binsize defaults to 1\n");
  326. #endif // DOES NOT SUPPORT API64
  327. EXIT_API(S_OK);
  328. }
  329. /******************************Public*Routine******************************\
  330. *
  331. * Routine Name:
  332. *
  333. * gs
  334. *
  335. * Routine Description:
  336. *
  337. * dumps FD_GLYPHSET structure
  338. *
  339. * Arguments:
  340. *
  341. * address of structure
  342. *
  343. * Return Value:
  344. *
  345. * none
  346. *
  347. \**************************************************************************/
  348. DECLARE_API( gs )
  349. {
  350. dprintf("Extension 'gs' is not converted.\n");
  351. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  352. FD_GLYPHSET fdg, *pfdg;
  353. FLONG fl;
  354. WCRUN *pwc;
  355. unsigned BytesPerHandle, i;
  356. unsigned u;
  357. HANDLE *ph, *phLast;
  358. FLAGDEF *pfd;
  359. PARSE_POINTER(gs_help);
  360. move( fdg, arg );
  361. if (fdg.cjThis > sizeof(adw))
  362. {
  363. dprintf("FD_GLYPHSET table too big to fit into adw\n");
  364. return;
  365. }
  366. move2( adw, arg, fdg.cjThis );
  367. pfdg = (FD_GLYPHSET*) adw;
  368. dprintf("\t\t cjThis = %u = %-#x\n", pfdg->cjThis, pfdg->cjThis );
  369. dprintf("\t\t flAccel = %-#x\n", pfdg->flAccel );
  370. fl = pfdg->flAccel;
  371. for (pfd=afdGS; pfd->psz; pfd++)
  372. {
  373. if (pfd->fl & fl)
  374. dprintf("\t\t\t %s\n", pfd->psz);
  375. fl &= ~pfd->fl;
  376. }
  377. if (fl) dprintf("\t\t\t %-#x (BAD FLAGS)\n", fl);
  378. dprintf("\t\t cGlyphsSupported = %u\n", pfdg->cGlyphsSupported );
  379. dprintf("\t\t cRuns = %u\n", pfdg->cRuns );
  380. dprintf("\t\t\t\tWCHAR HGLYPH\n");
  381. if ( pfdg->flAccel & GS_UNICODE_HANDLES )
  382. BytesPerHandle = 0;
  383. else
  384. BytesPerHandle = 4;
  385. for ( pwc = pfdg->awcrun; pwc < pfdg->awcrun + pfdg->cRuns; pwc++ )
  386. {
  387. dprintf(" ------------\n");
  388. ph = (HANDLE*)((BYTE*) pwc->phg + (UINT_PTR) adw - (unsigned) arg);
  389. phLast = ph + pwc->cGlyphs;
  390. i = (unsigned) pwc->wcLow;
  391. for ( ; ph < phLast; i++, ph++ )
  392. {
  393. if (CheckControlC()) // CTRL-C hit?
  394. break; // yes stop the loop
  395. u = BytesPerHandle ? (ULONG)(UINT_PTR) *ph : i;
  396. dprintf("\t\t\t\t%-#6x %-#x\n",i,u);
  397. }
  398. }
  399. return;
  400. gs_help:
  401. dprintf ("Usage: gs [-?] pointer to FD_GLYPHSET structure\n");
  402. #endif // DOES NOT SUPPORT API64
  403. EXIT_API(S_OK);
  404. }
  405. /******************************Public*Routine******************************\
  406. *
  407. * Routine Name:
  408. *
  409. * gdata
  410. *
  411. * Routine Description:
  412. *
  413. * dumps a GLYPHDATA structure
  414. *
  415. * Arguments:
  416. *
  417. * address of structure
  418. *
  419. * Return Value:
  420. *
  421. * none
  422. *
  423. \**************************************************************************/
  424. DECLARE_API( gdata )
  425. {
  426. dprintf("Extension 'gdata' is not converted.\n");
  427. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  428. GLYPHDATA gd, *pgd;
  429. LONG *al;
  430. PARSE_POINTER(gdata_help);
  431. move( gd, arg );
  432. pgd = (GLYPHDATA*) arg;
  433. dprintf("\n\n");
  434. dprintf("[%x] gdf %-#x\n", &(pgd->gdf), gd.gdf.pgb);
  435. dprintf("[%x] hg %-#x\n", &(pgd->hg ), gd.hg);
  436. dprintf("[%x] fxD %-#x\n", &(pgd->fxD), gd.fxD);
  437. dprintf("[%x] fxA %-#x\n", &(pgd->fxA), gd.fxA);
  438. dprintf("[%x] fxAB %-#x\n", &(pgd->fxAB), gd.fxAB);
  439. dprintf("[%x] fxInkTop %-#x\n", &(pgd->fxInkTop), gd.fxInkTop);
  440. dprintf("[%x] fxInkBottom %-#x\n", &(pgd->fxInkBottom), gd.fxInkBottom);
  441. dprintf("[%x] rclInk %d %d %d %d\n",
  442. &(pgd->rclInk),
  443. gd.rclInk.left,
  444. gd.rclInk.top,
  445. gd.rclInk.right,
  446. gd.rclInk.bottom
  447. );
  448. al = (LONG*) &gd.ptqD.x;
  449. dprintf("[%x] ptqD % 8x.%08x % 8x.%08x\n",
  450. &(pgd->ptqD),
  451. al[1], al[0], al[3], al[2]
  452. );
  453. dprintf("\n");
  454. return;
  455. gdata_help:
  456. dprintf ("Usage: gdata [-?] pointer to a GLYPHDATA structure\n");
  457. #endif // DOES NOT SUPPORT API64
  458. EXIT_API(S_OK);
  459. }
  460. DECLARE_API( fv )
  461. {
  462. dprintf("Extension 'fv' is not converted.\n");
  463. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  464. FILEVIEW fv, *pfv;
  465. PARSE_POINTER(fv_help);
  466. move( fv, arg );
  467. pfv = (FILEVIEW*) arg;
  468. dprintf("\n");
  469. dprintf("[%x] LastWriteTime %08x%08x\n", &(pfv->LastWriteTime), fv.LastWriteTime.HighPart, fv.LastWriteTime.LowPart);
  470. dprintf("[%x] pvKView %-#x\n" , &(pfv->pvKView), fv.pvKView);
  471. dprintf("[%x] pvViewFD %-#x\n" , &(pfv->pvViewFD), fv.pvViewFD);
  472. dprintf("[%x] cjView %-#x\n" , &(pfv->cjView), fv.cjView);
  473. dprintf("[%x] pSection %-#x\n" , &(pfv->pSection), fv.pSection);
  474. dprintf("\n");
  475. return;
  476. fv_help:
  477. dprintf ("Usage: fv [-?] pointer to a FILEVIEW structure\n");
  478. #endif // DOES NOT SUPPORT API64
  479. EXIT_API(S_OK);
  480. }
  481. DECLARE_API( ffv )
  482. {
  483. dprintf("Extension 'ffv' is not converted.\n");
  484. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  485. FONTFILEVIEW ffv, *pffv;
  486. PWSZ pwszDest;
  487. PARSE_POINTER(ffv_help);
  488. move( ffv, arg );
  489. pffv = (FONTFILEVIEW*) arg;
  490. dprintf("\n");
  491. dprintf("[%x] LastWriteTime %08x%08x\n", &pffv->fv.LastWriteTime , ffv.fv.LastWriteTime.HighPart, ffv.fv.LastWriteTime.LowPart);
  492. dprintf("[%x] pvKView %-#x\n" , &pffv->fv.pvKView , ffv.fv.pvKView );
  493. dprintf("[%x] pvViewFD %-#x\n" , &pffv->fv.pvViewFD , ffv.fv.pvViewFD );
  494. dprintf("[%x] cjView %-#x\n" , &pffv->fv.cjView , ffv.fv.cjView );
  495. dprintf("[%x] pSection %-#x\n" , &pffv->fv.pSection , ffv.fv.pSection );
  496. dprintf("[%x] pwszPath %-#x" , &pffv->pwszPath , ffv.pwszPath );
  497. if ( ffv.pwszPath )
  498. {
  499. pwszDest = wcsncpy((PWSZ) adw, ffv.pwszPath, sizeof(adw)/sizeof(WCHAR));
  500. dprintf(" = \"%ws\"\n", pwszDest );
  501. }
  502. else
  503. {
  504. dprintf("\n");
  505. }
  506. dprintf("[%x] ulRegionSize %-#x\n" , &pffv->ulRegionSize , ffv.ulRegionSize );
  507. dprintf("[%x] cKRefCount %-#x\n" , &pffv->cKRefCount , ffv.cKRefCount );
  508. dprintf("[%x] cRefCountFD %-#x\n" , &pffv->cRefCountFD , ffv.cRefCountFD );
  509. dprintf("[%x] SpoolerBase %-#x\n" , &pffv->SpoolerBase , ffv.SpoolerBase );
  510. dprintf("[%x] SpoolerPid %-#x\n" , &pffv->SpoolerPid , ffv.SpoolerPid );
  511. dprintf("\n");
  512. return;
  513. ffv_help:
  514. dprintf ("Usage: ffv [-?] pointer to a FONTFILEVIEW structure\n");
  515. return;
  516. #endif // DOES NOT SUPPORT API64
  517. EXIT_API(S_OK);
  518. }
  519. /******************************Public*Routine******************************\
  520. *
  521. * History:
  522. * 21-Feb-1995 -by- Lingyun Wang [lingyunw]
  523. * Wrote it.
  524. \**************************************************************************/
  525. DECLARE_API( elf )
  526. {
  527. dprintf("Extension 'elf' is not converted.\n");
  528. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  529. LOGFONTW lf;
  530. PARSE_POINTER(elf_help);
  531. move(lf,arg);
  532. vDumpLOGFONTW( &lf, (LOGFONTW*) arg );
  533. return;
  534. elf_help:
  535. dprintf ("Usage: elf [-?] pointer to an LOGFONTW structure\n");
  536. #endif // DOES NOT SUPPORT API64
  537. EXIT_API(S_OK);
  538. }
  539. /******************************Public*Routine******************************\
  540. * History:
  541. * 21-Feb-1995 -by- Lingyun Wang [lingyunw]
  542. * Wrote it.
  543. \**************************************************************************/
  544. DECLARE_API( helf )
  545. {
  546. dprintf("Extension 'helf' is not converted.\n");
  547. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  548. LOGFONTW lf, *plf;
  549. PARSE_POINTER(helf_help);
  550. plf = (LOGFONTW*) ((BYTE*)_pobj((HANDLE) arg) + offsetof(LFONT,elfw));
  551. move( lf , plf );
  552. vDumpLOGFONTW( &lf, plf );
  553. return;
  554. helf_help:
  555. dprintf ("Usage: helf [-?] font handle\n");
  556. #endif // DOES NOT SUPPORT API64
  557. EXIT_API(S_OK);
  558. }
  559. /******************************Public*Routine******************************\
  560. *
  561. * Routine Name:
  562. *
  563. * dhelf
  564. *
  565. \**************************************************************************/
  566. DECLARE_API( dhelf )
  567. {
  568. dprintf("Extension 'dhelf' is not converted.\n");
  569. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  570. dprintf("\n\ngdikdx.dhelf will soon be replaced by gdikdx.helf\n\n");
  571. helf(hCurrentProcess, hCurrentThread, dwCurrentPc, dwProcessor, args);
  572. #endif // DOES NOT SUPPORT API64
  573. EXIT_API(S_OK);
  574. }
  575. /******************************Public*Routine******************************\
  576. *
  577. * Routine Name:
  578. *
  579. * ifi
  580. *
  581. \**************************************************************************/
  582. DECLARE_API( ifi )
  583. {
  584. dprintf("Extension 'ifi' is not converted.\n");
  585. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  586. IFIMETRICS *pifiDst, *pifiSrc;
  587. ULONG cjIFI=0;
  588. PARSE_POINTER(ifi_help);
  589. pifiSrc = (IFIMETRICS *)arg;
  590. move(cjIFI,&pifiSrc->cjThis);
  591. if (cjIFI == 0) {
  592. dprintf("cjIFI == 0 ... no dump\n");
  593. return;
  594. }
  595. pifiDst = tmalloc(IFIMETRICS, cjIFI);
  596. if (pifiDst == 0) {
  597. dprintf("LocalAlloc Failed\n");
  598. return;
  599. }
  600. move2(pifiDst, pifiSrc, cjIFI);
  601. vDumpIFIMETRICS(pifiDst, pifiSrc);
  602. tfree(pifiDst);
  603. return;
  604. ifi_help:
  605. dprintf ("Usage: [-?] pointer to an IFIMETRICS structure\n");
  606. #endif // DOES NOT SUPPORT API64
  607. EXIT_API(S_OK);
  608. }
  609. /******************************Public*Routine******************************\
  610. *
  611. * Routine Name:
  612. *
  613. * difi
  614. *
  615. \**************************************************************************/
  616. DECLARE_API( difi )
  617. {
  618. dprintf("Extension 'difi' is not converted.\n");
  619. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  620. dprintf("\n\n");
  621. dprintf("WARNING gdikdx.difi will soon be replaced by gdikdx.ifi\n");
  622. dprintf("\n\n");
  623. ifi(hCurrentProcess, hCurrentThread, dwCurrentPc, dwProcessor, args);
  624. #endif // DOES NOT SUPPORT API64
  625. EXIT_API(S_OK);
  626. }
  627. /******************************Public*Routine******************************\
  628. *
  629. * Routine Name:
  630. *
  631. * bParseDbgFlags
  632. *
  633. * Routine Description:
  634. *
  635. * Looks at a flag string of the form
  636. *
  637. * -[abc..]*[ \t]
  638. *
  639. * and and sets the corresponding flags
  640. *
  641. * Arguments:
  642. *
  643. * pszFlags pointer to the flags string
  644. *
  645. * ppszStop pointer to place to put a pointer
  646. * to the terminating character
  647. *
  648. * pai pointer to an ARGINFO structure
  649. *
  650. *
  651. * Return Value:
  652. *
  653. * Returns TRUE if all the flags were good. The corresponding flags are
  654. * set in pai->fl. Returns FALSE if an error occurs. The pointer to
  655. * the terminating character is set.
  656. *
  657. \**************************************************************************/
  658. /*
  659. int bParseDbgFlags(const char *pszFlags, const char **ppchStop, ARGINFO *pai)
  660. {
  661. char ch;
  662. const char *pch;
  663. OPTDEF *pod;
  664. pch = pszFlags; // go to beginning of string
  665. pch += (*pch == '-' || *pch == '/'); // first char a '-'?
  666. for (ch = *pch; !isspace(ch); ch = *pch++) { // character not a space?
  667. for (pod = pai->aod; pod->ch; pod++) { // yes, go to start of table
  668. if (ch == pod->ch) { // found character?
  669. pai->fl |= pod->fl; // yes, set flag
  670. break; // and stop
  671. }
  672. } // go to next table entry
  673. if (pod->ch == 0) // charater found in table?
  674. return(0); // no, return error
  675. } // go to next char in string
  676. return((*ppchStop = pch) != pszFlags); // set stop pos'n and return
  677. }
  678. */
  679. /******************************Public*Routine******************************\
  680. *
  681. * Routine Name:
  682. *
  683. * bParseDbgArgs
  684. *
  685. * Routine Description:
  686. *
  687. * This routine parses the argument string pointer in pai looking
  688. * for a string of the form:
  689. *
  690. * [ \t]*(-[abc..]*[ \t]+)* hexnumber
  691. *
  692. * The value of the hexadecimal number is placed in pai->pv and the
  693. * flags are set in pai->fl according to the options table set
  694. * in pai->aod;
  695. *
  696. * Arguments:
  697. *
  698. * pai Pointer to an ARGINFO structure
  699. *
  700. * Return Value:
  701. *
  702. * Returns TRUE if parsing was good, FALSE otherwise.
  703. *
  704. \**************************************************************************/
  705. /*
  706. int bParseDbgArgs(ARGINFO *pai)
  707. {
  708. int argc; // # args in command line
  709. char ch;
  710. const char *pch;
  711. int bInArg;
  712. int bParseDbgFlags(const char*,const char**,ARGINFO*);
  713. pai->fl = 0; // clear flags
  714. pai->pv = 0; // clear pointer
  715. for (bInArg=0, pch=pai->psz, argc=0; ch = *pch; pch++) {
  716. if (isspace(ch)) // count the number of args
  717. bInArg = 0;
  718. else {
  719. argc += (bInArg == 0);
  720. bInArg = 1;
  721. }
  722. }
  723. for (pch = pai->psz; 1 < argc; argc--) { // get the flags from the
  724. if (!bParseDbgFlags(pch, &pch, pai)) // first (argc-1) arguments
  725. break;
  726. }
  727. // get the number from the last argument in command line
  728. return (argc == 1 && sscanf(pch, "%x", &(pai->pv)) == 1);
  729. }
  730. */
  731. /******************************Public*Routine******************************\
  732. *
  733. * History:
  734. * 20-Aug-1995 -by Kirk Olynyk [kirko]
  735. * Now has option flags.
  736. * 21-Feb-1995 -by- Lingyun Wang [lingyunw]
  737. * Wrote it.
  738. \**************************************************************************/
  739. DECLARE_API( fo )
  740. {
  741. INIT_API();
  742. ULONG64 foSrc;
  743. ULONG offset;
  744. ULONG localULONG;
  745. char *psz, ach[128];
  746. int i;
  747. BOOL Maximal=FALSE;
  748. BOOL Transform=FALSE;
  749. BOOL Font=FALSE;
  750. BOOL Header=FALSE;
  751. BOOL Glyphset=FALSE;
  752. BOOL Memory=FALSE;
  753. BOOL Cache=FALSE;
  754. PARSE_POINTER(fo_help);
  755. foSrc = arg;
  756. if(parse_iFindSwitch(tokens, ntok, 'a')!=-1) {Maximal=TRUE;}
  757. if(parse_iFindSwitch(tokens, ntok, 'x')!=-1) {Transform=TRUE;}
  758. if(parse_iFindSwitch(tokens, ntok, 'f')!=-1) {Font=TRUE;}
  759. if(parse_iFindSwitch(tokens, ntok, 'c')!=-1) {Cache=TRUE;}
  760. if(parse_iFindSwitch(tokens, ntok, 'h')!=-1) {Header=TRUE;}
  761. if(parse_iFindSwitch(tokens, ntok, 'w')!=-1) {Glyphset=TRUE;}
  762. if(parse_iFindSwitch(tokens, ntok, 'y')!=-1) {Memory=TRUE;}
  763. if(!(Maximal||Transform||Font||Cache||Header||Glyphset||Memory)) {Header=TRUE;}
  764. #define Dprint(expr, member) \
  765. dprintf("[0x%p] " #expr " " #member "\n", foSrc+offset, ##member)
  766. #define vDumpFoEFLOAT(member) \
  767. GetFieldOffset(GDIType(RFONT), #member, &offset); \
  768. sprintEFLOAT(Client, ach, foSrc+offset); \
  769. dprintf("[0x%p] %s " #member "\n", foSrc+offset, ach)
  770. #define vDumpFoULONG(member) \
  771. GetFieldOffset(GDIType(RFONT), #member, &offset); \
  772. GetRFONTSubField(#member,localULONG); \
  773. dprintf("[0x%p] %20u " #member "\n", foSrc+offset, localULONG)
  774. if(Maximal) {Header=TRUE;}
  775. if (Header) {
  776. FLONG fl;
  777. ULONG iUniq;
  778. ULONG iFace;
  779. ULONG cxMax;
  780. FLONG flFontType;
  781. ULONG64 iTTUniq;
  782. ULONG64 iFile;
  783. SIZE sizLogResPpi;
  784. ULONG ulStyleSize;
  785. ULONG64 pvConsumer;
  786. ULONG64 pvProducer;
  787. GetFONTOBJFieldAndOffset(iUniq);
  788. Dprint( %+#20x, iUniq);
  789. GetFONTOBJFieldAndOffset(iFace);
  790. Dprint( %+#20x, iFace);
  791. GetFONTOBJFieldAndOffset(cxMax);
  792. Dprint( %20d , cxMax);
  793. GetFONTOBJFieldAndOffset(flFontType);
  794. Dprint( %+#20x, flFontType);
  795. for (FLAGDEF *pfd = afdFO; pfd->psz; pfd++)
  796. if (pfd->fl & flFontType)
  797. dprintf(" \t\t%s\n", pfd->psz);
  798. GetFONTOBJFieldAndOffset(iTTUniq);
  799. Dprint( %+#20p, iTTUniq);
  800. GetFONTOBJFieldAndOffset(iFile);
  801. Dprint( %+#20p, iFile);
  802. GetFONTOBJFieldAndOffset(sizLogResPpi.cx);
  803. Dprint( %20u , sizLogResPpi.cx);
  804. GetFONTOBJFieldAndOffset(sizLogResPpi.cy);
  805. Dprint( %20u , sizLogResPpi.cy);
  806. GetFONTOBJFieldAndOffset(ulStyleSize);
  807. Dprint( %20u , ulStyleSize);
  808. GetFONTOBJFieldAndOffset(pvConsumer);
  809. Dprint( %+#20p, pvConsumer);
  810. GetFONTOBJFieldAndOffset(pvProducer);
  811. Dprint( %+#20p, pvProducer);
  812. }
  813. if (Maximal) {
  814. typedef struct _RFONTLINK { /* rfl */
  815. ULONG64 prfntPrev;
  816. ULONG64 prfntNext;
  817. } RFONTLINK, *PRFONTLINK;
  818. typedef struct _CACHE {
  819. // Info for GLYPHDATA portion of cache
  820. ULONG64 pgdNext; // ptr to next free place to put GLYPHDATA
  821. ULONG64 pgdThreshold; // ptr to first uncommited spot
  822. ULONG64 pjFirstBlockEnd; // ptr to end of first GLYPHDATA block
  823. ULONG64 pdblBase; // ptr to base of current GLYPHDATA block
  824. ULONG cMetrics; // number of GLYPHDATA's in the metrics cache
  825. // Info for GLYPHBITS portion of cache
  826. ULONG cjbblInitial; // size of initial bit block
  827. ULONG cjbbl; // size of any individual block in bytes
  828. ULONG cBlocksMax; // max # of blocks allowed
  829. ULONG cBlocks; // # of blocks allocated so far
  830. ULONG cGlyphs; // for statistical purposes only
  831. ULONG cjTotal; // also for stat purposes only
  832. ULONG64 pbblBase; // ptr to the first bit block (head of the list)
  833. ULONG64 pbblCur; // ptr to the block containing next
  834. ULONG64 pgbNext; // ptr to next free place to put GLYPHBITS
  835. ULONG64 pgbThreshold; // end of the current block
  836. // Info for lookaside portion of cache
  837. ULONG64 pjAuxCacheMem; // ptr to lookaside buffer, if any
  838. SIZE_T cjAuxCacheMem; // size of current lookaside buffer
  839. // Miscellany
  840. ULONG cjGlyphMax; // size of largest glyph
  841. // Type of metrics being cached
  842. BOOL bSmallMetrics;
  843. // binary cache search, used mostly for fe fonts
  844. INT iMax;
  845. INT iFirst;
  846. INT cBits;
  847. } CACHE;
  848. ULONG iUnique; // uniqueness number
  849. FLONG flType; // Cache type -
  850. ULONG ulContent; // Type of contents
  851. ULONG64 hdevProducer; // HDEV of the producer of font.
  852. BOOL bDeviceFont; // TRUE if realization of a device specific font
  853. ULONG64 hdevConsumer; // HDEV of the consumer of font.
  854. ULONG64 dhpdev; // device handle of PDEV of the consumer of font
  855. ULONG64 ppfe; // pointer to physical font entry
  856. ULONG64 pPFF; // point to physical font file
  857. FD_XFORM fdx; // N->D transform used to realize font
  858. ULONG cBitsPerPel; // number of bits per pel
  859. // MATRIX mxWorldToDevice;// RFONT was realized with this DC xform
  860. INT iGraphicsMode; // graphics mode used when
  861. // EPOINTFL eptflNtoWScale; // baseline and ascender scaling factors --
  862. BOOL bNtoWIdent; // TRUE if Notional to World is identity
  863. // EXFORMOBJ xoForDDI; // notional to device EXFORMOBJ
  864. // MATRIX mxForDDI; // xoForDDI's matrix
  865. FLONG flRealizedType;
  866. POINTL ptlUnderline1;
  867. POINTL ptlStrikeOut;
  868. POINTL ptlULThickness;
  869. POINTL ptlSOThickness;
  870. LONG lCharInc;
  871. FIX fxMaxAscent;
  872. FIX fxMaxDescent;
  873. FIX fxMaxExtent;
  874. POINTFIX ptfxMaxAscent;
  875. POINTFIX ptfxMaxDescent;
  876. ULONG cxMax; // width in pels of the widest glyph
  877. LONG lMaxAscent;
  878. LONG lMaxHeight;
  879. ULONG cyMax; // did not use to be here
  880. ULONG cjGlyphMax; // (cxMax + 7)/8 * cyMax, or at least it should be
  881. FD_XFORM fdxQuantized;
  882. LONG lNonLinearExtLeading;
  883. LONG lNonLinearIntLeading;
  884. LONG lNonLinearMaxCharWidth;
  885. LONG lNonLinearAvgCharWidth;
  886. ULONG ulOrientation;
  887. // EPOINTFL pteUnitBase;
  888. // EFLOAT efWtoDBase;
  889. // EFLOAT efDtoWBase;
  890. LONG lAscent;
  891. // EPOINTFL pteUnitAscent;
  892. // EFLOAT efWtoDAscent;
  893. // EFLOAT efDtoWAscent;
  894. LONG lEscapement;
  895. // EPOINTFL pteUnitEsc;
  896. // EFLOAT efWtoDEsc;
  897. // EFLOAT efDtoWEsc;
  898. // EFLOAT efEscToBase;
  899. // EFLOAT efEscToAscent;
  900. HGLYPH hgDefault;
  901. HGLYPH hgBreak;
  902. FIX fxBreak;
  903. ULONG64 pfdg; // ptr to wchar-->hglyph map
  904. ULONG64 wcgp; // ptr to wchar->pglyphdata map, if any
  905. FLONG flInfo;
  906. INT cSelected; // number of times selected
  907. RFONTLINK rflPDEV; // doubly linked list links
  908. RFONTLINK rflPFF; // doubly linked list links
  909. ULONG64 hsemCache; // glyph cache semaphore
  910. CACHE cache; // glyph bitmap cache
  911. POINTL ptlSim; // for bitmap scaling
  912. BOOL bNeededPaths; // was this rfont realized for a path bracket
  913. // EFLOAT efDtoWBase_31;
  914. // EFLOAT efDtoWAscent_31;
  915. ULONG64 ptmw; // cached text metrics
  916. LONG lMaxNegA;
  917. LONG lMaxNegC;
  918. LONG lMinWidthD;
  919. BOOL bIsSystemFont; // is this fixedsys/system/or terminal
  920. FLONG flEUDCState; // EUDC state information.
  921. ULONG64 prfntSystemTT; // system TT linked rfont
  922. ULONG64 prfntSysEUDC; // pointer to System wide EUDC Rfont.
  923. ULONG64 prfntDefEUDC; // pointer to Default EUDC Rfont.
  924. ULONG64 paprfntFaceName; // facename links
  925. ULONG64 aprfntQuickBuff;
  926. // quick buffer for face name and remote links
  927. BOOL bFilledEudcArray; // will be TRUE, the buffer is filled.
  928. ULONG ulTimeStamp; // timestamp for current link.
  929. UINT uiNumLinks; // number of linked fonts.
  930. BOOL bVertical; // vertical face flag.
  931. ULONG64 hsemEUDC; // EUDC semaphore
  932. // maximal dump
  933. #define GetAndPrintRFONTFieldAndOffset(expr, member) \
  934. GetRFONTFieldAndOffset(member); Dprint(expr, member)
  935. GetAndPrintRFONTFieldAndOffset( %+#20x, iUnique);
  936. GetAndPrintRFONTFieldAndOffset( %+#20x, flType);
  937. GetAndPrintRFONTFieldAndOffset( %+#20x, ulContent);
  938. GetAndPrintRFONTFieldAndOffset( %+#20x, hdevProducer);
  939. GetAndPrintRFONTFieldAndOffset( %+#20x, bDeviceFont);
  940. GetAndPrintRFONTFieldAndOffset( %+#20x, hdevConsumer);
  941. GetAndPrintRFONTFieldAndOffset( %+#20x, dhpdev);
  942. GetAndPrintRFONTFieldAndOffset( %+#20p, ppfe);
  943. GetAndPrintRFONTFieldAndOffset( %+#20p, pPFF);
  944. GetAndPrintRFONTFieldAndOffset( %+#20x, fdx.eXX);
  945. GetAndPrintRFONTFieldAndOffset( %+#20x, fdx.eXY);
  946. GetAndPrintRFONTFieldAndOffset( %+#20x, fdx.eYX);
  947. GetAndPrintRFONTFieldAndOffset( %+#20x, fdx.eYY);
  948. GetAndPrintRFONTFieldAndOffset( %20u , cBitsPerPel);
  949. GetRFONTOffset (mxWorldToDevice);
  950. dprintf("[0x%p] mxWorldToDevice: \n",foSrc+offset);
  951. vDumpMATRIX(Client, foSrc+offset);
  952. GetAndPrintRFONTFieldAndOffset( %20u , iGraphicsMode);
  953. vDumpFoEFLOAT(eptflNtoWScale.x);
  954. vDumpFoEFLOAT(eptflNtoWScale.y);
  955. GetAndPrintRFONTFieldAndOffset( %20d , bNtoWIdent);
  956. GetRFONTOffset (xoForDDI.pmx);
  957. dprintf("[0x%p] xoForDDI.pmx: \n",foSrc+offset);
  958. vDumpMATRIX(Client, foSrc+offset);
  959. vDumpFoULONG(xoForDDI.ulMode);
  960. GetRFONTOffset (mxForDDI);
  961. dprintf("[0x%p] mxForDDI: \n",foSrc+offset);
  962. vDumpMATRIX(Client, foSrc+offset);
  963. GetAndPrintRFONTFieldAndOffset( %+#20x, flRealizedType);
  964. GetAndPrintRFONTFieldAndOffset( %20d , ptlUnderline1.x);
  965. GetAndPrintRFONTFieldAndOffset( %20d , ptlUnderline1.y);
  966. GetAndPrintRFONTFieldAndOffset( %20d , ptlStrikeOut.x);
  967. GetAndPrintRFONTFieldAndOffset( %20d , ptlStrikeOut.y);
  968. GetAndPrintRFONTFieldAndOffset( %20d , ptlULThickness.x);
  969. GetAndPrintRFONTFieldAndOffset( %20d , ptlULThickness.y);
  970. GetAndPrintRFONTFieldAndOffset( %20d , ptlSOThickness.x);
  971. GetAndPrintRFONTFieldAndOffset( %20d , ptlSOThickness.y);
  972. GetAndPrintRFONTFieldAndOffset( %20d , lCharInc);
  973. GetAndPrintRFONTFieldAndOffset( %+#20x, fxMaxAscent);
  974. GetAndPrintRFONTFieldAndOffset( %+#20x, fxMaxDescent);
  975. GetAndPrintRFONTFieldAndOffset( %+#20x, fxMaxExtent);
  976. GetAndPrintRFONTFieldAndOffset( %+#20x, ptfxMaxAscent.x);
  977. GetAndPrintRFONTFieldAndOffset( %+#20x, ptfxMaxAscent.y);
  978. GetAndPrintRFONTFieldAndOffset( %+#20x, ptfxMaxDescent.x);
  979. GetAndPrintRFONTFieldAndOffset( %+#20x, ptfxMaxDescent.y);
  980. GetAndPrintRFONTFieldAndOffset( %20u , cxMax);
  981. GetAndPrintRFONTFieldAndOffset( %20d , lMaxAscent);
  982. GetAndPrintRFONTFieldAndOffset( %20d , lMaxHeight);
  983. GetAndPrintRFONTFieldAndOffset( %20u , cyMax);
  984. GetAndPrintRFONTFieldAndOffset( %20u , cjGlyphMax);
  985. GetAndPrintRFONTFieldAndOffset( %+#20x, fdxQuantized.eXX);
  986. GetAndPrintRFONTFieldAndOffset( %+#20x, fdxQuantized.eXY);
  987. GetAndPrintRFONTFieldAndOffset( %+#20x, fdxQuantized.eYX);
  988. GetAndPrintRFONTFieldAndOffset( %+#20x, fdxQuantized.eYY);
  989. GetAndPrintRFONTFieldAndOffset( %20d , lNonLinearExtLeading);
  990. GetAndPrintRFONTFieldAndOffset( %20d , lNonLinearIntLeading);
  991. GetAndPrintRFONTFieldAndOffset( %20d , lNonLinearMaxCharWidth);
  992. GetAndPrintRFONTFieldAndOffset( %20d , lNonLinearAvgCharWidth);
  993. GetAndPrintRFONTFieldAndOffset( %20u , ulOrientation);
  994. vDumpFoEFLOAT(pteUnitBase.x);
  995. vDumpFoEFLOAT(pteUnitBase.y);
  996. vDumpFoEFLOAT(efWtoDBase);
  997. vDumpFoEFLOAT(efDtoWBase);
  998. GetAndPrintRFONTFieldAndOffset( %20d , lAscent);
  999. vDumpFoEFLOAT(pteUnitAscent.x);
  1000. vDumpFoEFLOAT(pteUnitAscent.y);
  1001. vDumpFoEFLOAT(efWtoDAscent);
  1002. vDumpFoEFLOAT(efDtoWAscent);
  1003. GetAndPrintRFONTFieldAndOffset( %20d , lEscapement);
  1004. vDumpFoEFLOAT(pteUnitEsc.x);
  1005. vDumpFoEFLOAT(pteUnitEsc.y);
  1006. vDumpFoEFLOAT(efWtoDEsc);
  1007. vDumpFoEFLOAT(efDtoWEsc);
  1008. vDumpFoEFLOAT(efEscToBase);
  1009. vDumpFoEFLOAT(efEscToAscent);
  1010. GetAndPrintRFONTFieldAndOffset( %+#20x, flInfo);
  1011. GetAndPrintRFONTFieldAndOffset( %+#20x, hgBreak);
  1012. GetAndPrintRFONTFieldAndOffset( %+#20x, fxBreak);
  1013. GetAndPrintRFONTFieldAndOffset( %+#20x, pfdg);
  1014. GetAndPrintRFONTFieldAndOffset( %+#20p, wcgp);
  1015. GetAndPrintRFONTFieldAndOffset( %20u , cSelected);
  1016. //rflPDEV
  1017. GetAndPrintRFONTFieldAndOffset( %+#20x, rflPDEV.prfntPrev);
  1018. GetAndPrintRFONTFieldAndOffset( %+#20x, rflPDEV.prfntNext);
  1019. //rflPFF
  1020. GetAndPrintRFONTFieldAndOffset( %+#20x, rflPFF.prfntPrev);
  1021. GetAndPrintRFONTFieldAndOffset( %+#20x, rflPFF.prfntNext);
  1022. //hsemCache
  1023. GetAndPrintRFONTFieldAndOffset( %+#20x, hsemCache);
  1024. //cache
  1025. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.pgdNext);
  1026. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.pgdThreshold);
  1027. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.pjFirstBlockEnd);
  1028. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.pdblBase);
  1029. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.cMetrics);
  1030. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.cjbbl);
  1031. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.cBlocksMax);
  1032. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.cBlocks);
  1033. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.cGlyphs);
  1034. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.cjTotal);
  1035. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.pbblBase);
  1036. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.pbblCur);
  1037. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.pgbNext);
  1038. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.pgbThreshold);
  1039. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.pjAuxCacheMem);
  1040. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.cjAuxCacheMem);
  1041. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.cjGlyphMax);
  1042. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.bSmallMetrics);
  1043. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.iMax);
  1044. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.iFirst);
  1045. GetAndPrintRFONTFieldAndOffset( %+#20x, cache.cBits);
  1046. GetAndPrintRFONTFieldAndOffset( %20d , ptlSim.x);
  1047. GetAndPrintRFONTFieldAndOffset( %20d , ptlSim.y);
  1048. GetAndPrintRFONTFieldAndOffset( %20d , bNeededPaths);
  1049. vDumpFoEFLOAT(efDtoWBase_31);
  1050. vDumpFoEFLOAT(efDtoWAscent_31);
  1051. GetAndPrintRFONTFieldAndOffset( %+#20x, ptmw);
  1052. GetAndPrintRFONTFieldAndOffset( %20d , lMaxNegA);
  1053. GetAndPrintRFONTFieldAndOffset( %20d , lMaxNegC);
  1054. GetAndPrintRFONTFieldAndOffset( %20d , lMinWidthD);
  1055. GetAndPrintRFONTFieldAndOffset( %20d , bIsSystemFont);
  1056. GetAndPrintRFONTFieldAndOffset( %+#20x, flEUDCState);
  1057. GetAndPrintRFONTFieldAndOffset( %+#20x, prfntSystemTT);
  1058. GetAndPrintRFONTFieldAndOffset( %+#20x, prfntSysEUDC);
  1059. GetAndPrintRFONTFieldAndOffset( %+#20x, prfntDefEUDC);
  1060. GetAndPrintRFONTFieldAndOffset( %+#20x, paprfntFaceName);\
  1061. //aprfntQuickBuff
  1062. #if 0
  1063. GetAndPrintRFONTFieldAndOffset( %+20x, aprfntQuickBuff[0]);
  1064. GetAndPrintRFONTFieldAndOffset( %+20x, aprfntQuickBuff[1]);
  1065. GetAndPrintRFONTFieldAndOffset( %+20x, aprfntQuickBuff[2]);
  1066. GetAndPrintRFONTFieldAndOffset( %+20x, aprfntQuickBuff[3]);
  1067. GetAndPrintRFONTFieldAndOffset( %+20x, aprfntQuickBuff[4]);
  1068. GetAndPrintRFONTFieldAndOffset( %+20x, aprfntQuickBuff[5]);
  1069. GetAndPrintRFONTFieldAndOffset( %+20x, aprfntQuickBuff[6]);
  1070. GetAndPrintRFONTFieldAndOffset( %+20x, aprfntQuickBuff[7]);
  1071. #endif
  1072. GetAndPrintRFONTFieldAndOffset( %20d , bFilledEudcArray);
  1073. GetAndPrintRFONTFieldAndOffset( %20u , ulTimeStamp);
  1074. GetAndPrintRFONTFieldAndOffset( %20u , uiNumLinks);
  1075. GetAndPrintRFONTFieldAndOffset( %20d , bVertical);
  1076. }
  1077. if (Memory)
  1078. {
  1079. dprintf("Extension 'fo -y' is not converted.\n");
  1080. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  1081. vDumpGlyphMemory((RFONT*)arg);
  1082. #endif
  1083. }
  1084. if (Font) {
  1085. ULONG64 ppfe; // pointer to physical font entry
  1086. GetRFONTFieldAndOffset(ppfe);
  1087. dprintf("[Font Information]\n ppfe = %-#p\n", ppfe);
  1088. // print the face name of the font
  1089. if (ppfe) {
  1090. ULONG64 pfeSrc= ppfe;
  1091. ULONG64 pifi;
  1092. GetPFEFieldAndOffset(pifi);
  1093. if (pifi) {
  1094. ULONG dpwszFaceName, cjThis;
  1095. ULONG64 pifiSrc = pifi;
  1096. GetIFIMETRICSFieldAndOffset(cjThis);
  1097. GetIFIMETRICSFieldAndOffset(dpwszFaceName);
  1098. if (cjThis) {
  1099. WCHAR wszFaceName[MAX_PATH+1];
  1100. ReadMemory(pifiSrc+dpwszFaceName, wszFaceName,MAX_PATH, NULL);
  1101. dprintf(" [%ws]\n", wszFaceName);
  1102. }
  1103. }
  1104. }
  1105. ULONG64 pPFF; // point to physical font file
  1106. GetRFONTFieldAndOffset(pPFF);
  1107. dprintf(" pPFF = %-#p\n", pPFF);
  1108. if (pPFF) {
  1109. ULONG64 pffSrc = pPFF;
  1110. SIZE_T sizeofThis;
  1111. ULONG cFonts; // number of fonts (same as chpfe)
  1112. ULONG64 aulData; // data buffer for HPFE and filename
  1113. ULONG64 sizeOfPVOID;
  1114. sizeOfPVOID = GetTypeSize("PVOID");
  1115. GetPFFFieldAndOffset(sizeofThis);
  1116. GetPFFFieldAndOffset(cFonts);
  1117. GetPFFFieldAndOffset(aulData);
  1118. offset = offset + cFonts * (ULONG)sizeOfPVOID;
  1119. if (sizeofThis) {
  1120. WCHAR wszPathName[MAX_PATH+1];
  1121. ReadMemory(pffSrc+offset, wszPathName,MAX_PATH, NULL);
  1122. dprintf(" [%ws]\n", wszPathName);
  1123. }
  1124. }
  1125. }
  1126. if (Transform) {
  1127. dprintf("Extension 'fo -x' is not converted.\n");
  1128. #if 0 // DOES NOT SUPPORT API64
  1129. LONG l1,l2,l3,l4;
  1130. psz = ach;
  1131. psz += sprintFLOATL( psz, rf.fdx.eXX );
  1132. *psz++ = ' ';
  1133. psz += sprintFLOATL( psz, rf.fdx.eXY );
  1134. dprintf("[transform]\n fdx = %s\n", ach);
  1135. psz = ach;
  1136. psz += sprintFLOATL( psz, rf.fdx.eXY );
  1137. *psz++ = ' ';
  1138. psz += sprintFLOATL( psz, rf.fdx.eYY );
  1139. dprintf (" %s\n", ach );
  1140. l1 = rf.mxWorldToDevice.efM11.lEfToF();
  1141. l2 = rf.mxWorldToDevice.efM12.lEfToF();
  1142. l3 = rf.mxWorldToDevice.efM21.lEfToF();
  1143. l4 = rf.mxWorldToDevice.efM22.lEfToF();
  1144. dprintf(
  1145. " mxWorldToDevice =\n"
  1146. );
  1147. sprintEFLOAT( ach, rf.mxWorldToDevice.efM11 );
  1148. dprintf(" efM11 = %s\n", ach );
  1149. sprintEFLOAT( ach, rf.mxWorldToDevice.efM12 );
  1150. dprintf(" efM12 = %s\n", ach );
  1151. sprintEFLOAT( ach, rf.mxWorldToDevice.efM21 );
  1152. dprintf(" efM21 = %s\n", ach );
  1153. sprintEFLOAT( ach, rf.mxWorldToDevice.efM22 );
  1154. dprintf(" efM22 = %s\n", ach );
  1155. dprintf(
  1156. " fxDx = %-#x\n"
  1157. " fxDy = %-#x\n"
  1158. , rf.mxWorldToDevice.fxDx
  1159. , rf.mxWorldToDevice.fxDy
  1160. );
  1161. l1 = (LONG) rf.mxWorldToDevice.flAccel;
  1162. dprintf(" flAccel = %-#x\n", l1);
  1163. for (FLAGDEF *pfd=afdMX; pfd->psz; pfd++)
  1164. if (l1 & pfd->fl)
  1165. dprintf("\t\t%s\n", pfd->psz);
  1166. psz = ach;
  1167. psz += sprintEFLOAT( psz, rf.eptflNtoWScale.x);
  1168. *psz++ = ' ';
  1169. psz += sprintEFLOAT( psz, rf.eptflNtoWScale.y);
  1170. dprintf(" eptflNtoWScale = %s\n", ach );
  1171. dprintf(
  1172. " bNtoWIdent = %d\n"
  1173. , rf.bNtoWIdent
  1174. );
  1175. dprintf(
  1176. " xoForDDI =\n"
  1177. " mxForDDI =\n"
  1178. );
  1179. dprintf(
  1180. " ulOrientation = %u\n"
  1181. , rf.ulOrientation
  1182. );
  1183. psz = ach;
  1184. psz += sprintEFLOAT( ach, rf.pteUnitBase.x );
  1185. *psz++ = ' ';
  1186. psz += sprintEFLOAT( ach, rf.pteUnitBase.y );
  1187. dprintf(" pteUnitBase = %s\n", ach );
  1188. sprintEFLOAT( ach, rf.efWtoDBase );
  1189. dprintf(" efWtoDBase = %s\n", ach );
  1190. sprintEFLOAT( ach, rf.efDtoWBase );
  1191. dprintf(" efDtoWBase = %s\n", ach );
  1192. dprintf(" lAscent = %d\n", rf.lAscent);
  1193. psz = ach;
  1194. psz += sprintEFLOAT( ach, rf.pteUnitAscent.x );
  1195. *psz++ = ' ';
  1196. psz += sprintEFLOAT( ach, rf.pteUnitAscent.y );
  1197. dprintf(" pteUnitAscent = %s\n", ach );
  1198. sprintEFLOAT( ach, rf.efWtoDAscent );
  1199. dprintf(" efWtoDAscent = %s\n", ach );
  1200. sprintEFLOAT( ach, rf.efDtoWAscent );
  1201. dprintf(" efDtoWAscent = %s\n", ach );
  1202. psz = ach;
  1203. psz += sprintEFLOAT( ach, rf.pteUnitEsc.x );
  1204. *psz++ = ' ';
  1205. psz += sprintEFLOAT( ach, rf.pteUnitEsc.y );
  1206. dprintf(" pteUnitEsc = %s\n", ach );
  1207. sprintEFLOAT( ach, rf.efWtoDEsc );
  1208. dprintf(" efWtoDEsc = %s\n", ach );
  1209. sprintEFLOAT( ach, rf.efDtoWEsc );
  1210. dprintf(" efDtoWEsc = %s\n", ach );
  1211. sprintEFLOAT( ach, rf.efEscToBase );
  1212. dprintf(" efEscToBase = %s\n", ach );
  1213. sprintEFLOAT( ach, rf.efEscToAscent);
  1214. dprintf(" efEscToAscent = %s\n", ach );
  1215. dprintf("\n");
  1216. #endif
  1217. }
  1218. if (Glyphset) {
  1219. dprintf("Extension 'fo -w' is not converted.\n");
  1220. #if 0 // DOES NOT SUPPORT API64
  1221. if (rf.pfdg) {
  1222. FD_GLYPHSET fdg, *pfdg;
  1223. WCRUN *pwc;
  1224. move( fdg, rf.pfdg );
  1225. move2( adw, rf.pfdg, fdg.cjThis );
  1226. pfdg = (FD_GLYPHSET*) adw;
  1227. dprintf(
  1228. "\t\t cjThis = %u = %-#x\n"
  1229. , pfdg->cjThis
  1230. , pfdg->cjThis
  1231. );
  1232. dprintf("\t\t flAccel = %-#x\n", pfdg->flAccel );
  1233. FLONG flAccel = pfdg->flAccel;
  1234. for (FLAGDEF *pfd=afdGS; pfd->psz; pfd++)
  1235. if (flAccel & pfd->fl) {
  1236. dprintf("\t\t\t\t%s\n", pfd->psz);
  1237. flAccel &= ~pfd->fl;
  1238. }
  1239. if (flAccel)
  1240. dprintf("\t\t\t\t????????\n");
  1241. dprintf("\t\t\tcGlyphsSupported\t= %u\n", pfdg->cGlyphsSupported );
  1242. dprintf("\t\t\tcRuns\t\t= %u\n", pfdg->cRuns );
  1243. dprintf("\t\t\t\tWCHAR HGLYPH\n");
  1244. for ( pwc = pfdg->awcrun; pwc < pfdg->awcrun + pfdg->cRuns; pwc++ ) {
  1245. dprintf("\t\t\t\t------------\n");
  1246. HGLYPH *ahg= tmalloc(HGLYPH,sizeof(HGLYPH)*pwc->cGlyphs);
  1247. if ( ahg ) {
  1248. move2(ahg, pwc->phg, sizeof(HGLYPH) * pwc->cGlyphs );
  1249. for (unsigned i = 0; i < pwc->cGlyphs; i++) {
  1250. if (CheckControlC()) {
  1251. tfree( ahg );
  1252. return;
  1253. }
  1254. dprintf("\t\t\t\t%-#6x %-#x\n",
  1255. pwc->wcLow + (USHORT) i, ahg[i]);
  1256. }
  1257. tfree( ahg );
  1258. }
  1259. }
  1260. }
  1261. #endif
  1262. }
  1263. if (Cache) {
  1264. ULONG64 hsemCache; // glyph cache semaphore
  1265. GetRFONTFieldAndOffset(hsemCache);
  1266. GetRFONTOffset( cache.pgdNext);
  1267. dprintf(
  1268. "[cache]\n"
  1269. " hsemCache = %-#x\n" // semaphore
  1270. , hsemCache
  1271. );
  1272. vDumpCACHE(foSrc+offset);
  1273. }
  1274. EXIT_API(S_OK);
  1275. fo_help:
  1276. dprintf("Usage: fo [-?] [-a] [-c] [-f] [-h] [-w] [-x] [-y] pointer to FONTOBJ"
  1277. " -a maximal dump\n"
  1278. " -c cache\n"
  1279. " -x transform data\n"
  1280. " -? this message\n"
  1281. " -f font\n"
  1282. " -h FONTOBJ header\n"
  1283. " -w FD_GLYPHSET\n"
  1284. " -y Glyph Memory Usage\n");
  1285. #undef Dprintf
  1286. EXIT_API(S_OK);
  1287. }
  1288. /******************************Public*Routine******************************\
  1289. *
  1290. * Routine Name:
  1291. *
  1292. * vDumpPFE
  1293. *
  1294. \**************************************************************************/
  1295. void vDumpPFE(ULONG64 offPFE)
  1296. {
  1297. #define N3(a,b,c) \
  1298. GetPFEFieldAndOffset(c); \
  1299. dprintf( "[%p] %s", pfeSrc + offset, (a)); dprintf( (b), ##c )
  1300. #define N2(a,c) \
  1301. GetPFEOffset(c); \
  1302. dprintf( "[%p] %s", pfeSrc + offset, (a));
  1303. ULONG offset;
  1304. ULONG64 pfeSrc= offPFE;
  1305. FLAGDEF *pfd;
  1306. FLONG fl;
  1307. ULONG64 pPFF; // pointer to physical font file object
  1308. ULONG iFont; // index of the font for IFI or device
  1309. FLONG flPFE;
  1310. ULONG64 pfdg; // ptr to wc-->hg map
  1311. ULONG idfdg; // id returned by driver for FD_GLYPHSET
  1312. ULONG64 pifi; // pointer to ifimetrics
  1313. ULONG idifi; // id returned by driver for IFIMETRICS
  1314. ULONG64 pkp; // pointer to kerning pairs (lazily loaded on demand)
  1315. ULONG idkp; // id returned by driver for FD_KERNINGPAIR
  1316. ULONG ckp; // count of kerning pairs in the FD_KERNINGPAIR arrary
  1317. LONG iOrientation; // Cache IFI orientation.
  1318. ULONG cjEfdwPFE; // size of enumeration data needed for this pfe
  1319. ULONG64 pgiset; // initialized to NULL;
  1320. ULONG ulTimeStamp; // unique time stamp (smaller == older)
  1321. ULONG pid;
  1322. // QUICKLOOKUP ql; // QUICKLOOKUP if a linked font
  1323. ULONG64 pFlEntry; // Pointer to linked font list
  1324. ULONG cAlt;
  1325. ULONG cPfdgRef;
  1326. BYTE aiFamilyName[1]; // aiFamilyNameg[cAltCharSets]
  1327. dprintf("\nPFE\n\n");
  1328. N3("pPFF ", "%-#x\n", pPFF);
  1329. N3("iFont ", "%u\n", iFont);
  1330. N3("pifi ", "%-#x\n", pifi);
  1331. N3("flPFE ", "%-#x\n", flPFE);
  1332. for (fl = flPFE, pfd=afdPFE; pfd->psz; pfd++) {
  1333. if (fl & pfd->fl) {
  1334. dprintf(" %s\n", pfd->psz);
  1335. }
  1336. }
  1337. N3("pfdg ", "%-#x\n", pfdg);
  1338. N2("idifi\n", idifi);
  1339. N3("pkp ", "%-#x\n", pkp);
  1340. N3("idkp ", "%-#x\n", idkp);
  1341. N3("ckp ", "%u\n", ckp);
  1342. N3("iOrieintation ", "%d\n", iOrientation);
  1343. N3("cjEfdwPFE ", "%-#x\n", cjEfdwPFE);
  1344. N3("pgiset ", "%-#x\n", pgiset);
  1345. N3("ulTimeStamp ", "%u\n", ulTimeStamp);
  1346. N2("ufi\n", ufi);
  1347. N3("pid ", "%-#x\n", pid);
  1348. N2("ql\n" , ql);
  1349. N3("pFlEntry ", "%-#x\n", pFlEntry);
  1350. N3("cAlt ", "%u\n", cAlt);
  1351. N3("cPfdgRef ", "%u\n", cPfdgRef);
  1352. N2("aiFamilyName[]" , aiFamilyName[0]);
  1353. dprintf("\n\n");
  1354. #undef N2
  1355. #undef N3
  1356. }
  1357. /******************************Public*Routine******************************\
  1358. *
  1359. * Routine Name:
  1360. *
  1361. * pfe
  1362. *
  1363. \**************************************************************************/
  1364. DECLARE_API( pfe )
  1365. {
  1366. PARSE_POINTER(pfe_help);
  1367. vDumpPFE( arg );
  1368. EXIT_API(S_OK);
  1369. pfe_help:
  1370. dprintf ("Usage: pfe [-?] pointer to PFE\n");
  1371. EXIT_API(S_OK);
  1372. }
  1373. /******************************Public*Routine******************************\
  1374. *
  1375. * History:
  1376. * 21-Feb-1995 -by- Lingyun Wang [lingyunw]
  1377. * Wrote it.
  1378. \**************************************************************************/
  1379. DECLARE_API( hpfe )
  1380. {
  1381. dprintf("Why are you using a handle? Nobody uses a handle to a PFE\n");
  1382. EXIT_API(S_OK);
  1383. }
  1384. /******************************Public*Routine******************************\
  1385. * vPrintSkeletonPFF
  1386. *
  1387. * Argument
  1388. *
  1389. * pLocalPFF points to a complete local PFF structure
  1390. * (including PFE*'s and path name)
  1391. * all addresses contained are remote
  1392. * except for pwszPathname_ which has
  1393. * been converted before this routine
  1394. * was called
  1395. *
  1396. * History:
  1397. * Tue 30-Aug-1994 07:25:18 by Kirk Olynyk [kirko]
  1398. * Wrote it.
  1399. \**************************************************************************/
  1400. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  1401. VOID vPrintSkeletonPFF( PFF *pLocalPFF )
  1402. {
  1403. PFE **ppPFEl, **ppPFEl_;
  1404. if (pLocalPFF->hdev)
  1405. dprintf("\t%-#8x (HDEV)\n", pLocalPFF->hdev);
  1406. else
  1407. dprintf("\t\"%ws\"\n", pLocalPFF->pwszPathname_);
  1408. dprintf("\t PFE* IFI*\n");
  1409. ppPFEl = (PFE**) &(pLocalPFF->aulData[0]);
  1410. ppPFEl_ = ppPFEl + pLocalPFF->cFonts;
  1411. while (ppPFEl < ppPFEl_) {
  1412. PFE *pPFEr = *ppPFEl;
  1413. dprintf("\t %-#10x", pPFEr);
  1414. if ( pPFEr ) {
  1415. PFE PFEt;
  1416. move2(&PFEt, pPFEr, sizeof(PFEt));
  1417. dprintf(" %-#10x\t", PFEt.pifi);
  1418. {
  1419. ULONG sizeofIFI;
  1420. IFIMETRICS *pHeapIFI;
  1421. move2(
  1422. &sizeofIFI
  1423. , PFEt.pifi + offsetof(IFIMETRICS,cjThis)
  1424. , sizeof(sizeofIFI));
  1425. if (pHeapIFI = tmalloc(IFIMETRICS,sizeofIFI)) {
  1426. move2(pHeapIFI, PFEt.pifi, sizeofIFI);
  1427. IFIOBJ ifio(pHeapIFI);
  1428. dprintf(
  1429. "\"%ws\" %d %d\n"
  1430. , ifio.pwszFaceName()
  1431. , ifio.lfHeight()
  1432. , ifio.lfWidth()
  1433. );
  1434. tfree(pHeapIFI);
  1435. } else
  1436. dprintf("!!! memory allocation failure !!!\n");
  1437. }
  1438. } else
  1439. dprintf(" INVALID PFE\n");
  1440. ppPFEl++;
  1441. }
  1442. // Now print the RFONT list
  1443. {
  1444. RFONT LocalRFONT, *pRemoteRFONT;
  1445. if (pRemoteRFONT = pLocalPFF->prfntList) {
  1446. dprintf("\t\tRFONT* PFE*\n");
  1447. do {
  1448. move2(&LocalRFONT, pRemoteRFONT, sizeof(LocalRFONT));
  1449. dprintf("\t\t%-#10x %-#10x\n", pRemoteRFONT, LocalRFONT.ppfe);
  1450. pRemoteRFONT = LocalRFONT.rflPFF.prfntNext;
  1451. } while (pRemoteRFONT);
  1452. }
  1453. }
  1454. }
  1455. #endif // DOES NOT SUPPORT API64
  1456. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  1457. void vDumpPFT( PFT *pLocal, PFT *pRemote )
  1458. {
  1459. COUNT i;
  1460. dprintf("[%8x] pfhFamily %-#x\n", &pRemote->pfhFamily, pLocal->pfhFamily);
  1461. dprintf("[%8x] pfhFace %-#x\n", &pRemote->pfhFace , pLocal->pfhFace );
  1462. dprintf("[%8x] pfhUFI %-#x\n", &pRemote->pfhUFI , pLocal->pfhUFI );
  1463. dprintf("[%8x] cBuckets %-#x\n", &pRemote->cBuckets , pLocal->cBuckets );
  1464. dprintf("[%8x] cFiles %-#x\n", &pRemote->cFiles , pLocal->cFiles );
  1465. for (i = 0; i < pLocal->cBuckets; i++)
  1466. {
  1467. PFF *pRemotePFF = pLocal->apPFF[i];
  1468. if (pRemotePFF)
  1469. {
  1470. PFF *pLast;
  1471. dprintf("[%8x]", &pRemote->apPFF[i]);
  1472. pLast = 0;
  1473. while (pRemotePFF && !CheckControlC())
  1474. {
  1475. PFF LocalPFF;
  1476. dprintf(" %8x", pRemotePFF);
  1477. move(LocalPFF, pRemotePFF);
  1478. pLast = pRemotePFF;
  1479. pRemotePFF = LocalPFF.pPFFNext;
  1480. if (pRemotePFF && pRemotePFF == pLast)
  1481. {
  1482. dprintf(" <---- BAD PFF ?");
  1483. pRemotePFF = 0;
  1484. }
  1485. }
  1486. dprintf("\n");
  1487. }
  1488. }
  1489. dprintf("\n"
  1490. "PFF* Pathname_\n"
  1491. "-------- ---------\n");
  1492. for (i = 0; i < pLocal->cBuckets; i++)
  1493. {
  1494. PFF *pRemotePFF, LocalPFF;
  1495. PWSZ pwszDst;
  1496. if ( pRemotePFF = pLocal->apPFF[i] )
  1497. {
  1498. dprintf("apPFF[%d]\n", i);
  1499. for ( ; pRemotePFF; pRemotePFF=LocalPFF.pPFFNext)
  1500. {
  1501. move(LocalPFF, pRemotePFF);
  1502. pwszDst = wcsncpy((PWSZ) adw, LocalPFF.pwszPathname_, sizeof(adw)/sizeof(WCHAR));
  1503. if ( pwszDst == 0 )
  1504. {
  1505. pwszDst = L"";
  1506. }
  1507. dprintf("%8x \"%ws\"\n", pRemotePFF, pwszDst);
  1508. }
  1509. dprintf("\n");
  1510. }
  1511. }
  1512. }
  1513. #endif // DOES NOT SUPPORT API64
  1514. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  1515. void vDumpFONTHASH( FONTHASH *pLocal, FONTHASH *pRemote )
  1516. {
  1517. UINT i;
  1518. union {
  1519. UINT id;
  1520. char ach[4];
  1521. } u;
  1522. /*
  1523. UINT id; // 'HASH'
  1524. FONTHASHTYPE fht; // table type
  1525. UINT cBuckets; // total number of buckets
  1526. UINT cUsed; // number of buckets in use
  1527. UINT cCollisions;
  1528. HASHBUCKET *pbktFirst; // first bucket of doubly linked list of hash
  1529. // buckets maintained in order loaded into system
  1530. HASHBUCKET *pbktLast; // last bucket of doubly linked list of hash
  1531. // buckets maintained in order loaded into system
  1532. HASHBUCKET *apbkt[1]; // array of bucket pointers.
  1533. */
  1534. u.id = pLocal->id;
  1535. dprintf("[%8x] id %8x %c%c%c%c\n", &pRemote->id, u.id, u.ach[0], u.ach[1], u.ach[2], u.ach[3]);
  1536. dprintf("[%8x] fht %-#10x %s\n", &pRemote->fht, pLocal->fht, pszFONTHASHTYPE(pLocal->fht));
  1537. dprintf("[%8x] cBuckets %-#x\n", &pRemote->cBuckets, pLocal->cBuckets);
  1538. dprintf("[%8x] cUsed %-#x\n", &pRemote->cUsed, pLocal->cUsed);
  1539. dprintf("[%8x] cCollisions %-#x\n", &pRemote->cCollisions, pLocal->cCollisions);
  1540. dprintf("[%8x] pbktFirst %-#x\n", &pRemote->pbktFirst, pLocal->pbktFirst);
  1541. dprintf("[%8x] pbktLast %-#x\n", &pRemote->pbktLast, pLocal->pbktLast);
  1542. dprintf("\n");
  1543. i = pLocal->cBuckets * sizeof(HASHBUCKET*);
  1544. if (i == 0 )
  1545. {
  1546. dprintf("No buckets here\n");
  1547. return;
  1548. }
  1549. move2(adw,&(pRemote->apbkt[0]),i);
  1550. for ( i = 0; i < pLocal->cBuckets; i++)
  1551. {
  1552. HASHBUCKET *pRemoteHB = ((HASHBUCKET**) adw)[i];
  1553. if ( pRemoteHB )
  1554. {
  1555. HASHBUCKET LocalHB;
  1556. dprintf("apbkt[%3u]", i);
  1557. for ( ; pRemoteHB; pRemoteHB = LocalHB.pbktCollision)
  1558. {
  1559. dprintf(" %-#x", pRemoteHB);
  1560. move(LocalHB, pRemoteHB);
  1561. }
  1562. dprintf("\n");
  1563. }
  1564. }
  1565. dprintf("\n");
  1566. for ( i = 0; i < pLocal->cBuckets; i++)
  1567. {
  1568. HASHBUCKET *pRemoteHB = ((HASHBUCKET**) adw)[i];
  1569. if ( pRemoteHB )
  1570. {
  1571. HASHBUCKET LocalHB;
  1572. dprintf("--------------------------------------\n");
  1573. dprintf("apbkt[%3u]\n", i);
  1574. for ( ; pRemoteHB; pRemoteHB = LocalHB.pbktCollision)
  1575. {
  1576. dprintf("HASHBUCKET* %-#x ", pRemoteHB);
  1577. move(LocalHB, pRemoteHB);
  1578. switch ( pLocal->fht )
  1579. {
  1580. case FHT_FACE:
  1581. case FHT_FAMILY:
  1582. dprintf("\t\"%ws\"", LocalHB.u.wcCapName);
  1583. break;
  1584. case FHT_UFI:
  1585. dprintf("\tUFI(%-#x,%-#x)", LocalHB.u.ufi.CheckSum, LocalHB.u.ufi.Index);
  1586. break;
  1587. default:
  1588. break;
  1589. }
  1590. dprintf("\n");
  1591. {
  1592. PFELINK *ppfel = LocalHB.ppfelEnumHead;
  1593. PFELINK pfelLocal;
  1594. PFE LocalPFE;
  1595. if (ppfel)
  1596. {
  1597. dprintf("PFE*\n");
  1598. while (ppfel)
  1599. {
  1600. move(pfelLocal, ppfel);
  1601. dprintf("%-#x", pfelLocal.ppfe);
  1602. move(LocalPFE,pfelLocal.ppfe);
  1603. if (LocalPFE.pPFF)
  1604. {
  1605. PFF LocalPFF;
  1606. WCHAR awc[MAX_PATH];
  1607. move(LocalPFF, LocalPFE.pPFF);
  1608. wcsncpy( awc, LocalPFF.pwszPathname_, MAX_PATH);
  1609. awc[MAX_PATH-1]=0;
  1610. dprintf(" \"%ws\"", awc);
  1611. }
  1612. if (LocalPFE.pifi)
  1613. {
  1614. ULONG dp;
  1615. WCHAR awc[LF_FACESIZE+1];
  1616. PWSZ pwszSrc;
  1617. FWORD fwdAscender, fwdDescender, fwdWidth;
  1618. move(dp,&((LocalPFE.pifi)->dpwszFaceName));
  1619. pwszSrc = (PWSZ)(((char*) (LocalPFE.pifi)) + dp);
  1620. wcsncpy(awc, pwszSrc, LF_FACESIZE);
  1621. awc[LF_FACESIZE] = 0;
  1622. dprintf(" \"%ws\"", awc);
  1623. move(fwdAscender, &LocalPFE.pifi->fwdWinAscender);
  1624. move(fwdDescender, &LocalPFE.pifi->fwdWinDescender);
  1625. move(fwdWidth, &LocalPFE.pifi->fwdAveCharWidth);
  1626. dprintf(" %4d %4d %4d", fwdAscender, fwdDescender, fwdWidth);
  1627. }
  1628. dprintf("\n");
  1629. ppfel = pfelLocal.ppfelNext;
  1630. }
  1631. }
  1632. }
  1633. }
  1634. }
  1635. }
  1636. dprintf("--------------------------------------\n");
  1637. }
  1638. #endif // DOES NOT SUPPORT API64
  1639. /******************************Public*Routine******************************\
  1640. * vPrintSkeletonPFT
  1641. *
  1642. * History:
  1643. * Mon 29-Aug-1994 15:51:16 by Kirk Olynyk [kirko]
  1644. * Wrote it.
  1645. \**************************************************************************/
  1646. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  1647. VOID vPrintSkeletonPFT( PFT *pLocalPFT )
  1648. {
  1649. PFF *pPFFr, **ppPFFl, **ppPFFl_, *pPFFNext ,*pHeapPFF;
  1650. dprintf("pfhFamily = %-#x\n" , pLocalPFT->pfhFamily );
  1651. dprintf("pfhFace = %-#x\n" , pLocalPFT->pfhFace );
  1652. dprintf("cBuckets = %u\n" , pLocalPFT->cBuckets );
  1653. dprintf("cFiles = %u\n" , pLocalPFT->cFiles );
  1654. dprintf("\n\n");
  1655. for (
  1656. ppPFFl = pLocalPFT->apPFF
  1657. , ppPFFl_ = pLocalPFT->apPFF + pLocalPFT->cBuckets
  1658. ; ppPFFl < ppPFFl_
  1659. ; ppPFFl++
  1660. ) {
  1661. // if the bucket is empty skip to the next otherwise print
  1662. // the bucket number and then print the contents of all
  1663. // the PFF's hanging off the bucket.
  1664. if (!(pPFFr = *ppPFFl))
  1665. continue;
  1666. dprintf("apPFF[%u]\n", ppPFFl - pLocalPFT->apPFF);
  1667. while ( pPFFr ) {
  1668. // get the size of the remote PFF and allocate enough space
  1669. // on the heap
  1670. dprintf(" %-#8x", pPFFr);
  1671. PFF FramePFF;
  1672. move(FramePFF, pPFFr);
  1673. if (pHeapPFF = tmalloc(PFF,FramePFF.sizeofThis)) {
  1674. // get a local copy of the PFF and fix up the sting pointer
  1675. // to point to the address in the local heap then print
  1676. // the local copy. Some of the addresses in the local
  1677. // PFF point to remote object but vPrintSkeleton will
  1678. // take care of that. When we are done we free the memory.
  1679. move2(pHeapPFF, pPFFr, (ULONG)(ULONG_PTR)FramePFF.sizeofThis);
  1680. PFFOBJ pffo(pHeapPFF);
  1681. pHeapPFF->pwszPathname_ = pffo.pwszCalcPathname();
  1682. vPrintSkeletonPFF(
  1683. pHeapPFF
  1684. );
  1685. tfree(pHeapPFF);
  1686. }
  1687. else {
  1688. dprintf("Allocation failure\n");
  1689. break;
  1690. }
  1691. pPFFr = FramePFF.pPFFNext;
  1692. }
  1693. }
  1694. }
  1695. #endif // DOES NOT SUPPORT API64
  1696. /******************************Public*Routine******************************\
  1697. *
  1698. * History:
  1699. * 21-Feb-1995 -by- Lingyun Wang [lingyunw]
  1700. * Wrote it.
  1701. \**************************************************************************/
  1702. DECLARE_API( pft )
  1703. {
  1704. dprintf("Extension 'pft' is not converted.\n");
  1705. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  1706. PARSE_POINTER(pft_help);
  1707. Gdidpft((PFT *) arg);
  1708. return;
  1709. pft_help:
  1710. dprintf ("Usage: pft [-?] pointer to PFT\n");
  1711. #endif // DOES NOT SUPPORT API64
  1712. EXIT_API(S_OK);
  1713. }
  1714. /******************************Public*Routine******************************\
  1715. * dpft
  1716. *
  1717. * History:
  1718. * Mon 29-Aug-1994 15:39:39 by Kirk Olynyk [kirko]
  1719. * Wrote it.
  1720. \**************************************************************************/
  1721. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  1722. VOID Gdidpft( PFT *pRemotePFT)
  1723. {
  1724. ULONG size;
  1725. PFT LocalPFT, *pLocalPFT;
  1726. move(LocalPFT, pRemotePFT);
  1727. size = offsetof(PFT, apPFF[0]) + LocalPFT.cBuckets * sizeof(PFF *);
  1728. if (pLocalPFT = tmalloc(PFT, size)) {
  1729. move2(pLocalPFT, pRemotePFT, size);
  1730. vDumpPFT(pLocalPFT, pRemotePFT);
  1731. tfree(pLocalPFT);
  1732. } else
  1733. dprintf("dpft error --- failed to allocate memory\n");
  1734. dprintf("\n");
  1735. }
  1736. #endif // DOES NOT SUPPORT API64
  1737. /******************************Public*Routine******************************\
  1738. * dpubft
  1739. *
  1740. * dumps the public font table
  1741. *
  1742. * History:
  1743. * Thu 01-Sep-1994 23:20:54 by Kirk Olynyk [kirko]
  1744. * Wrote it.
  1745. \**************************************************************************/
  1746. DECLARE_API( pubft )
  1747. {
  1748. dprintf("Extension 'pubft' is not converted.\n");
  1749. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  1750. PFT * pft;
  1751. PARSE_ARGUMENTS(pubft_help);
  1752. GetValue (pft, "win32k!gpPFTPublic");
  1753. Gdidpft(pft);
  1754. return;
  1755. pubft_help:
  1756. dprintf("Usage: pubft [-?]\n");
  1757. //check that this is true
  1758. dprintf("Equivalent to pft win32k!gpPFTPublic\n");
  1759. #endif // DOES NOT SUPPORT API64
  1760. EXIT_API(S_OK);
  1761. }
  1762. /******************************Public*Routine******************************\
  1763. * Gdidpvtft( )
  1764. *
  1765. * dumps the private PFT
  1766. *
  1767. * History:
  1768. * 01-Oct-1996 -by- Xudong Wu [TessieW]
  1769. * Wrote it.
  1770. \**************************************************************************/
  1771. DECLARE_API( pvtft )
  1772. {
  1773. dprintf("Extension 'pvtft' is not converted.\n");
  1774. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  1775. PFT * pft;
  1776. PARSE_ARGUMENTS(pvtft_help);
  1777. GetValue (pft, "win32k!gpPFTPrivate");
  1778. Gdidpft(pft);
  1779. return;
  1780. pvtft_help:
  1781. dprintf("Usage: pvtft [-?]\n");
  1782. //check that this is true
  1783. dprintf("Equivalent to pft win32k!gpPFTPrivate\n");
  1784. #endif // DOES NOT SUPPORT API64
  1785. EXIT_API(S_OK);
  1786. }
  1787. /******************************Public*Routine******************************\
  1788. * ddevft
  1789. *
  1790. * dumps the device font table
  1791. *
  1792. * History:
  1793. * Thu 01-Sep-1994 23:21:15 by Kirk Olynyk [kirko]
  1794. * Wrote it.
  1795. \**************************************************************************/
  1796. DECLARE_API( devft )
  1797. {
  1798. dprintf("Extension 'devft' is not converted.\n");
  1799. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  1800. PFT *pft;
  1801. PARSE_ARGUMENTS(devft_help);
  1802. GetValue (pft, "win32k!gpPFTDevice");
  1803. Gdidpft(pft);
  1804. return;
  1805. devft_help:
  1806. dprintf("Usage: devft [-?]\n");
  1807. //check that this is true
  1808. dprintf("Equivalent to pft win32k!gpPFTDevice\n");
  1809. #endif // DOES NOT SUPPORT API64
  1810. EXIT_API(S_OK);
  1811. }
  1812. /******************************Public*Routine******************************\
  1813. *
  1814. * History:
  1815. * Sat 23-Sep-1995 08:26:09 by Kirk Olynyk [kirko]
  1816. * Re-wrote it.
  1817. * 21-Feb-1995 -by- Lingyun Wang [lingyunw]
  1818. * Wrote it.
  1819. \**************************************************************************/
  1820. DECLARE_API( stro )
  1821. {
  1822. #define QUICK_FACE_NAME_LINKS 8
  1823. ULONG offset;
  1824. ULONG64 estrobjSrc;
  1825. ULONG cGlyphs; // Number of glyphs.
  1826. FLONG flAccel; // Accelerator flags exposed to the driver.
  1827. ULONG ulCharInc; // Non-zero if constant character increment.
  1828. RECTL rclBkGround; // Background rect of the string.
  1829. ULONG64 pgp; // Accelerator if all GLYPHPOS's are valid.
  1830. ULONG64 pwszOrg; // pointer to original unicode string.
  1831. ULONG cgposCopied; // For enumeration.
  1832. ULONG cgposPositionsEnumerated; // only used for enumerating positions in linked strings
  1833. ULONG64 prfo; // Remember our RFONTOBJ.
  1834. FLONG flTO; // flags
  1835. ULONG64 pgpos; // Pointer to the GLYPHPOS structures.
  1836. POINTFIX ptfxRef; // Reference point.
  1837. POINTFIX ptfxUpdate; // CP advancement for the string.
  1838. POINTFIX ptfxEscapement; // The total escapement vector.
  1839. RECTFX rcfx; // The TextBox, projected onto the base and ascent.
  1840. FIX fxExtent; // The Windows compatible text extent.
  1841. FIX xExtra; // computed in H3, G2,3 cases
  1842. FIX xBreakExtra; // computed in H3, G2,3 cases
  1843. DWORD dwCodePage; // accelerator for ps driver
  1844. ULONG cExtraRects; // Rectangles for underline
  1845. RECTL arclExtra[3]; // and strikeout.
  1846. RECTL rclBkGroundSave; // used to save a copy of BkGroundRect
  1847. ULONG64 pwcPartition; // For partitioning
  1848. ULONG64 plPartition; // Points to partitioning information
  1849. ULONG64 plNext; // Next glyph in font
  1850. ULONG64 pgpNext; // For enumeration
  1851. LONG lCurrentFont; // For enumeration
  1852. POINTL ptlBaseLineAdjust; // Used to adjust SysEUDC baseline
  1853. ULONG cTTSysGlyphs; // Number of TT system font glyphs in a string
  1854. ULONG cSysGlyphs; // Number of system eudc glyphs in a string.
  1855. ULONG cDefGlyphs; // Number of default eudc glyphs in a string.
  1856. ULONG cNumFaceNameLinks; // Number of linked face name eudc in a string .
  1857. ULONG64 pacFaceNameGlyphs; // Pointer to array of number of face name glyphs.
  1858. ULONG acFaceNameGlyphs[QUICK_FACE_NAME_LINKS];
  1859. FLONG fl;
  1860. FLAGDEF *pfd;
  1861. WCHAR *awc;
  1862. int i;
  1863. BOOL Header=FALSE;
  1864. BOOL Position=FALSE;
  1865. BOOL East=FALSE;
  1866. PARSE_POINTER(stro_help);
  1867. estrobjSrc= arg;
  1868. if(parse_iFindSwitch(tokens, ntok, 'p')!=-1) {Position=TRUE;}
  1869. if(parse_iFindSwitch(tokens, ntok, 'h')!=-1) {Header=TRUE;}
  1870. if(parse_iFindSwitch(tokens, ntok, 'e')!=-1) {East=TRUE;}
  1871. if(!(Position||East||Header)) {Header=TRUE;}
  1872. if(East) {Header=TRUE;}
  1873. if (Header) {
  1874. GetESTROBJFieldAndOffset(cGlyphs);
  1875. dprintf("[%-#p] cGlyphs %-#x\n", estrobjSrc+offset , cGlyphs );
  1876. GetESTROBJFieldAndOffset(flAccel);
  1877. dprintf("[%-#p] flAccel %-#x\n", estrobjSrc+offset , flAccel );
  1878. for (fl=flAccel, pfd=afdSO; pfd->psz; pfd++)
  1879. if (fl & pfd->fl) {
  1880. dprintf("\t\t%s\n", pfd->psz);
  1881. fl &= ~pfd->fl;
  1882. }
  1883. GetESTROBJFieldAndOffset(ulCharInc);
  1884. dprintf("[%-#p] ulCharInc %-#x=%u\n", estrobjSrc+offset , ulCharInc , ulCharInc );
  1885. GetESTROBJFieldAndOffset(rclBkGround.left);
  1886. dprintf("[%-#p] rclBkGround.left %-#x=%d\n", estrobjSrc+offset , rclBkGround.left , rclBkGround.left );
  1887. GetESTROBJFieldAndOffset(rclBkGround.top);
  1888. dprintf("[%-#p] rclBkGround.top %-#x=%d\n", estrobjSrc+offset , rclBkGround.top , rclBkGround.top );
  1889. GetESTROBJFieldAndOffset(rclBkGround.right);
  1890. dprintf("[%-#p] rclBkGround.right %-#x=%d\n", estrobjSrc+offset , rclBkGround.right , rclBkGround.right );
  1891. GetESTROBJFieldAndOffset(rclBkGround.bottom);
  1892. dprintf("[%-#p] rclBkGround.bottom %-#x=%d\n", estrobjSrc+offset , rclBkGround.bottom , rclBkGround.bottom );
  1893. GetESTROBJFieldAndOffset(pgp);
  1894. dprintf("[%-#p] pgp %-#x\n", estrobjSrc+offset , pgp );
  1895. GetESTROBJFieldAndOffset(pwszOrg);
  1896. awc = (WCHAR*) adw;
  1897. awc[0] = 0;
  1898. if (pwszOrg && cGlyphs < 256) {
  1899. ReadMemory((ULONG_PTR) pwszOrg, adw, cGlyphs * sizeof(WCHAR), 0);
  1900. awc[255] = 0;
  1901. }
  1902. dprintf("[%-#p] pwszOrg %-#x ", estrobjSrc+offset, pwszOrg);
  1903. GetESTROBJFieldAndOffset(prfo);
  1904. if (awc[0] && prfo) {
  1905. #if 0
  1906. if (offsetof(RFONTOBJ,prfnt) != 0)
  1907. dprintf("\noffsetof(RFONTOBJ,prfnt) != 0\n");
  1908. else
  1909. #endif
  1910. {
  1911. ULONG64 foSrc;
  1912. FLONG flType; // Cache type -
  1913. GetFieldData(prfo, "PVOID", NULL, sizeof(foSrc), &foSrc);
  1914. GetRFONTFieldAndOffset( flType);
  1915. WCHAR wc, *pwc;
  1916. USHORT *pus, *pusStnl;
  1917. switch (flType & (RFONT_TYPE_UNICODE | RFONT_TYPE_HGLYPH)) {
  1918. case RFONT_TYPE_UNICODE:
  1919. dprintf("%c", '\"');
  1920. for (pwc = awc; wc = *pwc; pwc++) {
  1921. if (wc < 256 )
  1922. dprintf("%c", isprint((int)wc) ? (char) wc : 250);
  1923. else
  1924. dprintf("\\u%04X", wc);
  1925. }
  1926. dprintf("\"\n");
  1927. break;
  1928. case RFONT_TYPE_HGLYPH:
  1929. for (pwc = awc; wc = *pwc; pwc++)
  1930. dprintf("\t\t\t\tu%04X", wc);
  1931. dprintf("\n");
  1932. break;
  1933. default:
  1934. dprintf(" flType = %-#x [unknown string type]\n", flType);
  1935. break;
  1936. }
  1937. }
  1938. } else
  1939. dprintf("\n");
  1940. }
  1941. if (East) {
  1942. GetESTROBJFieldAndOffset(cgposCopied);
  1943. dprintf("[%-#p] cgposCopied %-#x\n", estrobjSrc+offset , cgposCopied );
  1944. GetESTROBJFieldAndOffset(cgposPositionsEnumerated);
  1945. dprintf("[%-#p] cgposPositionsEnumerated %-#x\n", estrobjSrc+offset , cgposPositionsEnumerated );
  1946. GetESTROBJFieldAndOffset(prfo);
  1947. dprintf("[%-#p] prfo %-#p\n", estrobjSrc+offset , prfo );
  1948. GetESTROBJFieldAndOffset(flTO);
  1949. dprintf("[%-#p] flTO %-#x\n", estrobjSrc+offset , flTO );
  1950. for (fl=flTO, pfd=afdTO; pfd->psz; pfd++)
  1951. if (fl & pfd->fl) {
  1952. dprintf("\t\t%s\n", pfd->psz);
  1953. fl &= ~pfd->fl;
  1954. }
  1955. GetESTROBJFieldAndOffset(pgpos);
  1956. dprintf("[%-#p] pgpos %-#p\n", estrobjSrc+offset , pgpos );
  1957. GetESTROBJFieldAndOffset(ptfxRef.x);
  1958. dprintf("[%-#p] ptfxRef.x %-#x\n", estrobjSrc+offset , ptfxRef.x );
  1959. GetESTROBJFieldAndOffset(ptfxRef.y);
  1960. dprintf("[%-#p] ptfxRef.y %-#x\n", estrobjSrc+offset , ptfxRef.y );
  1961. GetESTROBJFieldAndOffset(ptfxUpdate.x);
  1962. dprintf("[%-#p] ptfxUpdate.x %-#x\n", estrobjSrc+offset , ptfxUpdate.x );
  1963. GetESTROBJFieldAndOffset(ptfxUpdate.y);
  1964. dprintf("[%-#p] ptfxUpdate.y %-#x\n", estrobjSrc+offset , ptfxUpdate.y );
  1965. GetESTROBJFieldAndOffset(ptfxEscapement.x);
  1966. dprintf("[%-#p] ptfxEscapement.x %-#x\n", estrobjSrc+offset , ptfxEscapement.x );
  1967. GetESTROBJFieldAndOffset(ptfxEscapement.y);
  1968. dprintf("[%-#p] ptfxEscapement.y %-#x\n", estrobjSrc+offset , ptfxEscapement.y );
  1969. GetESTROBJFieldAndOffset(rcfx.xLeft);
  1970. dprintf("[%-#p] rcfx.xLeft %-#x\n", estrobjSrc+offset , rcfx.xLeft );
  1971. GetESTROBJFieldAndOffset(rcfx.yTop);
  1972. dprintf("[%-#p] rcfx.yTop %-#x\n", estrobjSrc+offset , rcfx.yTop );
  1973. GetESTROBJFieldAndOffset(rcfx.xRight);
  1974. dprintf("[%-#p] rcfx.xRight %-#x\n", estrobjSrc+offset , rcfx.xRight );
  1975. GetESTROBJFieldAndOffset(rcfx.yBottom);
  1976. dprintf("[%-#p] rcfx.yBottom %-#x\n", estrobjSrc+offset , rcfx.yBottom );
  1977. GetESTROBJFieldAndOffset(fxExtent);
  1978. dprintf("[%-#p] fxExtent %-#x\n", estrobjSrc+offset , fxExtent );
  1979. GetESTROBJFieldAndOffset(xExtra);
  1980. dprintf("[%-#p] xExtra %-#x\n", estrobjSrc+offset , xExtra );
  1981. GetESTROBJFieldAndOffset(xBreakExtra);
  1982. dprintf("[%-#p] xBreakExtra %-#x\n", estrobjSrc+offset , xBreakExtra );
  1983. GetESTROBJFieldAndOffset(dwCodePage);
  1984. dprintf("[%-#p] dwCodePage %-#x=%u\n", estrobjSrc+offset , dwCodePage , dwCodePage );
  1985. GetESTROBJFieldAndOffset(cExtraRects);
  1986. dprintf("[%-#p] cExtraRects %-#x=%u\n", estrobjSrc+offset , cExtraRects , cExtraRects );
  1987. GetESTROBJFieldAndOffset(arclExtra[0].left);
  1988. dprintf("[%-#p] arclExtra[0].left %-#x=%d\n", estrobjSrc+offset , arclExtra[0].left , arclExtra[0].left );
  1989. GetESTROBJFieldAndOffset(arclExtra[0].top);
  1990. dprintf("[%-#p] arclExtra[0].top %-#x=%d\n", estrobjSrc+offset , arclExtra[0].top , arclExtra[0].top );
  1991. GetESTROBJFieldAndOffset(arclExtra[0].right);
  1992. dprintf("[%-#p] arclExtra[0].right %-#x=%d\n", estrobjSrc+offset , arclExtra[0].right , arclExtra[0].right );
  1993. GetESTROBJFieldAndOffset(arclExtra[0].bottom);
  1994. dprintf("[%-#p] arclExtra[0].bottom %-#x=%d\n", estrobjSrc+offset , arclExtra[0].bottom , arclExtra[0].bottom );
  1995. GetESTROBJFieldAndOffset(arclExtra[1].left);
  1996. dprintf("[%-#p] arclExtra[1].left %-#x=%d\n", estrobjSrc+offset , arclExtra[1].left , arclExtra[1].left );
  1997. GetESTROBJFieldAndOffset(arclExtra[1].top);
  1998. dprintf("[%-#p] arclExtra[1].top %-#x=%d\n", estrobjSrc+offset , arclExtra[1].top , arclExtra[1].top );
  1999. GetESTROBJFieldAndOffset(arclExtra[1].right);
  2000. dprintf("[%-#p] arclExtra[1].right %-#x=%d\n", estrobjSrc+offset , arclExtra[1].right , arclExtra[1].right );
  2001. GetESTROBJFieldAndOffset(arclExtra[1].bottom);
  2002. dprintf("[%-#p] arclExtra[1].bottom %-#x=%d\n", estrobjSrc+offset , arclExtra[1].bottom , arclExtra[1].bottom );
  2003. GetESTROBJFieldAndOffset(arclExtra[2].left);
  2004. dprintf("[%-#p] arclExtra[2].left %-#x=%d\n", estrobjSrc+offset , arclExtra[2].left , arclExtra[2].left );
  2005. GetESTROBJFieldAndOffset(arclExtra[2].top);
  2006. dprintf("[%-#p] arclExtra[2].top %-#x=%d\n", estrobjSrc+offset , arclExtra[2].top , arclExtra[2].top );
  2007. GetESTROBJFieldAndOffset(arclExtra[2].right);
  2008. dprintf("[%-#p] arclExtra[2].right %-#x=%d\n", estrobjSrc+offset , arclExtra[2].right , arclExtra[2].right );
  2009. GetESTROBJFieldAndOffset(arclExtra[2].bottom);
  2010. dprintf("[%-#p] arclExtra[2].bottom %-#x=%d\n", estrobjSrc+offset , arclExtra[2].bottom , arclExtra[2].bottom );
  2011. GetESTROBJFieldAndOffset(rclBkGroundSave.top);
  2012. dprintf("[%-#p] rclBkGroundSave.top %-#x=%d\n", estrobjSrc+offset , rclBkGroundSave.top , rclBkGroundSave.top );
  2013. GetESTROBJFieldAndOffset(rclBkGroundSave.left);
  2014. dprintf("[%-#p] rclBkGroundSave.left %-#x=%d\n", estrobjSrc+offset , rclBkGroundSave.left , rclBkGroundSave.left );
  2015. GetESTROBJFieldAndOffset(rclBkGroundSave.right);
  2016. dprintf("[%-#p] rclBkGroundSave.right %-#x=%d\n", estrobjSrc+offset , rclBkGroundSave.right , rclBkGroundSave.right );
  2017. GetESTROBJFieldAndOffset(rclBkGroundSave.bottom);
  2018. dprintf("[%-#p] rclBkGroundSave.bottom %-#x=%d\n", estrobjSrc+offset, rclBkGroundSave.bottom, rclBkGroundSave.bottom);
  2019. GetESTROBJFieldAndOffset(pwcPartition);
  2020. dprintf("[%-#p] pwcPartition %-#p\n", estrobjSrc+offset , pwcPartition );
  2021. GetESTROBJFieldAndOffset(plPartition);
  2022. dprintf("[%-#p] plPartition %-#p\n", estrobjSrc+offset , plPartition );
  2023. GetESTROBJFieldAndOffset(plNext);
  2024. dprintf("[%-#p] plNext %-#p\n", estrobjSrc+offset , plNext );
  2025. GetESTROBJFieldAndOffset(pgpNext);
  2026. dprintf("[%-#p] pgpNext %-#p\n", estrobjSrc+offset , pgpNext );
  2027. GetESTROBJFieldAndOffset(lCurrentFont);
  2028. dprintf("[%-#p] lCurrentFont %-#x\n", estrobjSrc+offset , lCurrentFont );
  2029. GetESTROBJFieldAndOffset(ptlBaseLineAdjust.x);
  2030. dprintf("[%-#p] ptlBaseLineAdjust.x %-#x\n", estrobjSrc+offset , ptlBaseLineAdjust.x );
  2031. GetESTROBJFieldAndOffset(ptlBaseLineAdjust.y);
  2032. dprintf("[%-#p] ptlBaseLineAdjust.y %-#x\n", estrobjSrc+offset , ptlBaseLineAdjust.y );
  2033. GetESTROBJFieldAndOffset(cTTSysGlyphs);
  2034. dprintf("[%-#p] cTTSysGlyphs %-#x\n", estrobjSrc+offset , cTTSysGlyphs );
  2035. GetESTROBJFieldAndOffset(cSysGlyphs);
  2036. dprintf("[%-#p] cSysGlyphs %-#x\n", estrobjSrc+offset , cSysGlyphs );
  2037. GetESTROBJFieldAndOffset(cDefGlyphs);
  2038. dprintf("[%-#p] cDefGlyphs %-#x\n", estrobjSrc+offset , cDefGlyphs );
  2039. GetESTROBJFieldAndOffset(cNumFaceNameLinks);
  2040. dprintf("[%-#p] cNumFaceNameLinks %-#x\n", estrobjSrc+offset , cNumFaceNameLinks );
  2041. GetESTROBJFieldAndOffset(pacFaceNameGlyphs);
  2042. dprintf("[%-#p] pacFaceNameGlyphs %-#p\n", estrobjSrc+offset , pacFaceNameGlyphs );
  2043. GetESTROBJFieldAndOffset(acFaceNameGlyphs[0]);
  2044. dprintf("[%-#p] acFaceNameGlyphs[%d] %-#x\n", estrobjSrc+offset, 0, acFaceNameGlyphs[0] );
  2045. GetESTROBJFieldAndOffset(acFaceNameGlyphs[1]);
  2046. dprintf("[%-#p] acFaceNameGlyphs[%d] %-#x\n", estrobjSrc+offset, 1, acFaceNameGlyphs[1] );
  2047. GetESTROBJFieldAndOffset(acFaceNameGlyphs[2]);
  2048. dprintf("[%-#p] acFaceNameGlyphs[%d] %-#x\n", estrobjSrc+offset, 2, acFaceNameGlyphs[2] );
  2049. GetESTROBJFieldAndOffset(acFaceNameGlyphs[3]);
  2050. dprintf("[%-#p] acFaceNameGlyphs[%d] %-#x\n", estrobjSrc+offset, 3, acFaceNameGlyphs[3] );
  2051. GetESTROBJFieldAndOffset(acFaceNameGlyphs[4]);
  2052. dprintf("[%-#p] acFaceNameGlyphs[%d] %-#x\n", estrobjSrc+offset, 4, acFaceNameGlyphs[4] );
  2053. GetESTROBJFieldAndOffset(acFaceNameGlyphs[5]);
  2054. dprintf("[%-#p] acFaceNameGlyphs[%d] %-#x\n", estrobjSrc+offset, 5, acFaceNameGlyphs[5] );
  2055. GetESTROBJFieldAndOffset(acFaceNameGlyphs[6]);
  2056. dprintf("[%-#p] acFaceNameGlyphs[%d] %-#x\n", estrobjSrc+offset, 6, acFaceNameGlyphs[6] );
  2057. GetESTROBJFieldAndOffset(acFaceNameGlyphs[7]);
  2058. dprintf("[%-#p] acFaceNameGlyphs[%d] %-#x\n", estrobjSrc+offset, 7, acFaceNameGlyphs[7] );
  2059. }
  2060. if (Position) {
  2061. /* GLYPHPOS: */
  2062. ULONG hg, i;
  2063. ULONG64 pgdf;
  2064. POINTL ptl;
  2065. /* GLYPHDEF */
  2066. ULONG64 pgb = 0;
  2067. ULONG64 glyphposSrc, sizeOfGlyphPos;
  2068. sizeOfGlyphPos = GetTypeSize("GLYPHPOS");
  2069. GetESTROBJFieldAndOffset(rclBkGround.left);
  2070. GetESTROBJFieldAndOffset(rclBkGround.top);
  2071. GetESTROBJFieldAndOffset(rclBkGround.right);
  2072. GetESTROBJFieldAndOffset(rclBkGround.bottom);
  2073. GetESTROBJFieldAndOffset(cGlyphs);
  2074. GetESTROBJFieldAndOffset(pgp);
  2075. glyphposSrc = pgp;
  2076. dprintf(" ---------- ---------- ---------- ----------\n");
  2077. dprintf(" HGLYPH GLYPHBITS* x y\n");
  2078. dprintf(" ---------- ---------- ---------- ----------\n");
  2079. for (i = 0; i < cGlyphs; i++) {
  2080. char *pszOutOfBounds = "";
  2081. GetGLYPHPOSFieldAndOffset(pgdf);
  2082. GetGLYPHPOSFieldAndOffset(hg);
  2083. GetGLYPHPOSFieldAndOffset(ptl.x);
  2084. GetGLYPHPOSFieldAndOffset(ptl.y);
  2085. if (pgdf) {
  2086. POINTL ptlOrigin;
  2087. SIZEL sizlBitmap;
  2088. BYTE aj[1];
  2089. ULONG64 glyphdefSrc = pgdf;
  2090. GetGLYPHDEFFieldAndOffset(pgb);
  2091. if (pgb) {
  2092. RECT rcGlyph;
  2093. ULONG64 glyphbitsSrc = pgb;
  2094. GetGLYPHBITSFieldAndOffset(ptlOrigin.x);
  2095. GetGLYPHBITSFieldAndOffset(ptlOrigin.y);
  2096. GetGLYPHBITSFieldAndOffset(sizlBitmap.cx);
  2097. GetGLYPHBITSFieldAndOffset(sizlBitmap.cy);
  2098. rcGlyph.left = ptl.x + ptlOrigin.x;
  2099. rcGlyph.top = ptl.y + ptlOrigin.y;
  2100. rcGlyph.right = rcGlyph.left + sizlBitmap.cx;
  2101. rcGlyph.bottom = rcGlyph.top + sizlBitmap.cy;
  2102. if (
  2103. ( rcGlyph.left < rclBkGround.left ) ||
  2104. ( rcGlyph.right > rclBkGround.right ) ||
  2105. ( rcGlyph.top < rclBkGround.top ) ||
  2106. ( rcGlyph.bottom > rclBkGround.bottom )
  2107. )
  2108. {
  2109. pszOutOfBounds = " *** out of bounds ***";
  2110. }
  2111. } /* if (pgb) */
  2112. } /* if (pgdf) */
  2113. dprintf(
  2114. " %-#10x %-#18p %-10d %-10d%s\n"
  2115. , hg
  2116. , pgb // print the CONTENTS of the GLYPHDEF
  2117. , ptl.x
  2118. , ptl.y
  2119. , pszOutOfBounds
  2120. );
  2121. glyphposSrc += sizeOfGlyphPos;
  2122. } /* for */
  2123. dprintf(" ---------- ---------- ---------- ----------\n\n");
  2124. }
  2125. EXIT_API(S_OK);
  2126. stro_help:
  2127. dprintf("!gdikdx.stro [-p] address\n"
  2128. "-? print this message\n"
  2129. "-p print glyph positions\n"
  2130. "-h print header\n"
  2131. "-e far east\n");
  2132. EXIT_API(S_OK);
  2133. }
  2134. /******************************Public*Routine******************************\
  2135. *
  2136. * Routine Name:
  2137. *
  2138. * dstro
  2139. *
  2140. \**************************************************************************/
  2141. DECLARE_API( dstro )
  2142. {
  2143. dprintf("Extension 'dstro' is not converted.\n");
  2144. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  2145. dprintf("\n\n");
  2146. dprintf("gdikdx.dstro will soon be replaced by gdikdx.stro\n");
  2147. dprintf("\n\n");
  2148. stro(hCurrentProcess, hCurrentThread, dwCurrentPc, dwProcessor, args);
  2149. #endif // DOES NOT SUPPORT API64
  2150. EXIT_API(S_OK);
  2151. }
  2152. /******************************Public*Routine******************************\
  2153. *
  2154. * Dumps monochrome bitmaps.
  2155. *
  2156. * History:
  2157. * Sat 23-Sep-1995 08:26:43 by Kirk Olynyk [kirko]
  2158. * Re-wrote it.
  2159. * 21-Feb-1995 -by- Lingyun Wang [lingyunw]
  2160. * Wrote it.
  2161. \**************************************************************************/
  2162. DECLARE_API( gb )
  2163. {
  2164. #define CH_TOP_LEFT_CORNER '\xDA'
  2165. #define CH_HORIZONTAL_BAR '\xC4'
  2166. #define CH_VERTICAL_BAR '\xB3'
  2167. #define CH_PIXEL_ON '\x02'
  2168. #define CH_PIXEL_OFF '\xFA'
  2169. #define CH_GARBAGE '+'
  2170. ULONG64 glyphbitsSrc;
  2171. ULONG offset;
  2172. BYTE j, *pj8, *pj, *pjNext, *pjEnd;
  2173. int i, k, cj, cjScan, c4, c8, cLast;
  2174. char *pch;
  2175. POINTL ptlOrigin;
  2176. SIZEL sizlBitmap;
  2177. BYTE aj[1];
  2178. BOOL Gray=FALSE;
  2179. BOOL Mono=FALSE;
  2180. BOOL Header=FALSE;
  2181. PARSE_POINTER(gb_help);
  2182. if(parse_iFindSwitch(tokens, ntok, 'h')!=-1) {Header=TRUE;}
  2183. if(parse_iFindSwitch(tokens, ntok, 'm')!=-1) {Mono=TRUE;}
  2184. if(parse_iFindSwitch(tokens, ntok, 'g')!=-1) {Gray=TRUE;}
  2185. if(Mono&&Gray) {
  2186. Gray=FALSE;
  2187. dprintf("cannot have Monochrome and Gray simultaneously\n"
  2188. "assuming Monochrome\n");
  2189. }
  2190. if(!(Header||Mono||Gray)) {
  2191. Header=TRUE;
  2192. Mono=TRUE;
  2193. }
  2194. //arg from PARSE_POINTER() above.
  2195. glyphbitsSrc = arg;
  2196. GetGLYPHBITSFieldAndOffset(ptlOrigin.x);
  2197. GetGLYPHBITSFieldAndOffset(ptlOrigin.y);
  2198. GetGLYPHBITSFieldAndOffset(sizlBitmap.cx);
  2199. GetGLYPHBITSFieldAndOffset(sizlBitmap.cy);
  2200. // header information
  2201. if (Header) {
  2202. dprintf(
  2203. "ptlOrigin = (%d,%d)\n"
  2204. "sizlBitmap = (%d,%d)\n"
  2205. "\n\n"
  2206. , ptlOrigin.x
  2207. , ptlOrigin.y
  2208. , sizlBitmap.cx
  2209. , sizlBitmap.cy
  2210. );
  2211. }
  2212. // do stuff common to monochrome and gray glyphs
  2213. if (Mono||Gray) {
  2214. if ( sizlBitmap.cx > 150 ) {
  2215. dprintf("\nBitmap is wider than 150 characters\n");
  2216. EXIT_API(S_OK);
  2217. }
  2218. // cjScan = number of bytes per scan
  2219. if (Mono) {
  2220. cjScan = (sizlBitmap.cx + 7)/8; // 8 pixels per byte
  2221. } else
  2222. cjScan = (sizlBitmap.cx + 1)/2; // 2 pixels per byte
  2223. // cj = number of bytes in image bits (excluding header)
  2224. if ( ( cj = cjScan * sizlBitmap.cy ) > sizeof(adw) ) {
  2225. dprintf( "\nThe bits will blow out the buffer\n" );
  2226. EXIT_API(S_OK);
  2227. }
  2228. GetGLYPHBITSFieldAndOffset(aj[0]);
  2229. ReadMemory((ULONG_PTR) (glyphbitsSrc + offset), adw, cj, NULL);
  2230. dprintf("\n\n "); // leave space for number and vertical bar
  2231. for (i = 0, k = 0; i < sizlBitmap.cx; i++, k++) {
  2232. k = (k > 9) ? 0 : k; // print x-coordinates (mod 10)
  2233. dprintf("%1d", k);
  2234. } // go to new line
  2235. dprintf("\n %c",CH_TOP_LEFT_CORNER); // leave space for number
  2236. for (i = 0; i < sizlBitmap.cx; i++) // and then mark corner
  2237. dprintf("%c",CH_HORIZONTAL_BAR); // fill out horizontal line
  2238. dprintf("\n"); // move down to scan output
  2239. }
  2240. // monochrome glyph
  2241. if (Mono)
  2242. {
  2243. static char ach[16*4] = {
  2244. CH_PIXEL_OFF, CH_PIXEL_OFF, CH_PIXEL_OFF, CH_PIXEL_OFF,
  2245. CH_PIXEL_OFF, CH_PIXEL_OFF, CH_PIXEL_OFF, CH_PIXEL_ON ,
  2246. CH_PIXEL_OFF, CH_PIXEL_OFF, CH_PIXEL_ON , CH_PIXEL_OFF,
  2247. CH_PIXEL_OFF, CH_PIXEL_OFF, CH_PIXEL_ON , CH_PIXEL_ON ,
  2248. CH_PIXEL_OFF, CH_PIXEL_ON , CH_PIXEL_OFF, CH_PIXEL_OFF,
  2249. CH_PIXEL_OFF, CH_PIXEL_ON , CH_PIXEL_OFF, CH_PIXEL_ON ,
  2250. CH_PIXEL_OFF, CH_PIXEL_ON , CH_PIXEL_ON , CH_PIXEL_OFF,
  2251. CH_PIXEL_OFF, CH_PIXEL_ON , CH_PIXEL_ON , CH_PIXEL_ON ,
  2252. CH_PIXEL_ON , CH_PIXEL_OFF, CH_PIXEL_OFF, CH_PIXEL_OFF,
  2253. CH_PIXEL_ON , CH_PIXEL_OFF, CH_PIXEL_OFF, CH_PIXEL_ON ,
  2254. CH_PIXEL_ON , CH_PIXEL_OFF, CH_PIXEL_ON , CH_PIXEL_OFF,
  2255. CH_PIXEL_ON , CH_PIXEL_OFF, CH_PIXEL_ON , CH_PIXEL_ON ,
  2256. CH_PIXEL_ON , CH_PIXEL_ON , CH_PIXEL_OFF, CH_PIXEL_OFF,
  2257. CH_PIXEL_ON , CH_PIXEL_ON , CH_PIXEL_OFF, CH_PIXEL_ON ,
  2258. CH_PIXEL_ON , CH_PIXEL_ON , CH_PIXEL_ON , CH_PIXEL_OFF,
  2259. CH_PIXEL_ON , CH_PIXEL_ON , CH_PIXEL_ON , CH_PIXEL_ON
  2260. };
  2261. i = sizlBitmap.cx;
  2262. c8 = i / 8; // c8 = number of whole bytes
  2263. i = i % 8; // i = remaining number of pixels = 0..7
  2264. c4 = i / 4; // number of whole nybbles = 0..1
  2265. cLast = i % 4; // remaining number of pixels = 0..3
  2266. // k = row number
  2267. // pjEnd = pointer to address of scan beyond last scan
  2268. // pjNext = pointer to next scan
  2269. // pj = pointer to current byte
  2270. // for each scan ...
  2271. for (
  2272. pj = (BYTE*)adw, pjNext=pj+cjScan , pjEnd=pjNext+cj, k=0 ;
  2273. pjNext < pjEnd ;
  2274. pj=pjNext , pjNext+=cjScan, k++
  2275. )
  2276. {
  2277. if (CheckControlC())
  2278. EXIT_API(S_OK);
  2279. k = (k > 9) ? 0 : k;
  2280. // print row number (mod 10) followed by a vertical bar ...
  2281. dprintf("%1d%c",k,CH_VERTICAL_BAR);
  2282. // then do the pixels of the scan ...
  2283. // whole bytes first ...
  2284. for (pj8 = pj+c8 ; pj < pj8; pj++)
  2285. {
  2286. // high nybble first ...
  2287. pch = ach + 4 * (*pj >> 4);
  2288. dprintf("%c%c%c%c",pch[0],pch[1],pch[2],pch[3]);
  2289. // low nybble next ...
  2290. pch = ach + 4 * (*pj & 0xf);
  2291. dprintf("%c%c%c%c",pch[0],pch[1],pch[2],pch[3]);
  2292. }
  2293. // last partial byte ...
  2294. if (c4 || cLast)
  2295. {
  2296. // high nybble first ...
  2297. pch = ach + 4 * (*pj >> 4);
  2298. if (c4)
  2299. {
  2300. // print the entire high nybble ...
  2301. dprintf("%c%c%c%c",pch[0],pch[1],pch[2],pch[3]);
  2302. // go to the low nybble ...
  2303. pch = ach + 4 * (*pj & 0xf);
  2304. }
  2305. // last partial nybble ...
  2306. switch(cLast)
  2307. {
  2308. case 3: dprintf("%c",*pch++);
  2309. case 2: dprintf("%c",*pch++);
  2310. case 1: dprintf("%c",*pch);
  2311. }
  2312. //
  2313. // print any extraneous bits
  2314. //
  2315. for (j = *pj << i; j; j <<= 1)
  2316. {
  2317. if ( j & 0x80 )
  2318. {
  2319. dprintf("%c",CH_GARBAGE);
  2320. }
  2321. }
  2322. }
  2323. dprintf("\n");
  2324. }
  2325. }
  2326. // gray glyph
  2327. if (Gray)
  2328. {
  2329. static char achGray[16] = {
  2330. CH_PIXEL_OFF,
  2331. '1','2','3','4','5','6','7','8','9','a','b','c','d','e',
  2332. CH_PIXEL_ON
  2333. };
  2334. c8 = sizlBitmap.cx / 2; // number of whole bytes;
  2335. c4 = sizlBitmap.cx % 2; // number of whole nybbles;
  2336. // k = row number
  2337. // pjEnd = pointer to address of scan beyond last scan
  2338. // pjNext = pointer to next scan
  2339. // pj = pointer to current byte
  2340. // for each scan ...
  2341. for (
  2342. pj = (BYTE*)adw, pjNext=pj+cjScan , pjEnd=pjNext+cj, k=0 ;
  2343. pjNext < pjEnd ;
  2344. pj=pjNext , pjNext+=cjScan, k++
  2345. )
  2346. {
  2347. if (CheckControlC())
  2348. EXIT_API(S_OK);
  2349. k = (k > 9) ? 0 : k;
  2350. // print row number (mod 10) followed by a vertical bar ...
  2351. dprintf("%1d%c",k,CH_VERTICAL_BAR);
  2352. // then do the pixels of the scan ...
  2353. // whole bytes first ...
  2354. for (pj8 = pj+c8 ; pj < pj8; pj++)
  2355. dprintf("%c%c", achGray[*pj>>4], achGray[*pj & 0xf]);
  2356. // last partial byte ...
  2357. if (c4)
  2358. dprintf("%c", achGray[*pj >> 4]);
  2359. dprintf("\n");
  2360. }
  2361. }
  2362. EXIT_API(S_OK);
  2363. gb_help:
  2364. dprintf("Usage: gb [-?] [-g|-m] [-h] address\n"
  2365. " -? this message\n"
  2366. " -h print header\n"
  2367. " -m print monochrome bitmap\n"
  2368. " -g print 4-bpp bitmap\n"
  2369. "If no flags are supplied, -m -h assumed.\n"
  2370. "Cannot supply -m and -g together.");
  2371. EXIT_API(S_OK);
  2372. }
  2373. /******************************Public*Routine******************************\
  2374. *
  2375. * Routine Name:
  2376. *
  2377. * vDumpCOLORADJUSTMENT
  2378. *
  2379. \**************************************************************************/
  2380. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  2381. void vDumpCOLORADJUSTMENT(COLORADJUSTMENT *pdca, COLORADJUSTMENT *pdcaSrc)
  2382. {
  2383. FLAGDEF *pfd;
  2384. FLONG fl;
  2385. #define M3(aa,bb) \
  2386. dprintf("[%x] %s%-#x\n", &(pdcaSrc->##aa), (bb), pdca->##aa)
  2387. #define M2(aa,bb) \
  2388. dprintf("[%x] %s", &(pdcaSrc->##aa), (bb))
  2389. dprintf("\nCOLORADJUSTMENT\n address\n -------\n");
  2390. M3( caSize , "caSize " );
  2391. // caFlags
  2392. M3( caFlags , "caFlags " );
  2393. for ( fl = pdca->caFlags, pfd = afdCOLORADJUSTMENT; pfd->psz; pfd++)
  2394. if (fl & pfd->fl) {
  2395. dprintf("\t\t\t\t\t%s\n", pfd->psz);
  2396. fl &= ~pfd->fl;
  2397. }
  2398. if (fl)
  2399. dprintf("\t\t\t\t\tbad flags %-#x\n", fl);
  2400. M3( caIlluminantIndex, "caIlluminantIndex " );
  2401. M3( caRedGamma , "caRedGamma " );
  2402. M3( caGreenGamma , "caGreenGamma " );
  2403. M3( caBlueGamma , "caBlueGamma " );
  2404. M3( caReferenceBlack , "caReferenceBlack " );
  2405. M3( caReferenceWhite , "caReferenceWhite " );
  2406. M3( caContrast , "caContrast " );
  2407. M3( caBrightness , "caBrightness " );
  2408. M3( caColorfulness , "caColorfulness " );
  2409. M3( caRedGreenTint , "caRedGreenTint " );
  2410. dprintf("\n");
  2411. #undef M2
  2412. #undef M3
  2413. }
  2414. #endif // DOES NOT SUPPORT API64
  2415. /******************************Public*Routine******************************\
  2416. *
  2417. * History:
  2418. * 21-Feb-1995 -by- Lingyun Wang [lingyunw]
  2419. * Wrote it.
  2420. \**************************************************************************/
  2421. DECLARE_API( gdf )
  2422. {
  2423. dprintf("Extension 'gdf' is not converted.\n");
  2424. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  2425. GLYPHDEF gd;
  2426. PARSE_POINTER(gdf_help);
  2427. move(gd, arg);
  2428. dprintf("\n\nGLYPHDEF\n\n");
  2429. dprintf("[%x] %-#x\n", arg, gd.pgb);
  2430. dprintf("\n");
  2431. return;
  2432. gdf_help:
  2433. dprintf("Usage: gdf [-?] GLYPHDEF pointer\n");
  2434. #endif // DOES NOT SUPPORT API64
  2435. EXIT_API(S_OK);
  2436. }
  2437. /******************************Public*Routine******************************\
  2438. *
  2439. * Routine Name:
  2440. *
  2441. * vDumpGLYPHPOS
  2442. *
  2443. \**************************************************************************/
  2444. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  2445. void vDumpGLYPHPOS(GLYPHPOS *p1, GLYPHPOS *p0)
  2446. {
  2447. dprintf("\nGLYPHPOS\n\n");
  2448. dprintf("[%x] hg %-#x\n" , &p0->hg , p1->hg );
  2449. dprintf("[%x] pgdf %-#x\n" , &p0->pgdf, p1->pgdf);
  2450. dprintf("[%x] ptl %d %d\n", &p0->ptl , p1->ptl.x, p1->ptl.y);
  2451. dprintf("\n");
  2452. }
  2453. #endif // DOES NOT SUPPORT API64
  2454. /******************************Public*Routine******************************\
  2455. *
  2456. * Routine Name:
  2457. *
  2458. * gp
  2459. *
  2460. \**************************************************************************/
  2461. DECLARE_API( gp )
  2462. {
  2463. dprintf("Extension 'gp' is not converted.\n");
  2464. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  2465. GLYPHPOS gp;
  2466. PARSE_POINTER(gp_help);
  2467. move(gp,arg);
  2468. vDumpGLYPHPOS(&gp,(GLYPHPOS*)arg);
  2469. return;
  2470. gp_help:
  2471. dprintf("Usage: gp [-?] GLYPHPOS pointer\n");
  2472. #endif // DOES NOT SUPPORT API64
  2473. EXIT_API(S_OK);
  2474. }
  2475. /******************************Public*Routine******************************\
  2476. *
  2477. * Routine Name:
  2478. *
  2479. * ca
  2480. *
  2481. \**************************************************************************/
  2482. DECLARE_API( ca )
  2483. {
  2484. dprintf("Extension 'ca' is not converted.\n");
  2485. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  2486. COLORADJUSTMENT ca;
  2487. PARSE_POINTER(ca_help);
  2488. move(ca, arg);
  2489. vDumpCOLORADJUSTMENT(&ca, (COLORADJUSTMENT*) arg);
  2490. return;
  2491. ca_help:
  2492. dprintf("Usage: ca [-?] COLORADJUSTMENT pointer\n");
  2493. #endif // DOES NOT SUPPORT API64
  2494. EXIT_API(S_OK);
  2495. }
  2496. /******************************Public*Routine******************************\
  2497. *
  2498. * Routine Name:
  2499. *
  2500. * vDumpDATABLOCK
  2501. *
  2502. \**************************************************************************/
  2503. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  2504. void vDumpDATABLOCK(
  2505. DATABLOCK *p, // pointer to local DATABLOCK copy
  2506. DATABLOCK *p0 // pointer to original DATABLOCK on debug machine
  2507. )
  2508. {
  2509. dprintf( "\nDATABLOCK\n address\n -------\n" );
  2510. dprintf( "[%x] pdblNext %-#x\n", &(p0->pdblNext), p->pdblNext);
  2511. dprintf( "[%x] cgd %u\n", &(p0->cgd ), p->cgd );
  2512. dprintf( "\n" );
  2513. }
  2514. #endif // DOES NOT SUPPORT API64
  2515. /******************************Public*Routine******************************\
  2516. *
  2517. * Routine Name:
  2518. *
  2519. * vDumpCACHE
  2520. *
  2521. \**************************************************************************/
  2522. void vDumpCACHE(ULONG64 cacheSrc)
  2523. {
  2524. ULONG offset;
  2525. ULONG64 pgdNext; // ptr to next free place to put GLYPHDATA
  2526. ULONG64 pgdThreshold; // ptr to first uncommited spot
  2527. ULONG64 pjFirstBlockEnd; // ptr to end of first GLYPHDATA block
  2528. ULONG64 pdblBase; // ptr to base of current GLYPHDATA block
  2529. ULONG cMetrics; // number of GLYPHDATA's in the metrics cache
  2530. ULONG cjbblInitial; // size of initial bit block
  2531. ULONG cjbbl; // size of any individual block in bytes
  2532. ULONG cBlocksMax; // max # of blocks allowed
  2533. ULONG cBlocks; // # of blocks allocated so far
  2534. ULONG cGlyphs; // for statistical purposes only
  2535. ULONG cjTotal; // also for stat purposes only
  2536. ULONG64 pbblBase; // ptr to the first bit block (head of the list)
  2537. ULONG64 pbblCur; // ptr to the block containing next
  2538. ULONG64 pgbNext; // ptr to next free place to put GLYPHBITS
  2539. ULONG64 pgbThreshold; // end of the current block
  2540. ULONG64 pjAuxCacheMem; // ptr to lookaside buffer, if any
  2541. SIZE_T cjAuxCacheMem; // size of current lookaside buffer
  2542. ULONG cjGlyphMax; // size of largest glyph
  2543. BOOL bSmallMetrics;
  2544. INT iMax;
  2545. INT iFirst;
  2546. INT cBits;
  2547. #define GetAndPrintCACHEFieldAndOffset(expr, member) \
  2548. GetCACHEFieldAndOffset(member); dprintf("[0x%p] " #expr " " #member "\n", cacheSrc+offset, ##member)
  2549. dprintf("\nCACHE\n address\n -------\n" );
  2550. GetAndPrintCACHEFieldAndOffset( %+#20p, pgdNext);
  2551. GetAndPrintCACHEFieldAndOffset( %+#20p, pgdThreshold);
  2552. GetAndPrintCACHEFieldAndOffset( %+#20p, pjFirstBlockEnd);
  2553. GetAndPrintCACHEFieldAndOffset( %+#20p, pdblBase);
  2554. GetAndPrintCACHEFieldAndOffset( %+#20x, cMetrics);
  2555. GetAndPrintCACHEFieldAndOffset( %+#20x, cjbbl);
  2556. GetAndPrintCACHEFieldAndOffset( %+#20x, cBlocksMax);
  2557. GetAndPrintCACHEFieldAndOffset( %+#20x, cBlocks);
  2558. GetAndPrintCACHEFieldAndOffset( %+#20x, cGlyphs);
  2559. GetAndPrintCACHEFieldAndOffset( %+#20x, cjTotal);
  2560. GetAndPrintCACHEFieldAndOffset( %+#20p, pbblBase);
  2561. GetAndPrintCACHEFieldAndOffset( %+#20p, pbblCur);
  2562. GetAndPrintCACHEFieldAndOffset( %+#20p, pgbNext);
  2563. GetAndPrintCACHEFieldAndOffset( %+#20p, pgbThreshold);
  2564. GetAndPrintCACHEFieldAndOffset( %+#20p, pjAuxCacheMem);
  2565. GetAndPrintCACHEFieldAndOffset( %+#20x, cjAuxCacheMem);
  2566. GetAndPrintCACHEFieldAndOffset( %+#20x, cjGlyphMax);
  2567. GetAndPrintCACHEFieldAndOffset( %+#20x, bSmallMetrics);
  2568. GetAndPrintCACHEFieldAndOffset( %+#20x, iMax);
  2569. GetAndPrintCACHEFieldAndOffset( %+#20x, iFirst);
  2570. GetAndPrintCACHEFieldAndOffset( %+#20x, cBits);
  2571. dprintf("\n");
  2572. #undef M3
  2573. }
  2574. /******************************Public*Routine******************************\
  2575. *
  2576. * Routine Name:
  2577. *
  2578. * cache
  2579. *
  2580. \**************************************************************************/
  2581. DECLARE_API( cache )
  2582. {
  2583. PARSE_POINTER(cache_help);
  2584. vDumpCACHE(arg);
  2585. EXIT_API(S_OK);
  2586. cache_help:
  2587. dprintf("Usage: cache [-?] CACHE pointer\n");
  2588. EXIT_API(S_OK);
  2589. }
  2590. /******************************Public*Routine******************************\
  2591. *
  2592. * Routine Name:
  2593. *
  2594. * vDumpLOGFONTW
  2595. *
  2596. * Arguments:
  2597. *
  2598. * plfw -- pointer to local copy of LOGFONTW,
  2599. * dereferences are off of this address are safe
  2600. * plfwSrc -- address of original on debug machine,
  2601. * dereferences off of this address are not safe
  2602. *
  2603. * Return Value:
  2604. *
  2605. * none
  2606. *
  2607. \**************************************************************************/
  2608. void vDumpLOGFONTW(ULONG64 offLOGFONTW)
  2609. {
  2610. #define N3(a,b,c) \
  2611. dprintf( "[%p] %s", offLOGFONTW + offset, (a)); dprintf( (b), ##c )
  2612. // LOGFONTW
  2613. LONG lfHeight;
  2614. LONG lfWidth;
  2615. LONG lfEscapement;
  2616. LONG lfOrientation;
  2617. LONG lfWeight;
  2618. BYTE lfItalic;
  2619. BYTE lfUnderline;
  2620. BYTE lfStrikeOut;
  2621. BYTE lfCharSet;
  2622. BYTE lfOutPrecision;
  2623. BYTE lfClipPrecision;
  2624. BYTE lfQuality;
  2625. BYTE lfPitchAndFamily;
  2626. WCHAR lfFaceName[LF_FACESIZE];
  2627. ULONG offset;
  2628. dprintf("\nLOGFONTW\n address\n --------\n" );
  2629. GetLOGFONTWFieldAndOffset(lfHeight);
  2630. N3( "lfHeight " , "%d\n" , lfHeight );
  2631. GetLOGFONTWFieldAndOffset(lfWidth);
  2632. N3( "lfWidth " , "%d\n" , lfWidth );
  2633. GetLOGFONTWFieldAndOffset(lfEscapement);
  2634. N3( "lfEscapement " , "%d\n" , lfEscapement );
  2635. GetLOGFONTWFieldAndOffset(lfOrientation);
  2636. N3( "lfOrientation " , "%d\n" , lfOrientation );
  2637. GetLOGFONTWFieldAndOffset(lfWeight);
  2638. N3( "lfWeight " , "%d" , lfWeight );
  2639. dprintf(" = %s\n", pszFW(lfWeight) );
  2640. GetLOGFONTWFieldAndOffset(lfItalic);
  2641. N3( "lfItalic " , "0x%02x\n" , lfItalic );
  2642. GetLOGFONTWFieldAndOffset(lfUnderline);
  2643. N3( "lfUnderline " , "0x%02x\n" , lfUnderline );
  2644. GetLOGFONTWFieldAndOffset(lfStrikeOut);
  2645. N3( "lfStrikeOut " , "0x%02x\n" , lfStrikeOut );
  2646. GetLOGFONTWFieldAndOffset(lfCharSet);
  2647. N3( "lfCharSet " , "0x%02x" , lfCharSet );
  2648. dprintf(" = %s\n", pszCHARSET(lfCharSet));
  2649. GetLOGFONTWFieldAndOffset(lfOutPrecision);
  2650. N3( "lfOutPrecision " , "0x%02x" , lfOutPrecision );
  2651. dprintf(" = %s\n", pszOUT_PRECIS(lfOutPrecision ));
  2652. GetLOGFONTWFieldAndOffset(lfClipPrecision);
  2653. N3( "lfClipPrecision " , "0x%02x" , lfClipPrecision );
  2654. dprintf(" = %s\n", pszCLIP_PRECIS(lfClipPrecision));
  2655. GetLOGFONTWFieldAndOffset(lfQuality);
  2656. N3( "lfQuality " , "0x%02x" , lfQuality );
  2657. dprintf(" = %s\n", pszQUALITY(lfQuality));
  2658. GetLOGFONTWFieldAndOffset(lfPitchAndFamily);
  2659. N3( "lfPitchAndFamily " , "0x%02x" , lfPitchAndFamily );
  2660. dprintf(" = %s\n", pszPitchAndFamily(lfPitchAndFamily ) );
  2661. GetLOGFONTWFieldAndOffset(lfFaceName);
  2662. dprintf("[%p] lfFaceName \"%ws\"\n", offLOGFONTW + offset, lfFaceName);
  2663. dprintf("\n");
  2664. #undef N3
  2665. return;
  2666. }
  2667. /******************************Public*Routine******************************\
  2668. *
  2669. * Routine Name:
  2670. *
  2671. * vDumpFONTDIFF
  2672. *
  2673. \**************************************************************************/
  2674. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  2675. void vDumpFONTDIFF(FONTDIFF *p1/*copy*/ , FONTDIFF *p0 /* original */)
  2676. {
  2677. #define N2(a,c) dprintf("[%x] %s", &p0->##c, (a))
  2678. #define N3(a,b,c) dprintf("[%x] %s", &p0->##c, (a)); dprintf((b),p1->##c)
  2679. dprintf("\nFONTDIFF\n-------\n");
  2680. N3("jReserved1 ", "0x%02x\n", jReserved1);
  2681. N3("jReserved2 ", "0x%02x\n", jReserved2);
  2682. N3("jReserved3 ", "0x%02x\n", jReserved3);
  2683. N3("bWeight ", "0x%02x", bWeight );
  2684. dprintf(" = %s\n", pszPanoseWeight(p1->bWeight));
  2685. N3("usWinWeight ", "%u" , usWinWeight);
  2686. dprintf(" = %s\n", pszFW(p1->usWinWeight));
  2687. N3("fsSelection ", "%-#x\n" , fsSelection);
  2688. for (FLAGDEF *pfd=afdFM_SEL; pfd->psz; pfd++) {
  2689. if ((FLONG)p1->fsSelection & pfd->fl) {
  2690. dprintf(" %s\n", pfd->psz);
  2691. }
  2692. }
  2693. N3("fwdAveCharWidth ", "%d\n" , fwdAveCharWidth);
  2694. N3("fwdMaxCharInc ", "%d\n" , fwdMaxCharInc);
  2695. N2("ptlCaret ", ptlCaret);
  2696. dprintf("%d %d\n", p1->ptlCaret.x, p1->ptlCaret.y);
  2697. dprintf("\n");
  2698. #undef N2
  2699. #undef N3
  2700. }
  2701. #endif // DOES NOT SUPPORT API64
  2702. /******************************Public*Routine******************************\
  2703. *
  2704. * Routine Name:
  2705. *
  2706. * vDumpIFIMETRICS
  2707. *
  2708. \**************************************************************************/
  2709. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  2710. void vDumpIFIMETRICS(IFIMETRICS *p1, IFIMETRICS *p0)
  2711. {
  2712. FLONG fl;
  2713. FLAGDEF *pfd;
  2714. #define GETPTR(p,a) ((void*)(((BYTE*)(p))+(a)))
  2715. #define N2(a,c) dprintf("[%x] %s", &p0->##c, (a))
  2716. #define N3(a,b,c) dprintf("[%x] %s", &p0->##c, (a)); dprintf((b),p1->##c)
  2717. dprintf("\nIFIMETICS\n address\n -------\n");
  2718. N3("cjThis ", "%u\n" , cjThis );
  2719. N3("cjIfiExtra ", "%u\n" , cjIfiExtra );
  2720. N3("dpwszFamilyName ", "%-#x" , dpwszFamilyName );
  2721. dprintf(" \"%ws\"\n", GETPTR(p1,p1->dpwszFamilyName));
  2722. N3("dpwszStyleName ", "%-#x" , dpwszStyleName );
  2723. dprintf(" \"%ws\"\n", GETPTR(p1,p1->dpwszStyleName));
  2724. N3("dpwszFaceName ", "%-#x" , dpwszFaceName );
  2725. dprintf(" \"%ws\"\n", GETPTR(p1,p1->dpwszFaceName));
  2726. N3("dpwszUniqueName ", "%-#x" , dpwszUniqueName );
  2727. dprintf(" \"%ws\"\n", GETPTR(p1,p1->dpwszUniqueName));
  2728. N3("dpFontSim ", "%-#x\n" , dpFontSim );
  2729. N3("lEmbedId ", "%-#x\n" , lEmbedId );
  2730. N3("lItalicAngle ", "%d\n" , lItalicAngle );
  2731. N3("lCharBias ", "%d\n" , lCharBias );
  2732. N3("dpCharSets ", "%-#x\n" , dpCharSets );
  2733. if (p1->dpCharSets)
  2734. {
  2735. BYTE *pj0 = (BYTE *) GETPTR(p0,p1->dpCharSets);
  2736. BYTE *pj1 = (BYTE *) GETPTR(p1,p1->dpCharSets);
  2737. BYTE *pj1End = pj1 + 16; // number of charsets
  2738. dprintf(" Supported Charsets: \n");
  2739. for (; pj1 < pj1End; pj1++, pj0++)
  2740. dprintf("[%x]\t\t\t%s\n", pj0, pszCHARSET(*pj1));
  2741. }
  2742. N3("jWinCharSet ", "0x%02x", jWinCharSet );
  2743. dprintf(" %s\n", pszCHARSET(p1->jWinCharSet));
  2744. N3("jWinPitchAndFamily ", "0x%02x", jWinPitchAndFamily );
  2745. dprintf(" %s\n", pszPitchAndFamily(p1->jWinPitchAndFamily));
  2746. N3("usWinWeight ", "%u" , usWinWeight );
  2747. dprintf(" %s\n", pszFW(p1->usWinWeight));
  2748. N3("flInfo ", "%-#x\n" , flInfo );
  2749. for (fl=p1->flInfo,pfd=afdInfo;pfd->psz;pfd++) {
  2750. if (fl & pfd->fl) {
  2751. dprintf(" %s\n", pfd->psz);
  2752. }
  2753. }
  2754. N3("fsSelection ", "%-#x\n" , fsSelection );
  2755. for (fl = p1->fsSelection, pfd = afdFM_SEL; pfd->psz; pfd++) {
  2756. if (fl & pfd->fl) {
  2757. dprintf(" %s\n", pfd->psz);
  2758. }
  2759. }
  2760. N3("fsType ", "%-#x\n" , fsType );
  2761. for (fl=p1->fsType, pfd=afdFM_TYPE; pfd->psz; pfd++) {
  2762. if (fl & pfd->fl) {
  2763. dprintf(" %s\n", pfd->psz);
  2764. }
  2765. }
  2766. N3("fwdUnitsPerEm ", "%d\n" , fwdUnitsPerEm );
  2767. N3("fwdLowestPPEm ", "%d\n" , fwdLowestPPEm );
  2768. N3("fwdWinAscender ", "%d\n" , fwdWinAscender );
  2769. N3("fwdWinDescender ", "%d\n" , fwdWinDescender );
  2770. N3("fwdMacAscender ", "%d\n" , fwdMacAscender );
  2771. N3("fwdMacDescender ", "%d\n" , fwdMacDescender );
  2772. N3("fwdMacLineGap ", "%d\n" , fwdMacLineGap );
  2773. N3("fwdTypoAscender ", "%d\n" , fwdTypoAscender );
  2774. N3("fwdTypoDescender ", "%d\n" , fwdTypoDescender );
  2775. N3("fwdTypoLineGap ", "%d\n" , fwdTypoLineGap );
  2776. N3("fwdAveCharWidth ", "%d\n" , fwdAveCharWidth );
  2777. N3("fwdMaxCharInc ", "%d\n" , fwdMaxCharInc );
  2778. N3("fwdCapHeight ", "%d\n" , fwdCapHeight );
  2779. N3("fwdXHeight ", "%d\n" , fwdXHeight );
  2780. N3("fwdSubscriptXSize ", "%d\n" , fwdSubscriptXSize );
  2781. N3("fwdSubscriptYSize ", "%d\n" , fwdSubscriptYSize );
  2782. N3("fwdSubscriptXOffset ", "%d\n" , fwdSubscriptXOffset );
  2783. N3("fwdSubscriptYOffset ", "%d\n" , fwdSubscriptYOffset );
  2784. N3("fwdSuperscriptXSize ", "%d\n" , fwdSuperscriptXSize );
  2785. N3("fwdSuperscriptYSize ", "%d\n" , fwdSuperscriptYSize );
  2786. N3("fwdSuperscriptXOffset ", "%d\n" , fwdSuperscriptXOffset );
  2787. N3("fwdSuperscriptYOffset ", "%d\n" , fwdSuperscriptYOffset );
  2788. N3("fwdUnderscoreSize ", "%d\n" , fwdUnderscoreSize );
  2789. N3("fwdUnderscorePosition ", "%d\n" , fwdUnderscorePosition );
  2790. N3("fwdStrikeoutSize ", "%d\n" , fwdStrikeoutSize );
  2791. N3("fwdStrikeoutPosition ", "%d\n" , fwdStrikeoutPosition );
  2792. N3("chFirstChar ", "0x%02x\n", chFirstChar );
  2793. N3("chLastChar ", "0x%02x\n", chLastChar );
  2794. N3("chDefaultChar ", "0x%02x\n", chDefaultChar );
  2795. N3("chBreakChar ", "0x%02x\n", chBreakChar );
  2796. N3("wcFirstChar ", "%-#x\n" , wcFirstChar );
  2797. N3("wcLastChar ", "%-#x\n" , wcLastChar );
  2798. N3("wcDefaultChar ", "%-#x\n" , wcDefaultChar );
  2799. N3("wcBreakChar ", "%-#x\n" , wcBreakChar );
  2800. N2("ptlBaseline ", ptlBaseline);
  2801. dprintf("%d %d\n", p1->ptlBaseline.x, p1->ptlBaseline.y);
  2802. N2("ptlAspect ", ptlAspect );
  2803. dprintf("%d %d\n", p1->ptlAspect.x, p1->ptlAspect.y);
  2804. N2("ptlCaret ", ptlCaret );
  2805. dprintf("%d %d\n", p1->ptlCaret.x, p1->ptlCaret.y);
  2806. N2("rclFontBox ", rclFontBox );
  2807. dprintf("%d %d %d %d\n",
  2808. p1->rclFontBox.left,
  2809. p1->rclFontBox.top,
  2810. p1->rclFontBox.right,
  2811. p1->rclFontBox.bottom);
  2812. N2("achVendId\n" , achVendId[0]);
  2813. N3("cKerningPairs ", "%d\n" , cKerningPairs );
  2814. N3("ulPanoseCulture ", "%u\n" , ulPanoseCulture );
  2815. N2("panose\n", panose);
  2816. if (p1->dpFontSim) {
  2817. FONTDIFF *pfd0, *pfd1;
  2818. FONTSIM *pfs0 = (FONTSIM*) GETPTR(p0, p1->dpFontSim);
  2819. FONTSIM *pfs1 = (FONTSIM*) GETPTR(p1, p1->dpFontSim);
  2820. if (pfs1->dpBold) {
  2821. pfd0 = (FONTDIFF*) GETPTR(pfs0, pfs1->dpBold);
  2822. pfd1 = (FONTDIFF*) GETPTR(pfs1, pfs1->dpBold);
  2823. dprintf("\nBold Simulation ");
  2824. vDumpFONTDIFF(pfd1, pfd0);
  2825. }
  2826. if (pfs1->dpItalic) {
  2827. pfd0 = (FONTDIFF*) GETPTR(pfs0, pfs1->dpItalic);
  2828. pfd1 = (FONTDIFF*) GETPTR(pfs1, pfs1->dpItalic);
  2829. dprintf("\nItalic Simulation ");
  2830. vDumpFONTDIFF(pfd1, pfd0);
  2831. }
  2832. if (pfs1->dpBoldItalic) {
  2833. pfd0 = (FONTDIFF*) GETPTR(pfs0, pfs1->dpBoldItalic);
  2834. pfd1 = (FONTDIFF*) GETPTR(pfs1, pfs1->dpBoldItalic);
  2835. dprintf("\nBold Italic Simulation ");
  2836. vDumpFONTDIFF(pfd1, pfd0);
  2837. }
  2838. }
  2839. if (p1->cjIfiExtra)
  2840. {
  2841. // #define GETIFIEX(a) ((ULONG)p1 + sizeof(IFIMETRICS) + offsetof(IFIEXTRA,##a))
  2842. dprintf("\nIFIEXTRA\n -------\n");
  2843. IFIEXTRA *pifiex = (IFIEXTRA *)(p1 + 1);
  2844. if (p1->cjIfiExtra > offsetof(IFIEXTRA,ulIdentifier))
  2845. dprintf("ulIdentifier: 0x%x\n", pifiex->ulIdentifier);
  2846. if (p1->cjIfiExtra > offsetof(IFIEXTRA,dpFontSig))
  2847. dprintf("dpFontSig: 0x%x\n", pifiex->dpFontSig);
  2848. if (p1->cjIfiExtra > offsetof(IFIEXTRA,cig))
  2849. dprintf("cig: %u\n", pifiex->cig);
  2850. if (p1->cjIfiExtra > offsetof(IFIEXTRA,dpDesignVector))
  2851. dprintf("dpDesignVector: 0x%x\n", pifiex->dpDesignVector);
  2852. if (p1->cjIfiExtra > offsetof(IFIEXTRA,dpAxesInfoW))
  2853. dprintf("dpAxesInfoW: 0x%x\n", pifiex->dpAxesInfoW);
  2854. dprintf("\n -------\n");
  2855. }
  2856. dprintf("\n");
  2857. #undef N3
  2858. #undef N2
  2859. }
  2860. #endif // DOES NOT SUPPORT API64
  2861. /******************************Public*Routine******************************\
  2862. *
  2863. * Routine Name:
  2864. *
  2865. * pff
  2866. *
  2867. \**************************************************************************/
  2868. DECLARE_API( pff )
  2869. {
  2870. dprintf("Extension 'pff' is not converted.\n");
  2871. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  2872. PFF *pPFFCopy, *pPFFSrc;
  2873. ULONG size;
  2874. PARSE_POINTER(pff_help);
  2875. pPFFSrc = (PFF *)arg;
  2876. move(size,&pPFFSrc->sizeofThis);
  2877. if (pPFFCopy = tmalloc(PFF, size)) {
  2878. move2(pPFFCopy, pPFFSrc, size);
  2879. PFFOBJ pffo(pPFFCopy);
  2880. pPFFCopy->pwszPathname_ = pffo.pwszCalcPathname();
  2881. vDumpPFF(pPFFCopy,pPFFSrc);
  2882. tfree(pPFFCopy);
  2883. } else
  2884. dprintf("could not allocate memory\n");
  2885. return;
  2886. pff_help:
  2887. dprintf("Usage: pff [-?] PFF pointer\n");
  2888. #endif // DOES NOT SUPPORT API64
  2889. EXIT_API(S_OK);
  2890. }
  2891. /******************************Public*Routine******************************\
  2892. *
  2893. * Routine Name:
  2894. *
  2895. * vDumpPFF
  2896. *
  2897. \**************************************************************************/
  2898. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  2899. void vDumpPFF(PFF *p1 /*copy*/, PFF *p0 /*original*/)
  2900. {
  2901. ULONG iFile;
  2902. PWSZ pwszSrc, pwszDest;
  2903. #define N2(a,c) dprintf("[%x] %s", &p0->##c, (a))
  2904. #define N3(a,b,c) dprintf("[%x] %s", &p0->##c, (a)); dprintf((b),p1->##c)
  2905. N3("sizeofThis ", "%u\n", sizeofThis);
  2906. N3("pPFFNext ", "%-#x\n", pPFFNext);
  2907. N3("pPFFPrev ", "%-#x\n", pPFFPrev);
  2908. if (p1->hff != HFF_INVALID) // if not device font
  2909. {
  2910. N2("pwszPathname_ ", pwszPathname_);
  2911. move( pwszSrc, &p0->pwszPathname_ );
  2912. pwszDest = wcsncpy((PWSZ) adw, pwszSrc, sizeof(adw)/sizeof(WCHAR));
  2913. if ( pwszDest )
  2914. {
  2915. dprintf("%-#x = \"%ws\"\n", pwszSrc, (PWSZ) adw );
  2916. }
  2917. else
  2918. {
  2919. dprintf("\n");
  2920. }
  2921. }
  2922. N3("flState ", "%-#x\n", flState);
  2923. for (FLAGDEF *pfd = afdPFF; pfd->psz; pfd++) {
  2924. if (p1->flState & pfd->fl) {
  2925. dprintf(" %s\n", pfd->psz);
  2926. }
  2927. }
  2928. N3("cwc ", "%u\n", cwc);
  2929. N3("cFiles ", "%u\n", cFiles);
  2930. N3("cLoaded ", "%u\n", cLoaded);
  2931. N3("cNotEnum ", "%u\n", cNotEnum);
  2932. N3("cRFONT ", "%u\n", cRFONT);
  2933. N3("prfntList ", "%-#x\n", prfntList);
  2934. N3("hff ", "%-#x\n", hff);
  2935. N3("hdev ", "%-#x\n", hdev);
  2936. N3("dhpdev ", "%-#x\n", dhpdev);
  2937. N3("pfhFace ", "%-#x\n", pfhFace);
  2938. N3("pfhFamily ", "%-#x\n", pfhFamily);
  2939. N3("pfhUFI ", "%-#x\n", pfhUFI);
  2940. N3("pPFT ", "%-#x\n", pPFT);
  2941. N3("ulCheckSum ", "%-#x\n", ulCheckSum);
  2942. N3("cFonts ", "%u\n", cFonts);
  2943. N3("ppfv ", "%-#x\n", ppfv);
  2944. N3("pPvtDataHead ", "%-#x\n", pPvtDataHead);
  2945. dprintf("\n\n");
  2946. #undef N3
  2947. #undef N2
  2948. }
  2949. ///******************************Public*Routine******************************\
  2950. //*
  2951. //* Routine Name:
  2952. //*
  2953. //* vDumpFONTHASH
  2954. //*
  2955. //\**************************************************************************/
  2956. //
  2957. //void vDumpFONTHASH(FONTHASH *p1 /*copy*/,FONTHASH *p0 /*org*/)
  2958. //{
  2959. // #define N2(a,c) dprintf("[%x] %s", &p0->##c, (a))
  2960. // #define N3(a,b,c) dprintf("[%x] %s", &p0->##c, (a)); dprintf((b),p1->##c)
  2961. //
  2962. // dprintf("\nFONTHASH\n");
  2963. // N3("id ", "%4x\n", id);
  2964. // N3("fht ", "%d", fht);
  2965. // dprintf(" = %s\n", pszFONTHASHTYPE(p1->fht));
  2966. // N3("cBuckets ", "%u\n", cBuckets);
  2967. // N3("cCollisions ", "%u\n", cCollisions);
  2968. // N3("pbktFirst ", "%-#x\n", pbktFirst);
  2969. // N3("pbktLast ", "%-#x\n", pbktLast);
  2970. // N3("apbkt ", "%-#x\n", apbkt);
  2971. //
  2972. // #undef N3
  2973. // #undef N2
  2974. //}
  2975. /******************************Public*Routine******************************\
  2976. *
  2977. * Routine Name:
  2978. *
  2979. * vDumpHASHBUCKET
  2980. *
  2981. \**************************************************************************/
  2982. void vDumpHASHBUCKET(HASHBUCKET *p1 /*copy*/, HASHBUCKET *p0 /*org*/)
  2983. {
  2984. #define N2(a,c) dprintf("[%x] %s", &p0->##c, (a))
  2985. #define N3(a,b,c) dprintf("[%x] %s", &p0->##c, (a)); dprintf((b),p1->##c)
  2986. dprintf("\nHASHBUCKET\n");
  2987. N3("pbktCollision ", "%-#x\n", pbktCollision);
  2988. N3("ppfelEnumHead ", "%-#x\n", ppfelEnumHead);
  2989. N3("ppfelEnumTail ", "%-#x\n", ppfelEnumTail);
  2990. N3("cTrueType ", "%u\n", cTrueType);
  2991. N3("fl ", "%-#x\n", fl);
  2992. N3("pbktPrev ", "%-#x\n", pbktPrev);
  2993. N3("pbktNext ", "%-#x\n", pbktNext);
  2994. N3("ulTime ", "%u\n", ulTime);
  2995. N2("u\n", u);
  2996. N2("u.wcCapName ", u.wcCapName);
  2997. wcscpy((PWSZ) adw, p1->u.wcCapName);
  2998. dprintf("\"%ws\"\n", adw);
  2999. N2("u.ufi\n", u.ufi);
  3000. N3("u.ufi.CheckSum ", "%-#x\n", u.ufi.CheckSum);
  3001. N3("u.ufi.Index ", "%u\n", u.ufi.Index);
  3002. {
  3003. dprintf("\n");
  3004. {
  3005. PFELINK *ppfel = p1->ppfelEnumHead;
  3006. PFELINK pfelLocal;
  3007. PFE LocalPFE;
  3008. if (ppfel)
  3009. {
  3010. dprintf("PFE*\n");
  3011. while (ppfel)
  3012. {
  3013. move(pfelLocal, ppfel);
  3014. dprintf("%-#x", pfelLocal.ppfe);
  3015. move(LocalPFE,pfelLocal.ppfe);
  3016. if (LocalPFE.pPFF)
  3017. {
  3018. PFF LocalPFF;
  3019. WCHAR awc[MAX_PATH];
  3020. move(LocalPFF, LocalPFE.pPFF);
  3021. wcsncpy( awc, LocalPFF.pwszPathname_, MAX_PATH);
  3022. awc[MAX_PATH-1]=0;
  3023. dprintf(" \"%ws\"", awc);
  3024. }
  3025. if (LocalPFE.pifi)
  3026. {
  3027. ULONG dp;
  3028. WCHAR awc[LF_FACESIZE+1];
  3029. PWSZ pwszSrc;
  3030. FWORD fwdAscender, fwdDescender, fwdWidth;
  3031. move(dp,&((LocalPFE.pifi)->dpwszFaceName));
  3032. pwszSrc = (PWSZ)(((char*) (LocalPFE.pifi)) + dp);
  3033. wcsncpy(awc, pwszSrc, LF_FACESIZE);
  3034. awc[LF_FACESIZE] = 0;
  3035. dprintf(" \"%ws\"", awc);
  3036. move(fwdAscender, &LocalPFE.pifi->fwdWinAscender);
  3037. move(fwdDescender, &LocalPFE.pifi->fwdWinDescender);
  3038. move(fwdWidth, &LocalPFE.pifi->fwdAveCharWidth);
  3039. dprintf(" %4d %4d %4d", fwdAscender, fwdDescender, fwdWidth);
  3040. }
  3041. dprintf("\n");
  3042. ppfel = pfelLocal.ppfelNext;
  3043. }
  3044. }
  3045. }
  3046. }
  3047. #undef N3
  3048. #undef N2
  3049. }
  3050. void vDumpTEXTMETRICW(TEXTMETRICW *ptmLocal, TEXTMETRICW *ptmRemote)
  3051. {
  3052. #define N3(a,b,c) dprintf("[%x] %s", &ptmRemote->##c, (a)); dprintf((b),ptmLocal->##c)
  3053. dprintf("\nTEXTMETRICW\n");
  3054. N3("tmHeight ", "%d\n", tmHeight );
  3055. N3("tmAscent ", "%d\n", tmAscent );
  3056. N3("tmDescent ", "%d\n", tmDescent );
  3057. N3("tmInternalLeading ", "%d\n", tmInternalLeading );
  3058. N3("tmExternalLeading ", "%d\n", tmExternalLeading );
  3059. N3("tmAveCharWidth ", "%d\n", tmAveCharWidth );
  3060. N3("tmMaxCharWidth ", "%d\n", tmMaxCharWidth );
  3061. N3("tmWeight ", "%d\n", tmWeight );
  3062. N3("tmOverhang ", "%d\n", tmOverhang );
  3063. N3("tmDigitizedAspectX ", "%d\n", tmDigitizedAspectX );
  3064. N3("tmDigitizedAspectY ", "%d\n", tmDigitizedAspectY );
  3065. N3("tmFirstChar ", "%-#6x\n", tmFirstChar );
  3066. N3("tmLastChar ", "%-#6x\n", tmLastChar );
  3067. N3("tmDefaultChar ", "%-#6x\n", tmDefaultChar );
  3068. N3("tmBreakChar ", "%-#6x\n", tmBreakChar );
  3069. N3("tmItalic ", "%-#4x\n", tmItalic );
  3070. N3("tmUnderlined ", "%-#4x\n", tmUnderlined );
  3071. N3("tmStruckOut ", "%-#4x\n", tmStruckOut );
  3072. N3("tmPitchAndFamily ", "%-#4x\n", tmPitchAndFamily );
  3073. N3("tmCharSet ", "%-#4x\n", tmCharSet );
  3074. dprintf("\n");
  3075. #undef N3
  3076. }
  3077. void vDumpTMDIFF(TMDIFF *ptmdLocal, TMDIFF *ptmdRemote)
  3078. {
  3079. #define N3(a,b,c) dprintf("[%x] %s", &ptmdRemote->##c, (a)); dprintf((b),ptmdLocal->##c)
  3080. dprintf("\nTMDIFF\n");
  3081. N3("cjotma ", "%u\n", cjotma );
  3082. N3("chFirst ", "%-#4x\n", chFirst );
  3083. N3("chLast ", "%-#4x\n", chLast );
  3084. N3("chDefault ", "%-#4x\n", chDefault );
  3085. N3("chBreak ", "%-#4x\n", chBreak );
  3086. dprintf("\n");
  3087. #undef N3
  3088. }
  3089. #endif 0 // DOES NOT SUPPORT API64
  3090. DECLARE_API( tmwi )
  3091. {
  3092. dprintf("Extension 'tmwi' is not converted.\n");
  3093. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  3094. TMW_INTERNAL tmwi, *ptmwi;
  3095. PARSE_POINTER(tmwi_help);
  3096. ptmwi = (TMW_INTERNAL *)arg;
  3097. move(tmwi, ptmwi);
  3098. vDumpTEXTMETRICW(&tmwi.tmw, &ptmwi->tmw);
  3099. vDumpTMDIFF(&tmwi.tmdTmw, &ptmwi->tmdTmw);
  3100. return;
  3101. tmwi_help:
  3102. dprintf("Usage: tmwi [-?] TMW_INTERNAL pointer\n");
  3103. #endif // DOES NOT SUPPORT API64
  3104. EXIT_API(S_OK);
  3105. }
  3106. DECLARE_API( tm )
  3107. {
  3108. dprintf("Extension 'tm' is not converted.\n");
  3109. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  3110. TEXTMETRICW tm;
  3111. PARSE_POINTER(tm_help);
  3112. move(tm, arg);
  3113. vDumpTEXTMETRICW(&tm, (TEXTMETRICW*) arg);
  3114. return;
  3115. tm_help:
  3116. dprintf("Usage: tm [-?] TEXTMETRIC pointer\n");
  3117. #endif // DOES NOT SUPPORT API64
  3118. EXIT_API(S_OK);
  3119. }
  3120. /******************************Public*Routine******************************\
  3121. *
  3122. * Routine Name:
  3123. *
  3124. * fh
  3125. *
  3126. \**************************************************************************/
  3127. DECLARE_API( fh )
  3128. {
  3129. dprintf("Extension 'fh' is not converted.\n");
  3130. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  3131. FONTHASH fh;
  3132. PARSE_POINTER(fh_help);
  3133. move(fh, arg);
  3134. vDumpFONTHASH( &fh, (FONTHASH*) arg);
  3135. return;
  3136. fh_help:
  3137. dprintf("Usage: fh [-?] FONTHASH pointer\n");
  3138. #endif // DOES NOT SUPPORT API64
  3139. EXIT_API(S_OK);
  3140. }
  3141. /******************************Public*Routine******************************\
  3142. *
  3143. * Routine Name:
  3144. *
  3145. * hb
  3146. *
  3147. \**************************************************************************/
  3148. DECLARE_API( hb )
  3149. {
  3150. dprintf("Extension 'hb' is not converted.\n");
  3151. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  3152. HASHBUCKET hb;
  3153. PARSE_POINTER(hb_help);
  3154. move(hb, arg);
  3155. vDumpHASHBUCKET(&hb, (HASHBUCKET*) arg);
  3156. return;
  3157. hb_help:
  3158. dprintf("Usage: hb [-?] HASHBUCKET pointer\n");
  3159. #endif // DOES NOT SUPPORT API64
  3160. EXIT_API(S_OK);
  3161. }
  3162. /******************************Public*Routine******************************\
  3163. *
  3164. * Routine Name:
  3165. *
  3166. * cjGLYPHBITS
  3167. *
  3168. * Routine Description:
  3169. *
  3170. * Calculates the amount of memory associated with a GLYPHBITS structure
  3171. *
  3172. * Arguments:
  3173. *
  3174. * pgb pointer to GLYPHBITS structure
  3175. * prf pointer to RFONT
  3176. *
  3177. * Return Value:
  3178. *
  3179. * count of byte's
  3180. *
  3181. \**************************************************************************/
  3182. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  3183. unsigned cjGLYPHBITS(GLYPHBITS *pgb, RFONT *prf)
  3184. {
  3185. unsigned cj = 0;
  3186. if (pgb) {
  3187. if (prf->ulContent & FO_GLYPHBITS) {
  3188. cj = offsetof(GLYPHBITS, aj);
  3189. cj = (cj + 3) & ~3;
  3190. unsigned cjRow = pgb->sizlBitmap.cx;
  3191. if (prf->fobj.flFontType & FO_GRAY16)
  3192. cjRow = (cjRow+1)/2;
  3193. else
  3194. cjRow = (cjRow+7)/8;
  3195. cj += pgb->sizlBitmap.cy * cjRow;
  3196. cj = (cj + 3) & ~3;
  3197. }
  3198. }
  3199. return( cj );
  3200. }
  3201. #endif 0 // DOES NOT SUPPORT API64
  3202. /******************************Public*Routine******************************\
  3203. *
  3204. * Routine Name:
  3205. *
  3206. * vDumpGlyphMemory
  3207. *
  3208. * Routine Description:
  3209. *
  3210. * Dumps the memory usage for the glyphs associated with an RFONT
  3211. *
  3212. * Arguments:
  3213. *
  3214. * pRemoteRFONT pointer to a remote RFONT
  3215. *
  3216. * Return Value:
  3217. *
  3218. * none
  3219. *
  3220. \**************************************************************************/
  3221. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  3222. void vDumpGlyphMemory(RFONT *pRemoteRFONT)
  3223. {
  3224. unsigned cj;
  3225. if (!pRemoteRFONT)
  3226. return;
  3227. RFONT rf;
  3228. move(rf, pRemoteRFONT);
  3229. if ( rf.wcgp ) {
  3230. WCGP wcgp;
  3231. move(wcgp, rf.wcgp);
  3232. cj = offsetof(WCGP,agpRun[0]) + wcgp.cRuns * sizeof(GPRUN);
  3233. WCGP *pWCGP;
  3234. if ( pWCGP = tmalloc(WCGP, cj) ) {
  3235. move2(pWCGP, rf.wcgp, cj);
  3236. dprintf("------------------\n");
  3237. dprintf("character size\n");
  3238. dprintf("------------------\n");
  3239. GPRUN *pRun = pWCGP->agpRun;
  3240. GPRUN *pRunSentinel = pRun + pWCGP->cRuns;
  3241. for (; pRun < pRunSentinel ; pRun++ ) {
  3242. if (!pRun->apgd)
  3243. continue;
  3244. cj = sizeof(GLYPHDATA*) * pRun->cGlyphs;
  3245. GLYPHDATA **apgd;
  3246. if (!(apgd = tmalloc(GLYPHDATA*, cj)))
  3247. continue;
  3248. move2(apgd, pRun->apgd, cj);
  3249. unsigned wc = pRun->wcLow;
  3250. unsigned wcSentinel = wc + pRun->cGlyphs;
  3251. GLYPHDATA **ppgd = apgd;
  3252. for (; wc < wcSentinel; wc++, ppgd++) {
  3253. if (!*ppgd)
  3254. continue;
  3255. GLYPHDEF gdf;
  3256. move(gdf, &((*ppgd)->gdf));
  3257. if (gdf.pgb) {
  3258. GLYPHBITS gb;
  3259. move(gb, gdf.pgb);
  3260. cj = cjGLYPHBITS(&gb, &rf);
  3261. dprintf("%-#8x %8u\n", wc, cj);
  3262. }
  3263. }
  3264. tfree(apgd);
  3265. }
  3266. dprintf("------------------\n");
  3267. tfree(pWCGP);
  3268. }
  3269. }
  3270. }
  3271. #endif // DOES NOT SUPPORT API64
  3272. /******************************Public*Routine******************************\
  3273. *
  3274. * Routine Name:
  3275. *
  3276. * pdev
  3277. *
  3278. * Routine Description:
  3279. *
  3280. * Alternate version of PDEV dumper
  3281. *
  3282. * Arguments:
  3283. *
  3284. * Return Value:
  3285. *
  3286. * none
  3287. *
  3288. \**************************************************************************/
  3289. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  3290. char *pszDrvProcName(int index);
  3291. DECLARE_API( pdev )
  3292. {
  3293. dprintf("Extension 'pdev' is not converted.\n");
  3294. PDEV _pdev, *pPDEV;
  3295. RFONT rf, *prf;
  3296. CACHE cache;
  3297. BOOL HookFn=FALSE;
  3298. BOOL GlyphMem=FALSE;
  3299. BOOL MemAddr=FALSE;
  3300. PARSE_POINTER(pdev_help);
  3301. pPDEV = (PDEV *)arg;
  3302. if(parse_iFindSwitch(tokens, ntok, 'y')!=-1) {GlyphMem=TRUE;}
  3303. if(parse_iFindSwitch(tokens, ntok, 'o')!=-1) {MemAddr=TRUE;}
  3304. if(parse_iFindSwitch(tokens, ntok, 'f')!=-1) {HookFn=TRUE;}
  3305. move( _pdev, arg );
  3306. if (GlyphMem) {
  3307. dprintf("\n\nGlyph Bits Memory Allocation\n\n");
  3308. dprintf("cMetrics, cGlyphs, cjTotal, Total/Max, cBlocks, Ht, Wd, cjGlyphMax, FaceName\n");
  3309. unsigned cTouchedTotal, cAllocTotal, cjWastedTotal, cjAllocTotal;
  3310. cTouchedTotal = cAllocTotal = cjWastedTotal = cjAllocTotal = 0;
  3311. dprintf("[Active Fonts]\n");
  3312. vDumpRFONTList(
  3313. _pdev.prfntActive,
  3314. &cTouchedTotal,
  3315. &cAllocTotal,
  3316. &cjWastedTotal,
  3317. &cjAllocTotal
  3318. );
  3319. dprintf("[Inactive Fonts]\n");
  3320. vDumpRFONTList(
  3321. _pdev.prfntInactive,
  3322. &cTouchedTotal,
  3323. &cAllocTotal,
  3324. &cjWastedTotal,
  3325. &cjAllocTotal
  3326. );
  3327. }
  3328. //
  3329. // offsets
  3330. //
  3331. if (MemAddr)
  3332. {
  3333. #define N2(a,c) dprintf("[%x] %s\n", &pPDEV->##c, (a))
  3334. #define N3(a,b,c) dprintf("[%x] %s", &pPDEV->##c, (a)); dprintf((b),_pdev.##c)
  3335. N3( " hHmgr ", "%-#x\n", hHmgr );
  3336. N3( " cExclusiveLock ", "%-#x\n", cExclusiveLock );
  3337. N3( " Tid ", "%-#x\n", Tid );
  3338. N3( " ppdevNext ", "%-#x\n", ppdevNext );
  3339. N3( " cPdevRefs ", "%-#x\n", cPdevRefs );
  3340. N3( " pfnDrvSetPointerShape ", "%-#x\n", pfnDrvSetPointerShape );
  3341. N3( " pfnDrvMovePointer ", "%-#x\n", pfnDrvMovePointer );
  3342. N3( " pfnMovePointer ", "%-#x\n", pfnMovePointer );
  3343. N3( " pfnSync ", "%-#x\n", pfnSync );
  3344. N3( " pldev ", "%-#x\n", pldev );
  3345. N3( " dhpdev ", "%-#x\n", dhpdev );
  3346. N3( " ppalSurf ", "%-#x\n", ppalSurf );
  3347. N2( " devinfo ", devinfo );
  3348. N2( " GdiInfo ", GdiInfo );
  3349. N3( " pSurface ", "%-#x\n", pSurface );
  3350. N3( " hSpooler ", "%-#x\n", hSpooler );
  3351. N2( " ptlOrigin ", ptlOrigin );
  3352. N2( " eDirectDrawGlobal ", eDirectDrawGlobal );
  3353. N3( " ppdevParent ", "%-#x\n", ppdevParent );
  3354. N3( " fl ", "%-#x\n", fl );
  3355. N3( " hsemDevLock ", "%-#x\n", hsemDevLock );
  3356. N2( " hsemPointer ", hsemPointer );
  3357. N2( " ptlPointer ", ptlPointer );
  3358. N3( " hlfntDefault ", "%-#x\n", hlfntDefault );
  3359. N3( " hlfntAnsiVariable ", "%-#x\n", hlfntAnsiVariable );
  3360. N3( " hlfntAnsiFixed ", "%-#x\n", hlfntAnsiFixed );
  3361. N2( " ahsurf ", ahsurf );
  3362. N3( " pwszDataFile ", "%-#x\n", pwszDataFile );
  3363. N3( " pDevHTInfo ", "%-#x\n", pDevHTInfo );
  3364. N3( " prfntActive ", "%-#x\n", prfntActive );
  3365. N3( " prfntInactive ", "%-#x\n", prfntInactive );
  3366. N3( " cInactive ", "%-#x\n", cInactive );
  3367. N2( " ajbo ", ajbo );
  3368. N3( "cDirectDrawDisableLocks ", "%-#x\n", cDirectDrawDisableLocks );
  3369. N3( " TypeOneInfo ", "%-#x\n", TypeOneInfo );
  3370. N3( " RemoteTypeOne ", "%-#x\n", RemoteTypeOne );
  3371. N2( " apfn ", apfn );
  3372. #undef N3
  3373. #undef N2
  3374. }
  3375. if (HookFn)
  3376. {
  3377. dprintf("\nDispatch Table\n");
  3378. for (int i = 0; i < INDEX_LAST; i++)
  3379. {
  3380. if (_pdev.apfn[i])
  3381. {
  3382. dprintf("[%-#x] %-#10x %s\n", &(pPDEV->apfn[i]), _pdev.apfn[i], pszDrvProcName(i));
  3383. }
  3384. }
  3385. dprintf("\n");
  3386. }
  3387. return;
  3388. pdev_help:
  3389. dprintf("Usage: pdev [-?] [-o] [-f] [-y] pointer to a PDEV\n");
  3390. dprintf("-y glyph memory usage\n");
  3391. dprintf("-o memory addresses\n");
  3392. dprintf("-f functions hooked\n");
  3393. EXIT_API(S_OK);
  3394. }
  3395. #endif // DOES NOT SUPPORT API64
  3396. DECLARE_API( fdm )
  3397. {
  3398. dprintf("Extension 'fdm' is not converted.\n");
  3399. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  3400. FD_DEVICEMETRICS Fdm, *pFdm;
  3401. FLONG fl;
  3402. char ach[128], *psz;
  3403. FLAGDEF *pfd;
  3404. PARSE_POINTER(fdm_help);
  3405. pFdm = (FD_DEVICEMETRICS *)arg;
  3406. move( Fdm, arg );
  3407. #define N2(a,c) dprintf("[%x] %s", &pFdm->##c, (a))
  3408. #define N3(a,b,c) dprintf("[%x] %s", &pFdm->##c, (a)); dprintf((b),Fdm.##c)
  3409. N3("flRealizedType ", "%-#x\n", flRealizedType);
  3410. fl = Fdm.flRealizedType;
  3411. for (pfd=afdFDM; pfd->psz; pfd++) {
  3412. if (pfd->fl & fl)
  3413. dprintf("\t\t\t %s\n", pfd->psz);
  3414. fl &= ~pfd->fl;
  3415. }
  3416. N2("pteBase ", pteBase);
  3417. psz = ach;
  3418. psz += sprintFLOATL( psz, Fdm.pteBase.x );
  3419. *psz++ = ' ';
  3420. psz += sprintFLOATL( psz, Fdm.pteBase.y );
  3421. dprintf("%s\n", ach);
  3422. N2("pteSide ", pteSide);
  3423. psz = ach;
  3424. psz += sprintFLOATL( psz, Fdm.pteSide.x );
  3425. *psz++ = ' ';
  3426. psz += sprintFLOATL( psz, Fdm.pteSide.y );
  3427. dprintf("%s\n", ach);
  3428. N3("lD ", "%d\n", lD);
  3429. N3("fxMaxAscender ", "%-#x\n", fxMaxAscender);
  3430. N3("fxMaxDescender ", "%-#x\n", fxMaxDescender);
  3431. N2("ptlUnderline1 ", ptlUnderline1);
  3432. dprintf("%d %d\n", Fdm.ptlUnderline1.x, Fdm.ptlUnderline1.y);
  3433. N2("ptlStrikeOut ", ptlStrikeOut );
  3434. dprintf("%d %d\n", Fdm.ptlStrikeOut.x, Fdm.ptlStrikeOut.y );
  3435. N2("ptlULThickness ", ptlULThickness);
  3436. dprintf("%d %d\n", Fdm.ptlULThickness.x, Fdm.ptlULThickness.y);
  3437. N2("ptlSOThickness ", ptlSOThickness);
  3438. dprintf("%d %d\n", Fdm.ptlSOThickness.x, Fdm.ptlSOThickness.y);
  3439. N3("cxMax ", "%-#x\n", cxMax);
  3440. N3("cyMax ", "%-#x\n", cyMax);
  3441. N3("cjGlyphMax ", "%-#x\n", cjGlyphMax);
  3442. N2("fdxQuantized ", fdxQuantized);
  3443. psz = ach;
  3444. psz += sprintFLOATL( psz, Fdm.fdxQuantized.eXX );
  3445. *psz++ = ' ';
  3446. psz += sprintFLOATL( psz, Fdm.fdxQuantized.eXY );
  3447. dprintf("%s\n", ach);
  3448. psz = ach;
  3449. psz += sprintFLOATL( psz, Fdm.fdxQuantized.eYX );
  3450. *psz++ = ' ';
  3451. psz += sprintFLOATL( psz, Fdm.fdxQuantized.eYY );
  3452. dprintf("\t\t\t\t %s\n", ach);
  3453. N3("lNonLinearExtLeading ", "%-#x\n", lNonLinearExtLeading);
  3454. N3("lNonLinearIntLeading ", "%-#x\n", lNonLinearIntLeading);
  3455. N3("lNonLinearMaxCharWidth ", "%-#x\n", lNonLinearMaxCharWidth);
  3456. N3("lNonLinearAvgCharWidth ", "%-#x\n", lNonLinearAvgCharWidth);
  3457. N3("lMinA ", "%-#x\n", lMinA );
  3458. N3("lMinC ", "%-#x\n", lMinC );
  3459. N3("lMinD ", "%-#x\n", lMinD );
  3460. N3("alReserved[0] ", "%-#x\n", alReserved[0]);
  3461. /*
  3462. FLONG flRealizedType
  3463. POINTE pteBase
  3464. POINTE pteSide
  3465. LONG lD
  3466. FIX fxMaxAscender
  3467. FIX fxMaxDescender
  3468. POINTL ptlUnderline1
  3469. POINTL ptlStrikeOut
  3470. POINTL ptlULThickness
  3471. POINTL ptlSOThickness
  3472. ULONG cxMax;
  3473. ULONG cyMax;
  3474. ULONG cjGlyphMax;
  3475. FD_XFORM fdxQuantized
  3476. LONG lNonLinearExtLeading
  3477. LONG lNonLinearIntLeading
  3478. LONG lNonLinearMaxCharWidth
  3479. LONG lNonLinearAvgCharWidth
  3480. LONG lMinA
  3481. LONG lMinC
  3482. LONG lMinD
  3483. LONG alReserved
  3484. */
  3485. #undef N3
  3486. #undef N2
  3487. return;
  3488. fdm_help:
  3489. dprintf("Usage: fdm [-?] pointer to FD_DEVICEMETRICS structure.\n");
  3490. #endif // DOES NOT SUPPORT API64
  3491. EXIT_API(S_OK);
  3492. }
  3493. /******************************Public*Routine******************************\
  3494. *
  3495. * Routine Name:
  3496. *
  3497. * vDumpRFONTList
  3498. *
  3499. * Routine Description:
  3500. *
  3501. * Dump the memory allocation information for the RFONT structures
  3502. * along the linked list.
  3503. *
  3504. * Arguments:
  3505. *
  3506. * Return Value:
  3507. *
  3508. * none
  3509. *
  3510. \**************************************************************************/
  3511. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  3512. void vDumpRFONTList(
  3513. RFONT *prfRemote,
  3514. unsigned *pcTouchedTotal,
  3515. unsigned *pcAllocTotal,
  3516. unsigned *pcjWastedTotal,
  3517. unsigned *pcjAllocTotal
  3518. )
  3519. {
  3520. RFONT rf, *prf;
  3521. for (prf = prfRemote; prf; prf = rf.rflPDEV.prfntNext) {
  3522. move( rf, prf );
  3523. if (rf.ppfe) {
  3524. PFE _pfe;
  3525. move(_pfe, rf.ppfe);
  3526. if (_pfe.pifi) {
  3527. unsigned cjIFI;
  3528. move(cjIFI, &(_pfe.pifi->cjThis));
  3529. if (cjIFI) {
  3530. IFIMETRICS *pifi;
  3531. if (pifi = tmalloc(IFIMETRICS, cjIFI)) {
  3532. // Create an IFIOBJ to get the face name
  3533. // out of the IFIMETRICS structure
  3534. move2(pifi, (_pfe.pifi), cjIFI);
  3535. IFIOBJ ifio(pifi);
  3536. dprintf("%8d, %5d,%8d,%8d,%8d,%8d,%4d,%4d,%ws\n",
  3537. rf.cache.cMetrics,
  3538. rf.cache.cGlyphs,
  3539. rf.cache.cjTotal,
  3540. (rf.cache.cjTotal + rf.cache.cjGlyphMax/2) / rf.cache.cjGlyphMax,
  3541. rf.cache.cBlocks,
  3542. rf.lMaxHeight, rf.cxMax,
  3543. rf.cache.cjGlyphMax,
  3544. ifio.pwszFaceName()
  3545. );
  3546. tfree(pifi);
  3547. }
  3548. }
  3549. }
  3550. }
  3551. }
  3552. }
  3553. #endif 0 // DOES NOT SUPPORT API64
  3554. DECLARE_API ( dispcache )
  3555. {
  3556. dprintf("Extension 'dispcache' is not converted.\n");
  3557. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  3558. PDEV *pPDEV;
  3559. char ach[32];
  3560. PARSE_ARGUMENTS(dispcache_help);
  3561. GetValue( pPDEV, "win32k!ghdev");
  3562. sprintf(ach, "-y %p", pPDEV);
  3563. pdev( hCurrentProcess, hCurrentThread, dwCurrentPc, dwProcessor, ach );
  3564. return;
  3565. dispcache_help:
  3566. dprintf("Usage: dispcache [-?]\n");
  3567. #endif // DOES NOT SUPPORT API64
  3568. EXIT_API(S_OK);
  3569. }
  3570. DECLARE_API ( xo )
  3571. {
  3572. dprintf("Extension 'xo' is not converted.\n");
  3573. dprintf("Use 'dt win32k!EXFORMOBJ Address' and '!gdikdx.mx Matrix_Address'\n");
  3574. #if ENABLE_OLD_EXTS // DOES NOT SUPPORT API64
  3575. EXFORMOBJ xo, *pxo;
  3576. MATRIX mx;
  3577. PARSE_POINTER(xo_help);
  3578. pxo = (EXFORMOBJ *)arg;
  3579. move(xo, pxo);
  3580. dprintf("EXFORMOBJ\n");
  3581. dprintf("[%8x] %8x\n", &pxo->pmx, xo.pmx);
  3582. dprintf("[%8x] %8x\n", &pxo->ulMode, xo.ulMode);
  3583. if ( xo.pmx ) {
  3584. move( mx, xo.pmx );
  3585. vDumpMATRIX( &mx, xo.pmx );
  3586. }
  3587. return;
  3588. xo_help:
  3589. dprintf("Usage: xo [-?] EXFORMOBJ pointer\n");
  3590. #endif // DOES NOT SUPPORT API64
  3591. EXIT_API(S_OK);
  3592. }