summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_svcctl.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-01-27 20:31:58 +0000
committerLuke Leighton <lkcl@samba.org>1999-01-27 20:31:58 +0000
commit05040640856b8eb1bebc26afa2a2e210241b4838 (patch)
tree51983e9edc476b5ba7b6e8dcaad9819e2aa99277 /source3/rpc_client/cli_svcctl.c
parentf6c646467d3b6a4ad296e50a1bf89a36ce9551bc (diff)
downloadsamba-05040640856b8eb1bebc26afa2a2e210241b4838.tar.gz
samba-05040640856b8eb1bebc26afa2a2e210241b4838.tar.bz2
samba-05040640856b8eb1bebc26afa2a2e210241b4838.zip
Service Control Manager - service enumeration.
(This used to be commit f4dd8f6b566961890b2933b7a413241bf9b93797)
Diffstat (limited to 'source3/rpc_client/cli_svcctl.c')
-rw-r--r--source3/rpc_client/cli_svcctl.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source3/rpc_client/cli_svcctl.c b/source3/rpc_client/cli_svcctl.c
index 3535c90391..f14a699802 100644
--- a/source3/rpc_client/cli_svcctl.c
+++ b/source3/rpc_client/cli_svcctl.c
@@ -97,15 +97,19 @@ do a SVC Enumerate Services
BOOL do_svc_enum_svcs(struct cli_state *cli, uint16 fnum,
POLICY_HND *hnd,
uint32 services_type, uint32 services_state,
- uint32 buf_size, uint32 *resume_hnd,
- ENUM_SRVC_STATUS **svcs)
+ uint32 *buf_size, uint32 *resume_hnd,
+ uint32 *dos_error,
+ ENUM_SRVC_STATUS **svcs, uint32 *num_svcs)
{
prs_struct rbuf;
prs_struct buf;
SVC_Q_ENUM_SVCS_STATUS q_o;
BOOL valid_pol = False;
- if (hnd == NULL) return False;
+ if (hnd == NULL || buf_size == NULL || dos_error == NULL || num_svcs == NULL)
+ {
+ return False;
+ }
prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
prs_init(&rbuf, 0 , 4, SAFETY_MARGIN, True );
@@ -116,7 +120,7 @@ BOOL do_svc_enum_svcs(struct cli_state *cli, uint16 fnum,
make_svc_q_enum_svcs_status(&q_o, hnd,
services_type, services_state,
- buf_size, *resume_hnd);
+ *buf_size, *resume_hnd);
/* turn parameters into data stream */
svc_io_q_enum_svcs_status("", &q_o, &buf, 0);
@@ -136,13 +140,16 @@ BOOL do_svc_enum_svcs(struct cli_state *cli, uint16 fnum,
{
/* report error code */
DEBUG(0,("SVC_ENUM_SVCS_STATUS: %s\n", smb_err_msg(ERRDOS, r_o.dos_status)));
- p = r_o.dos_status != ERRmoredata;
+ p = r_o.dos_status == ERRmoredata;
}
if (p)
{
(*svcs) = r_o.svcs;
+ (*num_svcs) = r_o.num_svcs;
(*resume_hnd) = get_enum_hnd(&r_o.resume_hnd);
+ (*buf_size) = r_o.more_buf_size;
+ (*dos_error) = r_o.dos_status;
valid_pol = True;
}
}