Receiving an SMB_COM_CREATE_DIRECTORY Request

Upon receipt of an SMB_COM_CREATE_DIRECTORY Request (section from the client, the server MUST verify the following:

  • The TID in the SMB_Header.TID field MUST be a valid TID for this SMB connection, as defined in section

  • If the last element of the pathname in the SMB_Data.Bytes.DirectoryName field is removed, the remaining pathname MUST represent a valid directory within the share indicated by the TID.

  • The full pathname from the SMB_Data.Bytes.DirectoryName field MUST NOT resolve to an existing file or directory or other file system object.

  • The UID in the SMB_Header.UID field MUST be valid, as defined in section, and MUST represent the security context of a user with permission to create the directory. If the user does not have permission to create the directory, the server MUST return an error response with STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase Server.Statistics.sts0_permerrors by 1.

  • If the designated directory already exists, the server MUST return an error response with STATUS_OBJECT_NAME_COLLISION (ERRDOS/ ERRfilexists).

If these conditions are met, the server MUST attempt to create the directory.<240> If directory creation fails, the server MUST provide an error response to the client (see section for the list of expected error codes). Otherwise, the server the server MUST increase Server.Statistics.sts0_fopens by 1 and MUST return Success in the Status field. A new Open object MUST be allocated and inserted into Server.Connection.FileOpenTable with the following default values:

  • A new FID MUST be created to uniquely identify this Open request in Server.Connection.FileOpenTable.

  • Server.Open.TreeConnect MUST be set to the TreeConnect on which the open request was performed, and Server.Open.TreeConnect.OpenCount MUST be incremented by 1.

The server MUST register the Open request by invoking the Server Registers a New Open event ([MS-SRVS] section and MUST assign the return value to Server.OpenFileGlobalId.

The response MUST be sent to the client as specified in section