A DFS pathname adheres to the standard described in the FileNames section.
A DFS enabled client accessing a DFS share should set the Flags2 bit 12 in all
name based SMB requests indicating to the server that the enclosed pathname
should be resolved in the Distributed File System namespace. The pathname should
always have the full file name, including the server name and share name. If
the server can resolve the DFS name to a piece of local storage, the local storage
will be accessed. If the server determines that the DFS name actually maps to
a different server share, the access to the name will fail with the 32 bit status
STATUS_PATH_NOT_COVERED (0xC0000257), or DOS error
ERRsrv/ERRbadpath.
On receiving this error, the DFS enabled client should ask the server for a
referral (see TRANS2_GET_DFS_REFERRAL). The referral request should contain
the full file name.
The response to the request will contain a list of server and share names to try, and the part of the request file name that junctions to the list of server shares. If the ServerType field of the referral is set to 1 (SMB server), then the client should resubmit the request with the original file name to one of the server shares in the list, once again setting the Flags2 bit 12 bit in the SMB. If the ServerType field is not 1, then the client should strip off the part of the file name that junctions to the server share before resubmitting the request to one of servers in the list.
A response to a referral request may elicit a response that does not have the
StorageServers bit set. In that case, the client should resubmit the referral
request to one of the servers in the list, until it finally obtains a referral
response that has the StorageServers bit set, at which point the client can
resubmit the request SMB to one of
the listed server shares.
If, after getting a referral with the StorageServers bit set and resubmitting
the request to one of the server shares in the list, the server fails the request
with STATUS_PATH_NOT_COVERED, it must be the case that there is an inconsistency
between the view of the DFS namespace held by the server granting the referral
and the server listed in that referral. In this case, the client may inform
the server granting the referral of this inconsistency via the TRANS2_REPORT_DFS_INCONSISTENCY
SMB.