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
7afe18ec
Commit
7afe18ec
authored
Jun 15, 2006
by
Huw Davies
Committed by
Alexandre Julliard
Jun 15, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
printing: Don't limit the printer name length to CCHDEVICENAME characters.
parent
36bf71c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
init.c
dlls/wineps.drv/init.c
+10
-2
info.c
dlls/winspool.drv/info.c
+7
-14
No files found.
dlls/wineps.drv/init.c
View file @
7afe18ec
...
@@ -302,7 +302,7 @@ BOOL PSDRV_CreateDC( HDC hdc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR devi
...
@@ -302,7 +302,7 @@ BOOL PSDRV_CreateDC( HDC hdc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR devi
{
{
PSDRV_PDEVICE
*
physDev
;
PSDRV_PDEVICE
*
physDev
;
PRINTERINFO
*
pi
;
PRINTERINFO
*
pi
;
char
deviceA
[
CCHDEVICENAME
]
;
char
*
deviceA
;
/* If no device name was specified, retrieve the device name
/* If no device name was specified, retrieve the device name
* from the DEVMODE structure from the DC's physDev.
* from the DEVMODE structure from the DC's physDev.
...
@@ -310,12 +310,20 @@ BOOL PSDRV_CreateDC( HDC hdc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR devi
...
@@ -310,12 +310,20 @@ BOOL PSDRV_CreateDC( HDC hdc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR devi
if
(
!
device
&&
*
pdev
)
if
(
!
device
&&
*
pdev
)
{
{
physDev
=
*
pdev
;
physDev
=
*
pdev
;
deviceA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
CCHDEVICENAME
);
lstrcpynA
(
deviceA
,
(
LPCSTR
)
physDev
->
Devmode
->
dmPublic
.
dmDeviceName
,
CCHDEVICENAME
);
lstrcpynA
(
deviceA
,
(
LPCSTR
)
physDev
->
Devmode
->
dmPublic
.
dmDeviceName
,
CCHDEVICENAME
);
}
}
else
else
WideCharToMultiByte
(
CP_ACP
,
0
,
device
,
-
1
,
deviceA
,
sizeof
(
deviceA
),
NULL
,
NULL
);
{
DWORD
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
device
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
deviceA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
device
,
-
1
,
deviceA
,
len
,
NULL
,
NULL
);
}
pi
=
PSDRV_FindPrinterInfo
(
deviceA
);
pi
=
PSDRV_FindPrinterInfo
(
deviceA
);
HeapFree
(
GetProcessHeap
(),
0
,
deviceA
);
deviceA
=
NULL
;
TRACE
(
"(%s %s %s %p)
\n
"
,
debugstr_w
(
driver
),
debugstr_w
(
device
),
TRACE
(
"(%s %s %s %p)
\n
"
,
debugstr_w
(
driver
),
debugstr_w
(
device
),
debugstr_w
(
output
),
initData
);
debugstr_w
(
output
),
initData
);
...
...
dlls/winspool.drv/info.c
View file @
7afe18ec
...
@@ -2032,13 +2032,6 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter)
...
@@ -2032,13 +2032,6 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter)
SetLastError
(
ERROR_INVALID_LEVEL
);
SetLastError
(
ERROR_INVALID_LEVEL
);
return
0
;
return
0
;
}
}
if
(
strlenW
(
pi
->
pPrinterName
)
>=
CCHDEVICENAME
)
{
ERR
(
"Printername %s must not exceed length of DEVMODE.dmDeviceName !
\n
"
,
debugstr_w
(
pi
->
pPrinterName
)
);
SetLastError
(
ERROR_INVALID_LEVEL
);
return
0
;
}
if
(
!
pPrinter
)
{
if
(
!
pPrinter
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
return
0
;
...
@@ -2109,19 +2102,19 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter)
...
@@ -2109,19 +2102,19 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter)
dmW
=
pi
->
pDevMode
;
dmW
=
pi
->
pDevMode
;
else
else
{
{
dmW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
dmW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
ZeroMemory
(
dmW
,
size
);
ZeroMemory
(
dmW
,
size
);
dmW
->
dmSize
=
size
;
dmW
->
dmSize
=
size
;
if
(
0
>
DocumentPropertiesW
(
0
,
0
,
pi
->
pPrinterName
,
dmW
,
NULL
,
DM_OUT_BUFFER
))
if
(
0
>
DocumentPropertiesW
(
0
,
0
,
pi
->
pPrinterName
,
dmW
,
NULL
,
DM_OUT_BUFFER
))
{
{
WARN
(
"DocumentPropertiesW on printer '%s' failed!
\n
"
,
debugstr_w
(
pi
->
pPrinterName
));
WARN
(
"DocumentPropertiesW on printer '%s' failed!
\n
"
,
debugstr_w
(
pi
->
pPrinterName
));
HeapFree
(
GetProcessHeap
(),
0
,
dmW
);
HeapFree
(
GetProcessHeap
(),
0
,
dmW
);
dmW
=
NULL
;
dmW
=
NULL
;
}
}
else
else
{
{
/* set devmode to printer name */
/* set devmode to printer name */
strcpyW
(
dmW
->
dmDeviceName
,
pi
->
pPrinterName
);
lstrcpynW
(
dmW
->
dmDeviceName
,
pi
->
pPrinterName
,
CCHDEVICENAME
);
}
}
}
}
...
...
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