2 Unix SMB/CIFS implementation.
3 test suite for epmapper rpc operations
5 Copyright (C) Andrew Tridgell 2003
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 static BOOL test_Lookup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
30 struct rpc_if_id_t iface;
31 struct policy_handle handle;
37 r.in.inquiry_type = 0;
39 r.in.interface_id = &iface;
41 r.in.entry_handle = &handle;
42 r.out.entry_handle = &handle;
46 status = dcerpc_epm_Lookup(p, mem_ctx, &r);
47 if (NT_STATUS_IS_OK(status) && r.out.status == 0) {
48 printf("Found '%s'\n", r.out.entries[0].annotation);
50 } while (NT_STATUS_IS_OK(status) && r.out.status == 0);
52 if (!NT_STATUS_IS_OK(status)) {
53 printf("Lookup failed - %s\n", nt_errstr(status));
61 BOOL torture_rpc_epmapper(int dummy)
64 struct dcerpc_pipe *p;
68 mem_ctx = talloc_init("torture_rpc_epmapper");
70 status = torture_rpc_connection(&p,
73 DCERPC_EPMAPPER_VERSION);
74 if (!NT_STATUS_IS_OK(status)) {
78 p->flags |= DCERPC_DEBUG_PRINT_BOTH;
80 if (!test_Lookup(p, mem_ctx)) {