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
d005d1ee
Commit
d005d1ee
authored
Sep 29, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool.drv: Use DrvDocumentPropertySheets driver entry in DocumentProperties.
parent
1f89a886
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
12 deletions
+54
-12
Makefile.in
dlls/winspool.drv/Makefile.in
+1
-1
info.c
dlls/winspool.drv/info.c
+53
-11
No files found.
dlls/winspool.drv/Makefile.in
View file @
d005d1ee
MODULE
=
winspool.drv
UNIXLIB
=
winspool.so
IMPORTLIB
=
winspool
IMPORTS
=
user32 gdi32 advapi32
IMPORTS
=
user32 gdi32 advapi32
compstui
UNIX_CFLAGS
=
$(CUPS_CFLAGS)
UNIX_LIBS
=
$(APPLICATIONSERVICES_LIBS)
...
...
dlls/winspool.drv/info.c
View file @
d005d1ee
...
...
@@ -51,6 +51,7 @@
#include "wine/heap.h"
#include <wine/unixlib.h>
#include "ddk/compstui.h"
#include "ddk/winsplp.h"
#include "wspool.h"
...
...
@@ -115,11 +116,27 @@ typedef struct
/* entry points */
DWORD
(
WINAPI
*
pDrvDeviceCapabilities
)(
HANDLE
,
const
WCHAR
*
,
WORD
,
void
*
,
const
DEVMODEW
*
);
INT
(
WINAPI
*
pDrvDocumentProperties
)(
HWND
,
const
WCHAR
*
,
DEVMODEW
*
,
DEVMODEW
*
,
DWORD
);
LONG
(
WINAPI
*
pDrvDocumentPropertySheets
)(
PROPSHEETUI_INFO
*
,
LPARAM
);
WCHAR
name
[
1
];
}
config_module_t
;
typedef
struct
{
WORD
cbSize
;
WORD
Reserved
;
HANDLE
hPrinter
;
LPCWSTR
pszPrinterName
;
PDEVMODEW
pdmIn
;
PDEVMODEW
pdmOut
;
DWORD
cbOut
;
DWORD
fMode
;
}
DOCUMENTPROPERTYHEADERW
;
typedef
struct
{
DOCUMENTPROPERTYHEADERW
dph
;
config_module_t
*
config
;
}
document_property_t
;
/* ############################### */
static
opened_printer_t
**
printer_handles
;
...
...
@@ -502,7 +519,7 @@ static config_module_t *get_config_module(const WCHAR *device, BOOL grab)
ret
->
ref
=
2
;
/* one for config_module and one for the caller */
ret
->
module
=
driver_module
;
ret
->
pDrvDeviceCapabilities
=
(
void
*
)
GetProcAddress
(
driver_module
,
"DrvDeviceCapabilities"
);
ret
->
pDrvDocumentPropert
ies
=
(
void
*
)
GetProcAddress
(
driver_module
,
"DrvDocumentPropertie
s"
);
ret
->
pDrvDocumentPropert
ySheets
=
(
void
*
)
GetProcAddress
(
driver_module
,
"DrvDocumentPropertySheet
s"
);
wcscpy
(
ret
->
name
,
device
);
wine_rb_put
(
&
config_modules
,
ret
->
name
,
&
ret
->
entry
);
...
...
@@ -1896,6 +1913,18 @@ LONG WINAPI DocumentPropertiesA(HWND hwnd, HANDLE printer, char *device_name, DE
return
ret
;
}
static
LONG
WINAPI
document_callback
(
PROPSHEETUI_INFO
*
info
,
LPARAM
lparam
)
{
if
(
info
->
Reason
==
PROPSHEETUI_REASON_INIT
)
{
document_property_t
*
dp
=
(
document_property_t
*
)
info
->
lParamInit
;
if
(
!
info
->
pfnComPropSheet
(
info
->
hComPropSheet
,
CPSFUNC_ADD_PFNPROPSHEETUIW
,
(
LPARAM
)
dp
->
config
->
pDrvDocumentPropertySheets
,
(
LPARAM
)
&
dp
->
dph
))
return
ERR_CPSUI_GETLASTERROR
;
}
return
CPSUI_OK
;
}
/*****************************************************************************
* DocumentPropertiesW (WINSPOOL.@)
...
...
@@ -1905,8 +1934,8 @@ LONG WINAPI DocumentPropertiesW(HWND hWnd, HANDLE hPrinter,
LPDEVMODEW
pDevModeOutput
,
LPDEVMODEW
pDevModeInput
,
DWORD
fMode
)
{
config_module_t
*
config
=
NULL
;
const
WCHAR
*
device
=
NULL
;
document_property_t
dp
;
const
WCHAR
*
device
;
LONG
ret
;
TRACE
(
"(%p,%p,%s,%p,%p,%ld)
\n
"
,
...
...
@@ -1918,17 +1947,30 @@ LONG WINAPI DocumentPropertiesW(HWND hWnd, HANDLE hPrinter,
return
-
1
;
}
config
=
get_config_module
(
device
,
TRUE
);
if
(
!
config
)
{
dp
.
dph
.
cbSize
=
sizeof
(
dp
.
dph
);
dp
.
dph
.
Reserved
=
0
;
dp
.
dph
.
hPrinter
=
hPrinter
;
dp
.
dph
.
pszPrinterName
=
device
;
dp
.
dph
.
pdmIn
=
pDevModeInput
;
dp
.
dph
.
pdmOut
=
pDevModeOutput
;
dp
.
dph
.
cbOut
=
dp
.
dph
.
pdmOut
?
dp
.
dph
.
pdmOut
->
dmSize
:
0
;
dp
.
dph
.
fMode
=
fMode
;
dp
.
config
=
get_config_module
(
device
,
TRUE
);
if
(
!
dp
.
config
)
{
ERR
(
"Could not load config module for %s
\n
"
,
debugstr_w
(
device
));
return
-
1
;
}
/* FIXME: This uses Wine-specific config file entry point.
* We should use DrvDevicePropertySheets instead (requires CPSUI support first).
*/
ret
=
config
->
pDrvDocumentProperties
(
hWnd
,
device
,
pDevModeOutput
,
pDevModeInput
,
fMode
);
release_config_module
(
config
);
if
(
!
(
fMode
&
~
(
DM_IN_BUFFER
|
DM_OUT_BUFFER
|
DM_OUT_DEFAULT
)))
{
ret
=
dp
.
config
->
pDrvDocumentPropertySheets
(
NULL
,
(
LPARAM
)
&
dp
.
dph
);
if
((
!
fMode
||
!
pDevModeOutput
)
&&
dp
.
dph
.
cbOut
!=
ret
)
FIXME
(
"size mismatch: ret = %ld cbOut = %ld
\n
"
,
ret
,
dp
.
dph
.
cbOut
);
}
else
{
ret
=
CommonPropertySheetUIW
(
hWnd
,
document_callback
,
(
LPARAM
)
&
dp
,
NULL
);
}
release_config_module
(
dp
.
config
);
return
ret
;
}
...
...
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