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
da4d55db
Commit
da4d55db
authored
Dec 01, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Dec 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localspl: Use separate structure to store printserver handles.
parent
730b0826
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
11 deletions
+30
-11
provider.c
dlls/localspl/provider.c
+30
-11
No files found.
dlls/localspl/provider.c
View file @
da4d55db
...
...
@@ -248,6 +248,8 @@ typedef struct {
}
type
;
}
handle_header_t
;
typedef
handle_header_t
server_t
;
typedef
struct
{
handle_header_t
header
;
monitor_t
*
pm
;
...
...
@@ -1536,6 +1538,24 @@ static HMODULE driver_load(const printenv_t * env, LPWSTR dllname)
return
hui
;
}
static
HANDLE
server_alloc_handle
(
const
WCHAR
*
name
,
BOOL
*
stop_search
)
{
server_t
*
server
;
*
stop_search
=
FALSE
;
if
(
name
)
return
NULL
;
server
=
malloc
(
sizeof
(
*
server
));
if
(
!
server
)
{
*
stop_search
=
TRUE
;
return
NULL
;
}
server
->
type
=
HANDLE_SERVER
;
return
(
HANDLE
)
server
;
}
static
HANDLE
xcv_alloc_handle
(
const
WCHAR
*
name
,
PRINTER_DEFAULTSW
*
def
,
BOOL
*
stop_search
)
{
static
const
WCHAR
xcv_monitor
[]
=
L"XcvMonitor "
;
...
...
@@ -1544,7 +1564,7 @@ static HANDLE xcv_alloc_handle(const WCHAR *name, PRINTER_DEFAULTSW *def, BOOL *
xcv_t
*
xcv
;
*
stop_search
=
FALSE
;
if
(
!
name
||
name
[
0
]
!=
','
)
if
(
name
[
0
]
!=
','
)
return
NULL
;
name
++
;
...
...
@@ -1613,13 +1633,6 @@ static HANDLE printer_alloc_handle(const WCHAR *name, const WCHAR *basename,
return
NULL
;
}
if
(
!
basename
)
{
TRACE
(
"using the local printserver
\n
"
);
printer
->
header
.
type
=
HANDLE_SERVER
;
return
(
HANDLE
)
printer
;
}
printer
->
info
=
get_printer_info
(
basename
);
if
(
!
printer
->
info
)
{
...
...
@@ -2646,7 +2659,9 @@ static BOOL WINAPI fpOpenPrinter(WCHAR *name, HANDLE *hprinter,
return
FALSE
;
}
*
hprinter
=
xcv_alloc_handle
(
basename
,
def
,
&
stop_search
);
*
hprinter
=
server_alloc_handle
(
basename
,
&
stop_search
);
if
(
!*
hprinter
&&
!
stop_search
)
*
hprinter
=
xcv_alloc_handle
(
basename
,
def
,
&
stop_search
);
if
(
!*
hprinter
&&
!
stop_search
)
*
hprinter
=
printer_alloc_handle
(
name
,
basename
,
def
);
...
...
@@ -3417,7 +3432,11 @@ static BOOL WINAPI fpClosePrinter(HANDLE hprinter)
if
(
!
header
)
return
FALSE
;
if
(
header
->
type
==
HANDLE_XCV
)
if
(
header
->
type
==
HANDLE_SERVER
)
{
free
(
header
);
}
else
if
(
header
->
type
==
HANDLE_XCV
)
{
xcv_t
*
xcv
=
(
xcv_t
*
)
hprinter
;
...
...
@@ -3427,7 +3446,7 @@ static BOOL WINAPI fpClosePrinter(HANDLE hprinter)
monitor_unload
(
xcv
->
pm
);
free
(
xcv
);
}
else
if
(
header
->
type
==
HANDLE_
SERVER
||
header
->
type
==
HANDLE_
PRINTER
)
else
if
(
header
->
type
==
HANDLE_PRINTER
)
{
printer_t
*
printer
=
(
printer_t
*
)
hprinter
;
...
...
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