summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-11-14 11:25:30 +0100
committerGünther Deschner <gd@samba.org>2008-11-17 13:16:11 +0100
commitc0db253507569804e0cc852a58b5fa9117ebc92e (patch)
tree17dc1e80eab1b3a09e38e48719a2cc3a56b30e97 /source4
parentb43c3a36a7b8950421bd2f4b9c9eea809fd6f0dc (diff)
downloadsamba-c0db253507569804e0cc852a58b5fa9117ebc92e.tar.gz
samba-c0db253507569804e0cc852a58b5fa9117ebc92e.tar.xz
samba-c0db253507569804e0cc852a58b5fa9117ebc92e.zip
s4-smbtorture: fix test for svcctl_EnumServicesStatusW.
Guenther
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/svcctl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c
index 2683366866..4c5ccd75ee 100644
--- a/source4/torture/rpc/svcctl.c
+++ b/source4/torture/rpc/svcctl.c
@@ -126,6 +126,8 @@ static bool test_EnumServicesStatus(struct torture_context *tctx, struct dcerpc_
NTSTATUS status;
uint32_t resume_handle = 0;
struct ENUM_SERVICE_STATUS *service = NULL;
+ uint32_t bytes_needed = 0;
+ uint32_t services_returned = 0;
if (!test_OpenSCManager(p, tctx, &h))
return false;
@@ -137,16 +139,16 @@ static bool test_EnumServicesStatus(struct torture_context *tctx, struct dcerpc_
r.in.resume_handle = &resume_handle;
r.out.service = NULL;
r.out.resume_handle = &resume_handle;
- r.out.services_returned = 0;
- r.out.bytes_needed = 0;
+ r.out.services_returned = &services_returned;
+ r.out.bytes_needed = &bytes_needed;
status = dcerpc_svcctl_EnumServicesStatusW(p, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "EnumServicesStatus failed!");
if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) {
- r.in.buf_size = *r.out.bytes_needed;
- r.out.service = talloc_array(tctx, uint8_t, *r.out.bytes_needed);
+ r.in.buf_size = bytes_needed;
+ r.out.service = talloc_array(tctx, uint8_t, bytes_needed);
status = dcerpc_svcctl_EnumServicesStatusW(p, tctx, &r);
@@ -156,7 +158,7 @@ static bool test_EnumServicesStatus(struct torture_context *tctx, struct dcerpc_
service = (struct ENUM_SERVICE_STATUS *)r.out.service;
}
- for(i = 0; i < *r.out.services_returned; i++) {
+ for(i = 0; i < services_returned; i++) {
printf("Type: %d, State: %d\n", service[i].status.type, service[i].status.state);
}