/* Python wrapper functions auto-generated by pidl */ #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */ #include #include "python/py3compat.h" #include "includes.h" #include "python/modules.h" #include #include "librpc/rpc/pyrpc.h" #include "librpc/rpc/pyrpc_util.h" #include "bin/default/librpc/gen_ndr/ndr_fsrvp.h" #include "bin/default/librpc/gen_ndr/ndr_fsrvp_c.h" /* * Suppress compiler warnings if the generated code does not call these * functions */ #ifndef _MAYBE_UNUSED_ #ifdef __has_attribute #if __has_attribute(unused) #define _MAYBE_UNUSED_ __attribute__ ((unused)) #else #define _MAYBE_UNUSED_ #endif #endif #endif /* * These functions are here to ensure they can be optimized out by * the compiler based on the constant input values */ static inline unsigned long long ndr_sizeof2uintmax(size_t var_size) { switch (var_size) { case 8: return UINT64_MAX; case 4: return UINT32_MAX; case 2: return UINT16_MAX; case 1: return UINT8_MAX; } return 0; } static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size) { switch (var_size) { case 8: return INT64_MAX; case 4: return INT32_MAX; case 2: return INT16_MAX; case 1: return INT8_MAX; } return 0; } #include "librpc/gen_ndr/misc.h" static PyTypeObject fssagent_share_mapping_1_Type; static PyTypeObject fssagent_share_mapping_Type; static PyTypeObject FileServerVssAgent_InterfaceType; static PyTypeObject fss_GetSupportedVersion_Type; static PyTypeObject fss_SetContext_Type; static PyTypeObject fss_StartShadowCopySet_Type; static PyTypeObject fss_AddToShadowCopySet_Type; static PyTypeObject fss_CommitShadowCopySet_Type; static PyTypeObject fss_ExposeShadowCopySet_Type; static PyTypeObject fss_RecoveryCompleteShadowCopySet_Type; static PyTypeObject fss_AbortShadowCopySet_Type; static PyTypeObject fss_IsPathSupported_Type; static PyTypeObject fss_IsPathShadowCopied_Type; static PyTypeObject fss_GetShareMapping_Type; static PyTypeObject fss_DeleteShareMapping_Type; static PyTypeObject fss_PrepareShadowCopySet_Type; static PyTypeObject *GUID_Type; static PyTypeObject *BaseObject_Type; static PyTypeObject *ClientConnection_Type; static PyTypeObject *ndr_syntax_id_Type; static PyObject *py_fssagent_share_mapping_1_get_ShadowCopySetId(PyObject *obj, void *closure) { struct fssagent_share_mapping_1 *object = (struct fssagent_share_mapping_1 *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopySetId; py_ShadowCopySetId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->ShadowCopySetId); return py_ShadowCopySetId; } static int py_fssagent_share_mapping_1_set_ShadowCopySetId(PyObject *py_obj, PyObject *value, void *closure) { struct fssagent_share_mapping_1 *object = (struct fssagent_share_mapping_1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ShadowCopySetId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fssagent_share_mapping_1_get_ShadowCopyId(PyObject *obj, void *closure) { struct fssagent_share_mapping_1 *object = (struct fssagent_share_mapping_1 *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopyId; py_ShadowCopyId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->ShadowCopyId); return py_ShadowCopyId; } static int py_fssagent_share_mapping_1_set_ShadowCopyId(PyObject *py_obj, PyObject *value, void *closure) { struct fssagent_share_mapping_1 *object = (struct fssagent_share_mapping_1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ShadowCopyId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->ShadowCopyId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fssagent_share_mapping_1_get_ShareNameUNC(PyObject *obj, void *closure) { struct fssagent_share_mapping_1 *object = (struct fssagent_share_mapping_1 *)pytalloc_get_ptr(obj); PyObject *py_ShareNameUNC; if (object->ShareNameUNC == NULL) { Py_RETURN_NONE; } if (object->ShareNameUNC == NULL) { py_ShareNameUNC = Py_None; Py_INCREF(py_ShareNameUNC); } else { if (object->ShareNameUNC == NULL) { py_ShareNameUNC = Py_None; Py_INCREF(py_ShareNameUNC); } else { py_ShareNameUNC = PyUnicode_Decode(object->ShareNameUNC, strlen(object->ShareNameUNC), "utf-8", "ignore"); } } return py_ShareNameUNC; } static int py_fssagent_share_mapping_1_set_ShareNameUNC(PyObject *py_obj, PyObject *value, void *closure) { struct fssagent_share_mapping_1 *object = (struct fssagent_share_mapping_1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ShareNameUNC"); return -1; } if (value == Py_None) { object->ShareNameUNC = NULL; } else { object->ShareNameUNC = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->ShareNameUNC = talloc_str; } } return 0; } static PyObject *py_fssagent_share_mapping_1_get_ShadowCopyShareName(PyObject *obj, void *closure) { struct fssagent_share_mapping_1 *object = (struct fssagent_share_mapping_1 *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopyShareName; if (object->ShadowCopyShareName == NULL) { Py_RETURN_NONE; } if (object->ShadowCopyShareName == NULL) { py_ShadowCopyShareName = Py_None; Py_INCREF(py_ShadowCopyShareName); } else { if (object->ShadowCopyShareName == NULL) { py_ShadowCopyShareName = Py_None; Py_INCREF(py_ShadowCopyShareName); } else { py_ShadowCopyShareName = PyUnicode_Decode(object->ShadowCopyShareName, strlen(object->ShadowCopyShareName), "utf-8", "ignore"); } } return py_ShadowCopyShareName; } static int py_fssagent_share_mapping_1_set_ShadowCopyShareName(PyObject *py_obj, PyObject *value, void *closure) { struct fssagent_share_mapping_1 *object = (struct fssagent_share_mapping_1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ShadowCopyShareName"); return -1; } if (value == Py_None) { object->ShadowCopyShareName = NULL; } else { object->ShadowCopyShareName = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->ShadowCopyShareName = talloc_str; } } return 0; } static PyObject *py_fssagent_share_mapping_1_get_tstamp(PyObject *obj, void *closure) { struct fssagent_share_mapping_1 *object = (struct fssagent_share_mapping_1 *)pytalloc_get_ptr(obj); PyObject *py_tstamp; py_tstamp = PyLong_FromUnsignedLongLong(object->tstamp); return py_tstamp; } static int py_fssagent_share_mapping_1_set_tstamp(PyObject *py_obj, PyObject *value, void *closure) { struct fssagent_share_mapping_1 *object = (struct fssagent_share_mapping_1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tstamp"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tstamp)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->tstamp = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fssagent_share_mapping_1_getsetters[] = { { .name = discard_const_p(char, "ShadowCopySetId"), .get = py_fssagent_share_mapping_1_get_ShadowCopySetId, .set = py_fssagent_share_mapping_1_set_ShadowCopySetId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "ShadowCopyId"), .get = py_fssagent_share_mapping_1_get_ShadowCopyId, .set = py_fssagent_share_mapping_1_set_ShadowCopyId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "ShareNameUNC"), .get = py_fssagent_share_mapping_1_get_ShareNameUNC, .set = py_fssagent_share_mapping_1_set_ShareNameUNC, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "ShadowCopyShareName"), .get = py_fssagent_share_mapping_1_get_ShadowCopyShareName, .set = py_fssagent_share_mapping_1_set_ShadowCopyShareName, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "tstamp"), .get = py_fssagent_share_mapping_1_get_tstamp, .set = py_fssagent_share_mapping_1_set_tstamp, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = NULL } }; static PyObject *py_fssagent_share_mapping_1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct fssagent_share_mapping_1, type); } static PyTypeObject fssagent_share_mapping_1_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fssagent_share_mapping_1", .tp_getset = py_fssagent_share_mapping_1_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fssagent_share_mapping_1_new, }; static PyObject *py_import_fssagent_share_mapping(TALLOC_CTX *mem_ctx, int level, union fssagent_share_mapping *in) { PyObject *ret; switch (level) { case 1: if (in->ShareMapping1 == NULL) { ret = Py_None; Py_INCREF(ret); } else { ret = pytalloc_reference_ex(&fssagent_share_mapping_1_Type, in->ShareMapping1, in->ShareMapping1); } return ret; default: ret = Py_None; Py_INCREF(ret); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union fssagent_share_mapping *py_export_fssagent_share_mapping(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union fssagent_share_mapping *ret = talloc_zero(mem_ctx, union fssagent_share_mapping); switch (level) { case 1: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ShareMapping1"); talloc_free(ret); return NULL; } if (in == Py_None) { ret->ShareMapping1 = NULL; } else { ret->ShareMapping1 = NULL; PY_CHECK_TYPE(&fssagent_share_mapping_1_Type, in, talloc_free(ret); return NULL;); if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) { PyErr_NoMemory(); talloc_free(ret); return NULL; } ret->ShareMapping1 = (struct fssagent_share_mapping_1 *)pytalloc_get_ptr(in); } break; default: break; } return ret; } static PyObject *py_fssagent_share_mapping_import(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in_obj = NULL; union fssagent_share_mapping *in = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in_obj)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } in = (union fssagent_share_mapping *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union fssagent_share_mapping!"); return NULL; } return py_import_fssagent_share_mapping(mem_ctx, level, in); } static PyObject *py_fssagent_share_mapping_export(PyTypeObject *type, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "mem_ctx", "level", "in", NULL }; PyObject *mem_ctx_obj = NULL; TALLOC_CTX *mem_ctx = NULL; int level = 0; PyObject *in = NULL; union fssagent_share_mapping *out = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export", discard_const_p(char *, kwnames), &mem_ctx_obj, &level, &in)) { return NULL; } mem_ctx = pytalloc_get_ptr(mem_ctx_obj); if (mem_ctx == NULL) { PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!"); return NULL; } out = py_export_fssagent_share_mapping(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_fssagent_share_mapping_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fssagent_share_mapping_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fssagent_share_mapping_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_fssagent_share_mapping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject fssagent_share_mapping_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fssagent_share_mapping", .tp_getset = NULL, .tp_methods = py_fssagent_share_mapping_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fssagent_share_mapping_new, }; static PyObject *py_fss_GetSupportedVersion_out_get_MinVersion(PyObject *obj, void *closure) { struct fss_GetSupportedVersion *object = (struct fss_GetSupportedVersion *)pytalloc_get_ptr(obj); PyObject *py_MinVersion; if (object->out.MinVersion == NULL) { Py_RETURN_NONE; } py_MinVersion = PyLong_FromUnsignedLongLong((uint32_t)*object->out.MinVersion); return py_MinVersion; } static int py_fss_GetSupportedVersion_out_set_MinVersion(PyObject *py_obj, PyObject *value, void *closure) { struct fss_GetSupportedVersion *object = (struct fss_GetSupportedVersion *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.MinVersion)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.MinVersion"); return -1; } object->out.MinVersion = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.MinVersion); if (object->out.MinVersion == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.MinVersion)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } *object->out.MinVersion = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_fss_GetSupportedVersion_out_get_MaxVersion(PyObject *obj, void *closure) { struct fss_GetSupportedVersion *object = (struct fss_GetSupportedVersion *)pytalloc_get_ptr(obj); PyObject *py_MaxVersion; if (object->out.MaxVersion == NULL) { Py_RETURN_NONE; } py_MaxVersion = PyLong_FromUnsignedLongLong((uint32_t)*object->out.MaxVersion); return py_MaxVersion; } static int py_fss_GetSupportedVersion_out_set_MaxVersion(PyObject *py_obj, PyObject *value, void *closure) { struct fss_GetSupportedVersion *object = (struct fss_GetSupportedVersion *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.MaxVersion)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.MaxVersion"); return -1; } object->out.MaxVersion = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.MaxVersion); if (object->out.MaxVersion == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.MaxVersion)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } *object->out.MaxVersion = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_fss_GetSupportedVersion_get_result(PyObject *obj, void *closure) { struct fss_GetSupportedVersion *object = (struct fss_GetSupportedVersion *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result); return py_result; } static int py_fss_GetSupportedVersion_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct fss_GetSupportedVersion *object = (struct fss_GetSupportedVersion *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.result = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fss_GetSupportedVersion_getsetters[] = { { .name = discard_const_p(char, "out_MinVersion"), .get = py_fss_GetSupportedVersion_out_get_MinVersion, .set = py_fss_GetSupportedVersion_out_set_MinVersion, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_MaxVersion"), .get = py_fss_GetSupportedVersion_out_get_MaxVersion, .set = py_fss_GetSupportedVersion_out_set_MaxVersion, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_fss_GetSupportedVersion_get_result, .set = py_fss_GetSupportedVersion_set_result, .doc = discard_const_p(char, "PIDL-generated element of type uint32") }, { .name = NULL } }; static PyObject *py_fss_GetSupportedVersion_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct fss_GetSupportedVersion, type); struct fss_GetSupportedVersion *_self = (struct fss_GetSupportedVersion *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.MinVersion = talloc_zero(mem_ctx, uint32_t); _self->out.MaxVersion = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_fss_GetSupportedVersion_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(0); } static PyObject *py_fss_GetSupportedVersion_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct fss_GetSupportedVersion *object = (struct fss_GetSupportedVersion *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 1) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_GetSupportedVersion_ndr_pack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[0]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_fss_GetSupportedVersion_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_GetSupportedVersion_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_fss_GetSupportedVersion_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_GetSupportedVersion_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_fss_GetSupportedVersion_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct fss_GetSupportedVersion *object = (struct fss_GetSupportedVersion *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 1) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_GetSupportedVersion_ndr_unpack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[0]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_fss_GetSupportedVersion_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_GetSupportedVersion_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_GetSupportedVersion_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_GetSupportedVersion_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_GetSupportedVersion_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct fss_GetSupportedVersion *object = (struct fss_GetSupportedVersion *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_FileServerVssAgent.num_calls < 1) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_GetSupportedVersion_ndr_print"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[0]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_fss_GetSupportedVersion_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_GetSupportedVersion_ndr_print(py_obj, "fss_GetSupportedVersion_in", NDR_IN); } static PyObject *py_fss_GetSupportedVersion_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_GetSupportedVersion_ndr_print(py_obj, "fss_GetSupportedVersion_out", NDR_OUT); } static PyMethodDef py_fss_GetSupportedVersion_methods[] = { { "opnum", (PyCFunction)py_fss_GetSupportedVersion_ndr_opnum, METH_NOARGS|METH_CLASS, "fsrvp.fss_GetSupportedVersion.opnum() -> 0 (0x00) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_GetSupportedVersion_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_GetSupportedVersion_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_GetSupportedVersion_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_GetSupportedVersion_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_fss_GetSupportedVersion_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_fss_GetSupportedVersion_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject fss_GetSupportedVersion_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fss_GetSupportedVersion", .tp_getset = py_fss_GetSupportedVersion_getsetters, .tp_methods = py_fss_GetSupportedVersion_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fss_GetSupportedVersion_new, }; static bool pack_py_fss_GetSupportedVersion_args_in(PyObject *args, PyObject *kwargs, struct fss_GetSupportedVersion *r) { const char *kwnames[] = { NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":fss_GetSupportedVersion", discard_const_p(char *, kwnames))) { return false; } return true; } static PyObject *unpack_py_fss_GetSupportedVersion_args_out(struct fss_GetSupportedVersion *r) { PyObject *result; PyObject *py_MinVersion; PyObject *py_MaxVersion; result = PyTuple_New(3); py_MinVersion = PyLong_FromUnsignedLongLong((uint32_t)*r->out.MinVersion); PyTuple_SetItem(result, 0, py_MinVersion); py_MaxVersion = PyLong_FromUnsignedLongLong((uint32_t)*r->out.MaxVersion); PyTuple_SetItem(result, 1, py_MaxVersion); PyTuple_SetItem(result, 2, PyLong_FromUnsignedLongLong((uint32_t)r->out.result)); return result; } static PyObject *py_fss_SetContext_in_get_Context(PyObject *obj, void *closure) { struct fss_SetContext *object = (struct fss_SetContext *)pytalloc_get_ptr(obj); PyObject *py_Context; py_Context = PyLong_FromUnsignedLongLong((uint32_t)object->in.Context); return py_Context; } static int py_fss_SetContext_in_set_Context(PyObject *py_obj, PyObject *value, void *closure) { struct fss_SetContext *object = (struct fss_SetContext *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.Context"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.Context)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.Context = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_fss_SetContext_get_result(PyObject *obj, void *closure) { struct fss_SetContext *object = (struct fss_SetContext *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result); return py_result; } static int py_fss_SetContext_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct fss_SetContext *object = (struct fss_SetContext *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.result = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fss_SetContext_getsetters[] = { { .name = discard_const_p(char, "in_Context"), .get = py_fss_SetContext_in_get_Context, .set = py_fss_SetContext_in_set_Context, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_fss_SetContext_get_result, .set = py_fss_SetContext_set_result, .doc = discard_const_p(char, "PIDL-generated element of type uint32") }, { .name = NULL } }; static PyObject *py_fss_SetContext_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct fss_SetContext, type); return self; } static PyObject *py_fss_SetContext_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(1); } static PyObject *py_fss_SetContext_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct fss_SetContext *object = (struct fss_SetContext *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 2) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_SetContext_ndr_pack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[1]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_fss_SetContext_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_SetContext_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_fss_SetContext_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_SetContext_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_fss_SetContext_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct fss_SetContext *object = (struct fss_SetContext *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 2) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_SetContext_ndr_unpack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[1]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_fss_SetContext_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_SetContext_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_SetContext_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_SetContext_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_SetContext_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct fss_SetContext *object = (struct fss_SetContext *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_FileServerVssAgent.num_calls < 2) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_SetContext_ndr_print"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[1]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_fss_SetContext_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_SetContext_ndr_print(py_obj, "fss_SetContext_in", NDR_IN); } static PyObject *py_fss_SetContext_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_SetContext_ndr_print(py_obj, "fss_SetContext_out", NDR_OUT); } static PyMethodDef py_fss_SetContext_methods[] = { { "opnum", (PyCFunction)py_fss_SetContext_ndr_opnum, METH_NOARGS|METH_CLASS, "fsrvp.fss_SetContext.opnum() -> 1 (0x01) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_SetContext_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_SetContext_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_SetContext_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_SetContext_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_fss_SetContext_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_fss_SetContext_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject fss_SetContext_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fss_SetContext", .tp_getset = py_fss_SetContext_getsetters, .tp_methods = py_fss_SetContext_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fss_SetContext_new, }; static bool pack_py_fss_SetContext_args_in(PyObject *args, PyObject *kwargs, struct fss_SetContext *r) { PyObject *py_Context; const char *kwnames[] = { "Context", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:fss_SetContext", discard_const_p(char *, kwnames), &py_Context)) { return false; } if (py_Context == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.Context"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.Context)); if (PyLong_Check(py_Context)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_Context); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.Context = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_fss_SetContext_args_out(struct fss_SetContext *r) { PyObject *result; result = PyLong_FromUnsignedLongLong((uint32_t)r->out.result); return result; } static PyObject *py_fss_StartShadowCopySet_in_get_ClientShadowCopySetId(PyObject *obj, void *closure) { struct fss_StartShadowCopySet *object = (struct fss_StartShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_ClientShadowCopySetId; py_ClientShadowCopySetId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->in.ClientShadowCopySetId); return py_ClientShadowCopySetId; } static int py_fss_StartShadowCopySet_in_set_ClientShadowCopySetId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_StartShadowCopySet *object = (struct fss_StartShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ClientShadowCopySetId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.ClientShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_StartShadowCopySet_out_get_pShadowCopySetId(PyObject *obj, void *closure) { struct fss_StartShadowCopySet *object = (struct fss_StartShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_pShadowCopySetId; if (object->out.pShadowCopySetId == NULL) { Py_RETURN_NONE; } py_pShadowCopySetId = pytalloc_reference_ex(GUID_Type, object->out.pShadowCopySetId, object->out.pShadowCopySetId); return py_pShadowCopySetId; } static int py_fss_StartShadowCopySet_out_set_pShadowCopySetId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_StartShadowCopySet *object = (struct fss_StartShadowCopySet *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.pShadowCopySetId)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.pShadowCopySetId"); return -1; } object->out.pShadowCopySetId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.pShadowCopySetId); if (object->out.pShadowCopySetId == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.pShadowCopySetId = (struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_StartShadowCopySet_get_result(PyObject *obj, void *closure) { struct fss_StartShadowCopySet *object = (struct fss_StartShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result); return py_result; } static int py_fss_StartShadowCopySet_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct fss_StartShadowCopySet *object = (struct fss_StartShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.result = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fss_StartShadowCopySet_getsetters[] = { { .name = discard_const_p(char, "in_ClientShadowCopySetId"), .get = py_fss_StartShadowCopySet_in_get_ClientShadowCopySetId, .set = py_fss_StartShadowCopySet_in_set_ClientShadowCopySetId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "out_pShadowCopySetId"), .get = py_fss_StartShadowCopySet_out_get_pShadowCopySetId, .set = py_fss_StartShadowCopySet_out_set_pShadowCopySetId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "result"), .get = py_fss_StartShadowCopySet_get_result, .set = py_fss_StartShadowCopySet_set_result, .doc = discard_const_p(char, "PIDL-generated element of type uint32") }, { .name = NULL } }; static PyObject *py_fss_StartShadowCopySet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct fss_StartShadowCopySet, type); struct fss_StartShadowCopySet *_self = (struct fss_StartShadowCopySet *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.pShadowCopySetId = talloc_zero(mem_ctx, struct GUID); return self; } static PyObject *py_fss_StartShadowCopySet_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(2); } static PyObject *py_fss_StartShadowCopySet_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct fss_StartShadowCopySet *object = (struct fss_StartShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 3) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_StartShadowCopySet_ndr_pack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[2]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_fss_StartShadowCopySet_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_StartShadowCopySet_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_fss_StartShadowCopySet_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_StartShadowCopySet_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_fss_StartShadowCopySet_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct fss_StartShadowCopySet *object = (struct fss_StartShadowCopySet *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 3) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_StartShadowCopySet_ndr_unpack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[2]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_fss_StartShadowCopySet_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_StartShadowCopySet_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_StartShadowCopySet_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_StartShadowCopySet_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_StartShadowCopySet_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct fss_StartShadowCopySet *object = (struct fss_StartShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_FileServerVssAgent.num_calls < 3) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_StartShadowCopySet_ndr_print"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[2]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_fss_StartShadowCopySet_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_StartShadowCopySet_ndr_print(py_obj, "fss_StartShadowCopySet_in", NDR_IN); } static PyObject *py_fss_StartShadowCopySet_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_StartShadowCopySet_ndr_print(py_obj, "fss_StartShadowCopySet_out", NDR_OUT); } static PyMethodDef py_fss_StartShadowCopySet_methods[] = { { "opnum", (PyCFunction)py_fss_StartShadowCopySet_ndr_opnum, METH_NOARGS|METH_CLASS, "fsrvp.fss_StartShadowCopySet.opnum() -> 2 (0x02) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_StartShadowCopySet_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_StartShadowCopySet_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_StartShadowCopySet_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_StartShadowCopySet_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_fss_StartShadowCopySet_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_fss_StartShadowCopySet_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject fss_StartShadowCopySet_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fss_StartShadowCopySet", .tp_getset = py_fss_StartShadowCopySet_getsetters, .tp_methods = py_fss_StartShadowCopySet_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fss_StartShadowCopySet_new, }; static bool pack_py_fss_StartShadowCopySet_args_in(PyObject *args, PyObject *kwargs, struct fss_StartShadowCopySet *r) { PyObject *py_ClientShadowCopySetId; const char *kwnames[] = { "ClientShadowCopySetId", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:fss_StartShadowCopySet", discard_const_p(char *, kwnames), &py_ClientShadowCopySetId)) { return false; } if (py_ClientShadowCopySetId == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ClientShadowCopySetId"); return false; } PY_CHECK_TYPE(GUID_Type, py_ClientShadowCopySetId, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_ClientShadowCopySetId)) == NULL) { PyErr_NoMemory(); return false; } r->in.ClientShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(py_ClientShadowCopySetId); return true; } static PyObject *unpack_py_fss_StartShadowCopySet_args_out(struct fss_StartShadowCopySet *r) { PyObject *result; PyObject *py_pShadowCopySetId; result = PyTuple_New(2); py_pShadowCopySetId = pytalloc_reference_ex(GUID_Type, r->out.pShadowCopySetId, r->out.pShadowCopySetId); PyTuple_SetItem(result, 0, py_pShadowCopySetId); PyTuple_SetItem(result, 1, PyLong_FromUnsignedLongLong((uint32_t)r->out.result)); return result; } static PyObject *py_fss_AddToShadowCopySet_in_get_ClientShadowCopyId(PyObject *obj, void *closure) { struct fss_AddToShadowCopySet *object = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_ClientShadowCopyId; py_ClientShadowCopyId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->in.ClientShadowCopyId); return py_ClientShadowCopyId; } static int py_fss_AddToShadowCopySet_in_set_ClientShadowCopyId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_AddToShadowCopySet *object = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ClientShadowCopyId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.ClientShadowCopyId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_AddToShadowCopySet_in_get_ShadowCopySetId(PyObject *obj, void *closure) { struct fss_AddToShadowCopySet *object = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopySetId; py_ShadowCopySetId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->in.ShadowCopySetId); return py_ShadowCopySetId; } static int py_fss_AddToShadowCopySet_in_set_ShadowCopySetId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_AddToShadowCopySet *object = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShadowCopySetId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_AddToShadowCopySet_in_get_ShareName(PyObject *obj, void *closure) { struct fss_AddToShadowCopySet *object = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_ShareName; if (object->in.ShareName == NULL) { Py_RETURN_NONE; } if (object->in.ShareName == NULL) { py_ShareName = Py_None; Py_INCREF(py_ShareName); } else { py_ShareName = PyUnicode_Decode(object->in.ShareName, strlen(object->in.ShareName), "utf-8", "ignore"); } return py_ShareName; } static int py_fss_AddToShadowCopySet_in_set_ShareName(PyObject *py_obj, PyObject *value, void *closure) { struct fss_AddToShadowCopySet *object = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShareName"); return -1; } object->in.ShareName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.ShareName); if (object->in.ShareName == NULL) { PyErr_NoMemory(); return -1; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->in.ShareName = talloc_str; } return 0; } static PyObject *py_fss_AddToShadowCopySet_out_get_pShadowCopyId(PyObject *obj, void *closure) { struct fss_AddToShadowCopySet *object = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_pShadowCopyId; if (object->out.pShadowCopyId == NULL) { Py_RETURN_NONE; } py_pShadowCopyId = pytalloc_reference_ex(GUID_Type, object->out.pShadowCopyId, object->out.pShadowCopyId); return py_pShadowCopyId; } static int py_fss_AddToShadowCopySet_out_set_pShadowCopyId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_AddToShadowCopySet *object = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.pShadowCopyId)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.pShadowCopyId"); return -1; } object->out.pShadowCopyId = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.pShadowCopyId); if (object->out.pShadowCopyId == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->out.pShadowCopyId = (struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_AddToShadowCopySet_get_result(PyObject *obj, void *closure) { struct fss_AddToShadowCopySet *object = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result); return py_result; } static int py_fss_AddToShadowCopySet_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct fss_AddToShadowCopySet *object = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.result = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fss_AddToShadowCopySet_getsetters[] = { { .name = discard_const_p(char, "in_ClientShadowCopyId"), .get = py_fss_AddToShadowCopySet_in_get_ClientShadowCopyId, .set = py_fss_AddToShadowCopySet_in_set_ClientShadowCopyId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_ShadowCopySetId"), .get = py_fss_AddToShadowCopySet_in_get_ShadowCopySetId, .set = py_fss_AddToShadowCopySet_in_set_ShadowCopySetId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_ShareName"), .get = py_fss_AddToShadowCopySet_in_get_ShareName, .set = py_fss_AddToShadowCopySet_in_set_ShareName, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "out_pShadowCopyId"), .get = py_fss_AddToShadowCopySet_out_get_pShadowCopyId, .set = py_fss_AddToShadowCopySet_out_set_pShadowCopyId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "result"), .get = py_fss_AddToShadowCopySet_get_result, .set = py_fss_AddToShadowCopySet_set_result, .doc = discard_const_p(char, "PIDL-generated element of type uint32") }, { .name = NULL } }; static PyObject *py_fss_AddToShadowCopySet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct fss_AddToShadowCopySet, type); struct fss_AddToShadowCopySet *_self = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.pShadowCopyId = talloc_zero(mem_ctx, struct GUID); return self; } static PyObject *py_fss_AddToShadowCopySet_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(3); } static PyObject *py_fss_AddToShadowCopySet_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct fss_AddToShadowCopySet *object = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 4) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_AddToShadowCopySet_ndr_pack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[3]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_fss_AddToShadowCopySet_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_AddToShadowCopySet_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_fss_AddToShadowCopySet_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_AddToShadowCopySet_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_fss_AddToShadowCopySet_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct fss_AddToShadowCopySet *object = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 4) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_AddToShadowCopySet_ndr_unpack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[3]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_fss_AddToShadowCopySet_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_AddToShadowCopySet_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_AddToShadowCopySet_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_AddToShadowCopySet_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_AddToShadowCopySet_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct fss_AddToShadowCopySet *object = (struct fss_AddToShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_FileServerVssAgent.num_calls < 4) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_AddToShadowCopySet_ndr_print"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[3]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_fss_AddToShadowCopySet_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_AddToShadowCopySet_ndr_print(py_obj, "fss_AddToShadowCopySet_in", NDR_IN); } static PyObject *py_fss_AddToShadowCopySet_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_AddToShadowCopySet_ndr_print(py_obj, "fss_AddToShadowCopySet_out", NDR_OUT); } static PyMethodDef py_fss_AddToShadowCopySet_methods[] = { { "opnum", (PyCFunction)py_fss_AddToShadowCopySet_ndr_opnum, METH_NOARGS|METH_CLASS, "fsrvp.fss_AddToShadowCopySet.opnum() -> 3 (0x03) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_AddToShadowCopySet_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_AddToShadowCopySet_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_AddToShadowCopySet_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_AddToShadowCopySet_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_fss_AddToShadowCopySet_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_fss_AddToShadowCopySet_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject fss_AddToShadowCopySet_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fss_AddToShadowCopySet", .tp_getset = py_fss_AddToShadowCopySet_getsetters, .tp_methods = py_fss_AddToShadowCopySet_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fss_AddToShadowCopySet_new, }; static bool pack_py_fss_AddToShadowCopySet_args_in(PyObject *args, PyObject *kwargs, struct fss_AddToShadowCopySet *r) { PyObject *py_ClientShadowCopyId; PyObject *py_ShadowCopySetId; PyObject *py_ShareName; const char *kwnames[] = { "ClientShadowCopyId", "ShadowCopySetId", "ShareName", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:fss_AddToShadowCopySet", discard_const_p(char *, kwnames), &py_ClientShadowCopyId, &py_ShadowCopySetId, &py_ShareName)) { return false; } if (py_ClientShadowCopyId == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ClientShadowCopyId"); return false; } PY_CHECK_TYPE(GUID_Type, py_ClientShadowCopyId, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_ClientShadowCopyId)) == NULL) { PyErr_NoMemory(); return false; } r->in.ClientShadowCopyId = *(struct GUID *)pytalloc_get_ptr(py_ClientShadowCopyId); if (py_ShadowCopySetId == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShadowCopySetId"); return false; } PY_CHECK_TYPE(GUID_Type, py_ShadowCopySetId, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_ShadowCopySetId)) == NULL) { PyErr_NoMemory(); return false; } r->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(py_ShadowCopySetId); if (py_ShareName == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShareName"); return false; } r->in.ShareName = talloc_ptrtype(r, r->in.ShareName); if (r->in.ShareName == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_ShareName)) { unicode = PyUnicode_AsEncodedString(py_ShareName, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_ShareName)) { test_str = PyBytes_AS_STRING(py_ShareName); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ShareName)->tp_name); return false; } talloc_str = talloc_strdup(r, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return false; } r->in.ShareName = talloc_str; } return true; } static PyObject *unpack_py_fss_AddToShadowCopySet_args_out(struct fss_AddToShadowCopySet *r) { PyObject *result; PyObject *py_pShadowCopyId; result = PyTuple_New(2); py_pShadowCopyId = pytalloc_reference_ex(GUID_Type, r->out.pShadowCopyId, r->out.pShadowCopyId); PyTuple_SetItem(result, 0, py_pShadowCopyId); PyTuple_SetItem(result, 1, PyLong_FromUnsignedLongLong((uint32_t)r->out.result)); return result; } static PyObject *py_fss_CommitShadowCopySet_in_get_ShadowCopySetId(PyObject *obj, void *closure) { struct fss_CommitShadowCopySet *object = (struct fss_CommitShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopySetId; py_ShadowCopySetId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->in.ShadowCopySetId); return py_ShadowCopySetId; } static int py_fss_CommitShadowCopySet_in_set_ShadowCopySetId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_CommitShadowCopySet *object = (struct fss_CommitShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShadowCopySetId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_CommitShadowCopySet_in_get_TimeOutInMilliseconds(PyObject *obj, void *closure) { struct fss_CommitShadowCopySet *object = (struct fss_CommitShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_TimeOutInMilliseconds; py_TimeOutInMilliseconds = PyLong_FromUnsignedLongLong((uint32_t)object->in.TimeOutInMilliseconds); return py_TimeOutInMilliseconds; } static int py_fss_CommitShadowCopySet_in_set_TimeOutInMilliseconds(PyObject *py_obj, PyObject *value, void *closure) { struct fss_CommitShadowCopySet *object = (struct fss_CommitShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.TimeOutInMilliseconds"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.TimeOutInMilliseconds)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.TimeOutInMilliseconds = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_fss_CommitShadowCopySet_get_result(PyObject *obj, void *closure) { struct fss_CommitShadowCopySet *object = (struct fss_CommitShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result); return py_result; } static int py_fss_CommitShadowCopySet_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct fss_CommitShadowCopySet *object = (struct fss_CommitShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.result = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fss_CommitShadowCopySet_getsetters[] = { { .name = discard_const_p(char, "in_ShadowCopySetId"), .get = py_fss_CommitShadowCopySet_in_get_ShadowCopySetId, .set = py_fss_CommitShadowCopySet_in_set_ShadowCopySetId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_TimeOutInMilliseconds"), .get = py_fss_CommitShadowCopySet_in_get_TimeOutInMilliseconds, .set = py_fss_CommitShadowCopySet_in_set_TimeOutInMilliseconds, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_fss_CommitShadowCopySet_get_result, .set = py_fss_CommitShadowCopySet_set_result, .doc = discard_const_p(char, "PIDL-generated element of type uint32") }, { .name = NULL } }; static PyObject *py_fss_CommitShadowCopySet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct fss_CommitShadowCopySet, type); return self; } static PyObject *py_fss_CommitShadowCopySet_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(4); } static PyObject *py_fss_CommitShadowCopySet_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct fss_CommitShadowCopySet *object = (struct fss_CommitShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 5) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_CommitShadowCopySet_ndr_pack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[4]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_fss_CommitShadowCopySet_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_CommitShadowCopySet_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_fss_CommitShadowCopySet_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_CommitShadowCopySet_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_fss_CommitShadowCopySet_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct fss_CommitShadowCopySet *object = (struct fss_CommitShadowCopySet *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 5) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_CommitShadowCopySet_ndr_unpack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[4]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_fss_CommitShadowCopySet_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_CommitShadowCopySet_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_CommitShadowCopySet_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_CommitShadowCopySet_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_CommitShadowCopySet_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct fss_CommitShadowCopySet *object = (struct fss_CommitShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_FileServerVssAgent.num_calls < 5) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_CommitShadowCopySet_ndr_print"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[4]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_fss_CommitShadowCopySet_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_CommitShadowCopySet_ndr_print(py_obj, "fss_CommitShadowCopySet_in", NDR_IN); } static PyObject *py_fss_CommitShadowCopySet_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_CommitShadowCopySet_ndr_print(py_obj, "fss_CommitShadowCopySet_out", NDR_OUT); } static PyMethodDef py_fss_CommitShadowCopySet_methods[] = { { "opnum", (PyCFunction)py_fss_CommitShadowCopySet_ndr_opnum, METH_NOARGS|METH_CLASS, "fsrvp.fss_CommitShadowCopySet.opnum() -> 4 (0x04) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_CommitShadowCopySet_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_CommitShadowCopySet_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_CommitShadowCopySet_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_CommitShadowCopySet_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_fss_CommitShadowCopySet_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_fss_CommitShadowCopySet_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject fss_CommitShadowCopySet_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fss_CommitShadowCopySet", .tp_getset = py_fss_CommitShadowCopySet_getsetters, .tp_methods = py_fss_CommitShadowCopySet_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fss_CommitShadowCopySet_new, }; static bool pack_py_fss_CommitShadowCopySet_args_in(PyObject *args, PyObject *kwargs, struct fss_CommitShadowCopySet *r) { PyObject *py_ShadowCopySetId; PyObject *py_TimeOutInMilliseconds; const char *kwnames[] = { "ShadowCopySetId", "TimeOutInMilliseconds", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:fss_CommitShadowCopySet", discard_const_p(char *, kwnames), &py_ShadowCopySetId, &py_TimeOutInMilliseconds)) { return false; } if (py_ShadowCopySetId == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShadowCopySetId"); return false; } PY_CHECK_TYPE(GUID_Type, py_ShadowCopySetId, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_ShadowCopySetId)) == NULL) { PyErr_NoMemory(); return false; } r->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(py_ShadowCopySetId); if (py_TimeOutInMilliseconds == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.TimeOutInMilliseconds"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.TimeOutInMilliseconds)); if (PyLong_Check(py_TimeOutInMilliseconds)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_TimeOutInMilliseconds); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.TimeOutInMilliseconds = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_fss_CommitShadowCopySet_args_out(struct fss_CommitShadowCopySet *r) { PyObject *result; result = PyLong_FromUnsignedLongLong((uint32_t)r->out.result); return result; } static PyObject *py_fss_ExposeShadowCopySet_in_get_ShadowCopySetId(PyObject *obj, void *closure) { struct fss_ExposeShadowCopySet *object = (struct fss_ExposeShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopySetId; py_ShadowCopySetId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->in.ShadowCopySetId); return py_ShadowCopySetId; } static int py_fss_ExposeShadowCopySet_in_set_ShadowCopySetId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_ExposeShadowCopySet *object = (struct fss_ExposeShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShadowCopySetId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_ExposeShadowCopySet_in_get_TimeOutInMilliseconds(PyObject *obj, void *closure) { struct fss_ExposeShadowCopySet *object = (struct fss_ExposeShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_TimeOutInMilliseconds; py_TimeOutInMilliseconds = PyLong_FromUnsignedLongLong((uint32_t)object->in.TimeOutInMilliseconds); return py_TimeOutInMilliseconds; } static int py_fss_ExposeShadowCopySet_in_set_TimeOutInMilliseconds(PyObject *py_obj, PyObject *value, void *closure) { struct fss_ExposeShadowCopySet *object = (struct fss_ExposeShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.TimeOutInMilliseconds"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.TimeOutInMilliseconds)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.TimeOutInMilliseconds = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_fss_ExposeShadowCopySet_get_result(PyObject *obj, void *closure) { struct fss_ExposeShadowCopySet *object = (struct fss_ExposeShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result); return py_result; } static int py_fss_ExposeShadowCopySet_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct fss_ExposeShadowCopySet *object = (struct fss_ExposeShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.result = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fss_ExposeShadowCopySet_getsetters[] = { { .name = discard_const_p(char, "in_ShadowCopySetId"), .get = py_fss_ExposeShadowCopySet_in_get_ShadowCopySetId, .set = py_fss_ExposeShadowCopySet_in_set_ShadowCopySetId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_TimeOutInMilliseconds"), .get = py_fss_ExposeShadowCopySet_in_get_TimeOutInMilliseconds, .set = py_fss_ExposeShadowCopySet_in_set_TimeOutInMilliseconds, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_fss_ExposeShadowCopySet_get_result, .set = py_fss_ExposeShadowCopySet_set_result, .doc = discard_const_p(char, "PIDL-generated element of type uint32") }, { .name = NULL } }; static PyObject *py_fss_ExposeShadowCopySet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct fss_ExposeShadowCopySet, type); return self; } static PyObject *py_fss_ExposeShadowCopySet_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(5); } static PyObject *py_fss_ExposeShadowCopySet_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct fss_ExposeShadowCopySet *object = (struct fss_ExposeShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 6) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_ExposeShadowCopySet_ndr_pack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[5]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_fss_ExposeShadowCopySet_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_ExposeShadowCopySet_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_fss_ExposeShadowCopySet_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_ExposeShadowCopySet_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_fss_ExposeShadowCopySet_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct fss_ExposeShadowCopySet *object = (struct fss_ExposeShadowCopySet *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 6) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_ExposeShadowCopySet_ndr_unpack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[5]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_fss_ExposeShadowCopySet_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_ExposeShadowCopySet_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_ExposeShadowCopySet_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_ExposeShadowCopySet_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_ExposeShadowCopySet_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct fss_ExposeShadowCopySet *object = (struct fss_ExposeShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_FileServerVssAgent.num_calls < 6) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_ExposeShadowCopySet_ndr_print"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[5]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_fss_ExposeShadowCopySet_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_ExposeShadowCopySet_ndr_print(py_obj, "fss_ExposeShadowCopySet_in", NDR_IN); } static PyObject *py_fss_ExposeShadowCopySet_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_ExposeShadowCopySet_ndr_print(py_obj, "fss_ExposeShadowCopySet_out", NDR_OUT); } static PyMethodDef py_fss_ExposeShadowCopySet_methods[] = { { "opnum", (PyCFunction)py_fss_ExposeShadowCopySet_ndr_opnum, METH_NOARGS|METH_CLASS, "fsrvp.fss_ExposeShadowCopySet.opnum() -> 5 (0x05) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_ExposeShadowCopySet_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_ExposeShadowCopySet_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_ExposeShadowCopySet_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_ExposeShadowCopySet_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_fss_ExposeShadowCopySet_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_fss_ExposeShadowCopySet_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject fss_ExposeShadowCopySet_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fss_ExposeShadowCopySet", .tp_getset = py_fss_ExposeShadowCopySet_getsetters, .tp_methods = py_fss_ExposeShadowCopySet_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fss_ExposeShadowCopySet_new, }; static bool pack_py_fss_ExposeShadowCopySet_args_in(PyObject *args, PyObject *kwargs, struct fss_ExposeShadowCopySet *r) { PyObject *py_ShadowCopySetId; PyObject *py_TimeOutInMilliseconds; const char *kwnames[] = { "ShadowCopySetId", "TimeOutInMilliseconds", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:fss_ExposeShadowCopySet", discard_const_p(char *, kwnames), &py_ShadowCopySetId, &py_TimeOutInMilliseconds)) { return false; } if (py_ShadowCopySetId == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShadowCopySetId"); return false; } PY_CHECK_TYPE(GUID_Type, py_ShadowCopySetId, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_ShadowCopySetId)) == NULL) { PyErr_NoMemory(); return false; } r->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(py_ShadowCopySetId); if (py_TimeOutInMilliseconds == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.TimeOutInMilliseconds"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.TimeOutInMilliseconds)); if (PyLong_Check(py_TimeOutInMilliseconds)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_TimeOutInMilliseconds); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.TimeOutInMilliseconds = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_fss_ExposeShadowCopySet_args_out(struct fss_ExposeShadowCopySet *r) { PyObject *result; result = PyLong_FromUnsignedLongLong((uint32_t)r->out.result); return result; } static PyObject *py_fss_RecoveryCompleteShadowCopySet_in_get_ShadowCopySetId(PyObject *obj, void *closure) { struct fss_RecoveryCompleteShadowCopySet *object = (struct fss_RecoveryCompleteShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopySetId; py_ShadowCopySetId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->in.ShadowCopySetId); return py_ShadowCopySetId; } static int py_fss_RecoveryCompleteShadowCopySet_in_set_ShadowCopySetId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_RecoveryCompleteShadowCopySet *object = (struct fss_RecoveryCompleteShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShadowCopySetId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_RecoveryCompleteShadowCopySet_get_result(PyObject *obj, void *closure) { struct fss_RecoveryCompleteShadowCopySet *object = (struct fss_RecoveryCompleteShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result); return py_result; } static int py_fss_RecoveryCompleteShadowCopySet_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct fss_RecoveryCompleteShadowCopySet *object = (struct fss_RecoveryCompleteShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.result = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fss_RecoveryCompleteShadowCopySet_getsetters[] = { { .name = discard_const_p(char, "in_ShadowCopySetId"), .get = py_fss_RecoveryCompleteShadowCopySet_in_get_ShadowCopySetId, .set = py_fss_RecoveryCompleteShadowCopySet_in_set_ShadowCopySetId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "result"), .get = py_fss_RecoveryCompleteShadowCopySet_get_result, .set = py_fss_RecoveryCompleteShadowCopySet_set_result, .doc = discard_const_p(char, "PIDL-generated element of type uint32") }, { .name = NULL } }; static PyObject *py_fss_RecoveryCompleteShadowCopySet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct fss_RecoveryCompleteShadowCopySet, type); return self; } static PyObject *py_fss_RecoveryCompleteShadowCopySet_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(6); } static PyObject *py_fss_RecoveryCompleteShadowCopySet_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct fss_RecoveryCompleteShadowCopySet *object = (struct fss_RecoveryCompleteShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 7) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_RecoveryCompleteShadowCopySet_ndr_pack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[6]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_fss_RecoveryCompleteShadowCopySet_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_RecoveryCompleteShadowCopySet_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_fss_RecoveryCompleteShadowCopySet_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_RecoveryCompleteShadowCopySet_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_fss_RecoveryCompleteShadowCopySet_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct fss_RecoveryCompleteShadowCopySet *object = (struct fss_RecoveryCompleteShadowCopySet *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 7) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_RecoveryCompleteShadowCopySet_ndr_unpack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[6]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_fss_RecoveryCompleteShadowCopySet_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_RecoveryCompleteShadowCopySet_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_RecoveryCompleteShadowCopySet_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_RecoveryCompleteShadowCopySet_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_RecoveryCompleteShadowCopySet_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct fss_RecoveryCompleteShadowCopySet *object = (struct fss_RecoveryCompleteShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_FileServerVssAgent.num_calls < 7) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_RecoveryCompleteShadowCopySet_ndr_print"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[6]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_fss_RecoveryCompleteShadowCopySet_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_RecoveryCompleteShadowCopySet_ndr_print(py_obj, "fss_RecoveryCompleteShadowCopySet_in", NDR_IN); } static PyObject *py_fss_RecoveryCompleteShadowCopySet_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_RecoveryCompleteShadowCopySet_ndr_print(py_obj, "fss_RecoveryCompleteShadowCopySet_out", NDR_OUT); } static PyMethodDef py_fss_RecoveryCompleteShadowCopySet_methods[] = { { "opnum", (PyCFunction)py_fss_RecoveryCompleteShadowCopySet_ndr_opnum, METH_NOARGS|METH_CLASS, "fsrvp.fss_RecoveryCompleteShadowCopySet.opnum() -> 6 (0x06) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_RecoveryCompleteShadowCopySet_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_RecoveryCompleteShadowCopySet_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_RecoveryCompleteShadowCopySet_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_RecoveryCompleteShadowCopySet_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_fss_RecoveryCompleteShadowCopySet_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_fss_RecoveryCompleteShadowCopySet_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject fss_RecoveryCompleteShadowCopySet_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fss_RecoveryCompleteShadowCopySet", .tp_getset = py_fss_RecoveryCompleteShadowCopySet_getsetters, .tp_methods = py_fss_RecoveryCompleteShadowCopySet_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fss_RecoveryCompleteShadowCopySet_new, }; static bool pack_py_fss_RecoveryCompleteShadowCopySet_args_in(PyObject *args, PyObject *kwargs, struct fss_RecoveryCompleteShadowCopySet *r) { PyObject *py_ShadowCopySetId; const char *kwnames[] = { "ShadowCopySetId", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:fss_RecoveryCompleteShadowCopySet", discard_const_p(char *, kwnames), &py_ShadowCopySetId)) { return false; } if (py_ShadowCopySetId == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShadowCopySetId"); return false; } PY_CHECK_TYPE(GUID_Type, py_ShadowCopySetId, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_ShadowCopySetId)) == NULL) { PyErr_NoMemory(); return false; } r->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(py_ShadowCopySetId); return true; } static PyObject *unpack_py_fss_RecoveryCompleteShadowCopySet_args_out(struct fss_RecoveryCompleteShadowCopySet *r) { PyObject *result; result = PyLong_FromUnsignedLongLong((uint32_t)r->out.result); return result; } static PyObject *py_fss_AbortShadowCopySet_in_get_ShadowCopySetId(PyObject *obj, void *closure) { struct fss_AbortShadowCopySet *object = (struct fss_AbortShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopySetId; py_ShadowCopySetId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->in.ShadowCopySetId); return py_ShadowCopySetId; } static int py_fss_AbortShadowCopySet_in_set_ShadowCopySetId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_AbortShadowCopySet *object = (struct fss_AbortShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShadowCopySetId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_AbortShadowCopySet_get_result(PyObject *obj, void *closure) { struct fss_AbortShadowCopySet *object = (struct fss_AbortShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result); return py_result; } static int py_fss_AbortShadowCopySet_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct fss_AbortShadowCopySet *object = (struct fss_AbortShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.result = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fss_AbortShadowCopySet_getsetters[] = { { .name = discard_const_p(char, "in_ShadowCopySetId"), .get = py_fss_AbortShadowCopySet_in_get_ShadowCopySetId, .set = py_fss_AbortShadowCopySet_in_set_ShadowCopySetId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "result"), .get = py_fss_AbortShadowCopySet_get_result, .set = py_fss_AbortShadowCopySet_set_result, .doc = discard_const_p(char, "PIDL-generated element of type uint32") }, { .name = NULL } }; static PyObject *py_fss_AbortShadowCopySet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct fss_AbortShadowCopySet, type); return self; } static PyObject *py_fss_AbortShadowCopySet_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(7); } static PyObject *py_fss_AbortShadowCopySet_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct fss_AbortShadowCopySet *object = (struct fss_AbortShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 8) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_AbortShadowCopySet_ndr_pack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[7]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_fss_AbortShadowCopySet_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_AbortShadowCopySet_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_fss_AbortShadowCopySet_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_AbortShadowCopySet_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_fss_AbortShadowCopySet_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct fss_AbortShadowCopySet *object = (struct fss_AbortShadowCopySet *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 8) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_AbortShadowCopySet_ndr_unpack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[7]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_fss_AbortShadowCopySet_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_AbortShadowCopySet_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_AbortShadowCopySet_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_AbortShadowCopySet_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_AbortShadowCopySet_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct fss_AbortShadowCopySet *object = (struct fss_AbortShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_FileServerVssAgent.num_calls < 8) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_AbortShadowCopySet_ndr_print"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[7]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_fss_AbortShadowCopySet_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_AbortShadowCopySet_ndr_print(py_obj, "fss_AbortShadowCopySet_in", NDR_IN); } static PyObject *py_fss_AbortShadowCopySet_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_AbortShadowCopySet_ndr_print(py_obj, "fss_AbortShadowCopySet_out", NDR_OUT); } static PyMethodDef py_fss_AbortShadowCopySet_methods[] = { { "opnum", (PyCFunction)py_fss_AbortShadowCopySet_ndr_opnum, METH_NOARGS|METH_CLASS, "fsrvp.fss_AbortShadowCopySet.opnum() -> 7 (0x07) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_AbortShadowCopySet_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_AbortShadowCopySet_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_AbortShadowCopySet_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_AbortShadowCopySet_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_fss_AbortShadowCopySet_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_fss_AbortShadowCopySet_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject fss_AbortShadowCopySet_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fss_AbortShadowCopySet", .tp_getset = py_fss_AbortShadowCopySet_getsetters, .tp_methods = py_fss_AbortShadowCopySet_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fss_AbortShadowCopySet_new, }; static bool pack_py_fss_AbortShadowCopySet_args_in(PyObject *args, PyObject *kwargs, struct fss_AbortShadowCopySet *r) { PyObject *py_ShadowCopySetId; const char *kwnames[] = { "ShadowCopySetId", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:fss_AbortShadowCopySet", discard_const_p(char *, kwnames), &py_ShadowCopySetId)) { return false; } if (py_ShadowCopySetId == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShadowCopySetId"); return false; } PY_CHECK_TYPE(GUID_Type, py_ShadowCopySetId, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_ShadowCopySetId)) == NULL) { PyErr_NoMemory(); return false; } r->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(py_ShadowCopySetId); return true; } static PyObject *unpack_py_fss_AbortShadowCopySet_args_out(struct fss_AbortShadowCopySet *r) { PyObject *result; result = PyLong_FromUnsignedLongLong((uint32_t)r->out.result); return result; } static PyObject *py_fss_IsPathSupported_in_get_ShareName(PyObject *obj, void *closure) { struct fss_IsPathSupported *object = (struct fss_IsPathSupported *)pytalloc_get_ptr(obj); PyObject *py_ShareName; if (object->in.ShareName == NULL) { Py_RETURN_NONE; } if (object->in.ShareName == NULL) { py_ShareName = Py_None; Py_INCREF(py_ShareName); } else { py_ShareName = PyUnicode_Decode(object->in.ShareName, strlen(object->in.ShareName), "utf-8", "ignore"); } return py_ShareName; } static int py_fss_IsPathSupported_in_set_ShareName(PyObject *py_obj, PyObject *value, void *closure) { struct fss_IsPathSupported *object = (struct fss_IsPathSupported *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShareName"); return -1; } object->in.ShareName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.ShareName); if (object->in.ShareName == NULL) { PyErr_NoMemory(); return -1; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->in.ShareName = talloc_str; } return 0; } static PyObject *py_fss_IsPathSupported_out_get_SupportedByThisProvider(PyObject *obj, void *closure) { struct fss_IsPathSupported *object = (struct fss_IsPathSupported *)pytalloc_get_ptr(obj); PyObject *py_SupportedByThisProvider; if (object->out.SupportedByThisProvider == NULL) { Py_RETURN_NONE; } py_SupportedByThisProvider = PyLong_FromUnsignedLongLong((uint32_t)*object->out.SupportedByThisProvider); return py_SupportedByThisProvider; } static int py_fss_IsPathSupported_out_set_SupportedByThisProvider(PyObject *py_obj, PyObject *value, void *closure) { struct fss_IsPathSupported *object = (struct fss_IsPathSupported *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.SupportedByThisProvider)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.SupportedByThisProvider"); return -1; } object->out.SupportedByThisProvider = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.SupportedByThisProvider); if (object->out.SupportedByThisProvider == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.SupportedByThisProvider)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } *object->out.SupportedByThisProvider = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_fss_IsPathSupported_out_get_OwnerMachineName(PyObject *obj, void *closure) { struct fss_IsPathSupported *object = (struct fss_IsPathSupported *)pytalloc_get_ptr(obj); PyObject *py_OwnerMachineName; if (object->out.OwnerMachineName == NULL) { Py_RETURN_NONE; } if (*object->out.OwnerMachineName == NULL) { py_OwnerMachineName = Py_None; Py_INCREF(py_OwnerMachineName); } else { if (*object->out.OwnerMachineName == NULL) { py_OwnerMachineName = Py_None; Py_INCREF(py_OwnerMachineName); } else { py_OwnerMachineName = PyUnicode_Decode(*object->out.OwnerMachineName, strlen(*object->out.OwnerMachineName), "utf-8", "ignore"); } } return py_OwnerMachineName; } static int py_fss_IsPathSupported_out_set_OwnerMachineName(PyObject *py_obj, PyObject *value, void *closure) { struct fss_IsPathSupported *object = (struct fss_IsPathSupported *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.OwnerMachineName)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.OwnerMachineName"); return -1; } object->out.OwnerMachineName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.OwnerMachineName); if (object->out.OwnerMachineName == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.OwnerMachineName = NULL; } else { *object->out.OwnerMachineName = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } *object->out.OwnerMachineName = talloc_str; } } return 0; } static PyObject *py_fss_IsPathSupported_get_result(PyObject *obj, void *closure) { struct fss_IsPathSupported *object = (struct fss_IsPathSupported *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result); return py_result; } static int py_fss_IsPathSupported_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct fss_IsPathSupported *object = (struct fss_IsPathSupported *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.result = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fss_IsPathSupported_getsetters[] = { { .name = discard_const_p(char, "in_ShareName"), .get = py_fss_IsPathSupported_in_get_ShareName, .set = py_fss_IsPathSupported_in_set_ShareName, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "out_SupportedByThisProvider"), .get = py_fss_IsPathSupported_out_get_SupportedByThisProvider, .set = py_fss_IsPathSupported_out_set_SupportedByThisProvider, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_OwnerMachineName"), .get = py_fss_IsPathSupported_out_get_OwnerMachineName, .set = py_fss_IsPathSupported_out_set_OwnerMachineName, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "result"), .get = py_fss_IsPathSupported_get_result, .set = py_fss_IsPathSupported_set_result, .doc = discard_const_p(char, "PIDL-generated element of type uint32") }, { .name = NULL } }; static PyObject *py_fss_IsPathSupported_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct fss_IsPathSupported, type); struct fss_IsPathSupported *_self = (struct fss_IsPathSupported *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.SupportedByThisProvider = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_fss_IsPathSupported_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(8); } static PyObject *py_fss_IsPathSupported_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct fss_IsPathSupported *object = (struct fss_IsPathSupported *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 9) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_IsPathSupported_ndr_pack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[8]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_fss_IsPathSupported_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_IsPathSupported_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_fss_IsPathSupported_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_IsPathSupported_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_fss_IsPathSupported_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct fss_IsPathSupported *object = (struct fss_IsPathSupported *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 9) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_IsPathSupported_ndr_unpack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[8]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_fss_IsPathSupported_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_IsPathSupported_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_IsPathSupported_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_IsPathSupported_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_IsPathSupported_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct fss_IsPathSupported *object = (struct fss_IsPathSupported *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_FileServerVssAgent.num_calls < 9) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_IsPathSupported_ndr_print"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[8]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_fss_IsPathSupported_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_IsPathSupported_ndr_print(py_obj, "fss_IsPathSupported_in", NDR_IN); } static PyObject *py_fss_IsPathSupported_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_IsPathSupported_ndr_print(py_obj, "fss_IsPathSupported_out", NDR_OUT); } static PyMethodDef py_fss_IsPathSupported_methods[] = { { "opnum", (PyCFunction)py_fss_IsPathSupported_ndr_opnum, METH_NOARGS|METH_CLASS, "fsrvp.fss_IsPathSupported.opnum() -> 8 (0x08) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_IsPathSupported_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_IsPathSupported_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_IsPathSupported_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_IsPathSupported_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_fss_IsPathSupported_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_fss_IsPathSupported_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject fss_IsPathSupported_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fss_IsPathSupported", .tp_getset = py_fss_IsPathSupported_getsetters, .tp_methods = py_fss_IsPathSupported_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fss_IsPathSupported_new, }; static bool pack_py_fss_IsPathSupported_args_in(PyObject *args, PyObject *kwargs, struct fss_IsPathSupported *r) { PyObject *py_ShareName; const char *kwnames[] = { "ShareName", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:fss_IsPathSupported", discard_const_p(char *, kwnames), &py_ShareName)) { return false; } if (py_ShareName == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShareName"); return false; } r->in.ShareName = talloc_ptrtype(r, r->in.ShareName); if (r->in.ShareName == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_ShareName)) { unicode = PyUnicode_AsEncodedString(py_ShareName, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_ShareName)) { test_str = PyBytes_AS_STRING(py_ShareName); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ShareName)->tp_name); return false; } talloc_str = talloc_strdup(r, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return false; } r->in.ShareName = talloc_str; } return true; } static PyObject *unpack_py_fss_IsPathSupported_args_out(struct fss_IsPathSupported *r) { PyObject *result; PyObject *py_SupportedByThisProvider; PyObject *py_OwnerMachineName; result = PyTuple_New(3); py_SupportedByThisProvider = PyLong_FromUnsignedLongLong((uint32_t)*r->out.SupportedByThisProvider); PyTuple_SetItem(result, 0, py_SupportedByThisProvider); if (*r->out.OwnerMachineName == NULL) { py_OwnerMachineName = Py_None; Py_INCREF(py_OwnerMachineName); } else { if (*r->out.OwnerMachineName == NULL) { py_OwnerMachineName = Py_None; Py_INCREF(py_OwnerMachineName); } else { py_OwnerMachineName = PyUnicode_Decode(*r->out.OwnerMachineName, strlen(*r->out.OwnerMachineName), "utf-8", "ignore"); } } PyTuple_SetItem(result, 1, py_OwnerMachineName); PyTuple_SetItem(result, 2, PyLong_FromUnsignedLongLong((uint32_t)r->out.result)); return result; } static PyObject *py_fss_IsPathShadowCopied_in_get_ShareName(PyObject *obj, void *closure) { struct fss_IsPathShadowCopied *object = (struct fss_IsPathShadowCopied *)pytalloc_get_ptr(obj); PyObject *py_ShareName; if (object->in.ShareName == NULL) { Py_RETURN_NONE; } if (object->in.ShareName == NULL) { py_ShareName = Py_None; Py_INCREF(py_ShareName); } else { py_ShareName = PyUnicode_Decode(object->in.ShareName, strlen(object->in.ShareName), "utf-8", "ignore"); } return py_ShareName; } static int py_fss_IsPathShadowCopied_in_set_ShareName(PyObject *py_obj, PyObject *value, void *closure) { struct fss_IsPathShadowCopied *object = (struct fss_IsPathShadowCopied *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShareName"); return -1; } object->in.ShareName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.ShareName); if (object->in.ShareName == NULL) { PyErr_NoMemory(); return -1; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->in.ShareName = talloc_str; } return 0; } static PyObject *py_fss_IsPathShadowCopied_out_get_ShadowCopyPresent(PyObject *obj, void *closure) { struct fss_IsPathShadowCopied *object = (struct fss_IsPathShadowCopied *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopyPresent; if (object->out.ShadowCopyPresent == NULL) { Py_RETURN_NONE; } py_ShadowCopyPresent = PyLong_FromUnsignedLongLong((uint32_t)*object->out.ShadowCopyPresent); return py_ShadowCopyPresent; } static int py_fss_IsPathShadowCopied_out_set_ShadowCopyPresent(PyObject *py_obj, PyObject *value, void *closure) { struct fss_IsPathShadowCopied *object = (struct fss_IsPathShadowCopied *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ShadowCopyPresent)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ShadowCopyPresent"); return -1; } object->out.ShadowCopyPresent = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ShadowCopyPresent); if (object->out.ShadowCopyPresent == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.ShadowCopyPresent)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } *object->out.ShadowCopyPresent = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_fss_IsPathShadowCopied_out_get_ShadowCopyCompatibility(PyObject *obj, void *closure) { struct fss_IsPathShadowCopied *object = (struct fss_IsPathShadowCopied *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopyCompatibility; if (object->out.ShadowCopyCompatibility == NULL) { Py_RETURN_NONE; } py_ShadowCopyCompatibility = PyLong_FromLong(*object->out.ShadowCopyCompatibility); return py_ShadowCopyCompatibility; } static int py_fss_IsPathShadowCopied_out_set_ShadowCopyCompatibility(PyObject *py_obj, PyObject *value, void *closure) { struct fss_IsPathShadowCopied *object = (struct fss_IsPathShadowCopied *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ShadowCopyCompatibility)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ShadowCopyCompatibility"); return -1; } object->out.ShadowCopyCompatibility = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ShadowCopyCompatibility); if (object->out.ShadowCopyCompatibility == NULL) { PyErr_NoMemory(); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(*object->out.ShadowCopyCompatibility)); const long long int_min = -int_max - 1; if (PyLong_Check(value)) { long long test_var; test_var = PyLong_AsLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var < int_min || test_var > int_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\ PyLong_Type.tp_name, int_min, int_max, test_var); return -1; } *object->out.ShadowCopyCompatibility = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_fss_IsPathShadowCopied_get_result(PyObject *obj, void *closure) { struct fss_IsPathShadowCopied *object = (struct fss_IsPathShadowCopied *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result); return py_result; } static int py_fss_IsPathShadowCopied_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct fss_IsPathShadowCopied *object = (struct fss_IsPathShadowCopied *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.result = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fss_IsPathShadowCopied_getsetters[] = { { .name = discard_const_p(char, "in_ShareName"), .get = py_fss_IsPathShadowCopied_in_get_ShareName, .set = py_fss_IsPathShadowCopied_in_set_ShareName, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "out_ShadowCopyPresent"), .get = py_fss_IsPathShadowCopied_out_get_ShadowCopyPresent, .set = py_fss_IsPathShadowCopied_out_set_ShadowCopyPresent, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_ShadowCopyCompatibility"), .get = py_fss_IsPathShadowCopied_out_get_ShadowCopyCompatibility, .set = py_fss_IsPathShadowCopied_out_set_ShadowCopyCompatibility, .doc = discard_const_p(char, "PIDL-generated element of base type int32") }, { .name = discard_const_p(char, "result"), .get = py_fss_IsPathShadowCopied_get_result, .set = py_fss_IsPathShadowCopied_set_result, .doc = discard_const_p(char, "PIDL-generated element of type uint32") }, { .name = NULL } }; static PyObject *py_fss_IsPathShadowCopied_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct fss_IsPathShadowCopied, type); struct fss_IsPathShadowCopied *_self = (struct fss_IsPathShadowCopied *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.ShadowCopyPresent = talloc_zero(mem_ctx, uint32_t); _self->out.ShadowCopyCompatibility = talloc_zero(mem_ctx, int32_t); return self; } static PyObject *py_fss_IsPathShadowCopied_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(9); } static PyObject *py_fss_IsPathShadowCopied_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct fss_IsPathShadowCopied *object = (struct fss_IsPathShadowCopied *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 10) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_IsPathShadowCopied_ndr_pack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[9]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_fss_IsPathShadowCopied_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_IsPathShadowCopied_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_fss_IsPathShadowCopied_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_IsPathShadowCopied_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_fss_IsPathShadowCopied_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct fss_IsPathShadowCopied *object = (struct fss_IsPathShadowCopied *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 10) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_IsPathShadowCopied_ndr_unpack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[9]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_fss_IsPathShadowCopied_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_IsPathShadowCopied_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_IsPathShadowCopied_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_IsPathShadowCopied_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_IsPathShadowCopied_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct fss_IsPathShadowCopied *object = (struct fss_IsPathShadowCopied *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_FileServerVssAgent.num_calls < 10) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_IsPathShadowCopied_ndr_print"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[9]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_fss_IsPathShadowCopied_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_IsPathShadowCopied_ndr_print(py_obj, "fss_IsPathShadowCopied_in", NDR_IN); } static PyObject *py_fss_IsPathShadowCopied_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_IsPathShadowCopied_ndr_print(py_obj, "fss_IsPathShadowCopied_out", NDR_OUT); } static PyMethodDef py_fss_IsPathShadowCopied_methods[] = { { "opnum", (PyCFunction)py_fss_IsPathShadowCopied_ndr_opnum, METH_NOARGS|METH_CLASS, "fsrvp.fss_IsPathShadowCopied.opnum() -> 9 (0x09) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_IsPathShadowCopied_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_IsPathShadowCopied_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_IsPathShadowCopied_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_IsPathShadowCopied_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_fss_IsPathShadowCopied_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_fss_IsPathShadowCopied_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject fss_IsPathShadowCopied_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fss_IsPathShadowCopied", .tp_getset = py_fss_IsPathShadowCopied_getsetters, .tp_methods = py_fss_IsPathShadowCopied_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fss_IsPathShadowCopied_new, }; static bool pack_py_fss_IsPathShadowCopied_args_in(PyObject *args, PyObject *kwargs, struct fss_IsPathShadowCopied *r) { PyObject *py_ShareName; const char *kwnames[] = { "ShareName", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:fss_IsPathShadowCopied", discard_const_p(char *, kwnames), &py_ShareName)) { return false; } if (py_ShareName == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShareName"); return false; } r->in.ShareName = talloc_ptrtype(r, r->in.ShareName); if (r->in.ShareName == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_ShareName)) { unicode = PyUnicode_AsEncodedString(py_ShareName, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_ShareName)) { test_str = PyBytes_AS_STRING(py_ShareName); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ShareName)->tp_name); return false; } talloc_str = talloc_strdup(r, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return false; } r->in.ShareName = talloc_str; } return true; } static PyObject *unpack_py_fss_IsPathShadowCopied_args_out(struct fss_IsPathShadowCopied *r) { PyObject *result; PyObject *py_ShadowCopyPresent; PyObject *py_ShadowCopyCompatibility; result = PyTuple_New(3); py_ShadowCopyPresent = PyLong_FromUnsignedLongLong((uint32_t)*r->out.ShadowCopyPresent); PyTuple_SetItem(result, 0, py_ShadowCopyPresent); py_ShadowCopyCompatibility = PyLong_FromLong(*r->out.ShadowCopyCompatibility); PyTuple_SetItem(result, 1, py_ShadowCopyCompatibility); PyTuple_SetItem(result, 2, PyLong_FromUnsignedLongLong((uint32_t)r->out.result)); return result; } static PyObject *py_fss_GetShareMapping_in_get_ShadowCopyId(PyObject *obj, void *closure) { struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopyId; py_ShadowCopyId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->in.ShadowCopyId); return py_ShadowCopyId; } static int py_fss_GetShareMapping_in_set_ShadowCopyId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShadowCopyId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.ShadowCopyId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_GetShareMapping_in_get_ShadowCopySetId(PyObject *obj, void *closure) { struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopySetId; py_ShadowCopySetId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->in.ShadowCopySetId); return py_ShadowCopySetId; } static int py_fss_GetShareMapping_in_set_ShadowCopySetId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShadowCopySetId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_GetShareMapping_in_get_ShareName(PyObject *obj, void *closure) { struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(obj); PyObject *py_ShareName; if (object->in.ShareName == NULL) { Py_RETURN_NONE; } if (object->in.ShareName == NULL) { py_ShareName = Py_None; Py_INCREF(py_ShareName); } else { py_ShareName = PyUnicode_Decode(object->in.ShareName, strlen(object->in.ShareName), "utf-8", "ignore"); } return py_ShareName; } static int py_fss_GetShareMapping_in_set_ShareName(PyObject *py_obj, PyObject *value, void *closure) { struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShareName"); return -1; } object->in.ShareName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.ShareName); if (object->in.ShareName == NULL) { PyErr_NoMemory(); return -1; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->in.ShareName = talloc_str; } return 0; } static PyObject *py_fss_GetShareMapping_in_get_Level(PyObject *obj, void *closure) { struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(obj); PyObject *py_Level; py_Level = PyLong_FromUnsignedLongLong((uint32_t)object->in.Level); return py_Level; } static int py_fss_GetShareMapping_in_set_Level(PyObject *py_obj, PyObject *value, void *closure) { struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.Level"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.Level)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.Level = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_fss_GetShareMapping_out_get_ShareMapping(PyObject *obj, void *closure) { struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(obj); PyObject *py_ShareMapping; if (object->out.ShareMapping == NULL) { Py_RETURN_NONE; } py_ShareMapping = pyrpc_import_union(&fssagent_share_mapping_Type, object->out.ShareMapping, object->in.Level, object->out.ShareMapping, "union fssagent_share_mapping"); if (py_ShareMapping == NULL) { return NULL; } return py_ShareMapping; } static int py_fss_GetShareMapping_out_set_ShareMapping(PyObject *py_obj, PyObject *value, void *closure) { struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ShareMapping)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ShareMapping"); return -1; } object->out.ShareMapping = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ShareMapping); if (object->out.ShareMapping == NULL) { PyErr_NoMemory(); return -1; } { union fssagent_share_mapping *ShareMapping_switch_1; ShareMapping_switch_1 = (union fssagent_share_mapping *)pyrpc_export_union(&fssagent_share_mapping_Type, pytalloc_get_mem_ctx(py_obj), object->in.Level, value, "union fssagent_share_mapping"); if (ShareMapping_switch_1 == NULL) { return -1; } object->out.ShareMapping = ShareMapping_switch_1; } return 0; } static PyObject *py_fss_GetShareMapping_get_result(PyObject *obj, void *closure) { struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result); return py_result; } static int py_fss_GetShareMapping_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.result = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fss_GetShareMapping_getsetters[] = { { .name = discard_const_p(char, "in_ShadowCopyId"), .get = py_fss_GetShareMapping_in_get_ShadowCopyId, .set = py_fss_GetShareMapping_in_set_ShadowCopyId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_ShadowCopySetId"), .get = py_fss_GetShareMapping_in_get_ShadowCopySetId, .set = py_fss_GetShareMapping_in_set_ShadowCopySetId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_ShareName"), .get = py_fss_GetShareMapping_in_get_ShareName, .set = py_fss_GetShareMapping_in_set_ShareName, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_Level"), .get = py_fss_GetShareMapping_in_get_Level, .set = py_fss_GetShareMapping_in_set_Level, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_ShareMapping"), .get = py_fss_GetShareMapping_out_get_ShareMapping, .set = py_fss_GetShareMapping_out_set_ShareMapping, .doc = discard_const_p(char, "PIDL-generated element of base type fssagent_share_mapping") }, { .name = discard_const_p(char, "result"), .get = py_fss_GetShareMapping_get_result, .set = py_fss_GetShareMapping_set_result, .doc = discard_const_p(char, "PIDL-generated element of type uint32") }, { .name = NULL } }; static PyObject *py_fss_GetShareMapping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct fss_GetShareMapping, type); struct fss_GetShareMapping *_self = (struct fss_GetShareMapping *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.ShareMapping = talloc_zero(mem_ctx, union fssagent_share_mapping); return self; } static PyObject *py_fss_GetShareMapping_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(10); } static PyObject *py_fss_GetShareMapping_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 11) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_GetShareMapping_ndr_pack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[10]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_fss_GetShareMapping_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_GetShareMapping_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_fss_GetShareMapping_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_GetShareMapping_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_fss_GetShareMapping_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 11) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_GetShareMapping_ndr_unpack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[10]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_fss_GetShareMapping_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_GetShareMapping_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_GetShareMapping_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_GetShareMapping_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_GetShareMapping_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct fss_GetShareMapping *object = (struct fss_GetShareMapping *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_FileServerVssAgent.num_calls < 11) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_GetShareMapping_ndr_print"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[10]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_fss_GetShareMapping_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_GetShareMapping_ndr_print(py_obj, "fss_GetShareMapping_in", NDR_IN); } static PyObject *py_fss_GetShareMapping_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_GetShareMapping_ndr_print(py_obj, "fss_GetShareMapping_out", NDR_OUT); } static PyMethodDef py_fss_GetShareMapping_methods[] = { { "opnum", (PyCFunction)py_fss_GetShareMapping_ndr_opnum, METH_NOARGS|METH_CLASS, "fsrvp.fss_GetShareMapping.opnum() -> 10 (0x0a) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_GetShareMapping_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_GetShareMapping_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_GetShareMapping_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_GetShareMapping_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_fss_GetShareMapping_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_fss_GetShareMapping_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject fss_GetShareMapping_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fss_GetShareMapping", .tp_getset = py_fss_GetShareMapping_getsetters, .tp_methods = py_fss_GetShareMapping_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fss_GetShareMapping_new, }; static bool pack_py_fss_GetShareMapping_args_in(PyObject *args, PyObject *kwargs, struct fss_GetShareMapping *r) { PyObject *py_ShadowCopyId; PyObject *py_ShadowCopySetId; PyObject *py_ShareName; PyObject *py_Level; const char *kwnames[] = { "ShadowCopyId", "ShadowCopySetId", "ShareName", "Level", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:fss_GetShareMapping", discard_const_p(char *, kwnames), &py_ShadowCopyId, &py_ShadowCopySetId, &py_ShareName, &py_Level)) { return false; } if (py_ShadowCopyId == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShadowCopyId"); return false; } PY_CHECK_TYPE(GUID_Type, py_ShadowCopyId, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_ShadowCopyId)) == NULL) { PyErr_NoMemory(); return false; } r->in.ShadowCopyId = *(struct GUID *)pytalloc_get_ptr(py_ShadowCopyId); if (py_ShadowCopySetId == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShadowCopySetId"); return false; } PY_CHECK_TYPE(GUID_Type, py_ShadowCopySetId, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_ShadowCopySetId)) == NULL) { PyErr_NoMemory(); return false; } r->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(py_ShadowCopySetId); if (py_ShareName == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShareName"); return false; } r->in.ShareName = talloc_ptrtype(r, r->in.ShareName); if (r->in.ShareName == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_ShareName)) { unicode = PyUnicode_AsEncodedString(py_ShareName, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_ShareName)) { test_str = PyBytes_AS_STRING(py_ShareName); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ShareName)->tp_name); return false; } talloc_str = talloc_strdup(r, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return false; } r->in.ShareName = talloc_str; } if (py_Level == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.Level"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.Level)); if (PyLong_Check(py_Level)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_Level); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.Level = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_fss_GetShareMapping_args_out(struct fss_GetShareMapping *r) { PyObject *result; PyObject *py_ShareMapping; result = PyTuple_New(2); py_ShareMapping = pyrpc_import_union(&fssagent_share_mapping_Type, r->out.ShareMapping, r->in.Level, r->out.ShareMapping, "union fssagent_share_mapping"); if (py_ShareMapping == NULL) { return NULL; } PyTuple_SetItem(result, 0, py_ShareMapping); PyTuple_SetItem(result, 1, PyLong_FromUnsignedLongLong((uint32_t)r->out.result)); return result; } static PyObject *py_fss_DeleteShareMapping_in_get_ShadowCopySetId(PyObject *obj, void *closure) { struct fss_DeleteShareMapping *object = (struct fss_DeleteShareMapping *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopySetId; py_ShadowCopySetId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->in.ShadowCopySetId); return py_ShadowCopySetId; } static int py_fss_DeleteShareMapping_in_set_ShadowCopySetId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_DeleteShareMapping *object = (struct fss_DeleteShareMapping *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShadowCopySetId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_DeleteShareMapping_in_get_ShadowCopyId(PyObject *obj, void *closure) { struct fss_DeleteShareMapping *object = (struct fss_DeleteShareMapping *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopyId; py_ShadowCopyId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->in.ShadowCopyId); return py_ShadowCopyId; } static int py_fss_DeleteShareMapping_in_set_ShadowCopyId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_DeleteShareMapping *object = (struct fss_DeleteShareMapping *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShadowCopyId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.ShadowCopyId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_DeleteShareMapping_in_get_ShareName(PyObject *obj, void *closure) { struct fss_DeleteShareMapping *object = (struct fss_DeleteShareMapping *)pytalloc_get_ptr(obj); PyObject *py_ShareName; if (object->in.ShareName == NULL) { Py_RETURN_NONE; } if (object->in.ShareName == NULL) { py_ShareName = Py_None; Py_INCREF(py_ShareName); } else { py_ShareName = PyUnicode_Decode(object->in.ShareName, strlen(object->in.ShareName), "utf-8", "ignore"); } return py_ShareName; } static int py_fss_DeleteShareMapping_in_set_ShareName(PyObject *py_obj, PyObject *value, void *closure) { struct fss_DeleteShareMapping *object = (struct fss_DeleteShareMapping *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShareName"); return -1; } object->in.ShareName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.ShareName); if (object->in.ShareName == NULL) { PyErr_NoMemory(); return -1; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(value)) { unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return -1; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(value)) { test_str = PyBytes_AS_STRING(value); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name); return -1; } talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return -1; } object->in.ShareName = talloc_str; } return 0; } static PyObject *py_fss_DeleteShareMapping_get_result(PyObject *obj, void *closure) { struct fss_DeleteShareMapping *object = (struct fss_DeleteShareMapping *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result); return py_result; } static int py_fss_DeleteShareMapping_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct fss_DeleteShareMapping *object = (struct fss_DeleteShareMapping *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.result = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fss_DeleteShareMapping_getsetters[] = { { .name = discard_const_p(char, "in_ShadowCopySetId"), .get = py_fss_DeleteShareMapping_in_get_ShadowCopySetId, .set = py_fss_DeleteShareMapping_in_set_ShadowCopySetId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_ShadowCopyId"), .get = py_fss_DeleteShareMapping_in_get_ShadowCopyId, .set = py_fss_DeleteShareMapping_in_set_ShadowCopyId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_ShareName"), .get = py_fss_DeleteShareMapping_in_get_ShareName, .set = py_fss_DeleteShareMapping_in_set_ShareName, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "result"), .get = py_fss_DeleteShareMapping_get_result, .set = py_fss_DeleteShareMapping_set_result, .doc = discard_const_p(char, "PIDL-generated element of type uint32") }, { .name = NULL } }; static PyObject *py_fss_DeleteShareMapping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct fss_DeleteShareMapping, type); return self; } static PyObject *py_fss_DeleteShareMapping_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(11); } static PyObject *py_fss_DeleteShareMapping_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct fss_DeleteShareMapping *object = (struct fss_DeleteShareMapping *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 12) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_DeleteShareMapping_ndr_pack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[11]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_fss_DeleteShareMapping_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_DeleteShareMapping_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_fss_DeleteShareMapping_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_DeleteShareMapping_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_fss_DeleteShareMapping_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct fss_DeleteShareMapping *object = (struct fss_DeleteShareMapping *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 12) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_DeleteShareMapping_ndr_unpack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[11]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_fss_DeleteShareMapping_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_DeleteShareMapping_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_DeleteShareMapping_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_DeleteShareMapping_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_DeleteShareMapping_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct fss_DeleteShareMapping *object = (struct fss_DeleteShareMapping *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_FileServerVssAgent.num_calls < 12) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_DeleteShareMapping_ndr_print"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[11]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_fss_DeleteShareMapping_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_DeleteShareMapping_ndr_print(py_obj, "fss_DeleteShareMapping_in", NDR_IN); } static PyObject *py_fss_DeleteShareMapping_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_DeleteShareMapping_ndr_print(py_obj, "fss_DeleteShareMapping_out", NDR_OUT); } static PyMethodDef py_fss_DeleteShareMapping_methods[] = { { "opnum", (PyCFunction)py_fss_DeleteShareMapping_ndr_opnum, METH_NOARGS|METH_CLASS, "fsrvp.fss_DeleteShareMapping.opnum() -> 11 (0x0b) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_DeleteShareMapping_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_DeleteShareMapping_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_DeleteShareMapping_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_DeleteShareMapping_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_fss_DeleteShareMapping_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_fss_DeleteShareMapping_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject fss_DeleteShareMapping_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fss_DeleteShareMapping", .tp_getset = py_fss_DeleteShareMapping_getsetters, .tp_methods = py_fss_DeleteShareMapping_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fss_DeleteShareMapping_new, }; static bool pack_py_fss_DeleteShareMapping_args_in(PyObject *args, PyObject *kwargs, struct fss_DeleteShareMapping *r) { PyObject *py_ShadowCopySetId; PyObject *py_ShadowCopyId; PyObject *py_ShareName; const char *kwnames[] = { "ShadowCopySetId", "ShadowCopyId", "ShareName", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:fss_DeleteShareMapping", discard_const_p(char *, kwnames), &py_ShadowCopySetId, &py_ShadowCopyId, &py_ShareName)) { return false; } if (py_ShadowCopySetId == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShadowCopySetId"); return false; } PY_CHECK_TYPE(GUID_Type, py_ShadowCopySetId, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_ShadowCopySetId)) == NULL) { PyErr_NoMemory(); return false; } r->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(py_ShadowCopySetId); if (py_ShadowCopyId == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShadowCopyId"); return false; } PY_CHECK_TYPE(GUID_Type, py_ShadowCopyId, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_ShadowCopyId)) == NULL) { PyErr_NoMemory(); return false; } r->in.ShadowCopyId = *(struct GUID *)pytalloc_get_ptr(py_ShadowCopyId); if (py_ShareName == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShareName"); return false; } r->in.ShareName = talloc_ptrtype(r, r->in.ShareName); if (r->in.ShareName == NULL) { PyErr_NoMemory(); return false; } { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_ShareName)) { unicode = PyUnicode_AsEncodedString(py_ShareName, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_ShareName)) { test_str = PyBytes_AS_STRING(py_ShareName); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ShareName)->tp_name); return false; } talloc_str = talloc_strdup(r, test_str); if (unicode != NULL) { Py_DECREF(unicode); } if (talloc_str == NULL) { PyErr_NoMemory(); return false; } r->in.ShareName = talloc_str; } return true; } static PyObject *unpack_py_fss_DeleteShareMapping_args_out(struct fss_DeleteShareMapping *r) { PyObject *result; result = PyLong_FromUnsignedLongLong((uint32_t)r->out.result); return result; } static PyObject *py_fss_PrepareShadowCopySet_in_get_ShadowCopySetId(PyObject *obj, void *closure) { struct fss_PrepareShadowCopySet *object = (struct fss_PrepareShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_ShadowCopySetId; py_ShadowCopySetId = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->in.ShadowCopySetId); return py_ShadowCopySetId; } static int py_fss_PrepareShadowCopySet_in_set_ShadowCopySetId(PyObject *py_obj, PyObject *value, void *closure) { struct fss_PrepareShadowCopySet *object = (struct fss_PrepareShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ShadowCopySetId"); return -1; } PY_CHECK_TYPE(GUID_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(value); return 0; } static PyObject *py_fss_PrepareShadowCopySet_in_get_TimeOutInMilliseconds(PyObject *obj, void *closure) { struct fss_PrepareShadowCopySet *object = (struct fss_PrepareShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_TimeOutInMilliseconds; py_TimeOutInMilliseconds = PyLong_FromUnsignedLongLong((uint32_t)object->in.TimeOutInMilliseconds); return py_TimeOutInMilliseconds; } static int py_fss_PrepareShadowCopySet_in_set_TimeOutInMilliseconds(PyObject *py_obj, PyObject *value, void *closure) { struct fss_PrepareShadowCopySet *object = (struct fss_PrepareShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.TimeOutInMilliseconds"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.TimeOutInMilliseconds)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->in.TimeOutInMilliseconds = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_fss_PrepareShadowCopySet_get_result(PyObject *obj, void *closure) { struct fss_PrepareShadowCopySet *object = (struct fss_PrepareShadowCopySet *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result); return py_result; } static int py_fss_PrepareShadowCopySet_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct fss_PrepareShadowCopySet *object = (struct fss_PrepareShadowCopySet *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result)); if (PyLong_Check(value)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred() != NULL) { return -1; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return -1; } object->out.result = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_fss_PrepareShadowCopySet_getsetters[] = { { .name = discard_const_p(char, "in_ShadowCopySetId"), .get = py_fss_PrepareShadowCopySet_in_get_ShadowCopySetId, .set = py_fss_PrepareShadowCopySet_in_set_ShadowCopySetId, .doc = discard_const_p(char, "PIDL-generated element of base type GUID") }, { .name = discard_const_p(char, "in_TimeOutInMilliseconds"), .get = py_fss_PrepareShadowCopySet_in_get_TimeOutInMilliseconds, .set = py_fss_PrepareShadowCopySet_in_set_TimeOutInMilliseconds, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_fss_PrepareShadowCopySet_get_result, .set = py_fss_PrepareShadowCopySet_set_result, .doc = discard_const_p(char, "PIDL-generated element of type uint32") }, { .name = NULL } }; static PyObject *py_fss_PrepareShadowCopySet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct fss_PrepareShadowCopySet, type); return self; } static PyObject *py_fss_PrepareShadowCopySet_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(12); } static PyObject *py_fss_PrepareShadowCopySet_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct fss_PrepareShadowCopySet *object = (struct fss_PrepareShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 13) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_PrepareShadowCopySet_ndr_pack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[12]; push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj)); if (push == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } push->flags |= ndr_push_flags; err = call->ndr_push(push, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(push); PyErr_SetNdrError(err); return NULL; } blob = ndr_push_blob(push); ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(push); return ret; } static PyObject *py_fss_PrepareShadowCopySet_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_PrepareShadowCopySet_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_fss_PrepareShadowCopySet_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { const char * const kwnames[] = { "bigendian", "ndr64", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_push_flags = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__", discard_const_p(char *, kwnames), &bigendian_obj, &ndr64_obj)) { return NULL; } if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_push_flags |= LIBNDR_FLAG_NDR64; } return py_fss_PrepareShadowCopySet_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_fss_PrepareShadowCopySet_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining) { const struct ndr_interface_call *call = NULL; struct fss_PrepareShadowCopySet *object = (struct fss_PrepareShadowCopySet *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_FileServerVssAgent.num_calls < 13) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_PrepareShadowCopySet_ndr_unpack"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[12]; pull = ndr_pull_init_blob(blob, object); if (pull == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } pull->flags |= ndr_pull_flags; err = call->ndr_pull(pull, ndr_inout_flags, object); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } if (!allow_remaining) { uint32_t highest_ofs; if (pull->offset > pull->relative_highest_offset) { highest_ofs = pull->offset; } else { highest_ofs = pull->relative_highest_offset; } if (highest_ofs < pull->data_size) { err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", highest_ofs, pull->data_size); TALLOC_FREE(pull); PyErr_SetNdrError(err); return NULL; } } TALLOC_FREE(pull); Py_RETURN_NONE; } static PyObject *py_fss_PrepareShadowCopySet_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_PrepareShadowCopySet_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_PrepareShadowCopySet_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs) { DATA_BLOB blob; Py_ssize_t blob_length = 0; const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL }; PyObject *bigendian_obj = NULL; PyObject *ndr64_obj = NULL; uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &bigendian_obj, &ndr64_obj, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) { ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN; } if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) { ndr_pull_flags |= LIBNDR_FLAG_NDR64; } if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } return py_fss_PrepareShadowCopySet_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_fss_PrepareShadowCopySet_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct fss_PrepareShadowCopySet *object = (struct fss_PrepareShadowCopySet *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_FileServerVssAgent.num_calls < 13) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_fss_PrepareShadowCopySet_ndr_print"); return NULL; } call = &ndr_table_FileServerVssAgent.calls[12]; retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object); ret = PyUnicode_FromString(retstr); TALLOC_FREE(retstr); return ret; } static PyObject *py_fss_PrepareShadowCopySet_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_PrepareShadowCopySet_ndr_print(py_obj, "fss_PrepareShadowCopySet_in", NDR_IN); } static PyObject *py_fss_PrepareShadowCopySet_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_fss_PrepareShadowCopySet_ndr_print(py_obj, "fss_PrepareShadowCopySet_out", NDR_OUT); } static PyMethodDef py_fss_PrepareShadowCopySet_methods[] = { { "opnum", (PyCFunction)py_fss_PrepareShadowCopySet_ndr_opnum, METH_NOARGS|METH_CLASS, "fsrvp.fss_PrepareShadowCopySet.opnum() -> 12 (0x0c) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_PrepareShadowCopySet_ndr_pack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" }, { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_PrepareShadowCopySet_ndr_pack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" }, { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_PrepareShadowCopySet_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" }, { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_fss_PrepareShadowCopySet_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" }, { "__ndr_print_in__", (PyCFunction)py_fss_PrepareShadowCopySet_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_fss_PrepareShadowCopySet_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject fss_PrepareShadowCopySet_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.fss_PrepareShadowCopySet", .tp_getset = py_fss_PrepareShadowCopySet_getsetters, .tp_methods = py_fss_PrepareShadowCopySet_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_fss_PrepareShadowCopySet_new, }; static bool pack_py_fss_PrepareShadowCopySet_args_in(PyObject *args, PyObject *kwargs, struct fss_PrepareShadowCopySet *r) { PyObject *py_ShadowCopySetId; PyObject *py_TimeOutInMilliseconds; const char *kwnames[] = { "ShadowCopySetId", "TimeOutInMilliseconds", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:fss_PrepareShadowCopySet", discard_const_p(char *, kwnames), &py_ShadowCopySetId, &py_TimeOutInMilliseconds)) { return false; } if (py_ShadowCopySetId == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ShadowCopySetId"); return false; } PY_CHECK_TYPE(GUID_Type, py_ShadowCopySetId, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_ShadowCopySetId)) == NULL) { PyErr_NoMemory(); return false; } r->in.ShadowCopySetId = *(struct GUID *)pytalloc_get_ptr(py_ShadowCopySetId); if (py_TimeOutInMilliseconds == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.TimeOutInMilliseconds"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.TimeOutInMilliseconds)); if (PyLong_Check(py_TimeOutInMilliseconds)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_TimeOutInMilliseconds); if (PyErr_Occurred() != NULL) { return false; } if (test_var > uint_max) { PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\ PyLong_Type.tp_name, uint_max, test_var); return false; } r->in.TimeOutInMilliseconds = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_fss_PrepareShadowCopySet_args_out(struct fss_PrepareShadowCopySet *r) { PyObject *result; result = PyLong_FromUnsignedLongLong((uint32_t)r->out.result); return result; } const struct PyNdrRpcMethodDef py_ndr_FileServerVssAgent_methods[] = { { "fss_GetSupportedVersion", "S.fss_GetSupportedVersion() -> (MinVersion, MaxVersion, result)", (py_dcerpc_call_fn)dcerpc_fss_GetSupportedVersion_r, (py_data_pack_fn)pack_py_fss_GetSupportedVersion_args_in, (py_data_unpack_fn)unpack_py_fss_GetSupportedVersion_args_out, 0, &ndr_table_FileServerVssAgent }, { "fss_SetContext", "S.fss_SetContext(Context) -> result", (py_dcerpc_call_fn)dcerpc_fss_SetContext_r, (py_data_pack_fn)pack_py_fss_SetContext_args_in, (py_data_unpack_fn)unpack_py_fss_SetContext_args_out, 1, &ndr_table_FileServerVssAgent }, { "fss_StartShadowCopySet", "S.fss_StartShadowCopySet(ClientShadowCopySetId) -> (pShadowCopySetId, result)", (py_dcerpc_call_fn)dcerpc_fss_StartShadowCopySet_r, (py_data_pack_fn)pack_py_fss_StartShadowCopySet_args_in, (py_data_unpack_fn)unpack_py_fss_StartShadowCopySet_args_out, 2, &ndr_table_FileServerVssAgent }, { "fss_AddToShadowCopySet", "S.fss_AddToShadowCopySet(ClientShadowCopyId, ShadowCopySetId, ShareName) -> (pShadowCopyId, result)", (py_dcerpc_call_fn)dcerpc_fss_AddToShadowCopySet_r, (py_data_pack_fn)pack_py_fss_AddToShadowCopySet_args_in, (py_data_unpack_fn)unpack_py_fss_AddToShadowCopySet_args_out, 3, &ndr_table_FileServerVssAgent }, { "fss_CommitShadowCopySet", "S.fss_CommitShadowCopySet(ShadowCopySetId, TimeOutInMilliseconds) -> result", (py_dcerpc_call_fn)dcerpc_fss_CommitShadowCopySet_r, (py_data_pack_fn)pack_py_fss_CommitShadowCopySet_args_in, (py_data_unpack_fn)unpack_py_fss_CommitShadowCopySet_args_out, 4, &ndr_table_FileServerVssAgent }, { "fss_ExposeShadowCopySet", "S.fss_ExposeShadowCopySet(ShadowCopySetId, TimeOutInMilliseconds) -> result", (py_dcerpc_call_fn)dcerpc_fss_ExposeShadowCopySet_r, (py_data_pack_fn)pack_py_fss_ExposeShadowCopySet_args_in, (py_data_unpack_fn)unpack_py_fss_ExposeShadowCopySet_args_out, 5, &ndr_table_FileServerVssAgent }, { "fss_RecoveryCompleteShadowCopySet", "S.fss_RecoveryCompleteShadowCopySet(ShadowCopySetId) -> result", (py_dcerpc_call_fn)dcerpc_fss_RecoveryCompleteShadowCopySet_r, (py_data_pack_fn)pack_py_fss_RecoveryCompleteShadowCopySet_args_in, (py_data_unpack_fn)unpack_py_fss_RecoveryCompleteShadowCopySet_args_out, 6, &ndr_table_FileServerVssAgent }, { "fss_AbortShadowCopySet", "S.fss_AbortShadowCopySet(ShadowCopySetId) -> result", (py_dcerpc_call_fn)dcerpc_fss_AbortShadowCopySet_r, (py_data_pack_fn)pack_py_fss_AbortShadowCopySet_args_in, (py_data_unpack_fn)unpack_py_fss_AbortShadowCopySet_args_out, 7, &ndr_table_FileServerVssAgent }, { "fss_IsPathSupported", "S.fss_IsPathSupported(ShareName) -> (SupportedByThisProvider, OwnerMachineName, result)", (py_dcerpc_call_fn)dcerpc_fss_IsPathSupported_r, (py_data_pack_fn)pack_py_fss_IsPathSupported_args_in, (py_data_unpack_fn)unpack_py_fss_IsPathSupported_args_out, 8, &ndr_table_FileServerVssAgent }, { "fss_IsPathShadowCopied", "S.fss_IsPathShadowCopied(ShareName) -> (ShadowCopyPresent, ShadowCopyCompatibility, result)", (py_dcerpc_call_fn)dcerpc_fss_IsPathShadowCopied_r, (py_data_pack_fn)pack_py_fss_IsPathShadowCopied_args_in, (py_data_unpack_fn)unpack_py_fss_IsPathShadowCopied_args_out, 9, &ndr_table_FileServerVssAgent }, { "fss_GetShareMapping", "S.fss_GetShareMapping(ShadowCopyId, ShadowCopySetId, ShareName, Level) -> (ShareMapping, result)", (py_dcerpc_call_fn)dcerpc_fss_GetShareMapping_r, (py_data_pack_fn)pack_py_fss_GetShareMapping_args_in, (py_data_unpack_fn)unpack_py_fss_GetShareMapping_args_out, 10, &ndr_table_FileServerVssAgent }, { "fss_DeleteShareMapping", "S.fss_DeleteShareMapping(ShadowCopySetId, ShadowCopyId, ShareName) -> result", (py_dcerpc_call_fn)dcerpc_fss_DeleteShareMapping_r, (py_data_pack_fn)pack_py_fss_DeleteShareMapping_args_in, (py_data_unpack_fn)unpack_py_fss_DeleteShareMapping_args_out, 11, &ndr_table_FileServerVssAgent }, { "fss_PrepareShadowCopySet", "S.fss_PrepareShadowCopySet(ShadowCopySetId, TimeOutInMilliseconds) -> result", (py_dcerpc_call_fn)dcerpc_fss_PrepareShadowCopySet_r, (py_data_pack_fn)pack_py_fss_PrepareShadowCopySet_args_in, (py_data_unpack_fn)unpack_py_fss_PrepareShadowCopySet_args_out, 12, &ndr_table_FileServerVssAgent }, {0} }; static PyObject *interface_FileServerVssAgent_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_FileServerVssAgent); } #define PY_DOC_FILESERVERVSSAGENT "File Server Remote VSS Protocol" static PyTypeObject FileServerVssAgent_InterfaceType = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.FileServerVssAgent", .tp_basicsize = sizeof(dcerpc_InterfaceObject), .tp_doc = "FileServerVssAgent(binding, lp_ctx=None, credentials=None) -> connection\n" "\n" "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n" "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n" "credentials should be a credentials.Credentials object.\n\n"PY_DOC_FILESERVERVSSAGENT, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = interface_FileServerVssAgent_new, }; static PyObject *syntax_FileServerVssAgent_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_FileServerVssAgent.syntax_id); } #define PY_DOC_FILESERVERVSSAGENT_SYNTAX "File Server Remote VSS Protocol" static PyTypeObject FileServerVssAgent_SyntaxType = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "fsrvp.FileServerVssAgent_abstract_syntax", .tp_doc = "FileServerVssAgent_abstract_syntax()\n"PY_DOC_FILESERVERVSSAGENT_SYNTAX, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = syntax_FileServerVssAgent_new, }; static PyMethodDef fsrvp_methods[] = { { NULL, NULL, 0, NULL } }; static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, .m_name = "fsrvp", .m_doc = "fsrvp DCE/RPC", .m_size = -1, .m_methods = fsrvp_methods, }; MODULE_INIT_FUNC(fsrvp) { PyObject *m = NULL; PyObject *dep_samba_dcerpc_misc = NULL; PyObject *dep_talloc = NULL; PyObject *dep_samba_dcerpc_base = NULL; dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc"); if (dep_samba_dcerpc_misc == NULL) goto out; dep_talloc = PyImport_ImportModule("talloc"); if (dep_talloc == NULL) goto out; dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base"); if (dep_samba_dcerpc_base == NULL) goto out; GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID"); if (GUID_Type == NULL) goto out; BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject"); if (BaseObject_Type == NULL) goto out; ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection"); if (ClientConnection_Type == NULL) goto out; ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id"); if (ndr_syntax_id_Type == NULL) goto out; fssagent_share_mapping_1_Type.tp_base = BaseObject_Type; fssagent_share_mapping_1_Type.tp_basicsize = pytalloc_BaseObject_size(); fssagent_share_mapping_Type.tp_base = BaseObject_Type; fssagent_share_mapping_Type.tp_basicsize = pytalloc_BaseObject_size(); fss_GetSupportedVersion_Type.tp_base = BaseObject_Type; fss_GetSupportedVersion_Type.tp_basicsize = pytalloc_BaseObject_size(); fss_SetContext_Type.tp_base = BaseObject_Type; fss_SetContext_Type.tp_basicsize = pytalloc_BaseObject_size(); fss_StartShadowCopySet_Type.tp_base = BaseObject_Type; fss_StartShadowCopySet_Type.tp_basicsize = pytalloc_BaseObject_size(); fss_AddToShadowCopySet_Type.tp_base = BaseObject_Type; fss_AddToShadowCopySet_Type.tp_basicsize = pytalloc_BaseObject_size(); fss_CommitShadowCopySet_Type.tp_base = BaseObject_Type; fss_CommitShadowCopySet_Type.tp_basicsize = pytalloc_BaseObject_size(); fss_ExposeShadowCopySet_Type.tp_base = BaseObject_Type; fss_ExposeShadowCopySet_Type.tp_basicsize = pytalloc_BaseObject_size(); fss_RecoveryCompleteShadowCopySet_Type.tp_base = BaseObject_Type; fss_RecoveryCompleteShadowCopySet_Type.tp_basicsize = pytalloc_BaseObject_size(); fss_AbortShadowCopySet_Type.tp_base = BaseObject_Type; fss_AbortShadowCopySet_Type.tp_basicsize = pytalloc_BaseObject_size(); fss_IsPathSupported_Type.tp_base = BaseObject_Type; fss_IsPathSupported_Type.tp_basicsize = pytalloc_BaseObject_size(); fss_IsPathShadowCopied_Type.tp_base = BaseObject_Type; fss_IsPathShadowCopied_Type.tp_basicsize = pytalloc_BaseObject_size(); fss_GetShareMapping_Type.tp_base = BaseObject_Type; fss_GetShareMapping_Type.tp_basicsize = pytalloc_BaseObject_size(); fss_DeleteShareMapping_Type.tp_base = BaseObject_Type; fss_DeleteShareMapping_Type.tp_basicsize = pytalloc_BaseObject_size(); fss_PrepareShadowCopySet_Type.tp_base = BaseObject_Type; fss_PrepareShadowCopySet_Type.tp_basicsize = pytalloc_BaseObject_size(); FileServerVssAgent_InterfaceType.tp_base = ClientConnection_Type; FileServerVssAgent_SyntaxType.tp_base = ndr_syntax_id_Type; FileServerVssAgent_SyntaxType.tp_basicsize = pytalloc_BaseObject_size(); if (PyType_Ready(&fssagent_share_mapping_1_Type) < 0) goto out; if (PyType_Ready(&fssagent_share_mapping_Type) < 0) goto out; if (PyType_Ready(&fss_GetSupportedVersion_Type) < 0) goto out; if (PyType_Ready(&fss_SetContext_Type) < 0) goto out; if (PyType_Ready(&fss_StartShadowCopySet_Type) < 0) goto out; if (PyType_Ready(&fss_AddToShadowCopySet_Type) < 0) goto out; if (PyType_Ready(&fss_CommitShadowCopySet_Type) < 0) goto out; if (PyType_Ready(&fss_ExposeShadowCopySet_Type) < 0) goto out; if (PyType_Ready(&fss_RecoveryCompleteShadowCopySet_Type) < 0) goto out; if (PyType_Ready(&fss_AbortShadowCopySet_Type) < 0) goto out; if (PyType_Ready(&fss_IsPathSupported_Type) < 0) goto out; if (PyType_Ready(&fss_IsPathShadowCopied_Type) < 0) goto out; if (PyType_Ready(&fss_GetShareMapping_Type) < 0) goto out; if (PyType_Ready(&fss_DeleteShareMapping_Type) < 0) goto out; if (PyType_Ready(&fss_PrepareShadowCopySet_Type) < 0) goto out; if (PyType_Ready(&FileServerVssAgent_InterfaceType) < 0) goto out; if (PyType_Ready(&FileServerVssAgent_SyntaxType) < 0) goto out; if (!PyInterface_AddNdrRpcMethods(&FileServerVssAgent_InterfaceType, py_ndr_FileServerVssAgent_methods)) return NULL; #ifdef PY_FSSAGENT_SHARE_MAPPING_1_PATCH PY_FSSAGENT_SHARE_MAPPING_1_PATCH(&fssagent_share_mapping_1_Type); #endif #ifdef PY_FSSAGENT_SHARE_MAPPING_PATCH PY_FSSAGENT_SHARE_MAPPING_PATCH(&fssagent_share_mapping_Type); #endif #ifdef PY_FSS_GETSUPPORTEDVERSION_PATCH PY_FSS_GETSUPPORTEDVERSION_PATCH(&fss_GetSupportedVersion_Type); #endif #ifdef PY_FSS_SETCONTEXT_PATCH PY_FSS_SETCONTEXT_PATCH(&fss_SetContext_Type); #endif #ifdef PY_FSS_STARTSHADOWCOPYSET_PATCH PY_FSS_STARTSHADOWCOPYSET_PATCH(&fss_StartShadowCopySet_Type); #endif #ifdef PY_FSS_ADDTOSHADOWCOPYSET_PATCH PY_FSS_ADDTOSHADOWCOPYSET_PATCH(&fss_AddToShadowCopySet_Type); #endif #ifdef PY_FSS_COMMITSHADOWCOPYSET_PATCH PY_FSS_COMMITSHADOWCOPYSET_PATCH(&fss_CommitShadowCopySet_Type); #endif #ifdef PY_FSS_EXPOSESHADOWCOPYSET_PATCH PY_FSS_EXPOSESHADOWCOPYSET_PATCH(&fss_ExposeShadowCopySet_Type); #endif #ifdef PY_FSS_RECOVERYCOMPLETESHADOWCOPYSET_PATCH PY_FSS_RECOVERYCOMPLETESHADOWCOPYSET_PATCH(&fss_RecoveryCompleteShadowCopySet_Type); #endif #ifdef PY_FSS_ABORTSHADOWCOPYSET_PATCH PY_FSS_ABORTSHADOWCOPYSET_PATCH(&fss_AbortShadowCopySet_Type); #endif #ifdef PY_FSS_ISPATHSUPPORTED_PATCH PY_FSS_ISPATHSUPPORTED_PATCH(&fss_IsPathSupported_Type); #endif #ifdef PY_FSS_ISPATHSHADOWCOPIED_PATCH PY_FSS_ISPATHSHADOWCOPIED_PATCH(&fss_IsPathShadowCopied_Type); #endif #ifdef PY_FSS_GETSHAREMAPPING_PATCH PY_FSS_GETSHAREMAPPING_PATCH(&fss_GetShareMapping_Type); #endif #ifdef PY_FSS_DELETESHAREMAPPING_PATCH PY_FSS_DELETESHAREMAPPING_PATCH(&fss_DeleteShareMapping_Type); #endif #ifdef PY_FSS_PREPARESHADOWCOPYSET_PATCH PY_FSS_PREPARESHADOWCOPYSET_PATCH(&fss_PrepareShadowCopySet_Type); #endif #ifdef PY_FILESERVERVSSAGENT_PATCH PY_FILESERVERVSSAGENT_PATCH(&FileServerVssAgent_InterfaceType); #endif #ifdef PY_FILESERVERVSSAGENT_ABSTRACT_SYNTAX_PATCH PY_FILESERVERVSSAGENT_ABSTRACT_SYNTAX_PATCH(&FileServerVssAgent_SyntaxType); #endif #ifdef PY_ABSTRACT_SYNTAX_PATCH PY_ABSTRACT_SYNTAX_PATCH(&FileServerVssAgent_SyntaxType); #endif m = PyModule_Create(&moduledef); if (m == NULL) goto out; PyModule_AddObject(m, "FSRVP_E_BAD_STATE", PyLong_FromUnsignedLongLong(0x80042301)); PyModule_AddObject(m, "FSRVP_E_SHADOW_COPY_SET_IN_PROGRESS", PyLong_FromUnsignedLongLong(0x80042316)); PyModule_AddObject(m, "FSRVP_E_NOT_SUPPORTED", PyLong_FromUnsignedLongLong(0x8004230C)); PyModule_AddObject(m, "FSRVP_E_WAIT_TIMEOUT", PyLong_FromUnsignedLongLong(0x00000102)); PyModule_AddObject(m, "FSRVP_E_WAIT_FAILED", PyLong_FromUnsignedLongLong(0xFFFFFFFF)); PyModule_AddObject(m, "FSRVP_E_OBJECT_ALREADY_EXISTS", PyLong_FromUnsignedLongLong(0x8004230D)); PyModule_AddObject(m, "FSRVP_E_OBJECT_NOT_FOUND", PyLong_FromUnsignedLongLong(0x80042308)); PyModule_AddObject(m, "FSRVP_E_UNSUPPORTED_CONTEXT", PyLong_FromUnsignedLongLong(0x8004231B)); PyModule_AddObject(m, "FSRVP_E_BAD_ID", PyLong_FromUnsignedLongLong(0x80042302)); PyModule_AddObject(m, "FSRVP_E_SHADOWCOPYSET_ID_MISMATCH", PyLong_FromUnsignedLongLong(0x80042501)); PyModule_AddObject(m, "FSRVP_RPC_VERSION_1", PyLong_FromUnsignedLongLong(0x000000001)); PyModule_AddObject(m, "ATTR_PERSISTENT", PyLong_FromUnsignedLongLong(0x00000001)); PyModule_AddObject(m, "ATTR_NO_AUTO_RECOVERY", PyLong_FromUnsignedLongLong(0x00000002)); PyModule_AddObject(m, "ATTR_NO_AUTO_RELEASE", PyLong_FromUnsignedLongLong(0x00000008)); PyModule_AddObject(m, "ATTR_NO_WRITERS", PyLong_FromUnsignedLongLong(0x00000010)); PyModule_AddObject(m, "ATTR_FILE_SHARE", PyLong_FromUnsignedLongLong(0x04000000)); PyModule_AddObject(m, "ATTR_AUTO_RECOVERY", PyLong_FromUnsignedLongLong(0x00400000)); PyModule_AddObject(m, "FSRVP_CTX_BACKUP", PyLong_FromUnsignedLongLong(0x00000000)); PyModule_AddObject(m, "FSRVP_CTX_FILE_SHARE_BACKUP", PyLong_FromUnsignedLongLong(0x00000010)); PyModule_AddObject(m, "FSRVP_CTX_NAS_ROLLBACK", PyLong_FromUnsignedLongLong(0x00000019)); PyModule_AddObject(m, "FSRVP_CTX_APP_ROLLBACK", PyLong_FromUnsignedLongLong(0x00000009)); Py_INCREF((PyObject *)(void *)&fssagent_share_mapping_1_Type); PyModule_AddObject(m, "fssagent_share_mapping_1", (PyObject *)(void *)&fssagent_share_mapping_1_Type); Py_INCREF((PyObject *)(void *)&fssagent_share_mapping_Type); PyModule_AddObject(m, "fssagent_share_mapping", (PyObject *)(void *)&fssagent_share_mapping_Type); Py_INCREF((PyObject *)(void *)&fss_GetSupportedVersion_Type); PyModule_AddObject(m, "fss_GetSupportedVersion", (PyObject *)(void *)&fss_GetSupportedVersion_Type); Py_INCREF((PyObject *)(void *)&fss_SetContext_Type); PyModule_AddObject(m, "fss_SetContext", (PyObject *)(void *)&fss_SetContext_Type); Py_INCREF((PyObject *)(void *)&fss_StartShadowCopySet_Type); PyModule_AddObject(m, "fss_StartShadowCopySet", (PyObject *)(void *)&fss_StartShadowCopySet_Type); Py_INCREF((PyObject *)(void *)&fss_AddToShadowCopySet_Type); PyModule_AddObject(m, "fss_AddToShadowCopySet", (PyObject *)(void *)&fss_AddToShadowCopySet_Type); Py_INCREF((PyObject *)(void *)&fss_CommitShadowCopySet_Type); PyModule_AddObject(m, "fss_CommitShadowCopySet", (PyObject *)(void *)&fss_CommitShadowCopySet_Type); Py_INCREF((PyObject *)(void *)&fss_ExposeShadowCopySet_Type); PyModule_AddObject(m, "fss_ExposeShadowCopySet", (PyObject *)(void *)&fss_ExposeShadowCopySet_Type); Py_INCREF((PyObject *)(void *)&fss_RecoveryCompleteShadowCopySet_Type); PyModule_AddObject(m, "fss_RecoveryCompleteShadowCopySet", (PyObject *)(void *)&fss_RecoveryCompleteShadowCopySet_Type); Py_INCREF((PyObject *)(void *)&fss_AbortShadowCopySet_Type); PyModule_AddObject(m, "fss_AbortShadowCopySet", (PyObject *)(void *)&fss_AbortShadowCopySet_Type); Py_INCREF((PyObject *)(void *)&fss_IsPathSupported_Type); PyModule_AddObject(m, "fss_IsPathSupported", (PyObject *)(void *)&fss_IsPathSupported_Type); Py_INCREF((PyObject *)(void *)&fss_IsPathShadowCopied_Type); PyModule_AddObject(m, "fss_IsPathShadowCopied", (PyObject *)(void *)&fss_IsPathShadowCopied_Type); Py_INCREF((PyObject *)(void *)&fss_GetShareMapping_Type); PyModule_AddObject(m, "fss_GetShareMapping", (PyObject *)(void *)&fss_GetShareMapping_Type); Py_INCREF((PyObject *)(void *)&fss_DeleteShareMapping_Type); PyModule_AddObject(m, "fss_DeleteShareMapping", (PyObject *)(void *)&fss_DeleteShareMapping_Type); Py_INCREF((PyObject *)(void *)&fss_PrepareShadowCopySet_Type); PyModule_AddObject(m, "fss_PrepareShadowCopySet", (PyObject *)(void *)&fss_PrepareShadowCopySet_Type); Py_INCREF((PyObject *)(void *)&FileServerVssAgent_InterfaceType); PyModule_AddObject(m, "FileServerVssAgent", (PyObject *)(void *)&FileServerVssAgent_InterfaceType); Py_INCREF((PyObject *)(void *)&FileServerVssAgent_SyntaxType); PyModule_AddObject(m, "FileServerVssAgent_abstract_syntax", (PyObject *)(void *)&FileServerVssAgent_SyntaxType); Py_INCREF((PyObject *)(void *)&FileServerVssAgent_SyntaxType); PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&FileServerVssAgent_SyntaxType); #ifdef PY_MOD_FSRVP_PATCH PY_MOD_FSRVP_PATCH(m); #endif out: Py_XDECREF(dep_samba_dcerpc_misc); Py_XDECREF(dep_talloc); Py_XDECREF(dep_samba_dcerpc_base); return m; }