From 693c2e95294909292cd28982983681ea24912d28 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 9 Apr 2009 15:30:18 +0200 Subject: s4-smbtorture: add test_EnumDependentServicesW() to RPC-SVCCTL. Guenther --- source4/torture/rpc/svcctl.c | 67 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) (limited to 'source4/torture') diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c index 2ed85ec568..e38e8daba1 100644 --- a/source4/torture/rpc/svcctl.c +++ b/source4/torture/rpc/svcctl.c @@ -3,7 +3,7 @@ test suite for srvsvc rpc operations Copyright (C) Jelmer Vernooij 2004 - Copyright (C) Guenther Deschner 2008 + Copyright (C) Guenther Deschner 2008,2009 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -385,6 +385,69 @@ static bool test_EnumServicesStatus(struct torture_context *tctx, struct dcerpc_ return true; } +static bool test_EnumDependentServicesW(struct torture_context *tctx, + struct dcerpc_pipe *p) +{ + struct svcctl_EnumDependentServicesW r; + struct policy_handle h, s; + uint32_t needed; + uint32_t services_returned; + uint32_t i; + uint32_t states[] = { SERVICE_STATE_ACTIVE, + SERVICE_STATE_INACTIVE, + SERVICE_STATE_ALL }; + + if (!test_OpenSCManager(p, tctx, &h)) + return false; + + if (!test_OpenService(p, tctx, &h, "Netlogon", &s)) + return false; + + r.in.service = &s; + r.in.offered = 0; + r.in.state = 0; + r.out.service_status = NULL; + r.out.services_returned = &services_returned; + r.out.needed = &needed; + + torture_assert_ntstatus_ok(tctx, + dcerpc_svcctl_EnumDependentServicesW(p, tctx, &r), + "EnumDependentServicesW failed!"); + + torture_assert_werr_equal(tctx, r.out.result, WERR_INVALID_PARAM, + "EnumDependentServicesW failed!"); + + for (i=0; i