[PATCH v2 3/4] localspl: Add support for monitors providing the MONITOR2 interface.

Huw Davies huw at codeweavers.com
Thu Sep 5 06:54:07 CDT 2019


Hi Dmitry,

On Thu, Sep 05, 2019 at 06:31:41PM +0800, Dmitry Timoshkov wrote:
> diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c
> index 8e5e3428d5..44cf38e571 100644
> --- a/dlls/localspl/provider.c
> +++ b/dlls/localspl/provider.c

> @@ -577,15 +597,26 @@ static monitor_t * monitor_loadui(monitor_t * pm)
>      }
>  
>      /* query the userinterface-dllname from the Portmonitor */
> -    if ((pm->monitor) && (pm->monitor->pfnXcvDataPort)) {
> +    if (pm->monitor.pfnXcvDataPort) {
> +        res = pm->monitor.pfnXcvOpenPort(0, emptyW, SERVER_ACCESS_ADMINISTER, &hXcv);
> +        TRACE("got %u with %p\n", res, hXcv);
> +        if (res) {
> +            res = pm->monitor.pfnXcvDataPort(hXcv, monitorUIW, NULL, 0, (BYTE *) buffer, sizeof(buffer), &len);
> +            TRACE("got %u with %s\n", res, debugstr_w(buffer));
> +            if (res == ERROR_SUCCESS) pui = monitor_load(NULL, buffer);
> +            pm->monitor.pfnXcvClosePort(hXcv);
> +        }
> +        return pui;
> +    }
> +    else if (pm->old_XcvDataPort) {
>          /* building (",XcvMonitor %s",pm->name) not needed yet */
> -        res = pm->monitor->pfnXcvOpenPort(emptyW, SERVER_ACCESS_ADMINISTER, &hXcv);
> +        res = pm->old_XcvOpenPort(emptyW, SERVER_ACCESS_ADMINISTER, &hXcv);
>          TRACE("got %u with %p\n", res, hXcv);
>          if (res) {
> -            res = pm->monitor->pfnXcvDataPort(hXcv, monitorUIW, NULL, 0, (BYTE *) buffer, sizeof(buffer), &len);
> +            res = pm->monitor.pfnXcvDataPort(hXcv, monitorUIW, NULL, 0, (BYTE *) buffer, sizeof(buffer), &len);
>              TRACE("got %u with %s\n", res, debugstr_w(buffer));
>              if (res == ERROR_SUCCESS) pui = monitor_load(NULL, buffer);
> -            pm->monitor->pfnXcvClosePort(hXcv);
> +            pm->monitor.pfnXcvClosePort(hXcv);
>          }
>      }
>      return pui;


Thanks for doing this, but this bit doesn't look quite right.

You don't need old_XcvDataPort at all since the prototypes of old and new
are the same.  All you need to do is to call the appropriate XcvOpenPort
function and then fall into common code that calls XcvDataPort.  [And if
you really want to do it like you have, you need to call old_XvcDataPort
in the else block].

Huw.



More information about the wine-devel mailing list