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
7b0cda21
Commit
7b0cda21
authored
May 18, 2012
by
Huw Davies
Committed by
Alexandre Julliard
May 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool: Only perform printer initialisation once per session.
parent
9d0bfce9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
info.c
dlls/winspool.drv/info.c
+20
-0
No files found.
dlls/winspool.drv/info.c
View file @
7b0cda21
...
...
@@ -1076,12 +1076,31 @@ static void old_printer_check( BOOL delete_phase )
HeapFree
(
GetProcessHeap
(),
0
,
pi
);
}
static
const
WCHAR
winspool_mutex_name
[]
=
{
'_'
,
'_'
,
'W'
,
'I'
,
'N'
,
'E'
,
'_'
,
'W'
,
'I'
,
'N'
,
'S'
,
'P'
,
'O'
,
'O'
,
'L'
,
'_'
,
'M'
,
'U'
,
'T'
,
'E'
,
'X'
,
'_'
,
'_'
,
'\0'
};
void
WINSPOOL_LoadSystemPrinters
(
void
)
{
HKEY
hkey
,
hkeyPrinters
;
DWORD
needed
,
num
,
i
;
WCHAR
PrinterName
[
256
];
BOOL
done
=
FALSE
;
HANDLE
mutex
;
/* FIXME: The init code should be moved to spoolsv.exe */
mutex
=
CreateMutexW
(
NULL
,
TRUE
,
winspool_mutex_name
);
if
(
!
mutex
)
{
ERR
(
"Failed to create mutex
\n
"
);
return
;
}
if
(
GetLastError
()
==
ERROR_ALREADY_EXISTS
)
{
WaitForSingleObject
(
mutex
,
INFINITE
);
ReleaseMutex
(
mutex
);
TRACE
(
"Init already done
\n
"
);
return
;
}
/* This ensures that all printer entries have a valid Name value. If causes
problems later if they don't. If one is found to be missed we create one
...
...
@@ -1114,6 +1133,7 @@ void WINSPOOL_LoadSystemPrinters(void)
old_printer_check
(
TRUE
);
ReleaseMutex
(
mutex
);
return
;
}
...
...
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