s3: Lift the smbd_messaging_context from print_access_check
[abartlet/samba.git/.git] / source3 / include / nt_printing.h
index 5a1eb004894cb2a0eecb9b06cc28369c22ac2c12..f29b22fc4213e6d51ae6cdecb861a0e55cf8ce5d 100644 (file)
@@ -22,6 +22,9 @@
 #ifndef NT_PRINTING_H_
 #define NT_PRINTING_H_
 
+#include "client.h"
+#include "../librpc/gen_ndr/srv_spoolss.h"
+
 /* container for a single registry key */
 
 typedef struct {
@@ -184,6 +187,7 @@ typedef struct _Printer{
                uint32 change;
                /* are we in a FindNextPrinterChangeNotify() call? */
                bool fnpcn;
+               struct messaging_context *msg_ctx;
        } notify;
        struct {
                fstring machine;
@@ -193,8 +197,8 @@ typedef struct _Printer{
        /* devmode sent in the OpenPrinter() call */
        struct spoolss_DeviceMode *devmode;
 
-       /* cache the printer info */
-       NT_PRINTER_INFO_LEVEL *printer_info;
+       /* TODO cache the printer info2 structure */
+       struct spoolss_PrinterInfo2 *info2;
        
 } Printer_entry;
 
@@ -220,4 +224,66 @@ struct print_architecture_table_node {
        int     version;
 };
 
+bool nt_printing_init(struct messaging_context *msg_ctx);
+
+WERROR spoolss_create_default_devmode(TALLOC_CTX *mem_ctx,
+                                     const char *devicename,
+                                     struct spoolss_DeviceMode **devmode);
+
+WERROR spoolss_create_default_secdesc(TALLOC_CTX *mem_ctx,
+                                     struct spoolss_security_descriptor **secdesc);
+
+WERROR spoolss_map_to_os2_driver(TALLOC_CTX *mem_ctx, const char **pdrivername);
+
+const char *get_short_archi(const char *long_archi);
+
+bool print_access_check(struct auth_serversupplied_info *server_info,
+                       struct messaging_context *msg_ctx, int snum,
+                       int access_type);
+
+WERROR nt_printer_publish(TALLOC_CTX *mem_ctx,
+                         struct auth_serversupplied_info *server_info,
+                         struct spoolss_PrinterInfo2 *pinfo2,
+                         int action);
+
+bool is_printer_published(TALLOC_CTX *mem_ctx,
+                         struct auth_serversupplied_info *server_info,
+                         char *servername, char *printer, struct GUID *guid,
+                         struct spoolss_PrinterInfo2 **info2);
+
+WERROR check_published_printers(void);
+
+bool driver_info_ctr_to_info8(struct spoolss_AddDriverInfoCtr *r,
+                             struct spoolss_DriverInfo8 *_info8);
+
+bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
+                          struct auth_serversupplied_info *server_info,
+                          struct messaging_context *msg_ctx,
+                          const struct spoolss_DriverInfo8 *r);
+bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
+                                struct auth_serversupplied_info *server_info,
+                                struct messaging_context *msg_ctx,
+                                struct spoolss_DriverInfo8 *r);
+bool delete_driver_files(struct auth_serversupplied_info *server_info,
+                        const struct spoolss_DriverInfo8 *r);
+
+WERROR move_driver_to_download_area(struct pipes_struct *p,
+                                   struct spoolss_AddDriverInfoCtr *r,
+                                   WERROR *perr);
+
+WERROR clean_up_driver_struct(TALLOC_CTX *mem_ctx,
+                             struct pipes_struct *rpc_pipe,
+                             struct spoolss_AddDriverInfoCtr *r);
+
+void map_printer_permissions(struct security_descriptor *sd);
+
+void map_job_permissions(struct security_descriptor *sd);
+
+bool print_time_access_check(struct auth_serversupplied_info *server_info,
+                            const char *servicename);
+
+void nt_printer_remove(TALLOC_CTX *mem_ctx,
+                       struct auth_serversupplied_info *server_info,
+                       const char *printer);
+
 #endif /* NT_PRINTING_H_ */