source: branches/samba-3.0/source/python/py_samr.c

Last change on this file was 124, checked in by Paul Smedley, 18 years ago

Update source to 3.0.28a

File size: 16.6 KB
Line 
1/*
2 Python wrappers for DCERPC/SMB client routines.
3
4 Copyright (C) Tim Potter, 2002
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#include "python/py_samr.h"
22
23/*
24 * Exceptions raised by this module
25 */
26
27PyObject *samr_error; /* This indicates a non-RPC related error
28 such as name lookup failure */
29
30PyObject *samr_ntstatus; /* This exception is raised when a RPC call
31 returns a status code other than
32 NT_STATUS_OK */
33
34/* SAMR group handle object */
35
36static void py_samr_group_hnd_dealloc(PyObject* self)
37{
38 PyObject_Del(self);
39}
40
41static PyMethodDef samr_group_methods[] = {
42 { NULL }
43};
44
45static PyObject *py_samr_group_hnd_getattr(PyObject *self, char *attrname)
46{
47 return Py_FindMethod(samr_group_methods, self, attrname);
48}
49
50PyTypeObject samr_group_hnd_type = {
51 PyObject_HEAD_INIT(NULL)
52 0,
53 "SAMR Group Handle",
54 sizeof(samr_group_hnd_object),
55 0,
56 py_samr_group_hnd_dealloc, /*tp_dealloc*/
57 0, /*tp_print*/
58 py_samr_group_hnd_getattr, /*tp_getattr*/
59 0, /*tp_setattr*/
60 0, /*tp_compare*/
61 0, /*tp_repr*/
62 0, /*tp_as_number*/
63 0, /*tp_as_sequence*/
64 0, /*tp_as_mapping*/
65 0, /*tp_hash */
66};
67
68PyObject *new_samr_group_hnd_object(struct cli_state *cli, TALLOC_CTX *mem_ctx,
69 POLICY_HND *pol)
70{
71 samr_group_hnd_object *o;
72