3.3.5.56 Receiving an SMB_COM_CLOSE_PRINT_FILE Request

Upon receipt of an SMB_COM_CLOSE_PRINT_FILE Request (section 2.2.4.69.1), the server MUST verify the UID as in section 3.3.5.2.

The server MUST perform a lookup of the FID in Server.Connection.FileOpenTable. If the FID is not found, the server MUST return an error response with a Status of STATUS_INVALID_HANDLE (ERRDOS/ERRbadfid). Otherwise, the Open indicated by the FID MUST be closed, every lock in Open.Locks MUST be released, and Open.TreeConnect.OpenCount, Server.Statistics.sts0_jobsqueued, and Server.Statistics.sts0_fopens MUST be decreased by 1. The server MUST provide Open.FileGlobalId as an input parameter and MUST deregister the Open by invoking the event Server Deregisters an Open ([MS-SRVS] section 3.1.6.5). Once the file has been closed, the server MUST queue it for printing. The server SHOULD delete the file once it has been printed.<325>

If the file is successfully closed, the FID MUST be invalidated by removing the Open entry from Server.Connection.FileOpenTable. Once the FID has been invalidated, it is available to be reused by future open or create operations. The response MUST be sent to the client as specified in section 3.3.4.1.