3.2.4.20.3 Application Requests DFS Referral Information
The application provides the following:
ServerName: The name of the server from which to query referrals.
UserCredentials: An opaque implementation-specific entity that identifies the credentials to be used when authenticating to the remote server.
The maximum output buffer response size, in bytes.
An input buffer containing the application-provided structure REQ_GET_DFS_REFERRAL specified in [MS-DFSC] section 2.2.2 or REQ_GET_DFS_REFERRAL_EX specified in [MS-DFSC] section 2.2.3.
The FSCTL code for DFS referral information, either FSCTL_DFS_GET_REFERRALS or FSCTL_DFS_GET_REFERRALS_EX.
The client MUST search for an existing Session and TreeConnect to any share on the server identified by ServerName for the user identified by UserCredentials. If no Session and TreeConnect are found, the client MUST establish a new Session and TreeConnect to IPC$ on the target server as described in section 3.2.4.2 using the supplied ServerName and UserCredentials.
The client initializes an SMB2 IOCTL Request following the syntax specified in section 2.2.31. The SMB2 header MUST be initialized as follows:
The Command field is set to SMB2 IOCTL.
The MessageId field is set as specified in section 3.2.4.1.3.
The SessionId field is set to Session.SessionId.
The TreeId field is set to TreeConnect.TreeConnectId.
The SMB2 IOCTL Request MUST be initialized as follows:
The CtlCode field is set to the application-provided FSCTL code.
The FileId field is set to { 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF }.
The InputOffset field is set to the offset to the Buffer[], in bytes, from the beginning of the SMB2 header.
The InputCount field is set to the size of the Buffer field.
The OutputOffset field SHOULD<167> be set to zero.
The OutputCount field is set to 0.
The MaxInputResponse field is set to 0.
The MaxOutputResponse field is set to the maximum response buffer size that the calling application will accept.
SMB2_0_IOCTL_IS_FSCTL is set to TRUE in the Flags field.
Buffer is set to the application-provided input buffer.
The request MUST be sent to the server using the Session and TreeConnect obtained as a result of connecting to the IPC$ share on the server.