Get a third-party SMB stack. MoSMB has one of these, and there are others to choose from. Some support Windows, some only for Linux.
http://mosmb.com
In general, I would review what you are doing: no patches, EOSL, etc. - A big red flag for something in production. If not necessary, of course.
source share