diff options
author | Andreas Schneider <asn@samba.org> | 2011-02-01 15:33:02 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2011-02-07 12:32:02 +0100 |
commit | 1c6276ce7a917d7599205e7b3f9640811c0be24b (patch) | |
tree | 0baccf26eed4d7d560d2341ece3a49b57f1a0ec3 | |
parent | 1f0c766fa6f776f7ec25cab8634e2ad1f6c7aa50 (diff) | |
download | samba-1c6276ce7a917d7599205e7b3f9640811c0be24b.tar.gz samba-1c6276ce7a917d7599205e7b3f9640811c0be24b.tar.bz2 samba-1c6276ce7a917d7599205e7b3f9640811c0be24b.zip |
s3-rpc_server: Migrated spoolss to dcerpc_winreg_set_multi_sz.
Signed-off-by: Günther Deschner <gd@samba.org>
-rw-r--r-- | source3/rpc_server/srv_spoolss_util.c | 81 |
1 files changed, 35 insertions, 46 deletions
diff --git a/source3/rpc_server/srv_spoolss_util.c b/source3/rpc_server/srv_spoolss_util.c index 9f9611de18..56407119b5 100644 --- a/source3/rpc_server/srv_spoolss_util.c +++ b/source3/rpc_server/srv_spoolss_util.c @@ -655,40 +655,6 @@ done: return result; } -static WERROR winreg_printer_write_multi_sz(TALLOC_CTX *mem_ctx, - struct dcerpc_binding_handle *winreg_handle, - struct policy_handle *key_handle, - const char *value, - const char **data) -{ - struct winreg_String wvalue; - DATA_BLOB blob; - WERROR result = WERR_OK; - NTSTATUS status; - - wvalue.name = value; - if (!push_reg_multi_sz(mem_ctx, &blob, data)) { - return WERR_NOMEM; - } - status = dcerpc_winreg_SetValue(winreg_handle, - mem_ctx, - key_handle, - wvalue, - REG_MULTI_SZ, - blob.data, - blob.length, - &result); - if (!NT_STATUS_IS_OK(status)) { - result = ntstatus_to_werror(status); - } - if (!W_ERROR_IS_OK(result)) { - DEBUG(0, ("winreg_printer_write_multi_sz: Could not set value %s: %s\n", - wvalue.name, win_errstr(result))); - } - - return result; -} - static WERROR winreg_printer_opendriver(TALLOC_CTX *mem_ctx, const struct auth_serversupplied_info *server_info, struct messaging_context *msg_ctx, @@ -3608,9 +3574,15 @@ WERROR winreg_add_driver(TALLOC_CTX *mem_ctx, goto done; } - result = winreg_printer_write_multi_sz(tmp_ctx, winreg_handle, - &key_hnd, "Dependent Files", - info8.dependent_files); + status = dcerpc_winreg_set_multi_sz(tmp_ctx, + winreg_handle, + &key_hnd, + "Dependent Files", + info8.dependent_files, + &result); + if (!NT_STATUS_IS_OK(status)) { + result = ntstatus_to_werror(status); + } if (!W_ERROR_IS_OK(result)) { goto done; } @@ -3641,9 +3613,14 @@ WERROR winreg_add_driver(TALLOC_CTX *mem_ctx, goto done; } - result = winreg_printer_write_multi_sz(tmp_ctx, winreg_handle, - &key_hnd, "Previous Names", - info8.previous_names); + status = dcerpc_winreg_set_multi_sz(tmp_ctx, + winreg_handle, + &key_hnd, "Previous Names", + info8.previous_names, + &result); + if (!NT_STATUS_IS_OK(status)) { + result = ntstatus_to_werror(status); + } if (!W_ERROR_IS_OK(result)) { goto done; } @@ -3740,9 +3717,15 @@ WERROR winreg_add_driver(TALLOC_CTX *mem_ctx, goto done; } - result = winreg_printer_write_multi_sz(tmp_ctx, winreg_handle, - &key_hnd, "Color Profiles", - info8.color_profiles); + status = dcerpc_winreg_set_multi_sz(tmp_ctx, + winreg_handle, + &key_hnd, + "Color Profiles", + info8.color_profiles, + &result); + if (!NT_STATUS_IS_OK(status)) { + result = ntstatus_to_werror(status); + } if (!W_ERROR_IS_OK(result)) { goto done; } @@ -3773,9 +3756,15 @@ WERROR winreg_add_driver(TALLOC_CTX *mem_ctx, goto done; } - result = winreg_printer_write_multi_sz(tmp_ctx, winreg_handle, - &key_hnd, "CoreDependencies", - info8.core_driver_dependencies); + status = dcerpc_winreg_set_multi_sz(tmp_ctx, + winreg_handle, + &key_hnd, + "CoreDependencies", + info8.core_driver_dependencies, + &result); + if (!NT_STATUS_IS_OK(status)) { + result = ntstatus_to_werror(status); + } if (!W_ERROR_IS_OK(result)) { goto done; } |