s3: Lift the smbd_messaging_context from winreg_printer_getform1
[amitay/samba.git] / source3 / rpc_server / srv_spoolss_util.h
index f883f20a456df41610bf7da52219eaa353297f59..c9e27abafd6267eb3f7e1a461b754d90db5b26ad 100644 (file)
@@ -73,6 +73,7 @@ enum spoolss_PrinterInfo2Mask {
 
 WERROR winreg_create_printer(TALLOC_CTX *mem_ctx,
                             struct auth_serversupplied_info *server_info,
+                            struct messaging_context *msg_ctx,
                             const char *servername,
                             const char *sharename);
 
@@ -85,6 +86,8 @@ WERROR winreg_create_printer(TALLOC_CTX *mem_ctx,
  *
  * @param[in]  server_info The server supplied session info.
  *
+ * @param[in]  sharename  The share name.
+ *
  * @param[in]  info2_mask A bitmask which defines which values should be set.
  *
  * @param[in]  info2    A SetPrinterInfo2 structure with the data to set.
@@ -98,6 +101,8 @@ WERROR winreg_create_printer(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_update_printer(TALLOC_CTX *mem_ctx,
                             struct auth_serversupplied_info *server_info,
+                            struct messaging_context *msg_ctx,
+                            const char *sharename,
                             uint32_t info2_mask,
                             struct spoolss_SetPrinterInfo2 *info2,
                             struct spoolss_DeviceMode *devmode,
@@ -122,10 +127,51 @@ WERROR winreg_update_printer(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_get_printer(TALLOC_CTX *mem_ctx,
                          struct auth_serversupplied_info *server_info,
+                         struct messaging_context *msg_ctx,
                          const char *servername,
                          const char *printer,
                          struct spoolss_PrinterInfo2 **pinfo2);
 
+/**
+ * @brief Get the security descriptor for a printer.
+ *
+ * @param[in]  mem_ctx  The talloc memory context to use.
+ *
+ * @param[in]  server_info The server supplied session info.
+ *
+ * @param[in]  sharename  The share name.
+ *
+ * @param[out] psecdesc   A pointer to store the security descriptor.
+ *
+ * @return              On success WERR_OK, a corresponding DOS error is
+ *                      something went wrong.
+ */
+WERROR winreg_get_printer_secdesc(TALLOC_CTX *mem_ctx,
+                                 struct auth_serversupplied_info *server_info,
+                                 struct messaging_context *msg_ctx,
+                                 const char *sharename,
+                                 struct spoolss_security_descriptor **psecdesc);
+
+/**
+ * @brief Set the security descriptor for a printer.
+ *
+ * @param[in]  mem_ctx  The talloc memory context to use.
+ *
+ * @param[in]  server_info The server supplied session info.
+ *
+ * @param[in]  sharename  The share name.
+ *
+ * @param[in]  secdesc  The security descriptor to save.
+ *
+ * @return              On success WERR_OK, a corresponding DOS error is
+ *                      something went wrong.
+ */
+WERROR winreg_set_printer_secdesc(TALLOC_CTX *mem_ctx,
+                                 struct auth_serversupplied_info *server_info,
+                                 struct messaging_context *msg_ctx,
+                                 const char *sharename,
+                                 const struct spoolss_security_descriptor *secdesc);
+
 /**
  * @internal
  *
@@ -152,6 +198,7 @@ WERROR winreg_get_printer(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_set_printer_dataex(TALLOC_CTX *mem_ctx,
                                 struct auth_serversupplied_info *server_info,
+                                struct messaging_context *msg_ctx,
                                 const char *printer,
                                 const char *key,
                                 const char *value,
@@ -185,6 +232,7 @@ WERROR winreg_set_printer_dataex(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_get_printer_dataex(TALLOC_CTX *mem_ctx,
                                 struct auth_serversupplied_info *server_info,
+                                struct messaging_context *msg_ctx,
                                 const char *printer,
                                 const char *key,
                                 const char *value,
@@ -214,6 +262,7 @@ WERROR winreg_get_printer_dataex(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_enum_printer_dataex(TALLOC_CTX *mem_ctx,
                                  struct auth_serversupplied_info *server_info,
+                                 struct messaging_context *msg_ctx,
                                  const char *printer,
                                  const char *key,
                                  uint32_t *pnum_values,
@@ -239,6 +288,7 @@ WERROR winreg_enum_printer_dataex(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_delete_printer_dataex(TALLOC_CTX *mem_ctx,
                                    struct auth_serversupplied_info *server_info,
+                                   struct messaging_context *msg_ctx,
                                    const char *printer,
                                    const char *key,
                                    const char *value);
@@ -266,6 +316,7 @@ WERROR winreg_delete_printer_dataex(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_enum_printer_key(TALLOC_CTX *mem_ctx,
                               struct auth_serversupplied_info *server_info,
+                              struct messaging_context *msg_ctx,
                               const char *printer,
                               const char *key,
                               uint32_t *pnum_subkeys,
@@ -289,6 +340,7 @@ WERROR winreg_enum_printer_key(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx,
                                 struct auth_serversupplied_info *server_info,
+                                struct messaging_context *msg_ctx,
                                 const char *printer,
                                 const char *key);
 
@@ -312,6 +364,7 @@ WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_printer_update_changeid(TALLOC_CTX *mem_ctx,
                                      struct auth_serversupplied_info *server_info,
+                                     struct messaging_context *msg_ctx,
                                      const char *printer);
 
 /**
@@ -330,6 +383,7 @@ WERROR winreg_printer_update_changeid(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_printer_get_changeid(TALLOC_CTX *mem_ctx,
                                   struct auth_serversupplied_info *server_info,
+                                  struct messaging_context *msg_ctx,
                                   const char *printer,
                                   uint32_t *pchangeid);
 
@@ -352,6 +406,7 @@ WERROR winreg_printer_get_changeid(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_printer_addform1(TALLOC_CTX *mem_ctx,
                               struct auth_serversupplied_info *server_info,
+                              struct messaging_context *msg_ctx,
                               struct spoolss_AddFormInfo1 *form);
 
 /*
@@ -370,6 +425,7 @@ WERROR winreg_printer_addform1(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_printer_enumforms1(TALLOC_CTX *mem_ctx,
                                 struct auth_serversupplied_info *server_info,
+                                struct messaging_context *msg_ctx,
                                 uint32_t *pnum_info,
                                 union spoolss_FormInfo **pinfo);
 
@@ -389,6 +445,7 @@ WERROR winreg_printer_enumforms1(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_printer_deleteform1(TALLOC_CTX *mem_ctx,
                                  struct auth_serversupplied_info *server_info,
+                                 struct messaging_context *msg_ctx,
                                  const char *form_name);
 
 /**
@@ -411,6 +468,7 @@ WERROR winreg_printer_deleteform1(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_printer_setform1(TALLOC_CTX *mem_ctx,
                               struct auth_serversupplied_info *server_info,
+                              struct messaging_context *msg_ctx,
                               const char *form_name,
                               struct spoolss_AddFormInfo1 *form);
 
@@ -430,6 +488,7 @@ WERROR winreg_printer_setform1(TALLOC_CTX *mem_ctx,
  */
 WERROR winreg_printer_getform1(TALLOC_CTX *mem_ctx,
                               struct auth_serversupplied_info *server_info,
+                              struct messaging_context *msg_ctx,
                               const char *form_name,
                               struct spoolss_FormInfo1 *form);