summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-09-21 23:57:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:00:59 -0500
commit7ba2554d88a187ca1f4f40014363fdf9de2223a0 (patch)
treeb2c64360d1f0dcd5ba593b666b89bd44d8581b86 /source3/client
parent8ffe6c8a8d0c3315393506feabbbba5d503666e8 (diff)
downloadsamba-7ba2554d88a187ca1f4f40014363fdf9de2223a0.tar.gz
samba-7ba2554d88a187ca1f4f40014363fdf9de2223a0.tar.bz2
samba-7ba2554d88a187ca1f4f40014363fdf9de2223a0.zip
r18802: Use the pidl-generated code for the srvsvc interface, both client and server code.
This has had some basic testing. I'll do more during the next couple of days and hopefully also make RPC-SRVSVC from Samba4 pass against it. (This used to be commit ef10672399c4b82700dc431b4d93431ffdd42d98)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index d5dd93ac19..a8708a001e 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "client/client_proto.h"
+#include "include/rpc_client.h"
#ifndef REGISTER
#define REGISTER 0
#endif
@@ -2724,10 +2725,12 @@ static BOOL browse_host_rpc(BOOL sort)
NTSTATUS status;
struct rpc_pipe_client *pipe_hnd;
TALLOC_CTX *mem_ctx;
- ENUM_HND enum_hnd;
+ uint32 enum_hnd = 0;
WERROR werr;
- SRV_SHARE_INFO_CTR ctr;
+ union srvsvc_NetShareCtr ctr;
int i;
+ uint32 level;
+ uint32 numentries;
mem_ctx = talloc_new(NULL);
if (mem_ctx == NULL) {
@@ -2735,8 +2738,6 @@ static BOOL browse_host_rpc(BOOL sort)
return False;
}
- init_enum_hnd(&enum_hnd, 0);
-
pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SRVSVC, &status);
if (pipe_hnd == NULL) {
@@ -2746,8 +2747,10 @@ static BOOL browse_host_rpc(BOOL sort)
return False;
}
- werr = rpccli_srvsvc_net_share_enum(pipe_hnd, mem_ctx, 1, &ctr,
- 0xffffffff, &enum_hnd);
+ level = 1;
+
+ werr = rpccli_srvsvc_NetShareEnum(pipe_hnd, mem_ctx, NULL, &level, &ctr,
+ 0xffffffff, &numentries, &enum_hnd);
if (!W_ERROR_IS_OK(werr)) {
TALLOC_FREE(mem_ctx);
@@ -2755,14 +2758,9 @@ static BOOL browse_host_rpc(BOOL sort)
return False;
}
- for (i=0; i<ctr.num_entries; i++) {
- SRV_SHARE_INFO_1 *info = &ctr.share.info1[i];
- char *name, *comment;
- name = rpcstr_pull_unistr2_talloc(
- mem_ctx, &info->info_1_str.uni_netname);
- comment = rpcstr_pull_unistr2_talloc(
- mem_ctx, &info->info_1_str.uni_remark);
- browse_fn(name, info->info_1.type, comment, NULL);
+ for (i=0; i<numentries; i++) {
+ struct srvsvc_NetShareInfo1 *info = &ctr.ctr1->array[i];
+ browse_fn(info->name, info->type, info->comment, NULL);
}
TALLOC_FREE(mem_ctx);