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"
30 #define NONAMELESSUNION
31 #define NONAMELESSSTRUCT
34 #include "wine/debug.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(psdrv
);
41 #ifdef HAVE_CUPS_CUPS_H
42 #include <cups/cups.h>
44 #ifndef SONAME_LIBCUPS
45 #define SONAME_LIBCUPS "libcups.so"
48 static void *cupshandle
= NULL
;
51 static PSDRV_DEVMODEA DefaultDevmode
=
54 /* dmDeviceName */ "Wine PostScript Driver",
55 /* dmSpecVersion */ 0x30a,
56 /* dmDriverVersion */ 0x001,
57 /* dmSize */ sizeof(DEVMODEA
),
58 /* dmDriverExtra */ sizeof(PSDRV_DEVMODEA
)-sizeof(DEVMODEA
),
59 /* dmFields */ DM_ORIENTATION
| DM_PAPERSIZE
| DM_SCALE
|
60 DM_COPIES
| DM_DEFAULTSOURCE
| DM_COLOR
|
61 DM_DUPLEX
| DM_YRESOLUTION
| DM_TTOPTION
,
64 /* dmOrientation */ DMORIENT_PORTRAIT
,
65 /* dmPaperSize */ DMPAPER_LETTER
,
66 /* dmPaperLength */ 2794,
67 /* dmPaperWidth */ 2159
70 /* dmScale */ 100, /* ?? */
72 /* dmDefaultSource */ DMBIN_AUTO
,
73 /* dmPrintQuality */ 0,
74 /* dmColor */ DMCOLOR_COLOR
,
76 /* dmYResolution */ 0,
77 /* dmTTOption */ DMTT_SUBDEV
,
80 /* dmUnusedPadding */ 0,
84 /* dmDisplayFlags */ 0,
85 /* dmDisplayFrequency */ 0,
92 /* dmPanningWidth */ 0,
93 /* dmPanningHeight */ 0
99 /* numInstalledOptions */ 0
103 HANDLE PSDRV_Heap
= 0;
105 static HANDLE PSDRV_DefaultFont
= 0;
106 static LOGFONTA DefaultLogFont
= {
107 100, 0, 0, 0, FW_NORMAL
, FALSE
, FALSE
, FALSE
, ANSI_CHARSET
, 0, 0,
108 DEFAULT_QUALITY
, FIXED_PITCH
| FF_MODERN
, ""
111 /*********************************************************************
114 * Initializes font metrics and registers driver. wineps dll entry point.
117 BOOL WINAPI
DllMain( HINSTANCE hinst
, DWORD reason
, LPVOID reserved
)
119 TRACE("(%p, 0x%08lx, %p)\n", hinst
, reason
, reserved
);
123 case DLL_PROCESS_ATTACH
:
125 PSDRV_Heap
= HeapCreate(0, 0x10000, 0);
126 if (PSDRV_Heap
== NULL
)
129 if (PSDRV_GetFontMetrics() == FALSE
) {
130 HeapDestroy(PSDRV_Heap
);
134 PSDRV_DefaultFont
= CreateFontIndirectA(&DefaultLogFont
);
135 if (PSDRV_DefaultFont
== NULL
) {
136 HeapDestroy(PSDRV_Heap
);
139 #ifdef HAVE_CUPS_CUPS_H
140 /* dynamically load CUPS if not yet loaded */
142 cupshandle
= wine_dlopen(SONAME_LIBCUPS
, RTLD_NOW
, NULL
, 0);
143 if (!cupshandle
) cupshandle
= (void*)-1;
148 case DLL_PROCESS_DETACH
:
150 DeleteObject( PSDRV_DefaultFont
);
151 HeapDestroy( PSDRV_Heap
);
152 #ifdef HAVE_CUPS_CUPS_H
153 if (cupshandle
&& (cupshandle
!= (void*)-1)) {
154 wine_dlclose(cupshandle
, NULL
, 0);
165 static void PSDRV_UpdateDevCaps( PSDRV_PDEVICE
*physDev
)
168 INT width
= 0, height
= 0;
170 if(physDev
->Devmode
->dmPublic
.dmFields
& DM_PAPERSIZE
) {
171 for(page
= physDev
->pi
->ppd
->PageSizes
; page
; page
= page
->next
) {
172 if(page
->WinPage
== physDev
->Devmode
->dmPublic
.u1
.s1
.dmPaperSize
)
177 FIXME("Can't find page\n");
178 physDev
->ImageableArea
.left
= 0;
179 physDev
->ImageableArea
.right
= 0;
180 physDev
->ImageableArea
.bottom
= 0;
181 physDev
->ImageableArea
.top
= 0;
182 physDev
->PageSize
.cx
= 0;
183 physDev
->PageSize
.cy
= 0;
184 } else if(page
->ImageableArea
) {
185 /* physDev sizes in device units; ppd sizes in 1/72" */
186 physDev
->ImageableArea
.left
= page
->ImageableArea
->llx
*
187 physDev
->logPixelsX
/ 72;
188 physDev
->ImageableArea
.right
= page
->ImageableArea
->urx
*
189 physDev
->logPixelsX
/ 72;
190 physDev
->ImageableArea
.bottom
= page
->ImageableArea
->lly
*
191 physDev
->logPixelsY
/ 72;
192 physDev
->ImageableArea
.top
= page
->ImageableArea
->ury
*
193 physDev
->logPixelsY
/ 72;
194 physDev
->PageSize
.cx
= page
->PaperDimension
->x
*
195 physDev
->logPixelsX
/ 72;
196 physDev
->PageSize
.cy
= page
->PaperDimension
->y
*
197 physDev
->logPixelsY
/ 72;
199 physDev
->ImageableArea
.left
= physDev
->ImageableArea
.bottom
= 0;
200 physDev
->ImageableArea
.right
= physDev
->PageSize
.cx
=
201 page
->PaperDimension
->x
* physDev
->logPixelsX
/ 72;
202 physDev
->ImageableArea
.top
= physDev
->PageSize
.cy
=
203 page
->PaperDimension
->y
* physDev
->logPixelsY
/ 72;
205 } else if((physDev
->Devmode
->dmPublic
.dmFields
& DM_PAPERLENGTH
) &&
206 (physDev
->Devmode
->dmPublic
.dmFields
& DM_PAPERWIDTH
)) {
207 /* physDev sizes in device units; Devmode sizes in 1/10 mm */
208 physDev
->ImageableArea
.left
= physDev
->ImageableArea
.bottom
= 0;
209 physDev
->ImageableArea
.right
= physDev
->PageSize
.cx
=
210 physDev
->Devmode
->dmPublic
.u1
.s1
.dmPaperWidth
*
211 physDev
->logPixelsX
/ 254;
212 physDev
->ImageableArea
.top
= physDev
->PageSize
.cy
=
213 physDev
->Devmode
->dmPublic
.u1
.s1
.dmPaperLength
*
214 physDev
->logPixelsY
/ 254;
216 FIXME("Odd dmFields %lx\n", physDev
->Devmode
->dmPublic
.dmFields
);
217 physDev
->ImageableArea
.left
= 0;
218 physDev
->ImageableArea
.right
= 0;
219 physDev
->ImageableArea
.bottom
= 0;
220 physDev
->ImageableArea
.top
= 0;
221 physDev
->PageSize
.cx
= 0;
222 physDev
->PageSize
.cy
= 0;
225 TRACE("ImageableArea = %ld,%ld - %ld,%ld: PageSize = %ldx%ld\n",
226 physDev
->ImageableArea
.left
, physDev
->ImageableArea
.bottom
,
227 physDev
->ImageableArea
.right
, physDev
->ImageableArea
.top
,
228 physDev
->PageSize
.cx
, physDev
->PageSize
.cy
);
230 /* these are in device units */
231 width
= physDev
->ImageableArea
.right
- physDev
->ImageableArea
.left
;
232 height
= physDev
->ImageableArea
.top
- physDev
->ImageableArea
.bottom
;
234 if(physDev
->Devmode
->dmPublic
.u1
.s1
.dmOrientation
== DMORIENT_PORTRAIT
) {
235 physDev
->horzRes
= width
;
236 physDev
->vertRes
= height
;
238 physDev
->horzRes
= height
;
239 physDev
->vertRes
= width
;
242 /* these are in mm */
243 physDev
->horzSize
= (physDev
->horzRes
* 25.4) / physDev
->logPixelsX
;
244 physDev
->vertSize
= (physDev
->vertRes
* 25.4) / physDev
->logPixelsY
;
246 TRACE("devcaps: horzSize = %dmm, vertSize = %dmm, "
247 "horzRes = %d, vertRes = %d\n",
248 physDev
->horzSize
, physDev
->vertSize
,
249 physDev
->horzRes
, physDev
->vertRes
);
253 /**********************************************************************
256 BOOL
PSDRV_CreateDC( DC
*dc
, PSDRV_PDEVICE
**pdev
, LPCSTR driver
, LPCSTR device
,
257 LPCSTR output
, const DEVMODEA
* initData
)
259 PSDRV_PDEVICE
*physDev
;
262 /* If no device name was specified, retrieve the device name
263 * from the DEVMODE structure from the DC's physDev.
264 * (See CreateCompatibleDC) */
265 if ( !device
&& *pdev
)
268 device
= physDev
->Devmode
->dmPublic
.dmDeviceName
;
270 pi
= PSDRV_FindPrinterInfo(device
);
272 TRACE("(%s %s %s %p)\n", driver
, device
, output
, initData
);
274 if(!pi
) return FALSE
;
277 MESSAGE("To use WINEPS you need to install some AFM files.\n");
281 physDev
= (PSDRV_PDEVICE
*)HeapAlloc( PSDRV_Heap
, HEAP_ZERO_MEMORY
,
283 if (!physDev
) return FALSE
;
285 physDev
->hdc
= dc
->hSelf
;
290 physDev
->Devmode
= (PSDRV_DEVMODEA
*)HeapAlloc( PSDRV_Heap
, 0,
291 sizeof(PSDRV_DEVMODEA
) );
292 if(!physDev
->Devmode
) {
293 HeapFree( PSDRV_Heap
, 0, physDev
);
297 memcpy( physDev
->Devmode
, pi
->Devmode
, sizeof(PSDRV_DEVMODEA
) );
299 physDev
->logPixelsX
= physDev
->pi
->ppd
->DefaultResolution
;
300 physDev
->logPixelsY
= physDev
->pi
->ppd
->DefaultResolution
;
302 if (!output
) output
= "LPT1:"; /* HACK */
303 physDev
->job
.output
= HeapAlloc( PSDRV_Heap
, 0, strlen(output
)+1 );
304 strcpy( physDev
->job
.output
, output
);
305 physDev
->job
.hJob
= 0;
308 PSDRV_MergeDevmodes(physDev
->Devmode
, (PSDRV_DEVMODEA
*)initData
, pi
);
311 PSDRV_UpdateDevCaps(physDev
);
312 dc
->hFont
= PSDRV_DefaultFont
;
318 /**********************************************************************
321 BOOL
PSDRV_DeleteDC( PSDRV_PDEVICE
*physDev
)
325 HeapFree( PSDRV_Heap
, 0, physDev
->Devmode
);
326 HeapFree( PSDRV_Heap
, 0, physDev
->job
.output
);
327 HeapFree( PSDRV_Heap
, 0, physDev
);
333 /**********************************************************************
336 HDC
PSDRV_ResetDC( PSDRV_PDEVICE
*physDev
, const DEVMODEA
*lpInitData
)
339 PSDRV_MergeDevmodes(physDev
->Devmode
, (PSDRV_DEVMODEA
*)lpInitData
, physDev
->pi
);
340 PSDRV_UpdateDevCaps(physDev
);
345 /***********************************************************************
346 * GetDeviceCaps (WINEPS.@)
348 INT
PSDRV_GetDeviceCaps( PSDRV_PDEVICE
*physDev
, INT cap
)
355 return DT_RASPRINTER
;
357 return MulDiv(physDev
->horzSize
, 100,
358 physDev
->Devmode
->dmPublic
.dmScale
);
360 return MulDiv(physDev
->vertSize
, 100,
361 physDev
->Devmode
->dmPublic
.dmScale
);
363 return physDev
->horzRes
;
365 return physDev
->vertRes
;
367 return (physDev
->pi
->ppd
->ColorDevice
? 8 : 1);
379 return (physDev
->pi
->ppd
->ColorDevice
? 256 : -1);
381 return sizeof(PSDRV_PDEVICE
);
383 return (CC_CIRCLES
| CC_PIE
| CC_CHORD
| CC_ELLIPSES
| CC_WIDE
|
384 CC_STYLED
| CC_WIDESTYLED
| CC_INTERIORS
| CC_ROUNDRECT
);
386 return (LC_POLYLINE
| LC_MARKER
| LC_POLYMARKER
| LC_WIDE
|
387 LC_STYLED
| LC_WIDESTYLED
| LC_INTERIORS
);
389 return (PC_POLYGON
| PC_RECTANGLE
| PC_WINDPOLYGON
| PC_SCANLINE
|
390 PC_WIDE
| PC_STYLED
| PC_WIDESTYLED
| PC_INTERIORS
);
392 return TC_CR_ANY
| TC_VA_ABLE
; /* psdrv 0x59f7 */
396 return (RC_BITBLT
| RC_BITMAP64
| RC_GDI20_OUTPUT
| RC_DIBTODEV
|
397 RC_STRETCHBLT
| RC_STRETCHDIB
); /* psdrv 0x6e99 */
398 /* Are aspect[XY] and logPixels[XY] correct? */
399 /* Need to handle different res in x and y => fix ppd */
402 return physDev
->pi
->ppd
->DefaultResolution
;
404 return (int)hypot( (double)physDev
->pi
->ppd
->DefaultResolution
,
405 (double)physDev
->pi
->ppd
->DefaultResolution
);
407 return MulDiv(physDev
->logPixelsX
,
408 physDev
->Devmode
->dmPublic
.dmScale
, 100);
410 return MulDiv(physDev
->logPixelsY
,
411 physDev
->Devmode
->dmPublic
.dmScale
, 100);
419 return (physDev
->Devmode
->dmPublic
.u1
.s1
.dmOrientation
== DMORIENT_LANDSCAPE
) ?
420 physDev
->PageSize
.cy
: physDev
->PageSize
.cx
;
422 return (physDev
->Devmode
->dmPublic
.u1
.s1
.dmOrientation
== DMORIENT_LANDSCAPE
) ?
423 physDev
->PageSize
.cx
: physDev
->PageSize
.cy
;
424 case PHYSICALOFFSETX
:
425 if(physDev
->Devmode
->dmPublic
.u1
.s1
.dmOrientation
== DMORIENT_LANDSCAPE
) {
426 if(physDev
->pi
->ppd
->LandscapeOrientation
== -90)
427 return physDev
->PageSize
.cy
- physDev
->ImageableArea
.top
;
429 return physDev
->ImageableArea
.bottom
;
431 return physDev
->ImageableArea
.left
;
433 case PHYSICALOFFSETY
:
434 if(physDev
->Devmode
->dmPublic
.u1
.s1
.dmOrientation
== DMORIENT_LANDSCAPE
) {
435 if(physDev
->pi
->ppd
->LandscapeOrientation
== -90)
436 return physDev
->PageSize
.cx
- physDev
->ImageableArea
.right
;
438 return physDev
->ImageableArea
.left
;
440 return physDev
->PageSize
.cy
- physDev
->ImageableArea
.top
;
450 FIXME("(%p): unsupported capability %d, will return 0\n", physDev
->hdc
, cap
);
456 /**********************************************************************
457 * PSDRV_FindPrinterInfo
459 PRINTERINFO
*PSDRV_FindPrinterInfo(LPCSTR name
)
461 static PRINTERINFO
*PSDRV_PrinterList
;
462 DWORD type
= REG_BINARY
, needed
, res
, dwPaperSize
;
463 PRINTERINFO
*pi
= PSDRV_PrinterList
, **last
= &PSDRV_PrinterList
;
467 const char *ppd
= NULL
;
469 char* ppdFileName
= NULL
;
471 BOOL using_default_devmode
= FALSE
;
473 TRACE("'%s'\n", name
);
476 * If this loop completes, last will point to the 'next' element of the
477 * final PRINTERINFO in the list
479 for( ; pi
; last
= &pi
->next
, pi
= pi
->next
)
480 if(!strcmp(pi
->FriendlyName
, name
))
483 pi
= *last
= HeapAlloc( PSDRV_Heap
, HEAP_ZERO_MEMORY
, sizeof(*pi
) );
487 if (!(pi
->FriendlyName
= HeapAlloc( PSDRV_Heap
, 0, strlen(name
)+1 ))) goto fail
;
488 strcpy( pi
->FriendlyName
, name
);
490 /* Use Get|SetPrinterDataExA instead? */
492 res
= DrvGetPrinterData16((LPSTR
)name
, (LPSTR
)INT_PD_DEFAULT_DEVMODE
, &type
,
495 if(res
== ERROR_INVALID_PRINTER_NAME
|| needed
!= sizeof(DefaultDevmode
)) {
496 pi
->Devmode
= HeapAlloc( PSDRV_Heap
, 0, sizeof(DefaultDevmode
) );
497 if (pi
->Devmode
== NULL
)
499 memcpy(pi
->Devmode
, &DefaultDevmode
, sizeof(DefaultDevmode
) );
500 strcpy(pi
->Devmode
->dmPublic
.dmDeviceName
,name
);
501 using_default_devmode
= TRUE
;
503 /* need to do something here AddPrinter?? */
506 pi
->Devmode
= HeapAlloc( PSDRV_Heap
, 0, needed
);
507 DrvGetPrinterData16((LPSTR
)name
, (LPSTR
)INT_PD_DEFAULT_DEVMODE
, &type
,
508 (LPBYTE
)pi
->Devmode
, needed
, &needed
);
511 if (OpenPrinterA (pi
->FriendlyName
, &hPrinter
, NULL
) == 0) {
512 ERR ("OpenPrinterA failed with code %li\n", GetLastError ());
516 #ifdef HAVE_CUPS_CUPS_H
517 if (cupshandle
!= (void*)-1) {
518 typeof(cupsGetPPD
) * pcupsGetPPD
= NULL
;
520 pcupsGetPPD
= wine_dlsym(cupshandle
, "cupsGetPPD", NULL
, 0);
522 ppd
= pcupsGetPPD(name
);
525 needed
=strlen(ppd
)+1;
526 ppdFileName
=HeapAlloc(PSDRV_Heap
, 0, needed
);
527 memcpy(ppdFileName
, ppd
, needed
);
530 /* we should unlink() that file later */
532 res
= ERROR_FILE_NOT_FOUND
;
533 WARN("Did not find ppd for %s\n",name
);
539 res
= GetPrinterDataA(hPrinter
, "PPD File", NULL
, NULL
, 0, &needed
);
540 if ((res
==ERROR_SUCCESS
) || (res
==ERROR_MORE_DATA
)) {
541 ppdFileName
=HeapAlloc(PSDRV_Heap
, 0, needed
);
542 res
= GetPrinterDataA(hPrinter
, "PPD File", &ppdType
, ppdFileName
, needed
, &needed
);
545 /* Look for a ppd file for this printer in the config file.
546 * First look under that printer's name, and then under 'generic'
548 if((res
!= ERROR_SUCCESS
) && !RegOpenKeyA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\Wine\\Config\\ppd", &hkey
))
550 const char* value_name
;
552 if (RegQueryValueExA(hkey
, name
, 0, NULL
, NULL
, &needed
) == ERROR_SUCCESS
) {
554 } else if (RegQueryValueExA(hkey
, "generic", 0, NULL
, NULL
, &needed
) == ERROR_SUCCESS
) {
555 value_name
="generic";
560 ppdFileName
=HeapAlloc(PSDRV_Heap
, 0, needed
);
561 RegQueryValueExA(hkey
, value_name
, 0, &ppdType
, ppdFileName
, &needed
);
567 res
= ERROR_FILE_NOT_FOUND
;
568 ERR ("Error %li getting PPD file name for printer '%s'\n", res
, name
);
572 if (ppdType
==REG_EXPAND_SZ
) {
575 /* Expand environment variable references */
576 needed
=ExpandEnvironmentStringsA(ppdFileName
,NULL
,0);
577 tmp
=HeapAlloc(PSDRV_Heap
, 0, needed
);
578 ExpandEnvironmentStringsA(ppdFileName
,tmp
,needed
);
579 HeapFree(PSDRV_Heap
, 0, ppdFileName
);
584 pi
->ppd
= PSDRV_ParsePPD(ppdFileName
);
586 MESSAGE("Couldn't find PPD file '%s', expect a crash now!\n",
592 if(using_default_devmode
) {
595 if(GetLocaleInfoW(LOCALE_USER_DEFAULT
, LOCALE_IPAPERSIZE
| LOCALE_RETURN_NUMBER
,
596 (LPWSTR
)&papersize
, sizeof(papersize
))) {
598 memset(&dm
, 0, sizeof(dm
));
599 dm
.dmPublic
.dmFields
= DM_PAPERSIZE
;
600 dm
.dmPublic
.u1
.s1
.dmPaperSize
= papersize
;
601 PSDRV_MergeDevmodes(pi
->Devmode
, &dm
, pi
);
603 DrvSetPrinterData16((LPSTR
)name
, (LPSTR
)INT_PD_DEFAULT_DEVMODE
,
604 REG_BINARY
, (LPBYTE
)pi
->Devmode
, sizeof(DefaultDevmode
) );
609 * This is a hack. The default paper size should be read in as part of
610 * the Devmode structure, but Wine doesn't currently provide a convenient
611 * way to configure printers.
613 res
= GetPrinterDataA (hPrinter
, "Paper Size", NULL
, (LPBYTE
) &dwPaperSize
,
614 sizeof (DWORD
), &needed
);
615 if (res
== ERROR_SUCCESS
)
616 pi
->Devmode
->dmPublic
.u1
.s1
.dmPaperSize
= (SHORT
) dwPaperSize
;
617 else if (res
== ERROR_FILE_NOT_FOUND
)
618 TRACE ("No 'Paper Size' for printer '%s'\n", name
);
620 ERR ("GetPrinterDataA returned %li\n", res
);
624 res
= EnumPrinterDataExA (hPrinter
, "PrinterDriverData\\FontSubTable", NULL
,
625 0, &needed
, &pi
->FontSubTableSize
);
626 if (res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
) {
627 TRACE ("No 'FontSubTable' for printer '%s'\n", name
);
629 else if (res
== ERROR_MORE_DATA
) {
630 pi
->FontSubTable
= HeapAlloc (PSDRV_Heap
, 0, needed
);
631 if (pi
->FontSubTable
== NULL
) {
632 ERR ("Failed to allocate %li bytes from heap\n", needed
);
636 res
= EnumPrinterDataExA (hPrinter
, "PrinterDriverData\\FontSubTable",
637 (LPBYTE
) pi
->FontSubTable
, needed
, &needed
,
638 &pi
->FontSubTableSize
);
639 if (res
!= ERROR_SUCCESS
) {
640 ERR ("EnumPrinterDataExA returned %li\n", res
);
645 ERR("EnumPrinterDataExA returned %li\n", res
);
649 if (ClosePrinter (hPrinter
) == 0) {
650 ERR ("ClosePrinter failed with code %li\n", GetLastError ());
657 for(font
= pi
->ppd
->InstalledFonts
; font
; font
= font
->next
) {
658 afm
= PSDRV_FindAFMinList(PSDRV_AFMFontList
, font
->Name
);
660 TRACE( "Couldn't find AFM file for installed printer font '%s' - "
661 "ignoring\n", font
->Name
);
665 if (PSDRV_AddAFMtoList(&pi
->Fonts
, afm
, &added
) == FALSE
) {
666 PSDRV_FreeAFMList(pi
->Fonts
);
672 if (ppd
) unlink(ppd
);
676 ClosePrinter(hPrinter
);
679 HeapFree(PSDRV_Heap
, 0, ppdFileName
);
680 if (pi
->FontSubTable
)
681 HeapFree(PSDRV_Heap
, 0, pi
->FontSubTable
);
682 if (pi
->FriendlyName
)
683 HeapFree(PSDRV_Heap
, 0, pi
->FriendlyName
);
685 HeapFree(PSDRV_Heap
, 0, pi
->Devmode
);
687 HeapFree(PSDRV_Heap
, 0, pi
);
688 if (ppd
) unlink(ppd
);