2 Unix SMB/CIFS implementation.
5 Copyright (C) Tim Potter 2004
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.
24 NTSTATUS lsa_OpenPolicy(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
25 struct policy_handle *handle)
27 struct lsa_ObjectAttribute attr;
28 struct lsa_QosInfo qos;
29 struct lsa_OpenPolicy r;
31 uint16 system_name = '\\';
34 qos.impersonation_level = 2;
36 qos.effective_only = 0;
40 attr.object_name = NULL;
45 r.in.system_name = &system_name;
47 r.in.desired_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
48 r.out.handle = handle;
50 return dcerpc_lsa_OpenPolicy(p, mem_ctx, &r);
53 NTSTATUS lsa_OpenPolicy2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
54 struct policy_handle *handle)
56 struct lsa_ObjectAttribute attr;
57 struct lsa_QosInfo qos;
58 struct lsa_OpenPolicy2 r;
61 qos.impersonation_level = 2;
63 qos.effective_only = 0;
67 attr.object_name = NULL;
72 r.in.system_name = "\\";
74 r.in.desired_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
75 r.out.handle = handle;
77 return dcerpc_lsa_OpenPolicy2(p, mem_ctx, &r);