diff options
Diffstat (limited to 'source3/client')
-rw-r--r-- | source3/client/client.c | 26 |
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); |