diff options
author | Günther Deschner <gd@samba.org> | 2007-12-06 19:06:30 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2007-12-07 11:43:00 +0100 |
commit | 783afeb5fa563bcfd6635fd07076447f0c586dc5 (patch) | |
tree | c53360d767078f0de294c01ea811d9b463cd5937 | |
parent | 09c4b72a5730dc9c91d537632d3a9ca0a7c04c0b (diff) | |
download | samba-783afeb5fa563bcfd6635fd07076447f0c586dc5.tar.gz samba-783afeb5fa563bcfd6635fd07076447f0c586dc5.tar.bz2 samba-783afeb5fa563bcfd6635fd07076447f0c586dc5.zip |
Add cmd_wkssvc_messagebuffersend().
Guenther
(This used to be commit 71e512efabe833a850cce3ed827415b5d1c032d5)
-rw-r--r-- | source3/rpcclient/cmd_wkssvc.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/source3/rpcclient/cmd_wkssvc.c b/source3/rpcclient/cmd_wkssvc.c index b0c548f925..d32a4c591f 100644 --- a/source3/rpcclient/cmd_wkssvc.c +++ b/source3/rpcclient/cmd_wkssvc.c @@ -80,10 +80,45 @@ static WERROR cmd_wkssvc_getjoininformation(struct rpc_pipe_client *cli, return WERR_OK; } +static WERROR cmd_wkssvc_messagebuffersend(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + int argc, + const char **argv) +{ + const char *server_name = cli->cli->desthost; + const char *message_name = cli->cli->desthost; + const char *message_sender_name = cli->cli->desthost; + smb_ucs2_t *message_buffer = NULL; + size_t message_size = 0; + NTSTATUS status; + WERROR werr; + + message_size = push_ucs2_talloc(mem_ctx, + &message_buffer, + "my message"); + if (message_size == -1) { + return WERR_NOMEM; + } + + status = rpccli_wkssvc_NetrMessageBufferSend(cli, mem_ctx, + server_name, + message_name, + message_sender_name, + (uint8_t *)message_buffer, + message_size, + &werr); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } + + return werr; +} + struct cmd_set wkssvc_commands[] = { { "WKSSVC" }, - { "wkstagetinfo", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_wkstagetinfo, PI_WKSSVC, NULL, "Query WKSSVC Workstation Information", "" }, - { "getjoininformation", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_getjoininformation, PI_WKSSVC, NULL, "Query WKSSVC Join Information", "" }, + { "wkssvc_wkstagetinfo", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_wkstagetinfo, PI_WKSSVC, NULL, "Query WKSSVC Workstation Information", "" }, + { "wkssvc_getjoininformation", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_getjoininformation, PI_WKSSVC, NULL, "Query WKSSVC Join Information", "" }, + { "wkssvc_messagebuffersend", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_messagebuffersend, PI_WKSSVC, NULL, "Send WKSSVC message", "" }, { NULL } }; |