diff options
author | Günther Deschner <gd@samba.org> | 2016-11-02 13:43:34 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2017-05-09 16:43:13 +0200 |
commit | 5a3b99b7ce6a7342a8a427b941268a6a302ee158 (patch) | |
tree | 418c3c4492f5002abd20cddfe62aa5216e25413e | |
parent | 1494e94700be68d8c07753371dc8d09b120584fc (diff) | |
download | samba-5a3b99b7ce6a7342a8a427b941268a6a302ee158.tar.gz |
s3-spoolss: add winreg_add_driver_package_internal()
Guenther
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
-rw-r--r-- | source3/rpc_server/spoolss/srv_spoolss_util.c | 34 | ||||
-rw-r--r-- | source3/rpc_server/spoolss/srv_spoolss_util.h | 8 |
2 files changed, 41 insertions, 1 deletions
diff --git a/source3/rpc_server/spoolss/srv_spoolss_util.c b/source3/rpc_server/spoolss/srv_spoolss_util.c index 743ad5ca04d..753ddbdd281 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_util.c +++ b/source3/rpc_server/spoolss/srv_spoolss_util.c @@ -578,6 +578,40 @@ WERROR winreg_add_core_driver_internal(TALLOC_CTX *mem_ctx, return result; } +WERROR winreg_add_driver_package_internal(TALLOC_CTX *mem_ctx, + const struct auth_session_info *session_info, + struct messaging_context *msg_ctx, + const char *package_id, + const char *architecture, + const char *driver_store_path, + const char *cab_path) +{ + WERROR result; + struct dcerpc_binding_handle *b; + TALLOC_CTX *tmp_ctx; + + tmp_ctx = talloc_stackframe(); + if (tmp_ctx == NULL) { + return WERR_NOT_ENOUGH_MEMORY; + } + + result = winreg_printer_binding_handle(tmp_ctx, session_info, msg_ctx, &b); + if (!W_ERROR_IS_OK(result)) { + talloc_free(tmp_ctx); + return result; + } + + result = winreg_add_driver_package(mem_ctx, + b, + package_id, + architecture, + driver_store_path, + cab_path); + + talloc_free(tmp_ctx); + return result; +} + WERROR winreg_get_printer_secdesc_internal(TALLOC_CTX *mem_ctx, const struct auth_session_info *session_info, struct messaging_context *msg_ctx, diff --git a/source3/rpc_server/spoolss/srv_spoolss_util.h b/source3/rpc_server/spoolss/srv_spoolss_util.h index 2ab7bda03ed..d9cddcdaafc 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_util.h +++ b/source3/rpc_server/spoolss/srv_spoolss_util.h @@ -168,5 +168,11 @@ WERROR winreg_add_core_driver_internal(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, const char *architecture, const struct spoolss_CorePrinterDriver *core_printer_driver); - +WERROR winreg_add_driver_package_internal(TALLOC_CTX *mem_ctx, + const struct auth_session_info *session_info, + struct messaging_context *msg_ctx, + const char *package_id, + const char *architecture, + const char *driver_store_path, + const char *cab_path); #endif /* _SRV_SPOOLSS_UITL_H */ |