s3: Lift the smbd_messaging_context from winreg_printer_get_changeid
[abartlet/samba.git/.git] / source3 / rpc_server / srv_spoolss_util.h
index 1590db2c641d559cb76c32485c7a8e1a15142a83..92776158e90fc6ac53cbdbe6b2502fd5035336a9 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,11 +101,77 @@ 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,
                             struct security_descriptor *secdesc);
 
+
+/**
+ * @brief Get the inforamtion of a printer stored in the registry.
+ *
+ * @param[in]  mem_ctx  The talloc memory context to use.
+ *
+ * @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.
+ *
+ * @return              On success WERR_OK, a corresponding DOS error is
+ *                      something went wrong.
+ */
+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
  *
@@ -128,6 +198,7 @@ WERROR winreg_update_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,
@@ -161,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,
@@ -190,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,
@@ -215,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);
@@ -242,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,
@@ -265,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);
 
@@ -288,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);
 
 /**
@@ -306,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);