Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/include/nt_printing.h

    r414 r745  
    2323#define NT_PRINTING_H_
    2424
    25 /* container for a single registry key */
    26 
    27 typedef struct {
    28         char                    *name;
    29         struct regval_ctr       *values;
    30 } NT_PRINTER_KEY;
    31 
    32 /* container for all printer data */
    33 
    34 typedef struct {
    35         int             num_keys;
    36         NT_PRINTER_KEY  *keys;
    37 } NT_PRINTER_DATA;
    38 
    39 typedef struct ntdevicemode
    40 {
    41         fstring devicename;
    42         fstring formname;
    43 
    44         uint16  specversion;
    45         uint16  driverversion;
    46         uint16  size;
    47         uint16  driverextra;
    48         uint16  orientation;
    49         uint16  papersize;
    50         uint16  paperlength;
    51         uint16  paperwidth;
    52         uint16  scale;
    53         uint16  copies;
    54         uint16  defaultsource;
    55         uint16  printquality;
    56         uint16  color;
    57         uint16  duplex;
    58         uint16  yresolution;
    59         uint16  ttoption;
    60         uint16  collate;
    61         uint16  logpixels;
    62 
    63         uint32  fields;
    64         uint32  bitsperpel;
    65         uint32  pelswidth;
    66         uint32  pelsheight;
    67         uint32  displayflags;
    68         uint32  displayfrequency;
    69         uint32  icmmethod;
    70         uint32  icmintent;
    71         uint32  mediatype;
    72         uint32  dithertype;
    73         uint32  reserved1;
    74         uint32  reserved2;
    75         uint32  panningwidth;
    76         uint32  panningheight;
    77         uint8   *nt_dev_private;
    78 } NT_DEVICEMODE;
    79 
    80 typedef struct nt_printer_info_level_2
    81 {
    82         uint32 attributes;
    83         uint32 priority;
    84         uint32 default_priority;
    85         uint32 starttime;
    86         uint32 untiltime;
    87         uint32 status;
    88         uint32 cjobs;
    89         uint32 averageppm;
    90         fstring servername;
    91         fstring printername;
    92         fstring sharename;
    93         fstring portname;
    94         fstring drivername;
    95         char comment[1024];
    96         fstring location;
    97         NT_DEVICEMODE *devmode;
    98         fstring sepfile;
    99         fstring printprocessor;
    100         fstring datatype;
    101         fstring parameters;
    102         NT_PRINTER_DATA *data;
    103         SEC_DESC_BUF *secdesc_buf;
    104         uint32 changeid;
    105         uint32 c_setprinter;
    106         uint32 setuptime;       
    107 } NT_PRINTER_INFO_LEVEL_2;
    108 
    109 typedef struct nt_printer_info_level
    110 {
    111         NT_PRINTER_INFO_LEVEL_2 *info_2;
    112 } NT_PRINTER_INFO_LEVEL;
    113 
    114 typedef struct
    115 {
    116         fstring name;
    117         uint32 flag;
    118         uint32 width;
    119         uint32 length;
    120         uint32 left;
    121         uint32 top;
    122         uint32 right;
    123         uint32 bottom;
    124 } nt_forms_struct;
     25#include "client.h"
     26#include "../librpc/gen_ndr/spoolss.h"
    12527
    12628#ifndef SAMBA_PRINTER_PORT_NAME
     
    201103#define SPLHND_PORTMON_LOCAL    4
    202104
    203 /* structure to store the printer handles */
    204 /* and a reference to what it's pointing to */
    205 /* and the notify info asked about */
    206 /* that's the central struct */
    207 typedef struct _Printer{
    208         struct _Printer *prev, *next;
    209         bool document_started;
    210         bool page_started;
    211         uint32 jobid; /* jobid in printing backend */
    212         int printer_type;
    213         fstring servername;
    214         fstring sharename;
    215         uint32 type;
    216         uint32 access_granted;
    217         struct {
    218                 uint32 flags;
    219                 uint32 options;
    220                 fstring localmachine;
    221                 uint32 printerlocal;
    222                 struct spoolss_NotifyOption *option;
    223                 struct policy_handle client_hnd;
    224                 bool client_connected;
    225                 uint32 change;
    226                 /* are we in a FindNextPrinterChangeNotify() call? */
    227                 bool fnpcn;
    228         } notify;
    229         struct {
    230                 fstring machine;
    231                 fstring user;
    232         } client;
    233        
    234         /* devmode sent in the OpenPrinter() call */
    235         NT_DEVICEMODE   *nt_devmode;
    236        
    237         /* cache the printer info */
    238         NT_PRINTER_INFO_LEVEL *printer_info;
    239        
    240 } Printer_entry;
    241 
    242105/*
    243106 * The printer attributes.
     
    262125};
    263126
     127bool nt_printing_init(struct messaging_context *msg_ctx);
     128
     129const char *get_short_archi(const char *long_archi);
     130
     131bool print_access_check(const struct auth_serversupplied_info *server_info,
     132                        struct messaging_context *msg_ctx, int snum,
     133                        int access_type);
     134
     135WERROR nt_printer_publish(TALLOC_CTX *mem_ctx,
     136                          const struct auth_serversupplied_info *server_info,
     137                          struct messaging_context *msg_ctx,
     138                          struct spoolss_PrinterInfo2 *pinfo2,
     139                          int action);
     140
     141bool is_printer_published(TALLOC_CTX *mem_ctx,
     142                          const struct auth_serversupplied_info *server_info,
     143                          struct messaging_context *msg_ctx,
     144                          const char *servername, char *printer, struct GUID *guid,
     145                          struct spoolss_PrinterInfo2 **info2);
     146
     147WERROR check_published_printers(struct messaging_context *msg_ctx);
     148
     149bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
     150                           const struct auth_serversupplied_info *server_info,
     151                           struct messaging_context *msg_ctx,
     152                           const struct spoolss_DriverInfo8 *r);
     153bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
     154                                 const struct auth_serversupplied_info *server_info,
     155                                 struct messaging_context *msg_ctx,
     156                                 struct spoolss_DriverInfo8 *r);
     157bool delete_driver_files(const struct auth_serversupplied_info *server_info,
     158                         const struct spoolss_DriverInfo8 *r);
     159
     160WERROR move_driver_to_download_area(struct auth_serversupplied_info *session_info,
     161                                    struct spoolss_AddDriverInfoCtr *r);
     162
     163WERROR clean_up_driver_struct(TALLOC_CTX *mem_ctx,
     164                              struct auth_serversupplied_info *session_info,
     165                              struct spoolss_AddDriverInfoCtr *r);
     166
     167void map_printer_permissions(struct security_descriptor *sd);
     168
     169void map_job_permissions(struct security_descriptor *sd);
     170
     171bool print_time_access_check(const struct auth_serversupplied_info *server_info,
     172                             struct messaging_context *msg_ctx,
     173                             const char *servicename);
     174
     175void nt_printer_remove(TALLOC_CTX *mem_ctx,
     176                        const struct auth_serversupplied_info *server_info,
     177                        struct messaging_context *msg_ctx,
     178                        const char *printer);
     179
    264180#endif /* NT_PRINTING_H_ */
Note: See TracChangeset for help on using the changeset viewer.