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
d963a8f8
Commit
d963a8f8
authored
Apr 02, 2012
by
Huw Davies
Committed by
Alexandre Julliard
Apr 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Use the unicode version of StartDocPrinter.
parent
0b9a3f9d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
62 deletions
+26
-62
escape.c
dlls/wineps.drv/escape.c
+12
-56
init.c
dlls/wineps.drv/init.c
+13
-5
psdrv.h
dlls/wineps.drv/psdrv.h
+1
-1
No files found.
dlls/wineps.drv/escape.c
View file @
d963a8f8
...
...
@@ -409,15 +409,15 @@ INT PSDRV_EndPage( PHYSDEV dev )
/************************************************************************
* PSDRV_StartDoc
A
* PSDRV_StartDoc
*/
static
INT
PSDRV_StartDocA
(
PHYSDEV
dev
,
const
DOCINFOA
*
doc
)
INT
PSDRV_StartDoc
(
PHYSDEV
dev
,
const
DOCINFOW
*
doc
)
{
PSDRV_PDEVICE
*
physDev
=
get_psdrv_dev
(
dev
);
DOC_INFO_1
A
di
;
DOC_INFO_1
W
di
;
TRACE
(
"(%p, %p) => %s, %s, %s
\n
"
,
physDev
,
doc
,
debugstr_
a
(
doc
->
lpszDocName
),
debugstr_
a
(
doc
->
lpszOutput
),
debugstr_a
(
doc
->
lpszDatatype
));
TRACE
(
"(%p, %p) => %s, %s, %s
\n
"
,
physDev
,
doc
,
debugstr_
w
(
doc
->
lpszDocName
),
debugstr_
w
(
doc
->
lpszOutput
),
debugstr_w
(
doc
->
lpszDatatype
));
if
(
physDev
->
job
.
id
)
{
FIXME
(
"hJob != 0. Now what?
\n
"
);
...
...
@@ -431,21 +431,21 @@ static INT PSDRV_StartDocA( PHYSDEV dev, const DOCINFOA *doc )
return
0
;
}
di
.
pDocName
=
(
LPSTR
)
doc
->
lpszDocName
;
di
.
pDocName
=
(
LP
W
STR
)
doc
->
lpszDocName
;
di
.
pDatatype
=
NULL
;
if
(
doc
->
lpszOutput
)
di
.
pOutputFile
=
(
LPSTR
)
doc
->
lpszOutput
;
di
.
pOutputFile
=
(
LP
W
STR
)
doc
->
lpszOutput
;
else
if
(
physDev
->
job
.
output
)
di
.
pOutputFile
=
physDev
->
job
.
output
;
else
di
.
pOutputFile
=
NULL
;
TRACE
(
"using output: %s
\n
"
,
debugstr_
a
(
di
.
pOutputFile
));
TRACE
(
"using output: %s
\n
"
,
debugstr_
w
(
di
.
pOutputFile
));
/* redirection located in HKCU\Software\Wine\Printing\Spooler
is done during winspool.drv,ScheduleJob */
physDev
->
job
.
id
=
StartDocPrinter
A
(
physDev
->
job
.
hprinter
,
1
,
(
LPBYTE
)
&
di
);
physDev
->
job
.
id
=
StartDocPrinter
W
(
physDev
->
job
.
hprinter
,
1
,
(
LPBYTE
)
&
di
);
if
(
!
physDev
->
job
.
id
)
{
WARN
(
"StartDocPrinter() failed: %d
\n
"
,
GetLastError
());
ClosePrinter
(
physDev
->
job
.
hprinter
);
...
...
@@ -458,8 +458,9 @@ static INT PSDRV_StartDocA( PHYSDEV dev, const DOCINFOA *doc )
physDev
->
job
.
in_passthrough
=
FALSE
;
physDev
->
job
.
had_passthrough_rect
=
FALSE
;
if
(
doc
->
lpszDocName
)
{
physDev
->
job
.
DocName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
doc
->
lpszDocName
)
+
1
);
strcpy
(
physDev
->
job
.
DocName
,
doc
->
lpszDocName
);
INT
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszDocName
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
physDev
->
job
.
DocName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszDocName
,
-
1
,
physDev
->
job
.
DocName
,
len
,
NULL
,
NULL
);
}
else
physDev
->
job
.
DocName
=
NULL
;
...
...
@@ -467,51 +468,6 @@ static INT PSDRV_StartDocA( PHYSDEV dev, const DOCINFOA *doc )
}
/************************************************************************
* PSDRV_StartDoc
*/
INT
PSDRV_StartDoc
(
PHYSDEV
dev
,
const
DOCINFOW
*
doc
)
{
DOCINFOA
docA
;
INT
ret
,
len
;
LPSTR
docname
=
NULL
,
output
=
NULL
,
datatype
=
NULL
;
TRACE
(
"(%p, %p) => %d,%s,%s,%s
\n
"
,
dev
,
doc
,
doc
->
cbSize
,
debugstr_w
(
doc
->
lpszDocName
),
debugstr_w
(
doc
->
lpszOutput
),
debugstr_w
(
doc
->
lpszDatatype
));
docA
.
cbSize
=
doc
->
cbSize
;
if
(
doc
->
lpszDocName
)
{
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszDocName
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
docname
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszDocName
,
-
1
,
docname
,
len
,
NULL
,
NULL
);
}
if
(
doc
->
lpszOutput
)
{
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszOutput
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
output
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszOutput
,
-
1
,
output
,
len
,
NULL
,
NULL
);
}
if
(
doc
->
lpszDatatype
)
{
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszDatatype
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
datatype
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszDatatype
,
-
1
,
datatype
,
len
,
NULL
,
NULL
);
}
docA
.
lpszDocName
=
docname
;
docA
.
lpszOutput
=
output
;
docA
.
lpszDatatype
=
datatype
;
docA
.
fwType
=
doc
->
fwType
;
ret
=
PSDRV_StartDocA
(
dev
,
&
docA
);
HeapFree
(
GetProcessHeap
(),
0
,
docname
);
HeapFree
(
GetProcessHeap
(),
0
,
output
);
HeapFree
(
GetProcessHeap
(),
0
,
datatype
);
return
ret
;
}
/************************************************************************
* PSDRV_EndDoc
*/
INT
PSDRV_EndDoc
(
PHYSDEV
dev
)
...
...
dlls/wineps.drv/init.c
View file @
d963a8f8
...
...
@@ -41,6 +41,7 @@
#include "winnls.h"
#include "psdrv.h"
#include "winspool.h"
#include "wine/unicode.h"
#include "wine/library.h"
#include "wine/debug.h"
...
...
@@ -171,6 +172,17 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
return
TRUE
;
}
static
inline
WCHAR
*
strdupW
(
const
WCHAR
*
str
)
{
int
size
;
WCHAR
*
ret
;
if
(
!
str
)
return
NULL
;
size
=
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
ret
)
memcpy
(
ret
,
str
,
size
);
return
ret
;
}
static
void
PSDRV_UpdateDevCaps
(
PSDRV_PDEVICE
*
physDev
)
{
...
...
@@ -355,11 +367,7 @@ static BOOL PSDRV_CreateDC( PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device,
if
(
!
(
physDev
=
create_psdrv_physdev
(
pi
)))
return
FALSE
;
if
(
output
&&
*
output
)
{
INT
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
output
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
physDev
->
job
.
output
=
HeapAlloc
(
PSDRV_Heap
,
0
,
len
)))
WideCharToMultiByte
(
CP_ACP
,
0
,
output
,
-
1
,
physDev
->
job
.
output
,
len
,
NULL
,
NULL
);
}
if
(
output
&&
*
output
)
physDev
->
job
.
output
=
strdupW
(
output
);
if
(
initData
)
{
DEVMODEA
*
devmodeA
=
DEVMODEdupWtoA
(
PSDRV_Heap
,
initData
);
...
...
dlls/wineps.drv/psdrv.h
View file @
d963a8f8
...
...
@@ -346,7 +346,7 @@ typedef struct {
typedef
struct
{
DWORD
id
;
/* Job id */
HANDLE
hprinter
;
/* Printer handle */
LP
STR
output
;
/* Output file/port */
LP
WSTR
output
;
/* Output file/port */
LPSTR
DocName
;
/* Document Name */
BOOL
banding
;
/* Have we received a NEXTBAND */
BOOL
OutOfPage
;
/* Page header not sent yet */
...
...
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