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
142c2982
Commit
142c2982
authored
Apr 01, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 01, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool.drv: Move loading of libcups out of the init code protected by mutex.
parent
4e3b8621
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
14 deletions
+27
-14
info.c
dlls/winspool.drv/info.c
+27
-14
No files found.
dlls/winspool.drv/info.c
View file @
142c2982
...
...
@@ -874,6 +874,28 @@ static cups_ptype_t get_cups_printer_type( const cups_dest_t *dest )
return
ret
;
}
static
void
load_cups
(
void
)
{
cupshandle
=
wine_dlopen
(
SONAME_LIBCUPS
,
RTLD_NOW
,
NULL
,
0
);
if
(
!
cupshandle
)
return
;
TRACE
(
"%p: %s loaded
\n
"
,
cupshandle
,
SONAME_LIBCUPS
);
#define DO_FUNC(x) \
p##x = wine_dlsym( cupshandle, #x, NULL, 0 ); \
if (!p##x) \
{ \
ERR("failed to load symbol %s\n", #x); \
cupshandle = NULL; \
return; \
}
CUPS_FUNCS
;
#undef DO_FUNC
#define DO_FUNC(x) p##x = wine_dlsym( cupshandle, #x, NULL, 0 )
CUPS_OPT_FUNCS
;
#undef DO_FUNC
}
static
BOOL
CUPS_LoadPrinters
(
void
)
{
int
i
,
nrofdests
;
...
...
@@ -882,24 +904,11 @@ static BOOL CUPS_LoadPrinters(void)
PRINTER_INFO_2W
pi2
;
WCHAR
*
port
,
*
ppd_dir
=
NULL
,
*
ppd
;
HKEY
hkeyPrinter
,
hkeyPrinters
;
char
loaderror
[
256
];
WCHAR
nameW
[
MAX_PATH
];
HANDLE
added_printer
;
cups_ptype_t
printer_type
;
cupshandle
=
wine_dlopen
(
SONAME_LIBCUPS
,
RTLD_NOW
,
loaderror
,
sizeof
(
loaderror
));
if
(
!
cupshandle
)
{
TRACE
(
"%s
\n
"
,
loaderror
);
return
FALSE
;
}
TRACE
(
"%p: %s loaded
\n
"
,
cupshandle
,
SONAME_LIBCUPS
);
#define DO_FUNC(x) p##x = wine_dlsym( cupshandle, #x, NULL, 0 ); if (!p##x) return FALSE
CUPS_FUNCS
;
#undef DO_FUNC
#define DO_FUNC(x) p##x = wine_dlsym( cupshandle, #x, NULL, 0 )
CUPS_OPT_FUNCS
;
#undef DO_FUNC
if
(
!
cupshandle
)
return
FALSE
;
if
(
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
PrintersW
,
&
hkeyPrinters
)
!=
ERROR_SUCCESS
)
{
...
...
@@ -1590,6 +1599,10 @@ void WINSPOOL_LoadSystemPrinters(void)
WCHAR
PrinterName
[
256
];
BOOL
done
=
FALSE
;
#ifdef SONAME_LIBCUPS
load_cups
();
#endif
/* FIXME: The init code should be moved to spoolsv.exe */
init_mutex
=
CreateMutexW
(
NULL
,
TRUE
,
winspool_mutex_name
);
if
(
!
init_mutex
)
...
...
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