Was this page helpful?
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize Receiving an SMB_COM_CREATE_TEMPORARY Request

When the server receives an SMB_COM_CREATE_TEMPORARY Request (section, it MUST verify that the DirectoryName passed in the request identifies a directory within the supplied TID, verify the UID and ensure that the user has the necessary permissions to create a file in the directory. If the underlying object store returns STATUS_ACCESS_DENIED, the server MUST increase Server.Statistics.sts0_permerrors by 1.

The server MUST then create the file:

  • The name of the newly created file MUST NOT be the same as the name of any other file in the directory; otherwise, the server MUST return an error response with Status set to STATUS_OBJECT_NAME_COLLISION (ERRDOS/ERRfilexists).

  • The creation time of the file MAY be set to the value of the CreationTime field in the request.

  • The file is opened for read/write in Compatibility Mode (see section

 If the command is successful, the server MUST increase Server.Statistics.sts0_fopens by 1 and MUST allocate an Open object and insert it into Server.Connection.FileOpenTable with the following default values:

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

  • If Server.EnableOplock is TRUE and a requested OpLock was granted, the type of OpLock MUST be set in Server.Open.OpLock and Server.Open.OplockState MUST be set to Held; otherwise, Server.Open.OpLock MUST be set to None and Server.Open.OplockState MUST be set to None.<266>

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

  • The server MUST construct an SMB_COM_CREATE_TEMPORARY Response (section message.

  • Server.Open.Session MUST be set to Server.Open.TreeConnect.Session.

  • Server.Open.Connection MUST be set to the Server.Open.Session.Connection.

  • Server.Open.Locks MUST be set to an empty list.

  • Server.Open.PID MUST be set to the PID provided in the request.

  • Server.Open.PathName MUST be set to the name of the newly created file.

  • Server.Open.GrantedAccess MUST be set to (GENERIC_READ | GENERIC_WRITE).

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

If an error occurred, the server MUST send an error response message.

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

© 2016 Microsoft