diff options
author | Günther Deschner <gd@samba.org> | 2008-11-11 00:50:35 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-11-12 10:18:26 +0100 |
commit | 17fe93f94b461c980d2deac648067101b22dae6a (patch) | |
tree | 353695211df6dfb5de6049981238ec3aacac7d99 /source3 | |
parent | 365a703d1395ac69633711edd00f91e9ef8adc97 (diff) | |
download | samba-17fe93f94b461c980d2deac648067101b22dae6a.tar.gz samba-17fe93f94b461c980d2deac648067101b22dae6a.tar.bz2 samba-17fe93f94b461c980d2deac648067101b22dae6a.zip |
s3-rpcclient: add ntsvcs_getdevlist command.
Guenther
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpcclient/cmd_ntsvcs.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/source3/rpcclient/cmd_ntsvcs.c b/source3/rpcclient/cmd_ntsvcs.c index b7dc718b51..a3ddde22a3 100644 --- a/source3/rpcclient/cmd_ntsvcs.c +++ b/source3/rpcclient/cmd_ntsvcs.c @@ -215,6 +215,51 @@ static WERROR cmd_ntsvcs_get_dev_list_size(struct rpc_pipe_client *cli, return werr; } +static WERROR cmd_ntsvcs_get_dev_list(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + int argc, + const char **argv) +{ + NTSTATUS status; + WERROR werr; + const char *filter = NULL; + uint16_t *buffer = NULL; + uint32_t length = 0; + uint32_t flags = 0; + + if (argc > 3) { + printf("usage: %s [length] [filter]\n", argv[0]); + return WERR_OK; + } + + if (argc >= 2) { + length = atoi(argv[1]); + } + + if (argc >= 3) { + filter = argv[2]; + } + + buffer = talloc(mem_ctx, uint16_t); + if (!buffer) { + return WERR_NOMEM; + } + + status = rpccli_PNP_GetDeviceList(cli, mem_ctx, + filter, + buffer, + &length, + flags, + &werr); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } + + printf("devlist needs size: %d\n", length); + + return werr; +} + struct cmd_set ntsvcs_commands[] = { { "NTSVCS" }, @@ -224,5 +269,6 @@ struct cmd_set ntsvcs_commands[] = { { "ntsvcs_hwprofinfo", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_get_hw_prof_info, &ndr_table_ntsvcs.syntax_id, NULL, "Query NTSVCS HW prof info", "" }, { "ntsvcs_getdevregprop", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_get_dev_reg_prop, &ndr_table_ntsvcs.syntax_id, NULL, "Query NTSVCS device registry property", "" }, { "ntsvcs_getdevlistsize", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_get_dev_list_size, &ndr_table_ntsvcs.syntax_id, NULL, "Query NTSVCS device list size", "" }, + { "ntsvcs_getdevlist", RPC_RTYPE_WERROR, NULL, cmd_ntsvcs_get_dev_list, &ndr_table_ntsvcs.syntax_id, NULL, "Query NTSVCS device list", "" }, { NULL } }; |