From 5eeb178fe8942b0a4c41dee4ed1195ffa4ab524e Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Mon, 31 Oct 2016 17:43:58 +0100 Subject: [PATCH] s3-spoolss: add winreg_get_core_driver_internal() Guenther Signed-off-by: Guenther Deschner Reviewed-by: Andreas Schneider --- source3/rpc_server/spoolss/srv_spoolss_util.c | 33 +++++++++++++++++++++++++++ source3/rpc_server/spoolss/srv_spoolss_util.h | 7 ++++++ 2 files changed, 40 insertions(+) diff --git a/source3/rpc_server/spoolss/srv_spoolss_util.c b/source3/rpc_server/spoolss/srv_spoolss_util.c index 17acf515eb9..dd36c416da3 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_util.c +++ b/source3/rpc_server/spoolss/srv_spoolss_util.c @@ -516,6 +516,39 @@ WERROR winreg_add_driver_internal(TALLOC_CTX *mem_ctx, return result; } +WERROR winreg_get_core_driver_internal(TALLOC_CTX *mem_ctx, + const struct auth_session_info *session_info, + struct messaging_context *msg_ctx, + const char *architecture, + const struct GUID *core_driver_guid, + 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_get_core_driver(mem_ctx, + b, + architecture, + core_driver_guid, + 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, 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 8d6fb7848ee..3204a76de9b 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_util.h +++ b/source3/rpc_server/spoolss/srv_spoolss_util.h @@ -157,4 +157,11 @@ WERROR winreg_enum_printer_key_internal(TALLOC_CTX *mem_ctx, const char *key, uint32_t *pnum_subkeys, const char ***psubkeys); +WERROR winreg_get_core_driver_internal(TALLOC_CTX *mem_ctx, + const struct auth_session_info *session_info, + struct messaging_context *msg_ctx, + const char *architecture, + const struct GUID *core_driver_guid, + struct spoolss_CorePrinterDriver **core_printer_driver); + #endif /* _SRV_SPOOLSS_UITL_H */ -- 2.11.4.GIT