3.2.4.29 Application Requests to Print a File
The application MUST provide the Client.Session and MUST provide the Client.TreeConnect representing a connection to the printer share to which the data will be printed.
The client MUST create a print spool file using the SMB_COM_OPEN_PRINT_FILE command. The command request MUST be constructed as defined in section 2.2.4.67.1. The application MUST provide any printer-specific control data and the length, in bytes, of that data, which is copied into the SMB_Parameters.Words.SetupLength field. The application MUST indicate whether the data to be printed is to be handled in Text or Binary mode. See the description of the SMB_Parameters.Words.Mode field in section 2.2.4.67.1.
The application optionally provides printer-specific control data. If provided, it MUST be written to the spool file first, followed by the print file data itself.
The request MUST be sent to the server as described in section 3.2.4.1. If successful, the command MUST return a valid FID representing the opened spool file.
Any command capable of writing to an open FID, including SMB_COM_WRITE_PRINT_FILE, can be used to write the data to the print spool file. The file is queued for printing when the FID is closed. The FID can be closed using SMB_COM_CLOSE_PRINT_FILE (deprecated) or SMB_COM_CLOSE. The client can also use SMB_COM_WRITE_AND_CLOSE (deprecated) to write spool file data and close the file.