smb_print.c revision faa1795a28a5c712eed6d0a3f84d98c368a316c6
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Common Development and Distribution License (the "License").
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You may not use this file except in compliance with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * or http://www.opensolaris.org/os/licensing.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER END
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
7b59d02d2a384be9a08087b14defadd214b3c1ddjb * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#pragma ident "%Z%%M% %I% %E% SMI"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SMB print interface.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include <smbsrv/smb_incl.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * smb_com_open_print_file
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This message is sent to create a new printer file which will be deleted
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * once it has been closed and printed.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Client Request Description
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ================================== =================================
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR WordCount; Count of parameter words = 2
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT SetupLength; Length of printer setup data
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT Mode; 0 = Text mode (DOS expands TABs)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 1 = Graphics mode
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT ByteCount; Count of data bytes; min = 2
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR BufferFormat; 0x04
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * STRING IdentifierString[]; Identifier string
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Tid in the SMB header must refer to a printer resource type.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SetupLength is the number of bytes in the first part of the resulting
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * print spool file which contains printer-specific control strings.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Mode can have the following values:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 0 Text mode. The server may optionally
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * expand tabs to a series of spaces.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 1 Graphics mode. No conversion of data
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * should be done by the server.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IdentifierString can be used by the server to provide some sort of per-
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * client identifying component to the print file.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Server Response Description
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ================================== =================================
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR WordCount; Count of parameter words = 1
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT Fid; File handle
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT ByteCount; Count of data bytes = 0
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Fid is the returned handle which may be used by subsequent write and
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * close operations. When the file is finally closed, it will be sent to
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * the spooler and printed.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 4.5.1.1 Errors
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ERRDOS/ERRnoaccess
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ERRDOS/ERRnofids
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ERRSRV/ERRinvdevice
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ERRSRV/ERRbaduid
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ERRSRV/ERRqfull
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ERRSRV/ERRqtoobig
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_sdrc_t
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_pre_open_print_file(smb_request_t *sr)
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb{
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb DTRACE_SMB_1(op__OpenPrintFile__start, smb_request_t *, sr);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb return (SDRC_SUCCESS);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb}
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbvoid
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_post_open_print_file(smb_request_t *sr)
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb{
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb DTRACE_SMB_1(op__OpenPrintFile__done, smb_request_t *, sr);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb}
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb
7b59d02d2a384be9a08087b14defadd214b3c1ddjbsmb_sdrc_t /*ARGSUSED*/
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_com_open_print_file(smb_request_t *sr)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb return (SDRC_NOT_IMPLEMENTED);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * smb_com_close_print_file
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This message invalidates the specified file handle and queues the file
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * for printing.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Client Request Description
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ================================== =================================
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR WordCount; Count of parameter words = 1
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT Fid; File handle
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT ByteCount; Count of data bytes = 0
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Fid refers to a file previously created with SMB_COM_OPEN_PRINT_FILE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * On successful completion of this request, the file is queued for
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * printing by the server.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Server Response Description
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ================================== =================================
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR WordCount; Count of parameter words = 0
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT ByteCount; Count of data bytes = 0
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Servers which negotiate dialects of LANMAN1.0 and newer allow all the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * other types of Fid closing requests to invalidate the Fid and begin
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * spooling.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_sdrc_t
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_pre_close_print_file(smb_request_t *sr)
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb{
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb DTRACE_SMB_1(op__ClosePrintFile__start, smb_request_t *, sr);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb return (SDRC_SUCCESS);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb}
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbvoid
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_post_close_print_file(smb_request_t *sr)
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb{
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb DTRACE_SMB_1(op__ClosePrintFile__done, smb_request_t *, sr);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb}
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb
7b59d02d2a384be9a08087b14defadd214b3c1ddjbsmb_sdrc_t /*ARGSUSED*/
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_com_close_print_file(smb_request_t *sr)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb return (SDRC_NOT_IMPLEMENTED);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * smb_com_get_print_queue
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This message obtains a list of the elements currently in the print queue
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * on the server.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Client Request Description
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ================================== =================================
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR WordCount; Count of parameter words = 2
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT MaxCount; Max number of entries to return
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT StartIndex; First queue entry to return
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT ByteCount; Count of data bytes = 0
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * StartIndex specifies the first entry in the queue to return.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * MaxCount specifies the maximum number of entries to return, this may be
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * a positive or negative number. A positive number requests a forward
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * search, a negative number indicates a backward search.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Server Response Description
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ================================== =================================
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR WordCount; Count of parameter words = 2
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT Count; Number of entries returned
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT RestartIndex; Index of entry after last
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * returned
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT ByteCount; Count of data bytes; min = 3
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR BufferFormat; 0x01 -- Data block
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT DataLength; Length of data
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR Data[]; Queue elements
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Count indicates how many entries were actually returned. RestartIndex
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * is the index of the entry following the last entry returned; it may be
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * used as the StartIndex in a subsequent request to resume the queue
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * listing.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The format of each returned queue element is:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Queue Element Member Description
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ================================ ===================================
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SMB_DATE FileDate; Date file was queued
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SMB_TIME FileTime; Time file was queued
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR Status; Entry status. One of:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 01 = held or stopped
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 02 = printing
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 03 = awaiting print
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 04 = in intercept
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 05 = file had error
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 06 = printer error
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 07-FF = reserved
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT SpoolFileNumber; Assigned by the spooler
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ULONG SpoolFileSize; Number of bytes in spool file
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR Reserved;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR SpoolFileName[16]; Client which created the spool file
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SMB_COM_GET_PRINT_QUEUE will return less than the requested number of
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * elements only when the top or end of the queue is encountered.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Support for this SMB is server optional. In particular, no current
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Microsoft client software issues this request.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 4.5.2.1 Errors
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ERRHRD/ERRnotready
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ERRHRD/ERRerror
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ERRSRV/ERRbaduid
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
7b59d02d2a384be9a08087b14defadd214b3c1ddjbsmb_sdrc_t
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_pre_get_print_queue(smb_request_t *sr)
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb{
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb DTRACE_SMB_1(op__GetPrintQueue__start, smb_request_t *, sr);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb return (SDRC_SUCCESS);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb}
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbvoid
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_post_get_print_queue(smb_request_t *sr)
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb{
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb DTRACE_SMB_1(op__GetPrintQueue__done, smb_request_t *, sr);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb}
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_sdrc_t
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_com_get_print_queue(smb_request_t *sr)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw unsigned short max_count, start_ix;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
7b59d02d2a384be9a08087b14defadd214b3c1ddjb if (smbsr_decode_vwv(sr, "ww", &max_count, &start_ix) != 0)
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb return (SDRC_ERROR);
7b59d02d2a384be9a08087b14defadd214b3c1ddjb
7b59d02d2a384be9a08087b14defadd214b3c1ddjb if (smbsr_encode_result(sr, 2, 3, "bwwwbw", 2, 0, 0, 3, 1, 0))
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb return (SDRC_ERROR);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb return (SDRC_SUCCESS);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * smb_com_write_print_file
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This message is sent to write bytes into a print spool file.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Client Request Description
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ================================== =================================
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR WordCount; Count of parameter words = 1
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT Fid; File handle
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT ByteCount; Count of data bytes; min = 4
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR BufferFormat; 0x01 -- Data block
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT DataLength; Length of data
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR Data[]; Data
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Fid indicates the print spool file to be written, it must refer to a
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * print spool file.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ByteCount specifies the number of bytes to be written, and must be less
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * than MaxBufferSize for the Tid specified.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Data contains the bytes to append to the print spool file. The first
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SetupLength bytes in the resulting print spool file contain printer
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * setup data. SetupLength is specified in the SMB_COM_OPEN_PRINT_FILE SMB
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * request.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Server Response Description
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ================================== =================================
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UCHAR WordCount; Count of parameter words = 0
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * USHORT ByteCount; Count of data bytes = 0
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Servers which negotiate a protocol dialect of LANMAN1.0 or later also
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * support the application of normal write requests to print spool files.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_sdrc_t
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_pre_write_print_file(smb_request_t *sr)
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb{
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb DTRACE_SMB_1(op__WritePrintFile__start, smb_request_t *, sr);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb return (SDRC_SUCCESS);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb}
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbvoid
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_post_write_print_file(smb_request_t *sr)
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb{
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb DTRACE_SMB_1(op__WritePrintFile__done, smb_request_t *, sr);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb}
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb
7b59d02d2a384be9a08087b14defadd214b3c1ddjbsmb_sdrc_t /*ARGSUSED*/
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbsmb_com_write_print_file(smb_request_t *sr)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb return (SDRC_NOT_IMPLEMENTED);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}