diff options
author | Vicentiu Ciorbaru <cvicentiu@gmail.com> | 2011-07-12 19:50:57 +0300 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2011-07-13 11:31:22 +0200 |
commit | 0b1ba88f228592bd7ced01025a4045c946096ab4 (patch) | |
tree | a918fabbb2be55c84296064e473b79cfae0ebf85 /source3 | |
parent | a336cc44d94532d064cb272f3c2ff3c5b9230039 (diff) | |
download | samba-0b1ba88f228592bd7ced01025a4045c946096ab4.tar.gz samba-0b1ba88f228592bd7ced01025a4045c946096ab4.tar.bz2 samba-0b1ba88f228592bd7ced01025a4045c946096ab4.zip |
s3-rpc_client: Migrate to dcerpc_winreg_delete_subkeys_recursive().
Functions now use dcerpc_winreg_delete_subkeys_recursive() instead of the more
specific printer function winreg_printer_delete_subkeys().
Signed-off-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_client/cli_winreg_spoolss.c | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/source3/rpc_client/cli_winreg_spoolss.c b/source3/rpc_client/cli_winreg_spoolss.c index a7e2cdb9b9..83ea617946 100644 --- a/source3/rpc_client/cli_winreg_spoolss.c +++ b/source3/rpc_client/cli_winreg_spoolss.c @@ -2632,6 +2632,7 @@ WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx, char *keyname; char *path; WERROR result; + NTSTATUS status; TALLOC_CTX *tmp_ctx; tmp_ctx = talloc_stackframe(); @@ -2682,11 +2683,20 @@ WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx, } } - result = winreg_printer_delete_subkeys(tmp_ctx, - winreg_handle, - &hive_hnd, - access_mask, - keyname); + status = dcerpc_winreg_delete_subkeys_recursive(tmp_ctx, + winreg_handle, + &hive_hnd, + access_mask, + keyname, + &result); + + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("winreg_delete_printer_key: Could not delete key %s: %s\n", + key, nt_errstr(status))); + result = ntstatus_to_werror(status); + goto done; + } + if (!W_ERROR_IS_OK(result)) { DEBUG(0, ("winreg_delete_printer_key: Could not delete key %s: %s\n", key, win_errstr(result))); @@ -4057,6 +4067,7 @@ WERROR winreg_del_driver(TALLOC_CTX *mem_ctx, TALLOC_CTX *tmp_ctx; char *key_name; WERROR result; + NTSTATUS status; ZERO_STRUCT(hive_hnd); ZERO_STRUCT(key_hnd); @@ -4104,11 +4115,21 @@ WERROR winreg_del_driver(TALLOC_CTX *mem_ctx, goto done; } - result = winreg_printer_delete_subkeys(tmp_ctx, - winreg_handle, - &hive_hnd, - access_mask, - key_name); + status = dcerpc_winreg_delete_subkeys_recursive(tmp_ctx, + winreg_handle, + &hive_hnd, + access_mask, + key_name, + &result); + + if (!NT_STATUS_IS_OK(status)){ + DEBUG(0, ("winreg_del_driver: " + "Could not open driver (%s,%s,%u): %s\n", + info8->driver_name, info8->architecture, + version, nt_errstr(status))); + goto done; + } + if (!W_ERROR_IS_OK(result)) { DEBUG(0, ("winreg_del_driver: " "Could not open driver (%s,%s,%u): %s\n", |