Question about testing SHQueryValueExA in shlwapi/tests/shreg.c

Paul Vriens Paul.Vriens at xs4all.nl
Mon Jan 17 16:05:59 CST 2005


Hi,

I'm trying to fix the tests in shlwapi/tests/shreg.c (or Wine for that
matter).

One thing that puzzles me in the current code is the checks done after
we receive a ERROR_MORE_DATA when we pass a size smaller than the actual
data.

MSDN states:

If the buffer specified by pvData parameter is not large enough to hold
the data, the function returns ERROR_MORE_DATA and stores the required
buffer size in the variable pointed to by pcbData. In this case, the
contents of the pvData buffer are undefined.

If that's the case, what's the use of checking the returned buffer with
something?

Wine and Win98 leave the buffer intact (the contents and thus size
differ however)
WinXPProf and W2KProf clear (so it seems) the buffer.

Cheers,

Paul Vriens.






More information about the wine-devel mailing list