public void Read(byte[] pv, int cb, IntPtr pcbRead)
{
int count = this._stream.Read(pv, 0, cb);
// destination expects an ULONG (32 bit?), therefore we must guard against negative values
if (pcbRead != IntPtr.Zero)
{
Marshal.WriteInt32(pcbRead, count >= 0 ? count : 0);
}
}