It is well known that Microsoft themselves rely on the Samba source code to document their own networking protocol, because their own code has gotten so convoluted over the years. It's kinda surprising it works at all, really.

Wade.