Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
495267e5
Commit
495267e5
authored
Nov 15, 2009
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Nov 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Don't depend on 16-bit PrinterData functions from gdi.
parent
c00b7594
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
21 deletions
+23
-21
gdi32.spec
dlls/gdi32/gdi32.spec
+0
-2
init.c
dlls/wineps.drv/init.c
+23
-19
No files found.
dlls/gdi32/gdi32.spec
View file @
495267e5
...
...
@@ -514,8 +514,6 @@
# Wine extensions: Win16 functions that are needed by other dlls
#
@ stdcall CloseJob16(long)
@ stdcall DrvGetPrinterData16(str str ptr ptr long ptr)
@ stdcall DrvSetPrinterData16(str str long ptr long)
@ stdcall GetDCHook(long ptr)
@ stdcall OpenJob16(str str long)
@ stdcall SelectVisRgn(long long)
...
...
dlls/wineps.drv/init.c
View file @
495267e5
...
...
@@ -111,6 +111,8 @@ static const LOGFONTA DefaultLogFont = {
DEFAULT_QUALITY
,
FIXED_PITCH
|
FF_MODERN
,
""
};
static
const
CHAR
default_devmodeA
[]
=
"Default DevMode"
;
/*********************************************************************
* DllMain
*
...
...
@@ -532,7 +534,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
PRINTERINFO
*
pi
=
PSDRV_PrinterList
,
**
last
=
&
PSDRV_PrinterList
;
FONTNAME
*
font
;
const
AFM
*
afm
;
HANDLE
hPrinter
;
HANDLE
hPrinter
=
0
;
const
char
*
ppd
=
NULL
;
DWORD
ppdType
;
char
*
ppdFileName
=
NULL
;
...
...
@@ -556,32 +558,33 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
if
(
!
(
pi
->
FriendlyName
=
HeapAlloc
(
PSDRV_Heap
,
0
,
strlen
(
name
)
+
1
)))
goto
fail
;
strcpy
(
pi
->
FriendlyName
,
name
);
/* Use Get|SetPrinterDataExA instead? */
if
(
OpenPrinterA
(
pi
->
FriendlyName
,
&
hPrinter
,
NULL
)
==
0
)
{
ERR
(
"OpenPrinterA failed with code %i
\n
"
,
GetLastError
());
goto
cleanup
;
}
res
=
DrvGetPrinterData16
((
LPSTR
)
name
,
(
LPSTR
)
INT_PD_DEFAULT_DEVMODE
,
&
type
,
NULL
,
0
,
&
needed
);
needed
=
0
;
res
=
GetPrinterDataExA
(
hPrinter
,
NULL
,
default_devmodeA
,
&
type
,
NULL
,
0
,
&
needed
);
if
(
res
==
ERROR_INVALID_PRINTER_NAME
||
needed
!=
sizeof
(
DefaultDevmode
))
{
if
(
needed
<
sizeof
(
DefaultDevmode
))
{
pi
->
Devmode
=
HeapAlloc
(
PSDRV_Heap
,
0
,
sizeof
(
DefaultDevmode
)
);
if
(
pi
->
Devmode
==
NULL
)
goto
cleanup
;
*
pi
->
Devmode
=
DefaultDevmode
;
lstrcpynA
((
LPSTR
)
pi
->
Devmode
->
dmPublic
.
dmDeviceName
,
name
,
CCHDEVICENAME
);
using_default_devmode
=
TRUE
;
if
(
pi
->
Devmode
==
NULL
)
goto
closeprinter
;
/* need to do something here AddPrinter?? */
*
pi
->
Devmode
=
DefaultDevmode
;
lstrcpynA
((
LPSTR
)
pi
->
Devmode
->
dmPublic
.
dmDeviceName
,
name
,
CCHDEVICENAME
);
using_default_devmode
=
TRUE
;
}
else
{
pi
->
Devmode
=
HeapAlloc
(
PSDRV_Heap
,
0
,
needed
);
DrvGetPrinterData16
((
LPSTR
)
name
,
(
LPSTR
)
INT_PD_DEFAULT_DEVMODE
,
&
type
,
(
LPBYTE
)
pi
->
Devmode
,
needed
,
&
needed
);
}
if
(
pi
->
Devmode
==
NULL
)
goto
closeprinter
;
if
(
OpenPrinterA
(
pi
->
FriendlyName
,
&
hPrinter
,
NULL
)
==
0
)
{
ERR
(
"OpenPrinterA failed with code %i
\n
"
,
GetLastError
());
goto
cleanup
;
GetPrinterDataExA
(
hPrinter
,
NULL
,
default_devmodeA
,
&
type
,
(
LPBYTE
)
pi
->
Devmode
,
needed
,
&
needed
);
}
#ifdef SONAME_LIBCUPS
if
(
cupshandle
!=
(
void
*
)
-
1
)
{
typeof
(
cupsGetPPD
)
*
pcupsGetPPD
=
NULL
;
...
...
@@ -687,8 +690,9 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
dm
.
dmPublic
.
u1
.
s1
.
dmPaperSize
=
papersize
;
PSDRV_MergeDevmodes
(
pi
->
Devmode
,
&
dm
,
pi
);
}
DrvSetPrinterData16
((
LPSTR
)
name
,
(
LPSTR
)
INT_PD_DEFAULT_DEVMODE
,
REG_BINARY
,
(
LPBYTE
)
pi
->
Devmode
,
sizeof
(
DefaultDevmode
)
);
SetPrinterDataExA
(
hPrinter
,
NULL
,
default_devmodeA
,
REG_BINARY
,
(
LPBYTE
)
pi
->
Devmode
,
sizeof
(
DefaultDevmode
));
}
if
(
pi
->
ppd
->
DefaultPageSize
)
{
/* We'll let the ppd override the devmode */
...
...
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