2 * PostScript driver initialization functions
4 * Copyright 1998 Huw D M Davies
5 * Copyright 2001 Marcus Meissner
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "wine/port.h"
32 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(psdrv
);
39 #ifdef HAVE_CUPS_CUPS_H
40 #include <cups/cups.h>
43 #define CUPS_SONAME "libcups.so"
46 static void *cupshandle
= NULL
;
49 static PSDRV_DEVMODEA DefaultDevmode
=
52 /* dmDeviceName */ "Wine PostScript Driver",
53 /* dmSpecVersion */ 0x30a,
54 /* dmDriverVersion */ 0x001,
55 /* dmSize */ sizeof(DEVMODEA
),
56 /* dmDriverExtra */ sizeof(PSDRV_DEVMODEA
)-sizeof(DEVMODEA
),
57 /* dmFields */ DM_ORIENTATION
| DM_PAPERSIZE
| DM_SCALE
|
58 DM_COPIES
| DM_DEFAULTSOURCE
| DM_COLOR
|
59 DM_DUPLEX
| DM_YRESOLUTION
| DM_TTOPTION
,
62 /* dmOrientation */ DMORIENT_PORTRAIT
,
63 /* dmPaperSize */ DMPAPER_LETTER
,
64 /* dmPaperLength */ 2794,
65 /* dmPaperWidth */ 2159
68 /* dmScale */ 100, /* ?? */
70 /* dmDefaultSource */ DMBIN_AUTO
,
71 /* dmPrintQuality */ 0,
72 /* dmColor */ DMCOLOR_COLOR
,
74 /* dmYResolution */ 0,
75 /* dmTTOption */ DMTT_SUBDEV
,
78 /* dmUnusedPadding */ 0,
82 /* dmDisplayFlags */ 0,
83 /* dmDisplayFrequency */ 0,
90 /* dmPanningWidth */ 0,
91 /* dmPanningHeight */ 0
97 /* numInstalledOptions */ 0
101 HANDLE PSDRV_Heap
= 0;
103 static HANDLE PSDRV_DefaultFont
= 0;
104 static LOGFONTA DefaultLogFont
= {
105 100, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
, 0, 0,
106 DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
, ""
109 /*********************************************************************
112 * Initializes font metrics and registers driver. wineps dll entry point.
115 BOOL WINAPI
DllMain( HINSTANCE hinst
, DWORD reason
, LPVOID reserved
)
117 TRACE("(%p, 0x%08lx, %p)\n", hinst
, reason
, reserved
);
121 case DLL_PROCESS_ATTACH
:
123 PSDRV_Heap
= HeapCreate(0, 0x10000, 0);
124 if (PSDRV_Heap
== (HANDLE
)NULL
)
127 if (PSDRV_GetFontMetrics() == FALSE
) {
128 HeapDestroy(PSDRV_Heap
);
132 PSDRV_DefaultFont
= CreateFontIndirectA(&DefaultLogFont
);
133 if (PSDRV_DefaultFont
== (HANDLE
)NULL
) {
134 HeapDestroy(PSDRV_Heap
);
137 #ifdef HAVE_CUPS_CUPS_H
138 /* dynamically load CUPS if not yet loaded */
140 cupshandle
= wine_dlopen(CUPS_SONAME
, RTLD_NOW
, NULL
, 0);
141 if (!cupshandle
) cupshandle
= (void*)-1;
146 case DLL_PROCESS_DETACH
:
148 DeleteObject( PSDRV_DefaultFont
);
149 HeapDestroy( PSDRV_Heap
);
150 #ifdef HAVE_CUPS_CUPS_H
151 if (cupshandle
&& (cupshandle
!= (void*)-1)) {
152 wine_dlclose(cupshandle
, NULL
, 0);
163 static void PSDRV_UpdateDevCaps( PSDRV_PDEVICE
*physDev
)
166 INT width
= 0, height
= 0;
168 if(physDev
->Devmode
->dmPublic
.dmFields
& DM_PAPERSIZE
) {
169 for(page
= physDev
->pi
->ppd
->PageSizes
; page
; page
= page
->next
) {
170 if(page
->WinPage
== physDev
->Devmode
->dmPublic
.u1
.s1
.dmPaperSize
)
175 FIXME("Can't find page\n");
176 physDev
->ImageableArea
.left
= 0;
177 physDev
->ImageableArea
.right
= 0;
178 physDev
->ImageableArea
.bottom
= 0;
179 physDev
->ImageableArea
.top
= 0;
180 physDev
->PageSize
.cx
= 0;
181 physDev
->PageSize
.cy
= 0;
182 } else if(page
->ImageableArea
) {
183 /* physDev sizes in device units; ppd sizes in 1/72" */
184 physDev
->ImageableArea
.left
= page
->ImageableArea
->llx
*
185 physDev
->logPixelsX
/ 72;
186 physDev
->ImageableArea
.right
= page
->ImageableArea
->urx
*
187 physDev
->logPixelsX
/ 72;
188 physDev
->ImageableArea
.bottom
= page
->ImageableArea
->lly
*
189 physDev
->logPixelsY
/ 72;
190 physDev
->ImageableArea
.top
= page
->ImageableArea
->ury
*
191 physDev
->logPixelsY
/ 72;
192 physDev
->PageSize
.cx
= page
->PaperDimension
->x
*
193 physDev
->logPixelsX
/ 72;
194 physDev
->PageSize
.cy
= page
->PaperDimension
->y
*
195 physDev
->logPixelsY
/ 72;
197 physDev
->ImageableArea
.left
= physDev
->ImageableArea
.bottom
= 0;
198 physDev
->ImageableArea
.right
= physDev
->PageSize
.cx
=
199 page
->PaperDimension
->x
* physDev
->logPixelsX
/ 72;
200 physDev
->ImageableArea
.top
= physDev
->PageSize
.cy
=
201 page
->PaperDimension
->y
* physDev
->logPixelsY
/ 72;
203 } else if((physDev
->Devmode
->dmPublic
.dmFields
& DM_PAPERLENGTH
) &&
204 (physDev
->Devmode
->dmPublic
.dmFields
& DM_PAPERWIDTH
)) {
205 /* physDev sizes in device units; Devmode sizes in 1/10 mm */
206 physDev
->ImageableArea
.left
= physDev
->ImageableArea
.bottom
= 0;
207 physDev
->ImageableArea
.right
= physDev
->PageSize
.cx
=
208 physDev
->Devmode
->dmPublic
.u1
.s1
.dmPaperWidth
*
209 physDev
->logPixelsX
/ 254;
210 physDev
->ImageableArea
.top
= physDev
->PageSize
.cy
=
211 physDev
->Devmode
->dmPublic
.u1
.s1
.dmPaperLength
*
212 physDev
->logPixelsY
/ 254;
214 FIXME("Odd dmFields %lx\n", physDev
->Devmode
->dmPublic
.dmFields
);
215 physDev
->ImageableArea
.left
= 0;
216 physDev
->ImageableArea
.right
= 0;
217 physDev
->ImageableArea
.bottom
= 0;
218 physDev
->ImageableArea
.top
= 0;
219 physDev
->PageSize
.cx
= 0;
220 physDev
->PageSize
.cy
= 0;
223 TRACE("ImageableArea = %d,%d - %d,%d: PageSize = %ldx%ld\n",
224 physDev
->ImageableArea
.left
, physDev
->ImageableArea
.bottom
,
225 physDev
->ImageableArea
.right
, physDev
->ImageableArea
.top
,
226 physDev
->PageSize
.cx
, physDev
->PageSize
.cy
);
228 /* these are in device units */
229 width
= physDev
->ImageableArea
.right
- physDev
->ImageableArea
.left
;
230 height
= physDev
->ImageableArea
.top
- physDev
->ImageableArea
.bottom
;
232 if(physDev
->Devmode
->dmPublic
.u1
.s1
.dmOrientation
== DMORIENT_PORTRAIT
) {
233 physDev
->horzRes
= width
;
234 physDev
->vertRes
= height
;
236 physDev
->horzRes
= height
;
237 physDev
->vertRes
= width
;
240 /* these are in mm */
241 physDev
->horzSize
= (physDev
->horzRes
* 25.4) / physDev
->logPixelsX
;
242 physDev
->vertSize
= (physDev
->vertRes
* 25.4) / physDev
->logPixelsY
;
244 TRACE("devcaps: horzSize = %dmm, vertSize = %dmm, "
245 "horzRes = %d, vertRes = %d\n",
246 physDev
->horzSize
, physDev
->vertSize
,
247 physDev
->horzRes
, physDev
->vertRes
);
251 /**********************************************************************
254 BOOL
PSDRV_CreateDC( DC
*dc
, PSDRV_PDEVICE
**pdev
, LPCSTR driver
, LPCSTR device
,
255 LPCSTR output
, const DEVMODEA
* initData
)
257 PSDRV_PDEVICE
*physDev
;
260 /* If no device name was specified, retrieve the device name
261 * from the DEVMODE structure from the DC's physDev.
262 * (See CreateCompatibleDC) */
263 if ( !device
&& *pdev
)
266 device
= physDev
->Devmode
->dmPublic
.dmDeviceName
;
268 pi
= PSDRV_FindPrinterInfo(device
);
270 TRACE("(%s %s %s %p)\n", driver
, device
, output
, initData
);
272 if(!pi
) return FALSE
;
275 MESSAGE("To use WINEPS you need to install some AFM files.\n");
279 physDev
= (PSDRV_PDEVICE
*)HeapAlloc( PSDRV_Heap
, HEAP_ZERO_MEMORY
,
281 if (!physDev
) return FALSE
;
283 physDev
->hdc
= dc
->hSelf
;
288 physDev
->Devmode
= (PSDRV_DEVMODEA
*)HeapAlloc( PSDRV_Heap
, 0,
289 sizeof(PSDRV_DEVMODEA
) );
290 if(!physDev
->Devmode
) {
291 HeapFree( PSDRV_Heap
, 0, physDev
);
295 memcpy( physDev
->Devmode
, pi
->Devmode
, sizeof(PSDRV_DEVMODEA
) );
297 physDev
->logPixelsX
= physDev
->pi
->ppd
->DefaultResolution
;
298 physDev
->logPixelsY
= physDev
->pi
->ppd
->DefaultResolution
;
300 if (!output
) output
= "LPT1:"; /* HACK */
301 physDev
->job
.output
= HeapAlloc( PSDRV_Heap
, 0, strlen(output
)+1 );
302 strcpy( physDev
->job
.output
, output
);
303 physDev
->job
.hJob
= 0;
306 PSDRV_MergeDevmodes(physDev
->Devmode
, (PSDRV_DEVMODEA
*)initData
, pi
);
309 PSDRV_UpdateDevCaps(physDev
);
310 dc
->hFont
= PSDRV_DefaultFont
;
316 /**********************************************************************
319 BOOL
PSDRV_DeleteDC( PSDRV_PDEVICE
*physDev
)
323 HeapFree( PSDRV_Heap
, 0, physDev
->Devmode
);
324 HeapFree( PSDRV_Heap
, 0, physDev
->job
.output
);
325 HeapFree( PSDRV_Heap
, 0, physDev
);
331 /**********************************************************************
334 HDC
PSDRV_ResetDC( PSDRV_PDEVICE
*physDev
, const DEVMODEA
*lpInitData
)
337 PSDRV_MergeDevmodes(physDev
->Devmode
, (PSDRV_DEVMODEA
*)lpInitData
, physDev
->pi
);
338 PSDRV_UpdateDevCaps(physDev
);
343 /***********************************************************************
344 * GetDeviceCaps (WINEPS.@)
346 INT
PSDRV_GetDeviceCaps( PSDRV_PDEVICE
*physDev
, INT cap
)
353 return DT_RASPRINTER
;
355 return MulDiv(physDev
->horzSize
, 100,
356 physDev
->Devmode
->dmPublic
.dmScale
);
358 return MulDiv(physDev
->vertSize
, 100,
359 physDev
->Devmode
->dmPublic
.dmScale
);
361 return physDev
->horzRes
;
363 return physDev
->vertRes
;
365 return (physDev
->pi
->ppd
->ColorDevice
? 8 : 1);
377 return (physDev
->pi
->ppd
->ColorDevice
? 256 : -1);
379 return sizeof(PSDRV_PDEVICE
);
381 return (CC_CIRCLES
| CC_PIE
| CC_CHORD
| CC_ELLIPSES
| CC_WIDE
|
382 CC_STYLED
| CC_WIDESTYLED
| CC_INTERIORS
| CC_ROUNDRECT
);
384 return (LC_POLYLINE
| LC_MARKER
| LC_POLYMARKER
| LC_WIDE
|
385 LC_STYLED
| LC_WIDESTYLED
| LC_INTERIORS
);
387 return (PC_POLYGON
| PC_RECTANGLE
| PC_WINDPOLYGON
| PC_SCANLINE
|
388 PC_WIDE
| PC_STYLED
| PC_WIDESTYLED
| PC_INTERIORS
);
390 return TC_CR_ANY
| TC_VA_ABLE
; /* psdrv 0x59f7 */
394 return (RC_BITBLT
| RC_BITMAP64
| RC_GDI20_OUTPUT
| RC_DIBTODEV
|
395 RC_STRETCHBLT
| RC_STRETCHDIB
); /* psdrv 0x6e99 */
396 /* Are aspect[XY] and logPixels[XY] correct? */
397 /* Need to handle different res in x and y => fix ppd */
400 return physDev
->pi
->ppd
->DefaultResolution
;
402 return (int)hypot( (double)physDev
->pi
->ppd
->DefaultResolution
,
403 (double)physDev
->pi
->ppd
->DefaultResolution
);
405 return MulDiv(physDev
->logPixelsX
,
406 physDev
->Devmode
->dmPublic
.dmScale
, 100);
408 return MulDiv(physDev
->logPixelsY
,
409 physDev
->Devmode
->dmPublic
.dmScale
, 100);
417 return (physDev
->Devmode
->dmPublic
.u1
.s1
.dmOrientation
== DMORIENT_LANDSCAPE
) ?
418 physDev
->PageSize
.cy
: physDev
->PageSize
.cx
;
420 return (physDev
->Devmode
->dmPublic
.u1
.s1
.dmOrientation
== DMORIENT_LANDSCAPE
) ?
421 physDev
->PageSize
.cx
: physDev
->PageSize
.cy
;
422 case PHYSICALOFFSETX
:
423 if(physDev
->Devmode
->dmPublic
.u1
.s1
.dmOrientation
== DMORIENT_LANDSCAPE
) {
424 if(physDev
->pi
->ppd
->LandscapeOrientation
== -90)
425 return physDev
->PageSize
.cy
- physDev
->ImageableArea
.top
;
427 return physDev
->ImageableArea
.bottom
;
429 return physDev
->ImageableArea
.left
;
431 case PHYSICALOFFSETY
:
432 if(physDev
->Devmode
->dmPublic
.u1
.s1
.dmOrientation
== DMORIENT_LANDSCAPE
) {
433 if(physDev
->pi
->ppd
->LandscapeOrientation
== -90)
434 return physDev
->PageSize
.cx
- physDev
->ImageableArea
.right
;
436 return physDev
->ImageableArea
.left
;
438 return physDev
->PageSize
.cy
- physDev
->ImageableArea
.top
;
448 FIXME("(%p): unsupported capability %d, will return 0\n", physDev
->hdc
, cap
);
454 /**********************************************************************
455 * PSDRV_FindPrinterInfo
457 PRINTERINFO
*PSDRV_FindPrinterInfo(LPCSTR name
)
459 static PRINTERINFO
*PSDRV_PrinterList
;
460 DWORD type
= REG_BINARY
, needed
, res
, dwPaperSize
;
461 PRINTERINFO
*pi
= PSDRV_PrinterList
, **last
= &PSDRV_PrinterList
;
465 const char *ppd
= NULL
;
467 char* ppdFileName
= NULL
;
469 BOOL using_default_devmode
= FALSE
;
471 TRACE("'%s'\n", name
);
474 * If this loop completes, last will point to the 'next' element of the
475 * final PRINTERINFO in the list
477 for( ; pi
; last
= &pi
->next
, pi
= pi
->next
)
478 if(!strcmp(pi
->FriendlyName
, name
))
481 pi
= *last
= HeapAlloc( PSDRV_Heap
, HEAP_ZERO_MEMORY
, sizeof(*pi
) );
485 if (!(pi
->FriendlyName
= HeapAlloc( PSDRV_Heap
, 0, strlen(name
)+1 ))) goto fail
;
486 strcpy( pi
->FriendlyName
, name
);
488 /* Use Get|SetPrinterDataExA instead? */
490 res
= DrvGetPrinterData16((LPSTR
)name
, (LPSTR
)INT_PD_DEFAULT_DEVMODE
, &type
,
493 if(res
== ERROR_INVALID_PRINTER_NAME
|| needed
!= sizeof(DefaultDevmode
)) {
494 pi
->Devmode
= HeapAlloc( PSDRV_Heap
, 0, sizeof(DefaultDevmode
) );
495 if (pi
->Devmode
== NULL
)
497 memcpy(pi
->Devmode
, &DefaultDevmode
, sizeof(DefaultDevmode
) );
498 strcpy(pi
->Devmode
->dmPublic
.dmDeviceName
,name
);
499 using_default_devmode
= TRUE
;
501 /* need to do something here AddPrinter?? */
504 pi
->Devmode
= HeapAlloc( PSDRV_Heap
, 0, needed
);
505 DrvGetPrinterData16((LPSTR
)name
, (LPSTR
)INT_PD_DEFAULT_DEVMODE
, &type
,
506 (LPBYTE
)pi
->Devmode
, needed
, &needed
);
509 if (OpenPrinterA (pi
->FriendlyName
, &hPrinter
, NULL
) == 0) {
510 ERR ("OpenPrinterA failed with code %li\n", GetLastError ());
514 #ifdef HAVE_CUPS_CUPS_H
515 if (cupshandle
!= (void*)-1) {
516 typeof(cupsGetPPD
) * pcupsGetPPD
= NULL
;
518 pcupsGetPPD
= wine_dlsym(cupshandle
, "cupsGetPPD", NULL
, 0);
520 ppd
= pcupsGetPPD(name
);
523 needed
=strlen(ppd
)+1;
524 ppdFileName
=HeapAlloc(PSDRV_Heap
, 0, needed
);
525 memcpy(ppdFileName
, ppd
, needed
);
528 /* we should unlink() that file later */
530 res
= ERROR_FILE_NOT_FOUND
;
531 WARN("Did not find ppd for %s\n",name
);
537 res
= GetPrinterDataA(hPrinter
, "PPD File", NULL
, NULL
, 0, &needed
);
538 if ((res
==ERROR_SUCCESS
) || (res
==ERROR_MORE_DATA
)) {
539 ppdFileName
=HeapAlloc(PSDRV_Heap
, 0, needed
);
540 res
= GetPrinterDataA(hPrinter
, "PPD File", &ppdType
, ppdFileName
, needed
, &needed
);
543 /* Look for a ppd file for this printer in the config file.
544 * First look under that printer's name, and then under 'generic'
546 if((res
!= ERROR_SUCCESS
) && !RegOpenKeyA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\Wine\\Config\\ppd", &hkey
))
548 const char* value_name
;
550 if (RegQueryValueExA(hkey
, name
, 0, NULL
, NULL
, &needed
) == ERROR_SUCCESS
) {
552 } else if (RegQueryValueExA(hkey
, "generic", 0, NULL
, NULL
, &needed
) == ERROR_SUCCESS
) {
553 value_name
="generic";
558 ppdFileName
=HeapAlloc(PSDRV_Heap
, 0, needed
);
559 RegQueryValueExA(hkey
, value_name
, 0, &ppdType
, ppdFileName
, &needed
);
565 res
= ERROR_FILE_NOT_FOUND
;
566 ERR ("Error %li getting PPD file name for printer '%s'\n", res
, name
);
570 if (ppdType
==REG_EXPAND_SZ
) {
573 /* Expand environment variable references */
574 needed
=ExpandEnvironmentStringsA(ppdFileName
,NULL
,0);
575 tmp
=HeapAlloc(PSDRV_Heap
, 0, needed
);
576 ExpandEnvironmentStringsA(ppdFileName
,tmp
,needed
);
577 HeapFree(PSDRV_Heap
, 0, ppdFileName
);
582 pi
->ppd
= PSDRV_ParsePPD(ppdFileName
);
584 MESSAGE("Couldn't find PPD file '%s', expect a crash now!\n",
590 if(using_default_devmode
) {
593 if(GetLocaleInfoW(LOCALE_USER_DEFAULT
, LOCALE_IPAPERSIZE
| LOCALE_RETURN_NUMBER
,
594 (LPWSTR
)&papersize
, sizeof(papersize
))) {
596 memset(&dm
, 0, sizeof(dm
));
597 dm
.dmPublic
.dmFields
= DM_PAPERSIZE
;
598 dm
.dmPublic
.u1
.s1
.dmPaperSize
= papersize
;
599 PSDRV_MergeDevmodes(pi
->Devmode
, &dm
, pi
);
601 DrvSetPrinterData16((LPSTR
)name
, (LPSTR
)INT_PD_DEFAULT_DEVMODE
,
602 REG_BINARY
, (LPBYTE
)pi
->Devmode
, sizeof(DefaultDevmode
) );
607 * This is a hack. The default paper size should be read in as part of
608 * the Devmode structure, but Wine doesn't currently provide a convenient
609 * way to configure printers.
611 res
= GetPrinterDataA (hPrinter
, "Paper Size", NULL
, (LPBYTE
) &dwPaperSize
,
612 sizeof (DWORD
), &needed
);
613 if (res
== ERROR_SUCCESS
)
614 pi
->Devmode
->dmPublic
.u1
.s1
.dmPaperSize
= (SHORT
) dwPaperSize
;
615 else if (res
== ERROR_FILE_NOT_FOUND
)
616 TRACE ("No 'Paper Size' for printer '%s'\n", name
);
618 ERR ("GetPrinterDataA returned %li\n", res
);
622 res
= EnumPrinterDataExA (hPrinter
, "PrinterDriverData\\FontSubTable", NULL
,
623 0, &needed
, &pi
->FontSubTableSize
);
624 if (res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
) {
625 TRACE ("No 'FontSubTable' for printer '%s'\n", name
);
627 else if (res
== ERROR_MORE_DATA
) {
628 pi
->FontSubTable
= HeapAlloc (PSDRV_Heap
, 0, needed
);
629 if (pi
->FontSubTable
== NULL
) {
630 ERR ("Failed to allocate %li bytes from heap\n", needed
);
634 res
= EnumPrinterDataExA (hPrinter
, "PrinterDriverData\\FontSubTable",
635 (LPBYTE
) pi
->FontSubTable
, needed
, &needed
,
636 &pi
->FontSubTableSize
);
637 if (res
!= ERROR_SUCCESS
) {
638 ERR ("EnumPrinterDataExA returned %li\n", res
);
643 ERR("EnumPrinterDataExA returned %li\n", res
);
647 if (ClosePrinter (hPrinter
) == 0) {
648 ERR ("ClosePrinter failed with code %li\n", GetLastError ());
655 for(font
= pi
->ppd
->InstalledFonts
; font
; font
= font
->next
) {
656 afm
= PSDRV_FindAFMinList(PSDRV_AFMFontList
, font
->Name
);
658 TRACE( "Couldn't find AFM file for installed printer font '%s' - "
659 "ignoring\n", font
->Name
);
663 if (PSDRV_AddAFMtoList(&pi
->Fonts
, afm
, &added
) == FALSE
) {
664 PSDRV_FreeAFMList(pi
->Fonts
);
670 if (ppd
) unlink(ppd
);
674 ClosePrinter(hPrinter
);
677 HeapFree(PSDRV_Heap
, 0, ppdFileName
);
678 if (pi
->FontSubTable
)
679 HeapFree(PSDRV_Heap
, 0, pi
->FontSubTable
);
680 if (pi
->FriendlyName
)
681 HeapFree(PSDRV_Heap
, 0, pi
->FriendlyName
);
683 HeapFree(PSDRV_Heap
, 0, pi
->Devmode
);
685 HeapFree(PSDRV_Heap
, 0, pi
);
686 if (ppd
) unlink(ppd
);