Exemplo n.º 1
0
static bool test_QueryServiceStatus(struct torture_context *tctx,
				    struct dcerpc_pipe *p)
{
	struct svcctl_QueryServiceStatus r;
	struct policy_handle h, s;
	struct SERVICE_STATUS service_status;
	NTSTATUS status;

	if (!test_OpenSCManager(p, tctx, &h))
		return false;

	if (!test_OpenService(p, tctx, &h, TORTURE_DEFAULT_SERVICE, &s))
		return false;

	r.in.handle = &s;
	r.out.service_status = &service_status;

	status = dcerpc_svcctl_QueryServiceStatus(p, tctx, &r);
	torture_assert_ntstatus_ok(tctx, status, "QueryServiceStatus failed!");
	torture_assert_werr_ok(tctx, r.out.result, "QueryServiceStatus failed!");

	if (!test_CloseServiceHandle(p, tctx, &s))
		return false;

	if (!test_CloseServiceHandle(p, tctx, &h))
		return false;

	return true;
}
Exemplo n.º 2
0
NTSTATUS svc_QueryServiceStatus(struct dcerpc_pipe * svc_pipe,
			    struct policy_handle * psvc_handle,
			    struct SERVICE_STATUS * sstatus)
{
	NTSTATUS status;
	struct svcctl_QueryServiceStatus r;

	r.in.handle = psvc_handle;
	r.out.service_status = sstatus;
	status = dcerpc_svcctl_QueryServiceStatus(svc_pipe, NULL, &r);
	return NT_RES(status, r.out.result);
}