winspool: AddMonitor: Test the Driver-Entry before return an Error

Detlef Riekenberg wine.dev at web.de
Fri Jun 16 03:01:31 CDT 2006



During my Tests, I found a Problem in AddMonitor, that is related to
caching: (Windows cache all Monitor-Entries and is using this Cache for
all Monitor-Functions, but we do no caching and check the Registry).

RedMon works great with our code, but some Installer set Options for
the Port before calling "AddMonitor"
That works on windows, but not in wine.

Since most wine - users will never install a Printmonitor at all,
I want to avoid caching all Monitor-Entries or protect all
Monitor-Functions with a Mutex.

A small Issue is left (documented also in the Code):
When a User installs two Printmonitors at the same Time with the same
Name but with a different Driver-DLL and a Task-Switch comes between
RegQueryValueExW and RegSetValueExW, a Race Condition is possible but
silently ignored.

A Critical Section is still needed later, when we load and use the
Monitors.



Changelog:
- winspool: AddMonitor: Test the Driver-Entry before return an Error




Resend with a different Changelog





-- 
By By ...
      ... Detlef
-------------- next part --------------
A non-text attachment was scrubbed...
Name: update_AddMonitor.diff
Type: text/x-patch
Size: 1569 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20060616/8e1d64dc/update_AddMonitor-0001.diff


More information about the wine-patches mailing list