s3: Lift the smbd_messaging_context from winreg_printer_addform1
[abartlet/samba.git/.git] / source3 / rpc_server / srv_spoolss_util.h
index 4b5117e937751d8641a2b83a0fd5f0139af75402..ada7cabdeec02301b6925178d6947530c75f2a0e 100644 (file)
@@ -73,6 +73,8 @@ 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);
 
 /**
@@ -84,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.
@@ -97,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,
@@ -110,6 +116,8 @@ WERROR winreg_update_printer(TALLOC_CTX *mem_ctx,
  *
  * @param[in]  server_info The server supplied session info.
  *
+ * @param[in]  printer  The servername to use.
+ *
  * @param[in]  printer  The name of the printer to get.
  *
  * @param[out] pinfo2   A pointer to store a PRINTER_INFO_2 structure.
@@ -119,9 +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
  *
@@ -148,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,
@@ -181,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,
@@ -210,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,
@@ -235,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);
@@ -262,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,
@@ -285,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);
 
@@ -308,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);
 
 /**
@@ -326,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);
 
@@ -348,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);
 
 /*