diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-08-03 23:06:15 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:57:46 -0500 |
commit | d31150a34f1b07b543aa26074d761ef9371576af (patch) | |
tree | 92da8ecd66c062a76e9745dbe44d855b345dc9bd /source4/torture | |
parent | 076d0bc8c4e5c18301ac7747a8f2a7d90a70ecb3 (diff) | |
download | samba-d31150a34f1b07b543aa26074d761ef9371576af.tar.gz samba-d31150a34f1b07b543aa26074d761ef9371576af.tar.bz2 samba-d31150a34f1b07b543aa26074d761ef9371576af.zip |
r1642: Torture test for EnumServicesStatus, almost finished.
(This used to be commit fb2ca1f4cde014c93a0741b8ba03d2d9caffd8df)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/svcctl.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c index 062fcdf584..d33639e3a5 100644 --- a/source4/torture/rpc/svcctl.c +++ b/source4/torture/rpc/svcctl.c @@ -27,15 +27,18 @@ static BOOL test_EnumServicesStatus(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, int i; NTSTATUS status; uint32 resume_handle = 0; - struct ENUM_SERVICE_STATUS *service = talloc_p(mem_ctx, struct ENUM_SERVICE_STATUS); + struct ENUM_SERVICE_STATUS *service = NULL; + uint32 needed, sr; r.in.handle = h; r.in.type = SERVICE_TYPE_WIN32; r.in.state = SERVICE_STATE_ALL; - r.in.buf_size = sizeof(struct ENUM_SERVICE_STATUS); + r.in.buf_size = 0; r.in.resume_handle = &resume_handle; - r.out.service = service; + r.out.service = NULL; r.out.resume_handle = &resume_handle; + r.out.services_returned = 0; + r.out.bytes_needed = 0; status = dcerpc_svcctl_EnumServicesStatus(p, mem_ctx, &r); @@ -45,9 +48,8 @@ static BOOL test_EnumServicesStatus(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, } if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) { - r.in.buf_size = r.out.bytes_needed + sizeof(struct ENUM_SERVICE_STATUS); - service = talloc_realloc(mem_ctx, service, r.in.buf_size); - r.out.service = service; + r.in.buf_size = r.out.bytes_needed; + r.out.service = talloc(mem_ctx, r.out.bytes_needed); status = dcerpc_svcctl_EnumServicesStatus(p, mem_ctx, &r); @@ -60,10 +62,11 @@ static BOOL test_EnumServicesStatus(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, printf("EnumServicesStatus failed\n"); return False; } + service = (struct ENUM_SERVICE_STATUS *)r.out.service; } for(i = 0; i < r.out.services_returned; i++) { - printf("%s - %s\n", service[i].service_name, service[i].display_name); + printf("Type: %d, State: %d\n", service[i].status.type, service[i].status.state); } return True; |