shdocvw: [Patch 1/2] Implement URLSubRegQueryA [Resend]

Detlef Riekenberg wine.dev at web.de
Wed Oct 15 18:20:02 CDT 2008


On Mi, 2008-10-15 at 16:53 +0200, Alexandre Julliard wrote:
> Detlef Riekenberg <wine.dev at web.de> writes:
> 
> > +    len = sizeof(buffer);
> > +    res = SHRegGetUSValueA(regpath, name, NULL, buffer,  &len, FALSE, NULL, 0);
> > +    if (!res) {
> > +        lstrcpynA(out, buffer, outlen);
> > +        if (outlen > 0) {
> > +            out[min(outlen-1,len)] = '\0';
> > +        }
> 
> This doesn't look right. Why do you even need a separate buffer?

The test in Patch 2 show, that URLSubRegQueryA still succeed,
when the caller buffer is to small (the result is truncated).

I used the buffer from the caller first, but SHRegGetUSValueA fail, when
the
buffer is to small.

With the seperate buffer, SHRegGetUSValueA (and URLSubRegQueryA) only
fails,
when the value does not exist in the registry.

Dropping the seperate buffer is possible, but then the implemenation
works only, when the the caller buffer is always large enough and we
need to add a buch of todo_wine.

I used a new file for the test, because URLSubRegQueryA is not related
to an object, and ParseURLFromOutsideSource is in the pipeline.

-- 
 
By by ... Detlef





More information about the wine-devel mailing list