summaryrefslogtreecommitdiffstats
path: root/source/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
commitef10672399c4b82700dc431b4d93431ffdd42d98 (patch)
treedbfd3ef7121cbac6891756ce9677f7b287e2e317 /source/client
parentfc6543ca78e5c137d77bdc7845df273aae50e5cb (diff)
downloadsamba-ef10672399c4b82700dc431b4d93431ffdd42d98.tar.gz
samba-ef10672399c4b82700dc431b4d93431ffdd42d98.tar.xz
samba-ef10672399c4b82700dc431b4d93431ffdd42d98.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.
Diffstat (limited to 'source/client')
-rw-r--r--source/client/client.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/source/client/client.c b/source/client/client.c
index d5dd93ac195..a8708a001e8 100644
--- a/source/client/client.c
+++ b/source/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);