Re: IStream.Read()
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Wed, 9 May 2007 23:19:22 +0200
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message news:MPG.20ac426d68ba0f82bd@xxxxxxxxxxxxxxxxxxxxxxx
Willy Denoyette [MVP] <willy.denoyette@xxxxxxxxxx> wrote:Hmmm, I see ....> It depends on what you mean by "the MSDN library". In the offline
> version of the MSDN library (which is what I'd certainly look it up in
> normally) it *does* specify it.
I mean both, the on-line MSDN Library (msdn2), this one holds the latest
update, and,
Off-line, the latest MSDN from the subscribers download site (Build date:
2/1/2007), and the version that comes with Orcas Beta1 both have the same
description for both IStream.Read and ISequentialStream - no mention about
null pointers.
Odd - I've got the same quote as Nick had in ISequentialStream::Read,
and I'm sure I've been installing all the latest disks... Is there a
decent way of finding the version of any particular file? The URL in
the offline MSDN is
ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.WIN32COM.v10.en/oledb/htm/
oledbisequentialstream__read.htm
I'm on - ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.WIN32COM.v10.en/stg/stg/isequentialstream_read.htm -
see, ISTREAM is part of the "structured storage" interfaces, while you are at the "oledb programmers reference " stuff, it's not surprising to find this here, it's old hat that never gest updated in the post OLEDB age ;-), IMO it doesn't even belong there.
Also take note that I did not install from the distribution, but I install the latest download available from the MSDN subscribers area, more exactly, the April 2007 MSDN Library (en_msdn_library_2007_04_dvd_X13-63638.iso ISO-9660 DVD Image ).
> My guess is that the docs are wrong/incomplete. I'm surprised at the
> difference between the offline and online docs though :(
Incomplete, I agree, wrong? (take care [1]) possibly, confusing -
certainly....
I think it counts as "wrong" if it's been introduced into the
documentation as if it had always been part of the interface contract,
when older implementations could have legitimately returned the
appropriate error code instead.
Return values are never part of the contract, a COM interface is carved in stone, right, that means you cannot change the return type nor the argument types and number of arguments, but the value returned is not part of the contract
The documentation specifies the "standard" return values, like S_OK, E_FAIL etc.., but the implementor of an interface method is free to return what he sees fit.
Now, when you look at the ISequential::Read method, you'll see that STG_E_INVALIDPOINTER is one of the values that could "possibly" be returned from a typical implemetation. If the implementor , requires the pointers to be valid, it can return STG_E_INVALIDPOINTER when one of them is not. I have found one implementation that actually does that. So IMO, the parameter description was too general, in the sense that it makes you fell that null is valid irrespective the implementaton of the interface.
So, again be prepared to get an exception thrown on you when passing null, note that this is extremely rare to happen, besides, you should never pass a null pointer, as it's nearly impossible to know what exactly has been returned from the callee (0 values is valid data to be returned in the buffer).
..
This is a general complaint of mine, the .NET MSDN docs are produced by
"robots", no longer by humans, they offer not much more than what's actually
documented in the .NET library code, that is the minimum, programmers are no
technical writers and having both is a slow and too expensive process, even
for MSFT , so they expect from us that we add the missing pieces and
possibly correct what's wrong (see the MSDN's Community contents), which is
not a bad idea after all.
[1] Finally it will be the community's fault the docs are wrong ;-).
Indeed. I'm ashamed to say I haven't found time to contribute to the
MSDN pages, beyond mailing appropriate people when I've spotted
mistakes.
Same here, but I'm not ashamed ;-)
Willy.
.
- References:
- IStream.Read()
- From: Peter Larsen []
- Re: IStream.Read()
- From: Willy Denoyette [MVP]
- Re: IStream.Read()
- From: Nicholas Paldino [.NET/C# MVP]
- Re: IStream.Read()
- From: Willy Denoyette [MVP]
- Re: IStream.Read()
- From: Nicholas Paldino [.NET/C# MVP]
- Re: IStream.Read()
- From: Willy Denoyette [MVP]
- Re: IStream.Read()
- From: Jon Skeet [C# MVP]
- Re: IStream.Read()
- From: Willy Denoyette [MVP]
- Re: IStream.Read()
- From: Jon Skeet [C# MVP]
- IStream.Read()
- Prev by Date: Re: What can be stored in application settings?
- Next by Date: Reflection Issue / Question
- Previous by thread: Re: IStream.Read()
- Next by thread: Re: IStream.Read()
- Index(es):
Relevant Pages
|