On Thu Jul 25 18:25:31 2024 +0000, Fabian Maurer wrote:
Probably should look like
[local] HRESULT Next( [in] ULONG celt, [in] REFIID riid, [out, size_is(celt), length_is(*pceltFetched), iid_is(riid)] void **rgelt, [out] ULONG *pceltFetched);
I *think* the annotations are optional, but the local stuff might be needed for... something. I don't know, probably best to have it. Not sure where you got that `pceltFetched` [optional] from, I didn't find that.
The annotations mostly affect COM remoting. They're probably also theoretically usable for some forms of bounds checking, but I'm not aware of any implementation thereof.
Yes, that [optional] does indeed not belong. The argument is nullable, but that tag is only for VARIANT and VARIANT* type arguments. Probably related to calling the function from Visual Basic.
[local] bans remoting on that function. I'd either skip it and assume the default handler is good enough, or add that tag to half of both IEnumObjects and IObjectCollection (and change it when and if anyone complains).
I can't find a clear answer for how [size_is] and [length_is] interact, but I do know that *pceltFetched is not a number if pceltFetched is null. Personally I'd include [size_is] and skip [length_is], unless someone who actually understands this stuff tells me otherwise.