diff options
author | Günther Deschner <gd@samba.org> | 2016-10-31 18:07:50 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2017-05-09 16:43:13 +0200 |
commit | 48e65a15ac306051c0f37520a86d38f254b04321 (patch) | |
tree | 7cd46d4010c9bc81001e5de7d0d5c54a13e93077 /source3 | |
parent | f22c5f1b9aaac39fea7b58817f67654595f74658 (diff) | |
download | samba-48e65a15ac306051c0f37520a86d38f254b04321.tar.gz |
s3-spoolss: add winreg_add_core_driver_internal()
Guenther
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/spoolss/srv_spoolss_util.c | 29 | ||||
-rw-r--r-- | source3/rpc_server/spoolss/srv_spoolss_util.h | 5 |
2 files changed, 34 insertions, 0 deletions
diff --git a/source3/rpc_server/spoolss/srv_spoolss_util.c b/source3/rpc_server/spoolss/srv_spoolss_util.c index dd36c416da3..743ad5ca04d 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_util.c +++ b/source3/rpc_server/spoolss/srv_spoolss_util.c @@ -548,6 +548,35 @@ WERROR winreg_get_core_driver_internal(TALLOC_CTX *mem_ctx, return result; } +WERROR winreg_add_core_driver_internal(TALLOC_CTX *mem_ctx, + const struct auth_session_info *session_info, + struct messaging_context *msg_ctx, + const char *architecture, + const struct spoolss_CorePrinterDriver *core_printer_driver) +{ + 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_core_driver(mem_ctx, + b, + architecture, + core_printer_driver); + + talloc_free(tmp_ctx); + return result; +} WERROR winreg_get_printer_secdesc_internal(TALLOC_CTX *mem_ctx, const struct auth_session_info *session_info, diff --git a/source3/rpc_server/spoolss/srv_spoolss_util.h b/source3/rpc_server/spoolss/srv_spoolss_util.h index 3204a76de9b..2ab7bda03ed 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_util.h +++ b/source3/rpc_server/spoolss/srv_spoolss_util.h @@ -163,5 +163,10 @@ WERROR winreg_get_core_driver_internal(TALLOC_CTX *mem_ctx, const char *architecture, const struct GUID *core_driver_guid, struct spoolss_CorePrinterDriver **core_printer_driver); +WERROR winreg_add_core_driver_internal(TALLOC_CTX *mem_ctx, + const struct auth_session_info *session_info, + struct messaging_context *msg_ctx, + const char *architecture, + const struct spoolss_CorePrinterDriver *core_printer_driver); #endif /* _SRV_SPOOLSS_UITL_H */ |