Wednesday, August 1, 2007

Why am I receiving parsing and validation errors in my receive pipeline when using my custom disassembler pipeline component?

When writing a custom disassembler pipeline component you should always:

· Read from the incoming data stream until no more bytes are read.

· Reset the data stream pointer to the start of the stream.

Failure to read all of the data in the incoming data stream could cause your component to process the data incorrectly or miss important data. If you fail to reset the data stream pointer, the next component in the pipeline receives what appears to be an empty (or incomplete) stream.

For example, this code illustrates logic to use the Seek method to point to the beginning of the stream before returning the stream:

myDataStream.Seek(0, SeekOrigin.Begin);

return myDataStream;


Source: Microsoft

No comments: