[PATCH 2/5] activeds: Implement ADsOpenObject.

Dmitry Timoshkov dmitry at baikal.ru
Mon Dec 16 02:15:56 CST 2019


Alistair Leslie-Hughes <leslie_alistair at hotmail.com> wrote:

> > +                    if (CoCreateInstance(&clsid, 0, CLSCTX_INPROC_SERVER, &IID_IADsOpenDSObject, (void **)&adsopen) == S_OK)
> > +                    {
> > +                        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.

> > +                        {
> > +                            hr = IDispatch_QueryInterface(disp, riid, obj);
> > +                            IDispatch_Release(disp);
> Now that you have found the object, shouldn't you exit the loop?

Yes, thanks for spotting this. I think it could be fixed in a later patch.

-- 
Dmitry.



More information about the wine-devel mailing list