[PATCH 3/4] localspl: Add support for monitors providing the MONITOR2 interface.
Huw Davies
huw at codeweavers.com
Wed Sep 4 03:58:31 CDT 2019
On Wed, Sep 04, 2019 at 04:34:14PM +0800, Dmitry Timoshkov wrote:
> Hi Huw,
>
> Huw Davies <huw at codeweavers.com> wrote:
>
> > > @@ -66,9 +66,9 @@ typedef struct {
> > > LPWSTR dllname;
> > > PMONITORUI monitorUI;
> > > LPMONITOR monitor;
> > > + LPMONITOR2 monitor2;
> > > HMODULE hdll;
> > > DWORD refcount;
> > > - DWORD dwMonitorSize;
> > > } monitor_t;
> >
> > Hi Dmitry,
> >
> > Is there a reason why we can't simply replace the MONITOR struct with
> > a MONITOR2 struct? It would require a bit more work at initialisation
> > but then calling the functions would be rather simpler.
>
> I considered that, and even have done an initial implementation that way.
> However, the structures have different prototypes for some callbacks, and
> in order to take care of this we'd need to create wrappers. I'd rather
> decided to use an appropriate table instead.
It's only a couple of functions (OpenPortEx and XcvOpenPort) and all you'd
need would be something like:
if (monitor.cbSize == sizeof(MONITOR))
monitor.pfnXcvOpenPort( old_args );
else
monitor.pfnXcvOpenPort( new_args );
which is more or less what you're doing for every call at the moment.
This would also have to benefit of actually copying the fn ptrs returned
by the init function, rather than assuming the driver keeps the structure
available for its lifetime.
Huw.
More information about the wine-devel
mailing list