[PATCH 2/5] activeds: Implement ADsOpenObject.

Nikolay Sivov bunglehead at gmail.com
Mon Dec 16 02:56:00 CST 2019


On Mon, Dec 16, 2019 at 11:52 AM Dmitry Timoshkov <dmitry at baikal.ru> wrote:

> Nikolay Sivov <bunglehead at gmail.com> wrote:
>
> > > > > +                        hr =
> IADsOpenDSObject_OpenDSObject(adsopen,
> > > (BSTR)path, (BSTR)user, (BSTR)password, reserved, &disp);
> > > > > +                        if (hr == S_OK)
> > > > You cannot cast to a BSTR, it will corrupt the data structure.
> > >
> > > I depends wheather the callee uses SysStringLen() and friends, in this
> > > particular case it works just fine, there are many other places in the
> code
> > > when it's not necessary to create intermediate copies of the strings.
> > >
> >
> > It does not matter if it works in this case, arguments should use correct
> > types. If we have similar violations somewhere else, those need fixing as
> > well.
>
> That's a pretty incorrect assertion, there's nothing wrong in casting
> BSTR to LPWSTR and vice versa.
>

What's incorrect about it? You can use BSTR as WCHAR * argument, obviously.
Not the other way around, even if it happens to work.


>
> --
> Dmitry.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20191216/00d02ac6/attachment.htm>


More information about the wine-devel mailing list