3.2.4.9 Application Requests Applying File Attributes

The application provides:

  • A handle to the Open identifying a file or named pipe.

  • The InformationClass of the information being applied to the file or pipe, as specified in [MS-FSCC] section 2.4.

  • A buffer containing the information being applied.

If the handle is invalid, or if no Open referenced by the handle is found, the client MUST return an implementation-specific error code. If the handle is valid and Open is found, the client MUST proceed as follows.

For the specified Open, the client MUST select a connection as specified in section 3.2.4.1.7. If no connection is available, the client MUST fail the set operation.

Otherwise, the client initializes an SMB2 SET_INFO Request following the syntax specified in section 2.2.37. The SMB2 header MUST be initialized as follows:

  • The Command field is set to SMB2 SET_INFO.

  • The MessageId field is set as specified in section 3.2.4.1.3.

  • The SessionId field is set to Open.TreeConnect.Session.SessionId.

  • The TreeId field is set to Open.TreeConnect.TreeConnectId.

The SMB2 SET_INFO Request MUST be initialized as follows:

  • The InfoType field is set to SMB2_0_INFO_FILE.

  • The FileInfoClass field is set to the InformationClass provided by the application.

  • The buffer provided by the client is copied into Buffer[].<153>

  • The BufferOffset field is set to the offset, in bytes, from the beginning of the SMB2 header to Buffer[].

  • The BufferLength field is set to the length, in bytes, of the buffer that is provided by the application.

  • The AdditionalInformation is set to 0.

  • The FileId field is set to Open.FileId.

The request MUST be sent to the server.