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
a2e6c734
Commit
a2e6c734
authored
Apr 04, 2012
by
Huw Davies
Committed by
Alexandre Julliard
Apr 04, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Change the printer info list into a standard list.
parent
a37ee1e2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
15 deletions
+12
-15
init.c
dlls/wineps.drv/init.c
+9
-13
psdrv.h
dlls/wineps.drv/psdrv.h
+3
-2
No files found.
dlls/wineps.drv/init.c
View file @
a2e6c734
...
@@ -530,15 +530,15 @@ static INT PSDRV_GetDeviceCaps( PHYSDEV dev, INT cap )
...
@@ -530,15 +530,15 @@ static INT PSDRV_GetDeviceCaps( PHYSDEV dev, INT cap )
}
}
}
}
static
struct
list
printer_list
=
LIST_INIT
(
printer_list
);
/**********************************************************************
/**********************************************************************
* PSDRV_FindPrinterInfo
* PSDRV_FindPrinterInfo
*/
*/
PRINTERINFO
*
PSDRV_FindPrinterInfo
(
LPCWSTR
name
)
PRINTERINFO
*
PSDRV_FindPrinterInfo
(
LPCWSTR
name
)
{
{
static
PRINTERINFO
*
PSDRV_PrinterList
;
DWORD
type
=
REG_BINARY
,
needed
,
res
,
dwPaperSize
;
DWORD
type
=
REG_BINARY
,
needed
,
res
,
dwPaperSize
;
PRINTERINFO
*
pi
=
PSDRV_PrinterList
,
**
last
=
&
PSDRV_PrinterList
;
PRINTERINFO
*
pi
;
FONTNAME
*
font
;
FONTNAME
*
font
;
const
AFM
*
afm
;
const
AFM
*
afm
;
HANDLE
hPrinter
=
0
;
HANDLE
hPrinter
=
0
;
...
@@ -551,17 +551,14 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
...
@@ -551,17 +551,14 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
TRACE
(
"'%s'
\n
"
,
debugstr_w
(
name
));
TRACE
(
"'%s'
\n
"
,
debugstr_w
(
name
));
/*
LIST_FOR_EACH_ENTRY
(
pi
,
&
printer_list
,
PRINTERINFO
,
entry
)
* If this loop completes, last will point to the 'next' element of the
{
* final PRINTERINFO in the list
if
(
!
strcmpW
(
pi
->
friendly_name
,
name
))
*/
for
(
;
pi
;
last
=
&
pi
->
next
,
pi
=
pi
->
next
)
if
(
!
strcmpW
(
pi
->
friendly_name
,
name
))
return
pi
;
return
pi
;
}
pi
=
*
last
=
HeapAlloc
(
PSDRV_Heap
,
HEAP_ZERO_MEMORY
,
sizeof
(
*
pi
)
);
pi
=
HeapAlloc
(
PSDRV_Heap
,
HEAP_ZERO_MEMORY
,
sizeof
(
*
pi
)
);
if
(
pi
==
NULL
)
if
(
pi
==
NULL
)
return
NULL
;
return
NULL
;
if
(
!
(
pi
->
friendly_name
=
HeapAlloc
(
PSDRV_Heap
,
0
,
(
strlenW
(
name
)
+
1
)
*
sizeof
(
WCHAR
)
)))
goto
fail
;
if
(
!
(
pi
->
friendly_name
=
HeapAlloc
(
PSDRV_Heap
,
0
,
(
strlenW
(
name
)
+
1
)
*
sizeof
(
WCHAR
)
)))
goto
fail
;
strcpyW
(
pi
->
friendly_name
,
name
);
strcpyW
(
pi
->
friendly_name
,
name
);
...
@@ -775,7 +772,6 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
...
@@ -775,7 +772,6 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
goto
cleanup
;
goto
cleanup
;
}
}
pi
->
next
=
NULL
;
pi
->
Fonts
=
NULL
;
pi
->
Fonts
=
NULL
;
for
(
font
=
pi
->
ppd
->
InstalledFonts
;
font
;
font
=
font
->
next
)
{
for
(
font
=
pi
->
ppd
->
InstalledFonts
;
font
;
font
=
font
->
next
)
{
...
@@ -795,6 +791,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
...
@@ -795,6 +791,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
}
}
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
if
(
ppd
)
unlink
(
ppd
);
if
(
ppd
)
unlink
(
ppd
);
list_add_head
(
&
printer_list
,
&
pi
->
entry
);
return
pi
;
return
pi
;
closeprinter:
closeprinter:
...
@@ -808,7 +805,6 @@ fail:
...
@@ -808,7 +805,6 @@ fail:
HeapFree
(
PSDRV_Heap
,
0
,
pi
);
HeapFree
(
PSDRV_Heap
,
0
,
pi
);
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
if
(
ppd
)
unlink
(
ppd
);
if
(
ppd
)
unlink
(
ppd
);
*
last
=
NULL
;
return
NULL
;
return
NULL
;
}
}
...
...
dlls/wineps.drv/psdrv.h
View file @
a2e6c734
...
@@ -241,14 +241,15 @@ numInstalledOptions of OPTIONs
...
@@ -241,14 +241,15 @@ numInstalledOptions of OPTIONs
}
PSDRV_DEVMODEA
;
}
PSDRV_DEVMODEA
;
typedef
struct
_tagPI
{
typedef
struct
{
struct
list
entry
;
WCHAR
*
friendly_name
;
WCHAR
*
friendly_name
;
PPD
*
ppd
;
PPD
*
ppd
;
PSDRV_DEVMODEA
*
Devmode
;
PSDRV_DEVMODEA
*
Devmode
;
FONTFAMILY
*
Fonts
;
FONTFAMILY
*
Fonts
;
PPRINTER_ENUM_VALUESA
FontSubTable
;
PPRINTER_ENUM_VALUESA
FontSubTable
;
DWORD
FontSubTableSize
;
DWORD
FontSubTableSize
;
struct
_tagPI
*
next
;
}
PRINTERINFO
;
}
PRINTERINFO
;
typedef
struct
{
typedef
struct
{
...
...
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