[2/8] webservices: Protect messages with a critical section.

Sebastian Lackner sebastian at fds-team.de
Wed Mar 8 10:13:38 CST 2017


On 08.03.2017 11:25, Hans Leidekker wrote:
> +        }
>      }
>  
>      msg->is_addressed = TRUE;

Not sure if it matters, but previously this was skipped in case of a failure.

Also please note that depending on how many objects are used by an application,
a separate CS for each might significantly increase memory usage.

> -    return S_OK;
> +
> +    LeaveCriticalSection( &msg->cs );
> +    return hr;
[...]
> -    msg->init  = init;
> -    msg->state = WS_MESSAGE_STATE_INITIALIZED;
> -    return write_envelope( msg );
> +    if ((hr = write_envelope( msg )) == S_OK)
> +    {
> +        msg->init  = init;
> +        msg->state = WS_MESSAGE_STATE_INITIALIZED;
> +    }

Here, the new code also does something else than the old one. Previously the
msg fields were changed unconditionally.





More information about the wine-devel mailing list