[jcifs] Re: Maximum message size

Christopher R. Hertel crh at nts.umn.edu
Sun Oct 6 04:41:39 EST 2002

Urban Widmark wrote:
> On Sat, 5 Oct 2002, Christopher R. Hertel wrote:
> > The first thing I note about that structure is that the type of the
> > MaxCountHigh has *got* to be wrong.  The description of the field says
> > that it contains the "High 16 bits of MaxCount".  We don't need a
> > 32-bit field to store 16 bits.
> If it was wrong Samba would be reading the wrong high offset, smbfs
> would send the wrong offset, jcifs would ...

Your later arguments are correct.  This one, however...  There are lots of 
instances of Samba and jCIFS and everything else getting things right 
despite the documentation.  I'm just trying to figure out if the 
documentation is wrong or if I am.

> I suspect that someone would
> notice the massive data corruption that would follow when using >4G
> files and a windows box if the layout was wrong.

Likewise.  That's why I'm asking.  :)

> > Also the description of WordCount for this block says that the block
> > is 10 or 12 words long (20 or 24 bytes).  If I count up the bytes
> > following WordCount I get 26, or 22 if I leave out the OffsetHigh
> > field (which is the optional field).  In other words, there are two
> > extra bytes somewhere.  That supports the theory that the MaxCountHigh
> > field should be a USHORT, not a ULONG.
> Are you counting the ByteCount as a parameter word? Because it isn't.

Here's where you caught me.
Yes, I was being stupid and counting the ByteCount.  Yep.  Urq.

> > Even so, we still have a problem.
> >
> >   Why would we need the "High 16 bits of MaxCount if CAP_LARGE_READX"
> >   unless we could send more than 65535 bytes?
> Future expansion?

I'm still confused by this, and by the use of a longword to hold a short's 
worth of data.

Thanks for setting me straight on the count.

Chris -)-----

Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org

More information about the jcifs mailing list