Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
92bce60f
Commit
92bce60f
authored
Apr 12, 2012
by
Huw Davies
Committed by
Alexandre Julliard
Apr 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Simplify the failure path.
parent
83ba3189
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
14 deletions
+9
-14
init.c
dlls/wineps.drv/init.c
+9
-14
No files found.
dlls/wineps.drv/init.c
View file @
92bce60f
...
...
@@ -608,7 +608,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
if
(
OpenPrinterW
(
pi
->
friendly_name
,
&
hPrinter
,
NULL
)
==
0
)
{
ERR
(
"OpenPrinter failed with code %i
\n
"
,
GetLastError
());
goto
cleanup
;
goto
fail
;
}
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
name
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
...
...
@@ -616,7 +616,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
WideCharToMultiByte
(
CP_ACP
,
0
,
name
,
-
1
,
nameA
,
len
,
NULL
,
NULL
);
pi
->
Devmode
=
get_devmode
(
hPrinter
,
name
,
&
using_default_devmode
);
if
(
!
pi
->
Devmode
)
goto
closeprinter
;
if
(
!
pi
->
Devmode
)
goto
fail
;
#ifdef SONAME_LIBCUPS
if
(
cupshandle
!=
(
void
*
)
-
1
)
{
...
...
@@ -681,7 +681,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
{
res
=
ERROR_FILE_NOT_FOUND
;
ERR
(
"Error %i getting PPD file name for printer '%s'
\n
"
,
res
,
debugstr_w
(
name
));
goto
closeprinter
;
goto
fail
;
}
ppdFileName
=
HeapAlloc
(
PSDRV_Heap
,
0
,
strlen
(
data_dir
)
+
strlen
(
filename
)
+
1
);
strcpy
(
ppdFileName
,
data_dir
);
...
...
@@ -704,7 +704,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
if
(
!
pi
->
ppd
)
{
MESSAGE
(
"Couldn't find PPD file '%s', expect a crash now!
\n
"
,
ppdFileName
);
goto
closeprinter
;
goto
fail
;
}
/* Some gimp-print ppd files don't contain a DefaultResolution line
...
...
@@ -748,7 +748,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
TRACE
(
"No 'Paper Size' for printer '%s'
\n
"
,
debugstr_w
(
name
));
else
{
ERR
(
"GetPrinterDataA returned %i
\n
"
,
res
);
goto
closeprinter
;
goto
fail
;
}
/* Duplex is indicated by the setting of the DM_DUPLEX bit in dmFields.
...
...
@@ -767,10 +767,6 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
pi
->
FontSubTable
=
load_font_sub_table
(
hPrinter
,
&
pi
->
FontSubTableSize
);
ClosePrinter
(
hPrinter
);
pi
->
Fonts
=
NULL
;
LIST_FOR_EACH_ENTRY
(
font
,
&
pi
->
ppd
->
InstalledFonts
,
FONTNAME
,
entry
)
{
afm
=
PSDRV_FindAFMinList
(
PSDRV_AFMFontList
,
font
->
Name
);
...
...
@@ -782,24 +778,23 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
BOOL
added
;
if
(
PSDRV_AddAFMtoList
(
&
pi
->
Fonts
,
afm
,
&
added
)
==
FALSE
)
{
PSDRV_FreeAFMList
(
pi
->
Fonts
);
goto
cleanup
;
goto
fail
;
}
}
}
ClosePrinter
(
hPrinter
);
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
if
(
ppd
)
unlink
(
ppd
);
list_add_head
(
&
printer_list
,
&
pi
->
entry
);
return
pi
;
closeprinter:
ClosePrinter
(
hPrinter
);
cleanup:
fail:
if
(
hPrinter
)
ClosePrinter
(
hPrinter
);
HeapFree
(
PSDRV_Heap
,
0
,
ppdFileName
);
HeapFree
(
PSDRV_Heap
,
0
,
pi
->
FontSubTable
);
HeapFree
(
PSDRV_Heap
,
0
,
pi
->
friendly_name
);
HeapFree
(
PSDRV_Heap
,
0
,
pi
->
Devmode
);
fail:
HeapFree
(
PSDRV_Heap
,
0
,
pi
);
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
if
(
ppd
)
unlink
(
ppd
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment