The macOS server uses FILE_ATTRIBUTE_READONLY in a different way from the Microsoft specifications, so we now try to check if the server is a Mac and adjust the mapping of file attributes accordingly.
Windows does not let us query FileStreamInformation on FAT filesystems, so we should simply treat this as an indication that the AFP info and resource fork are not available, rather than as an error condition.
This is an initial implementation that should work but may be fairly slow. It can be optimized later, e.g. by caching directory information and by using the "AAPL" extensions if available.
This makes things faster, and may allow the operation to work in some cases where it would otherwise fail because the file is write-only and therefore the AFP Info cannot be accessed.
It will not let us query FileStreamInformation on the resource fork (which Windows allows), so we need to open the data fork and get it from there instead.
macOS gives the actual allocation size in the Create response, but just sets the allocation size equal to the EOF in FILE_STREAM_INFORMATION. To give more accurate results in such cases, we take the allocation size from the Create response if it is available and still seems to be accurate.