/* 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_samr.h" #include "bin/default/librpc/gen_ndr/ndr_samr_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" #include "librpc/gen_ndr/lsa.h" #include "librpc/gen_ndr/security.h" static PyTypeObject samr_SamEntry_Type; static PyTypeObject samr_SamArray_Type; static PyTypeObject samr_DomInfo1_Type; static PyTypeObject samr_DomGeneralInformation_Type; static PyTypeObject samr_DomInfo3_Type; static PyTypeObject samr_DomOEMInformation_Type; static PyTypeObject samr_DomInfo5_Type; static PyTypeObject samr_DomInfo6_Type; static PyTypeObject samr_DomInfo7_Type; static PyTypeObject samr_DomInfo8_Type; static PyTypeObject samr_DomInfo9_Type; static PyTypeObject samr_DomGeneralInformation2_Type; static PyTypeObject samr_DomInfo12_Type; static PyTypeObject samr_DomInfo13_Type; static PyTypeObject samr_DomainInfo_Type; static PyTypeObject samr_Ids_Type; static PyTypeObject samr_GroupInfoAll_Type; static PyTypeObject samr_GroupInfoAttributes_Type; static PyTypeObject samr_GroupInfoDescription_Type; static PyTypeObject samr_GroupInfo_Type; static PyTypeObject samr_RidAttrArray_Type; static PyTypeObject samr_AliasInfoAll_Type; static PyTypeObject samr_AliasInfo_Type; static PyTypeObject samr_UserInfo1_Type; static PyTypeObject samr_UserInfo2_Type; static PyTypeObject samr_LogonHours_Type; static PyTypeObject samr_UserInfo3_Type; static PyTypeObject samr_UserInfo4_Type; static PyTypeObject samr_UserInfo5_Type; static PyTypeObject samr_UserInfo6_Type; static PyTypeObject samr_UserInfo7_Type; static PyTypeObject samr_UserInfo8_Type; static PyTypeObject samr_UserInfo9_Type; static PyTypeObject samr_UserInfo10_Type; static PyTypeObject samr_UserInfo11_Type; static PyTypeObject samr_UserInfo12_Type; static PyTypeObject samr_UserInfo13_Type; static PyTypeObject samr_UserInfo14_Type; static PyTypeObject samr_UserInfo16_Type; static PyTypeObject samr_UserInfo17_Type; static PyTypeObject samr_Password_Type; static PyTypeObject samr_UserInfo18_Type; static PyTypeObject samr_UserInfo20_Type; static PyTypeObject samr_UserInfo21_Type; static PyTypeObject samr_CryptPassword_Type; static PyTypeObject samr_UserInfo23_Type; static PyTypeObject samr_UserInfo24_Type; static PyTypeObject samr_CryptPasswordEx_Type; static PyTypeObject samr_UserInfo25_Type; static PyTypeObject samr_UserInfo26_Type; static PyTypeObject samr_UserInfo_Type; static PyTypeObject samr_RidWithAttribute_Type; static PyTypeObject samr_RidWithAttributeArray_Type; static PyTypeObject samr_DispEntryGeneral_Type; static PyTypeObject samr_DispInfoGeneral_Type; static PyTypeObject samr_DispEntryFull_Type; static PyTypeObject samr_DispInfoFull_Type; static PyTypeObject samr_DispEntryFullGroup_Type; static PyTypeObject samr_DispInfoFullGroups_Type; static PyTypeObject samr_DispEntryAscii_Type; static PyTypeObject samr_DispInfoAscii_Type; static PyTypeObject samr_DispInfo_Type; static PyTypeObject samr_PwInfo_Type; static PyTypeObject userPwdChangeFailureInformation_Type; static PyTypeObject samr_ConnectInfo1_Type; static PyTypeObject samr_ConnectInfo_Type; static PyTypeObject samr_ValidationBlob_Type; static PyTypeObject samr_ValidatePasswordInfo_Type; static PyTypeObject samr_ValidatePasswordRepCtr_Type; static PyTypeObject samr_ValidatePasswordRep_Type; static PyTypeObject samr_ValidatePasswordReq3_Type; static PyTypeObject samr_ValidatePasswordReq2_Type; static PyTypeObject samr_ValidatePasswordReq1_Type; static PyTypeObject samr_ValidatePasswordReq_Type; static PyTypeObject samr_InterfaceType; static PyTypeObject samr_Connect_Type; static PyTypeObject samr_Close_Type; static PyTypeObject samr_SetSecurity_Type; static PyTypeObject samr_QuerySecurity_Type; static PyTypeObject samr_Shutdown_Type; static PyTypeObject samr_LookupDomain_Type; static PyTypeObject samr_EnumDomains_Type; static PyTypeObject samr_OpenDomain_Type; static PyTypeObject samr_QueryDomainInfo_Type; static PyTypeObject samr_SetDomainInfo_Type; static PyTypeObject samr_CreateDomainGroup_Type; static PyTypeObject samr_EnumDomainGroups_Type; static PyTypeObject samr_CreateUser_Type; static PyTypeObject samr_EnumDomainUsers_Type; static PyTypeObject samr_CreateDomAlias_Type; static PyTypeObject samr_EnumDomainAliases_Type; static PyTypeObject samr_GetAliasMembership_Type; static PyTypeObject samr_LookupNames_Type; static PyTypeObject samr_LookupRids_Type; static PyTypeObject samr_OpenGroup_Type; static PyTypeObject samr_QueryGroupInfo_Type; static PyTypeObject samr_SetGroupInfo_Type; static PyTypeObject samr_AddGroupMember_Type; static PyTypeObject samr_DeleteDomainGroup_Type; static PyTypeObject samr_DeleteGroupMember_Type; static PyTypeObject samr_QueryGroupMember_Type; static PyTypeObject samr_SetMemberAttributesOfGroup_Type; static PyTypeObject samr_OpenAlias_Type; static PyTypeObject samr_QueryAliasInfo_Type; static PyTypeObject samr_SetAliasInfo_Type; static PyTypeObject samr_DeleteDomAlias_Type; static PyTypeObject samr_AddAliasMember_Type; static PyTypeObject samr_DeleteAliasMember_Type; static PyTypeObject samr_GetMembersInAlias_Type; static PyTypeObject samr_OpenUser_Type; static PyTypeObject samr_DeleteUser_Type; static PyTypeObject samr_QueryUserInfo_Type; static PyTypeObject samr_SetUserInfo_Type; static PyTypeObject samr_ChangePasswordUser_Type; static PyTypeObject samr_GetGroupsForUser_Type; static PyTypeObject samr_QueryDisplayInfo_Type; static PyTypeObject samr_GetDisplayEnumerationIndex_Type; static PyTypeObject samr_TestPrivateFunctionsDomain_Type; static PyTypeObject samr_TestPrivateFunctionsUser_Type; static PyTypeObject samr_GetUserPwInfo_Type; static PyTypeObject samr_RemoveMemberFromForeignDomain_Type; static PyTypeObject samr_QueryDomainInfo2_Type; static PyTypeObject samr_QueryUserInfo2_Type; static PyTypeObject samr_QueryDisplayInfo2_Type; static PyTypeObject samr_GetDisplayEnumerationIndex2_Type; static PyTypeObject samr_CreateUser2_Type; static PyTypeObject samr_QueryDisplayInfo3_Type; static PyTypeObject samr_AddMultipleMembersToAlias_Type; static PyTypeObject samr_RemoveMultipleMembersFromAlias_Type; static PyTypeObject samr_OemChangePasswordUser2_Type; static PyTypeObject samr_ChangePasswordUser2_Type; static PyTypeObject samr_GetDomPwInfo_Type; static PyTypeObject samr_Connect2_Type; static PyTypeObject samr_SetUserInfo2_Type; static PyTypeObject samr_SetBootKeyInformation_Type; static PyTypeObject samr_GetBootKeyInformation_Type; static PyTypeObject samr_Connect3_Type; static PyTypeObject samr_Connect4_Type; static PyTypeObject samr_ChangePasswordUser3_Type; static PyTypeObject samr_Connect5_Type; static PyTypeObject samr_RidToSid_Type; static PyTypeObject samr_SetDsrmPassword_Type; static PyTypeObject samr_ValidatePassword_Type; static PyTypeObject *lsa_String_Type; static PyTypeObject *BaseObject_Type; static PyTypeObject *lsa_BinaryString_Type; static PyTypeObject *lsa_AsciiStringLarge_Type; static PyTypeObject *lsa_StringLarge_Type; static PyTypeObject *policy_handle_Type; static PyTypeObject *sec_desc_buf_Type; static PyTypeObject *dom_sid_Type; static PyTypeObject *lsa_SidArray_Type; static PyTypeObject *lsa_Strings_Type; static PyTypeObject *lsa_AsciiString_Type; static PyTypeObject *ClientConnection_Type; static PyTypeObject *ndr_syntax_id_Type; static PyObject *py_samr_SamEntry_get_idx(PyObject *obj, void *closure) { struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(obj); PyObject *py_idx; py_idx = PyLong_FromUnsignedLongLong((uint32_t)object->idx); return py_idx; } static int py_samr_SamEntry_set_idx(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idx"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idx)); 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->idx = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_SamEntry_get_name(PyObject *obj, void *closure) { struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(obj); PyObject *py_name; py_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name); return py_name; } static int py_samr_SamEntry_set_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_SamEntry_getsetters[] = { { .name = discard_const_p(char, "idx"), .get = py_samr_SamEntry_get_idx, .set = py_samr_SamEntry_set_idx, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "name"), .get = py_samr_SamEntry_get_name, .set = py_samr_SamEntry_set_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_SamEntry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_SamEntry, type); } static PyTypeObject samr_SamEntry_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.SamEntry", .tp_getset = py_samr_SamEntry_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_SamEntry_new, }; static PyObject *py_samr_SamArray_get_count(PyObject *obj, void *closure) { struct samr_SamArray *object = (struct samr_SamArray *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_samr_SamArray_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SamArray *object = (struct samr_SamArray *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); 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->count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_SamArray_get_entries(PyObject *obj, void *closure) { struct samr_SamArray *object = (struct samr_SamArray *)pytalloc_get_ptr(obj); PyObject *py_entries; if (object->entries == NULL) { Py_RETURN_NONE; } if (object->entries == NULL) { py_entries = Py_None; Py_INCREF(py_entries); } else { py_entries = PyList_New(object->count); if (py_entries == NULL) { return NULL; } { int entries_cntr_1; for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) { PyObject *py_entries_1; py_entries_1 = pytalloc_reference_ex(&samr_SamEntry_Type, object->entries, &object->entries[entries_cntr_1]); PyList_SetItem(py_entries, entries_cntr_1, py_entries_1); } } } return py_entries; } static int py_samr_SamArray_set_entries(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SamArray *object = (struct samr_SamArray *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries"); return -1; } if (value == Py_None) { object->entries = NULL; } else { object->entries = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int entries_cntr_1; object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value)); if (!object->entries) { return -1;; } talloc_set_name_const(object->entries, "ARRAY: object->entries"); for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) { if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]"); return -1; } PY_CHECK_TYPE(&samr_SamEntry_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;); if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->entries[entries_cntr_1] = *(struct samr_SamEntry *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1)); } } } return 0; } static PyGetSetDef py_samr_SamArray_getsetters[] = { { .name = discard_const_p(char, "count"), .get = py_samr_SamArray_get_count, .set = py_samr_SamArray_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "entries"), .get = py_samr_SamArray_get_entries, .set = py_samr_SamArray_set_entries, .doc = discard_const_p(char, "PIDL-generated element of base type samr_SamEntry") }, { .name = NULL } }; static PyObject *py_samr_SamArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_SamArray, type); } static PyTypeObject samr_SamArray_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.SamArray", .tp_getset = py_samr_SamArray_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_SamArray_new, }; static PyObject *py_samr_DomInfo1_get_min_password_length(PyObject *obj, void *closure) { struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj); PyObject *py_min_password_length; py_min_password_length = PyLong_FromLong((uint16_t)object->min_password_length); return py_min_password_length; } static int py_samr_DomInfo1_set_min_password_length(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->min_password_length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_password_length)); 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->min_password_length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomInfo1_get_password_history_length(PyObject *obj, void *closure) { struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj); PyObject *py_password_history_length; py_password_history_length = PyLong_FromLong((uint16_t)object->password_history_length); return py_password_history_length; } static int py_samr_DomInfo1_set_password_history_length(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_history_length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_history_length)); 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->password_history_length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomInfo1_get_password_properties(PyObject *obj, void *closure) { struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj); PyObject *py_password_properties; py_password_properties = PyLong_FromUnsignedLongLong((uint32_t)object->password_properties); return py_password_properties; } static int py_samr_DomInfo1_set_password_properties(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_properties"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_properties)); 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->password_properties = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomInfo1_get_max_password_age(PyObject *obj, void *closure) { struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj); PyObject *py_max_password_age; py_max_password_age = PyLong_FromLongLong(object->max_password_age); return py_max_password_age; } static int py_samr_DomInfo1_set_max_password_age(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_password_age"); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(object->max_password_age)); 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->max_password_age = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomInfo1_get_min_password_age(PyObject *obj, void *closure) { struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj); PyObject *py_min_password_age; py_min_password_age = PyLong_FromLongLong(object->min_password_age); return py_min_password_age; } static int py_samr_DomInfo1_set_min_password_age(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->min_password_age"); return -1; } { const long long int_max = ndr_sizeof2intmax(sizeof(object->min_password_age)); 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->min_password_age = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_DomInfo1_getsetters[] = { { .name = discard_const_p(char, "min_password_length"), .get = py_samr_DomInfo1_get_min_password_length, .set = py_samr_DomInfo1_set_min_password_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "password_history_length"), .get = py_samr_DomInfo1_get_password_history_length, .set = py_samr_DomInfo1_set_password_history_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "password_properties"), .get = py_samr_DomInfo1_get_password_properties, .set = py_samr_DomInfo1_set_password_properties, .doc = discard_const_p(char, "PIDL-generated element of base type samr_PasswordProperties") }, { .name = discard_const_p(char, "max_password_age"), .get = py_samr_DomInfo1_get_max_password_age, .set = py_samr_DomInfo1_set_max_password_age, .doc = discard_const_p(char, "PIDL-generated element of base type dlong") }, { .name = discard_const_p(char, "min_password_age"), .get = py_samr_DomInfo1_get_min_password_age, .set = py_samr_DomInfo1_set_min_password_age, .doc = discard_const_p(char, "PIDL-generated element of base type dlong") }, { .name = NULL } }; static PyObject *py_samr_DomInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DomInfo1, type); } static PyTypeObject samr_DomInfo1_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DomInfo1", .tp_getset = py_samr_DomInfo1_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DomInfo1_new, }; static PyObject *py_samr_DomGeneralInformation_get_force_logoff_time(PyObject *obj, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj); PyObject *py_force_logoff_time; py_force_logoff_time = PyLong_FromUnsignedLongLong(object->force_logoff_time); return py_force_logoff_time; } static int py_samr_DomGeneralInformation_set_force_logoff_time(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->force_logoff_time"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->force_logoff_time)); 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->force_logoff_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomGeneralInformation_get_oem_information(PyObject *obj, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj); PyObject *py_oem_information; py_oem_information = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->oem_information); return py_oem_information; } static int py_samr_DomGeneralInformation_set_oem_information(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->oem_information"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->oem_information = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DomGeneralInformation_get_domain_name(PyObject *obj, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj); PyObject *py_domain_name; py_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->domain_name); return py_domain_name; } static int py_samr_DomGeneralInformation_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DomGeneralInformation_get_primary(PyObject *obj, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj); PyObject *py_primary; py_primary = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->primary); return py_primary; } static int py_samr_DomGeneralInformation_set_primary(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->primary = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DomGeneralInformation_get_sequence_num(PyObject *obj, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj); PyObject *py_sequence_num; py_sequence_num = PyLong_FromUnsignedLongLong(object->sequence_num); return py_sequence_num; } static int py_samr_DomGeneralInformation_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sequence_num"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sequence_num)); 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->sequence_num = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomGeneralInformation_get_domain_server_state(PyObject *obj, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj); PyObject *py_domain_server_state; py_domain_server_state = PyLong_FromUnsignedLongLong((uint32_t)object->domain_server_state); return py_domain_server_state; } static int py_samr_DomGeneralInformation_set_domain_server_state(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_server_state"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_server_state)); 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->domain_server_state = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomGeneralInformation_get_role(PyObject *obj, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj); PyObject *py_role; py_role = PyLong_FromUnsignedLongLong((uint32_t)object->role); return py_role; } static int py_samr_DomGeneralInformation_set_role(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->role"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->role)); 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->role = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomGeneralInformation_get_unknown3(PyObject *obj, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown3); return py_unknown3; } static int py_samr_DomGeneralInformation_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown3)); 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->unknown3 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomGeneralInformation_get_num_users(PyObject *obj, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj); PyObject *py_num_users; py_num_users = PyLong_FromUnsignedLongLong((uint32_t)object->num_users); return py_num_users; } static int py_samr_DomGeneralInformation_set_num_users(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_users"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_users)); 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->num_users = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomGeneralInformation_get_num_groups(PyObject *obj, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj); PyObject *py_num_groups; py_num_groups = PyLong_FromUnsignedLongLong((uint32_t)object->num_groups); return py_num_groups; } static int py_samr_DomGeneralInformation_set_num_groups(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_groups"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_groups)); 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->num_groups = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomGeneralInformation_get_num_aliases(PyObject *obj, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj); PyObject *py_num_aliases; py_num_aliases = PyLong_FromUnsignedLongLong((uint32_t)object->num_aliases); return py_num_aliases; } static int py_samr_DomGeneralInformation_set_num_aliases(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_aliases"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_aliases)); 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->num_aliases = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_DomGeneralInformation_getsetters[] = { { .name = discard_const_p(char, "force_logoff_time"), .get = py_samr_DomGeneralInformation_get_force_logoff_time, .set = py_samr_DomGeneralInformation_set_force_logoff_time, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "oem_information"), .get = py_samr_DomGeneralInformation_get_oem_information, .set = py_samr_DomGeneralInformation_set_oem_information, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "domain_name"), .get = py_samr_DomGeneralInformation_get_domain_name, .set = py_samr_DomGeneralInformation_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "primary"), .get = py_samr_DomGeneralInformation_get_primary, .set = py_samr_DomGeneralInformation_set_primary, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "sequence_num"), .get = py_samr_DomGeneralInformation_get_sequence_num, .set = py_samr_DomGeneralInformation_set_sequence_num, .doc = discard_const_p(char, "PIDL-generated element of base type udlong") }, { .name = discard_const_p(char, "domain_server_state"), .get = py_samr_DomGeneralInformation_get_domain_server_state, .set = py_samr_DomGeneralInformation_set_domain_server_state, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainServerState") }, { .name = discard_const_p(char, "role"), .get = py_samr_DomGeneralInformation_get_role, .set = py_samr_DomGeneralInformation_set_role, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Role") }, { .name = discard_const_p(char, "unknown3"), .get = py_samr_DomGeneralInformation_get_unknown3, .set = py_samr_DomGeneralInformation_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "num_users"), .get = py_samr_DomGeneralInformation_get_num_users, .set = py_samr_DomGeneralInformation_set_num_users, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "num_groups"), .get = py_samr_DomGeneralInformation_get_num_groups, .set = py_samr_DomGeneralInformation_set_num_groups, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "num_aliases"), .get = py_samr_DomGeneralInformation_get_num_aliases, .set = py_samr_DomGeneralInformation_set_num_aliases, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_samr_DomGeneralInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DomGeneralInformation, type); } static PyTypeObject samr_DomGeneralInformation_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DomGeneralInformation", .tp_getset = py_samr_DomGeneralInformation_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DomGeneralInformation_new, }; static PyObject *py_samr_DomInfo3_get_force_logoff_time(PyObject *obj, void *closure) { struct samr_DomInfo3 *object = (struct samr_DomInfo3 *)pytalloc_get_ptr(obj); PyObject *py_force_logoff_time; py_force_logoff_time = PyLong_FromUnsignedLongLong(object->force_logoff_time); return py_force_logoff_time; } static int py_samr_DomInfo3_set_force_logoff_time(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo3 *object = (struct samr_DomInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->force_logoff_time"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->force_logoff_time)); 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->force_logoff_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_DomInfo3_getsetters[] = { { .name = discard_const_p(char, "force_logoff_time"), .get = py_samr_DomInfo3_get_force_logoff_time, .set = py_samr_DomInfo3_set_force_logoff_time, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = NULL } }; static PyObject *py_samr_DomInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DomInfo3, type); } static PyTypeObject samr_DomInfo3_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DomInfo3", .tp_getset = py_samr_DomInfo3_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DomInfo3_new, }; static PyObject *py_samr_DomOEMInformation_get_oem_information(PyObject *obj, void *closure) { struct samr_DomOEMInformation *object = (struct samr_DomOEMInformation *)pytalloc_get_ptr(obj); PyObject *py_oem_information; py_oem_information = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->oem_information); return py_oem_information; } static int py_samr_DomOEMInformation_set_oem_information(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomOEMInformation *object = (struct samr_DomOEMInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->oem_information"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->oem_information = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_DomOEMInformation_getsetters[] = { { .name = discard_const_p(char, "oem_information"), .get = py_samr_DomOEMInformation_get_oem_information, .set = py_samr_DomOEMInformation_set_oem_information, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_DomOEMInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DomOEMInformation, type); } static PyTypeObject samr_DomOEMInformation_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DomOEMInformation", .tp_getset = py_samr_DomOEMInformation_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DomOEMInformation_new, }; static PyObject *py_samr_DomInfo5_get_domain_name(PyObject *obj, void *closure) { struct samr_DomInfo5 *object = (struct samr_DomInfo5 *)pytalloc_get_ptr(obj); PyObject *py_domain_name; py_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->domain_name); return py_domain_name; } static int py_samr_DomInfo5_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo5 *object = (struct samr_DomInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_DomInfo5_getsetters[] = { { .name = discard_const_p(char, "domain_name"), .get = py_samr_DomInfo5_get_domain_name, .set = py_samr_DomInfo5_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_DomInfo5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DomInfo5, type); } static PyTypeObject samr_DomInfo5_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DomInfo5", .tp_getset = py_samr_DomInfo5_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DomInfo5_new, }; static PyObject *py_samr_DomInfo6_get_primary(PyObject *obj, void *closure) { struct samr_DomInfo6 *object = (struct samr_DomInfo6 *)pytalloc_get_ptr(obj); PyObject *py_primary; py_primary = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->primary); return py_primary; } static int py_samr_DomInfo6_set_primary(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo6 *object = (struct samr_DomInfo6 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->primary = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_DomInfo6_getsetters[] = { { .name = discard_const_p(char, "primary"), .get = py_samr_DomInfo6_get_primary, .set = py_samr_DomInfo6_set_primary, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_DomInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DomInfo6, type); } static PyTypeObject samr_DomInfo6_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DomInfo6", .tp_getset = py_samr_DomInfo6_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DomInfo6_new, }; static PyObject *py_samr_DomInfo7_get_role(PyObject *obj, void *closure) { struct samr_DomInfo7 *object = (struct samr_DomInfo7 *)pytalloc_get_ptr(obj); PyObject *py_role; py_role = PyLong_FromUnsignedLongLong((uint32_t)object->role); return py_role; } static int py_samr_DomInfo7_set_role(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo7 *object = (struct samr_DomInfo7 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->role"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->role)); 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->role = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_DomInfo7_getsetters[] = { { .name = discard_const_p(char, "role"), .get = py_samr_DomInfo7_get_role, .set = py_samr_DomInfo7_set_role, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Role") }, { .name = NULL } }; static PyObject *py_samr_DomInfo7_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DomInfo7, type); } static PyTypeObject samr_DomInfo7_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DomInfo7", .tp_getset = py_samr_DomInfo7_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DomInfo7_new, }; static PyObject *py_samr_DomInfo8_get_sequence_num(PyObject *obj, void *closure) { struct samr_DomInfo8 *object = (struct samr_DomInfo8 *)pytalloc_get_ptr(obj); PyObject *py_sequence_num; py_sequence_num = PyLong_FromUnsignedLongLong(object->sequence_num); return py_sequence_num; } static int py_samr_DomInfo8_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo8 *object = (struct samr_DomInfo8 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sequence_num"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sequence_num)); 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->sequence_num = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomInfo8_get_domain_create_time(PyObject *obj, void *closure) { struct samr_DomInfo8 *object = (struct samr_DomInfo8 *)pytalloc_get_ptr(obj); PyObject *py_domain_create_time; py_domain_create_time = PyLong_FromUnsignedLongLong(object->domain_create_time); return py_domain_create_time; } static int py_samr_DomInfo8_set_domain_create_time(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo8 *object = (struct samr_DomInfo8 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_create_time"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_create_time)); 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->domain_create_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_DomInfo8_getsetters[] = { { .name = discard_const_p(char, "sequence_num"), .get = py_samr_DomInfo8_get_sequence_num, .set = py_samr_DomInfo8_set_sequence_num, .doc = discard_const_p(char, "PIDL-generated element of base type hyper") }, { .name = discard_const_p(char, "domain_create_time"), .get = py_samr_DomInfo8_get_domain_create_time, .set = py_samr_DomInfo8_set_domain_create_time, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = NULL } }; static PyObject *py_samr_DomInfo8_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DomInfo8, type); } static PyTypeObject samr_DomInfo8_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DomInfo8", .tp_getset = py_samr_DomInfo8_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DomInfo8_new, }; static PyObject *py_samr_DomInfo9_get_domain_server_state(PyObject *obj, void *closure) { struct samr_DomInfo9 *object = (struct samr_DomInfo9 *)pytalloc_get_ptr(obj); PyObject *py_domain_server_state; py_domain_server_state = PyLong_FromUnsignedLongLong((uint32_t)object->domain_server_state); return py_domain_server_state; } static int py_samr_DomInfo9_set_domain_server_state(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo9 *object = (struct samr_DomInfo9 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_server_state"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_server_state)); 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->domain_server_state = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_DomInfo9_getsetters[] = { { .name = discard_const_p(char, "domain_server_state"), .get = py_samr_DomInfo9_get_domain_server_state, .set = py_samr_DomInfo9_set_domain_server_state, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainServerState") }, { .name = NULL } }; static PyObject *py_samr_DomInfo9_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DomInfo9, type); } static PyTypeObject samr_DomInfo9_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DomInfo9", .tp_getset = py_samr_DomInfo9_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DomInfo9_new, }; static PyObject *py_samr_DomGeneralInformation2_get_general(PyObject *obj, void *closure) { struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(obj); PyObject *py_general; py_general = pytalloc_reference_ex(&samr_DomGeneralInformation_Type, pytalloc_get_mem_ctx(obj), &object->general); return py_general; } static int py_samr_DomGeneralInformation2_set_general(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->general"); return -1; } PY_CHECK_TYPE(&samr_DomGeneralInformation_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->general = *(struct samr_DomGeneralInformation *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DomGeneralInformation2_get_lockout_duration(PyObject *obj, void *closure) { struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(obj); PyObject *py_lockout_duration; py_lockout_duration = PyLong_FromUnsignedLongLong(object->lockout_duration); return py_lockout_duration; } static int py_samr_DomGeneralInformation2_set_lockout_duration(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_duration"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_duration)); 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->lockout_duration = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomGeneralInformation2_get_lockout_window(PyObject *obj, void *closure) { struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(obj); PyObject *py_lockout_window; py_lockout_window = PyLong_FromUnsignedLongLong(object->lockout_window); return py_lockout_window; } static int py_samr_DomGeneralInformation2_set_lockout_window(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_window"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_window)); 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->lockout_window = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomGeneralInformation2_get_lockout_threshold(PyObject *obj, void *closure) { struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(obj); PyObject *py_lockout_threshold; py_lockout_threshold = PyLong_FromLong((uint16_t)object->lockout_threshold); return py_lockout_threshold; } static int py_samr_DomGeneralInformation2_set_lockout_threshold(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_threshold"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_threshold)); 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->lockout_threshold = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_DomGeneralInformation2_getsetters[] = { { .name = discard_const_p(char, "general"), .get = py_samr_DomGeneralInformation2_get_general, .set = py_samr_DomGeneralInformation2_set_general, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomGeneralInformation") }, { .name = discard_const_p(char, "lockout_duration"), .get = py_samr_DomGeneralInformation2_get_lockout_duration, .set = py_samr_DomGeneralInformation2_set_lockout_duration, .doc = discard_const_p(char, "PIDL-generated element of base type hyper") }, { .name = discard_const_p(char, "lockout_window"), .get = py_samr_DomGeneralInformation2_get_lockout_window, .set = py_samr_DomGeneralInformation2_set_lockout_window, .doc = discard_const_p(char, "PIDL-generated element of base type hyper") }, { .name = discard_const_p(char, "lockout_threshold"), .get = py_samr_DomGeneralInformation2_get_lockout_threshold, .set = py_samr_DomGeneralInformation2_set_lockout_threshold, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = NULL } }; static PyObject *py_samr_DomGeneralInformation2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DomGeneralInformation2, type); } static PyTypeObject samr_DomGeneralInformation2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DomGeneralInformation2", .tp_getset = py_samr_DomGeneralInformation2_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DomGeneralInformation2_new, }; static PyObject *py_samr_DomInfo12_get_lockout_duration(PyObject *obj, void *closure) { struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(obj); PyObject *py_lockout_duration; py_lockout_duration = PyLong_FromUnsignedLongLong(object->lockout_duration); return py_lockout_duration; } static int py_samr_DomInfo12_set_lockout_duration(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_duration"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_duration)); 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->lockout_duration = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomInfo12_get_lockout_window(PyObject *obj, void *closure) { struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(obj); PyObject *py_lockout_window; py_lockout_window = PyLong_FromUnsignedLongLong(object->lockout_window); return py_lockout_window; } static int py_samr_DomInfo12_set_lockout_window(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_window"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_window)); 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->lockout_window = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomInfo12_get_lockout_threshold(PyObject *obj, void *closure) { struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(obj); PyObject *py_lockout_threshold; py_lockout_threshold = PyLong_FromLong((uint16_t)object->lockout_threshold); return py_lockout_threshold; } static int py_samr_DomInfo12_set_lockout_threshold(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_threshold"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_threshold)); 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->lockout_threshold = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_DomInfo12_getsetters[] = { { .name = discard_const_p(char, "lockout_duration"), .get = py_samr_DomInfo12_get_lockout_duration, .set = py_samr_DomInfo12_set_lockout_duration, .doc = discard_const_p(char, "PIDL-generated element of base type hyper") }, { .name = discard_const_p(char, "lockout_window"), .get = py_samr_DomInfo12_get_lockout_window, .set = py_samr_DomInfo12_set_lockout_window, .doc = discard_const_p(char, "PIDL-generated element of base type hyper") }, { .name = discard_const_p(char, "lockout_threshold"), .get = py_samr_DomInfo12_get_lockout_threshold, .set = py_samr_DomInfo12_set_lockout_threshold, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = NULL } }; static PyObject *py_samr_DomInfo12_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DomInfo12, type); } static PyTypeObject samr_DomInfo12_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DomInfo12", .tp_getset = py_samr_DomInfo12_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DomInfo12_new, }; static PyObject *py_samr_DomInfo13_get_sequence_num(PyObject *obj, void *closure) { struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(obj); PyObject *py_sequence_num; py_sequence_num = PyLong_FromUnsignedLongLong(object->sequence_num); return py_sequence_num; } static int py_samr_DomInfo13_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sequence_num"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sequence_num)); 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->sequence_num = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomInfo13_get_domain_create_time(PyObject *obj, void *closure) { struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(obj); PyObject *py_domain_create_time; py_domain_create_time = PyLong_FromUnsignedLongLong(object->domain_create_time); return py_domain_create_time; } static int py_samr_DomInfo13_set_domain_create_time(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_create_time"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_create_time)); 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->domain_create_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DomInfo13_get_modified_count_at_last_promotion(PyObject *obj, void *closure) { struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(obj); PyObject *py_modified_count_at_last_promotion; py_modified_count_at_last_promotion = PyLong_FromUnsignedLongLong(object->modified_count_at_last_promotion); return py_modified_count_at_last_promotion; } static int py_samr_DomInfo13_set_modified_count_at_last_promotion(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->modified_count_at_last_promotion"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->modified_count_at_last_promotion)); 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->modified_count_at_last_promotion = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_DomInfo13_getsetters[] = { { .name = discard_const_p(char, "sequence_num"), .get = py_samr_DomInfo13_get_sequence_num, .set = py_samr_DomInfo13_set_sequence_num, .doc = discard_const_p(char, "PIDL-generated element of base type hyper") }, { .name = discard_const_p(char, "domain_create_time"), .get = py_samr_DomInfo13_get_domain_create_time, .set = py_samr_DomInfo13_set_domain_create_time, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "modified_count_at_last_promotion"), .get = py_samr_DomInfo13_get_modified_count_at_last_promotion, .set = py_samr_DomInfo13_set_modified_count_at_last_promotion, .doc = discard_const_p(char, "PIDL-generated element of base type hyper") }, { .name = NULL } }; static PyObject *py_samr_DomInfo13_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DomInfo13, type); } static PyTypeObject samr_DomInfo13_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DomInfo13", .tp_getset = py_samr_DomInfo13_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DomInfo13_new, }; static PyObject *py_import_samr_DomainInfo(TALLOC_CTX *mem_ctx, int level, union samr_DomainInfo *in) { PyObject *ret; switch (level) { case 1: ret = pytalloc_reference_ex(&samr_DomInfo1_Type, mem_ctx, &in->info1); return ret; case 2: ret = pytalloc_reference_ex(&samr_DomGeneralInformation_Type, mem_ctx, &in->general); return ret; case 3: ret = pytalloc_reference_ex(&samr_DomInfo3_Type, mem_ctx, &in->info3); return ret; case 4: ret = pytalloc_reference_ex(&samr_DomOEMInformation_Type, mem_ctx, &in->oem); return ret; case 5: ret = pytalloc_reference_ex(&samr_DomInfo5_Type, mem_ctx, &in->info5); return ret; case 6: ret = pytalloc_reference_ex(&samr_DomInfo6_Type, mem_ctx, &in->info6); return ret; case 7: ret = pytalloc_reference_ex(&samr_DomInfo7_Type, mem_ctx, &in->info7); return ret; case 8: ret = pytalloc_reference_ex(&samr_DomInfo8_Type, mem_ctx, &in->info8); return ret; case 9: ret = pytalloc_reference_ex(&samr_DomInfo9_Type, mem_ctx, &in->info9); return ret; case 11: ret = pytalloc_reference_ex(&samr_DomGeneralInformation2_Type, mem_ctx, &in->general2); return ret; case 12: ret = pytalloc_reference_ex(&samr_DomInfo12_Type, mem_ctx, &in->info12); return ret; case 13: ret = pytalloc_reference_ex(&samr_DomInfo13_Type, mem_ctx, &in->info13); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union samr_DomainInfo *py_export_samr_DomainInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union samr_DomainInfo *ret = talloc_zero(mem_ctx, union samr_DomainInfo); switch (level) { case 1: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DomInfo1_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->info1 = *(struct samr_DomInfo1 *)pytalloc_get_ptr(in); break; case 2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->general"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DomGeneralInformation_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->general = *(struct samr_DomGeneralInformation *)pytalloc_get_ptr(in); break; case 3: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info3"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DomInfo3_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->info3 = *(struct samr_DomInfo3 *)pytalloc_get_ptr(in); break; case 4: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->oem"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DomOEMInformation_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->oem = *(struct samr_DomOEMInformation *)pytalloc_get_ptr(in); break; case 5: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info5"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DomInfo5_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->info5 = *(struct samr_DomInfo5 *)pytalloc_get_ptr(in); break; case 6: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info6"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DomInfo6_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->info6 = *(struct samr_DomInfo6 *)pytalloc_get_ptr(in); break; case 7: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info7"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DomInfo7_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->info7 = *(struct samr_DomInfo7 *)pytalloc_get_ptr(in); break; case 8: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info8"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DomInfo8_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->info8 = *(struct samr_DomInfo8 *)pytalloc_get_ptr(in); break; case 9: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info9"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DomInfo9_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->info9 = *(struct samr_DomInfo9 *)pytalloc_get_ptr(in); break; case 11: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->general2"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DomGeneralInformation2_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->general2 = *(struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(in); break; case 12: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info12"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DomInfo12_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->info12 = *(struct samr_DomInfo12 *)pytalloc_get_ptr(in); break; case 13: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info13"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DomInfo13_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->info13 = *(struct samr_DomInfo13 *)pytalloc_get_ptr(in); break; default: PyErr_SetString(PyExc_TypeError, "invalid union level value"); talloc_free(ret); ret = NULL; } return ret; } static PyObject *py_samr_DomainInfo_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 samr_DomainInfo *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 samr_DomainInfo *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_DomainInfo!"); return NULL; } return py_import_samr_DomainInfo(mem_ctx, level, in); } static PyObject *py_samr_DomainInfo_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 samr_DomainInfo *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_samr_DomainInfo(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_samr_DomainInfo_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DomainInfo_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DomainInfo_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_samr_DomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject samr_DomainInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DomainInfo", .tp_getset = NULL, .tp_methods = py_samr_DomainInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DomainInfo_new, }; static PyObject *py_samr_Ids_get_count(PyObject *obj, void *closure) { struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_samr_Ids_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); 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->count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_Ids_get_ids(PyObject *obj, void *closure) { struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(obj); PyObject *py_ids; if (object->ids == NULL) { Py_RETURN_NONE; } if (object->ids == NULL) { py_ids = Py_None; Py_INCREF(py_ids); } else { py_ids = PyList_New(object->count); if (py_ids == NULL) { return NULL; } { int ids_cntr_1; for (ids_cntr_1 = 0; ids_cntr_1 < (object->count); ids_cntr_1++) { PyObject *py_ids_1; py_ids_1 = PyLong_FromUnsignedLongLong((uint32_t)object->ids[ids_cntr_1]); PyList_SetItem(py_ids, ids_cntr_1, py_ids_1); } } } return py_ids; } static int py_samr_Ids_set_ids(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->ids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ids"); return -1; } if (value == Py_None) { object->ids = NULL; } else { object->ids = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int ids_cntr_1; object->ids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->ids, PyList_GET_SIZE(value)); if (!object->ids) { return -1;; } talloc_set_name_const(object->ids, "ARRAY: object->ids"); for (ids_cntr_1 = 0; ids_cntr_1 < PyList_GET_SIZE(value); ids_cntr_1++) { if (PyList_GET_ITEM(value, ids_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ids[ids_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ids[ids_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, ids_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, ids_cntr_1)); 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->ids[ids_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyGetSetDef py_samr_Ids_getsetters[] = { { .name = discard_const_p(char, "count"), .get = py_samr_Ids_get_count, .set = py_samr_Ids_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "ids"), .get = py_samr_Ids_get_ids, .set = py_samr_Ids_set_ids, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_samr_Ids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_Ids, type); } static PyTypeObject samr_Ids_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.Ids", .tp_getset = py_samr_Ids_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_Ids_new, }; static PyObject *py_samr_GroupInfoAll_get_name(PyObject *obj, void *closure) { struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(obj); PyObject *py_name; py_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name); return py_name; } static int py_samr_GroupInfoAll_set_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GroupInfoAll_get_attributes(PyObject *obj, void *closure) { struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(obj); PyObject *py_attributes; py_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->attributes); return py_attributes; } static int py_samr_GroupInfoAll_set_attributes(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes)); 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->attributes = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_GroupInfoAll_get_num_members(PyObject *obj, void *closure) { struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(obj); PyObject *py_num_members; py_num_members = PyLong_FromUnsignedLongLong((uint32_t)object->num_members); return py_num_members; } static int py_samr_GroupInfoAll_set_num_members(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_members"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_members)); 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->num_members = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_GroupInfoAll_get_description(PyObject *obj, void *closure) { struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(obj); PyObject *py_description; py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description); return py_description; } static int py_samr_GroupInfoAll_set_description(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->description = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_GroupInfoAll_getsetters[] = { { .name = discard_const_p(char, "name"), .get = py_samr_GroupInfoAll_get_name, .set = py_samr_GroupInfoAll_set_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "attributes"), .get = py_samr_GroupInfoAll_get_attributes, .set = py_samr_GroupInfoAll_set_attributes, .doc = discard_const_p(char, "PIDL-generated element of base type security_GroupAttrs") }, { .name = discard_const_p(char, "num_members"), .get = py_samr_GroupInfoAll_get_num_members, .set = py_samr_GroupInfoAll_set_num_members, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "description"), .get = py_samr_GroupInfoAll_get_description, .set = py_samr_GroupInfoAll_set_description, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_GroupInfoAll_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_GroupInfoAll, type); } static PyTypeObject samr_GroupInfoAll_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.GroupInfoAll", .tp_getset = py_samr_GroupInfoAll_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_GroupInfoAll_new, }; static PyObject *py_samr_GroupInfoAttributes_get_attributes(PyObject *obj, void *closure) { struct samr_GroupInfoAttributes *object = (struct samr_GroupInfoAttributes *)pytalloc_get_ptr(obj); PyObject *py_attributes; py_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->attributes); return py_attributes; } static int py_samr_GroupInfoAttributes_set_attributes(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GroupInfoAttributes *object = (struct samr_GroupInfoAttributes *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes)); 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->attributes = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_GroupInfoAttributes_getsetters[] = { { .name = discard_const_p(char, "attributes"), .get = py_samr_GroupInfoAttributes_get_attributes, .set = py_samr_GroupInfoAttributes_set_attributes, .doc = discard_const_p(char, "PIDL-generated element of base type security_GroupAttrs") }, { .name = NULL } }; static PyObject *py_samr_GroupInfoAttributes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_GroupInfoAttributes, type); } static PyTypeObject samr_GroupInfoAttributes_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.GroupInfoAttributes", .tp_getset = py_samr_GroupInfoAttributes_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_GroupInfoAttributes_new, }; static PyObject *py_samr_GroupInfoDescription_get_description(PyObject *obj, void *closure) { struct samr_GroupInfoDescription *object = (struct samr_GroupInfoDescription *)pytalloc_get_ptr(obj); PyObject *py_description; py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description); return py_description; } static int py_samr_GroupInfoDescription_set_description(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GroupInfoDescription *object = (struct samr_GroupInfoDescription *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->description = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_GroupInfoDescription_getsetters[] = { { .name = discard_const_p(char, "description"), .get = py_samr_GroupInfoDescription_get_description, .set = py_samr_GroupInfoDescription_set_description, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_GroupInfoDescription_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_GroupInfoDescription, type); } static PyTypeObject samr_GroupInfoDescription_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.GroupInfoDescription", .tp_getset = py_samr_GroupInfoDescription_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_GroupInfoDescription_new, }; static PyObject *py_import_samr_GroupInfo(TALLOC_CTX *mem_ctx, int level, union samr_GroupInfo *in) { PyObject *ret; switch (level) { case GROUPINFOALL: ret = pytalloc_reference_ex(&samr_GroupInfoAll_Type, mem_ctx, &in->all); return ret; case GROUPINFONAME: ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->name); return ret; case GROUPINFOATTRIBUTES: ret = pytalloc_reference_ex(&samr_GroupInfoAttributes_Type, mem_ctx, &in->attributes); return ret; case GROUPINFODESCRIPTION: ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->description); return ret; case GROUPINFOALL2: ret = pytalloc_reference_ex(&samr_GroupInfoAll_Type, mem_ctx, &in->all2); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union samr_GroupInfo *py_export_samr_GroupInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union samr_GroupInfo *ret = talloc_zero(mem_ctx, union samr_GroupInfo); switch (level) { case GROUPINFOALL: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->all"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_GroupInfoAll_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->all = *(struct samr_GroupInfoAll *)pytalloc_get_ptr(in); break; case GROUPINFONAME: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->name"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(lsa_String_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->name = *(struct lsa_String *)pytalloc_get_ptr(in); break; case GROUPINFOATTRIBUTES: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->attributes"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_GroupInfoAttributes_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->attributes = *(struct samr_GroupInfoAttributes *)pytalloc_get_ptr(in); break; case GROUPINFODESCRIPTION: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->description"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(lsa_String_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->description = *(struct lsa_String *)pytalloc_get_ptr(in); break; case GROUPINFOALL2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->all2"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_GroupInfoAll_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->all2 = *(struct samr_GroupInfoAll *)pytalloc_get_ptr(in); break; default: PyErr_SetString(PyExc_TypeError, "invalid union level value"); talloc_free(ret); ret = NULL; } return ret; } static PyObject *py_samr_GroupInfo_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 samr_GroupInfo *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 samr_GroupInfo *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_GroupInfo!"); return NULL; } return py_import_samr_GroupInfo(mem_ctx, level, in); } static PyObject *py_samr_GroupInfo_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 samr_GroupInfo *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_samr_GroupInfo(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_samr_GroupInfo_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GroupInfo_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GroupInfo_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_samr_GroupInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject samr_GroupInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.GroupInfo", .tp_getset = NULL, .tp_methods = py_samr_GroupInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_GroupInfo_new, }; static PyObject *py_samr_RidAttrArray_get_count(PyObject *obj, void *closure) { struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_samr_RidAttrArray_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); 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->count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_RidAttrArray_get_rids(PyObject *obj, void *closure) { struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(obj); PyObject *py_rids; if (object->rids == NULL) { Py_RETURN_NONE; } if (object->rids == NULL) { py_rids = Py_None; Py_INCREF(py_rids); } else { py_rids = PyList_New(object->count); if (py_rids == NULL) { return NULL; } { int rids_cntr_1; for (rids_cntr_1 = 0; rids_cntr_1 < (object->count); rids_cntr_1++) { PyObject *py_rids_1; py_rids_1 = PyLong_FromUnsignedLongLong((uint32_t)object->rids[rids_cntr_1]); PyList_SetItem(py_rids, rids_cntr_1, py_rids_1); } } } return py_rids; } static int py_samr_RidAttrArray_set_rids(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->rids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids"); return -1; } if (value == Py_None) { object->rids = NULL; } else { object->rids = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int rids_cntr_1; object->rids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->rids, PyList_GET_SIZE(value)); if (!object->rids) { return -1;; } talloc_set_name_const(object->rids, "ARRAY: object->rids"); for (rids_cntr_1 = 0; rids_cntr_1 < PyList_GET_SIZE(value); rids_cntr_1++) { if (PyList_GET_ITEM(value, rids_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids[rids_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rids[rids_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, rids_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, rids_cntr_1)); 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->rids[rids_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyObject *py_samr_RidAttrArray_get_attributes(PyObject *obj, void *closure) { struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(obj); PyObject *py_attributes; if (object->attributes == NULL) { Py_RETURN_NONE; } if (object->attributes == NULL) { py_attributes = Py_None; Py_INCREF(py_attributes); } else { py_attributes = PyList_New(object->count); if (py_attributes == NULL) { return NULL; } { int attributes_cntr_1; for (attributes_cntr_1 = 0; attributes_cntr_1 < (object->count); attributes_cntr_1++) { PyObject *py_attributes_1; py_attributes_1 = PyLong_FromUnsignedLongLong((uint32_t)object->attributes[attributes_cntr_1]); PyList_SetItem(py_attributes, attributes_cntr_1, py_attributes_1); } } } return py_attributes; } static int py_samr_RidAttrArray_set_attributes(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->attributes)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes"); return -1; } if (value == Py_None) { object->attributes = NULL; } else { object->attributes = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int attributes_cntr_1; object->attributes = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->attributes, PyList_GET_SIZE(value)); if (!object->attributes) { return -1;; } talloc_set_name_const(object->attributes, "ARRAY: object->attributes"); for (attributes_cntr_1 = 0; attributes_cntr_1 < PyList_GET_SIZE(value); attributes_cntr_1++) { if (PyList_GET_ITEM(value, attributes_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes[attributes_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes[attributes_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, attributes_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, attributes_cntr_1)); 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->attributes[attributes_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyGetSetDef py_samr_RidAttrArray_getsetters[] = { { .name = discard_const_p(char, "count"), .get = py_samr_RidAttrArray_get_count, .set = py_samr_RidAttrArray_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "rids"), .get = py_samr_RidAttrArray_get_rids, .set = py_samr_RidAttrArray_set_rids, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "attributes"), .get = py_samr_RidAttrArray_get_attributes, .set = py_samr_RidAttrArray_set_attributes, .doc = discard_const_p(char, "PIDL-generated element of base type security_GroupAttrs") }, { .name = NULL } }; static PyObject *py_samr_RidAttrArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_RidAttrArray, type); } static PyTypeObject samr_RidAttrArray_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.RidAttrArray", .tp_getset = py_samr_RidAttrArray_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_RidAttrArray_new, }; static PyObject *py_samr_AliasInfoAll_get_name(PyObject *obj, void *closure) { struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(obj); PyObject *py_name; py_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name); return py_name; } static int py_samr_AliasInfoAll_set_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_AliasInfoAll_get_num_members(PyObject *obj, void *closure) { struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(obj); PyObject *py_num_members; py_num_members = PyLong_FromUnsignedLongLong((uint32_t)object->num_members); return py_num_members; } static int py_samr_AliasInfoAll_set_num_members(PyObject *py_obj, PyObject *value, void *closure) { struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_members"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_members)); 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->num_members = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_AliasInfoAll_get_description(PyObject *obj, void *closure) { struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(obj); PyObject *py_description; py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description); return py_description; } static int py_samr_AliasInfoAll_set_description(PyObject *py_obj, PyObject *value, void *closure) { struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->description = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_AliasInfoAll_getsetters[] = { { .name = discard_const_p(char, "name"), .get = py_samr_AliasInfoAll_get_name, .set = py_samr_AliasInfoAll_set_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "num_members"), .get = py_samr_AliasInfoAll_get_num_members, .set = py_samr_AliasInfoAll_set_num_members, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "description"), .get = py_samr_AliasInfoAll_get_description, .set = py_samr_AliasInfoAll_set_description, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_AliasInfoAll_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_AliasInfoAll, type); } static PyTypeObject samr_AliasInfoAll_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.AliasInfoAll", .tp_getset = py_samr_AliasInfoAll_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_AliasInfoAll_new, }; static PyObject *py_import_samr_AliasInfo(TALLOC_CTX *mem_ctx, int level, union samr_AliasInfo *in) { PyObject *ret; switch (level) { case ALIASINFOALL: ret = pytalloc_reference_ex(&samr_AliasInfoAll_Type, mem_ctx, &in->all); return ret; case ALIASINFONAME: ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->name); return ret; case ALIASINFODESCRIPTION: ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->description); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union samr_AliasInfo *py_export_samr_AliasInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union samr_AliasInfo *ret = talloc_zero(mem_ctx, union samr_AliasInfo); switch (level) { case ALIASINFOALL: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->all"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_AliasInfoAll_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->all = *(struct samr_AliasInfoAll *)pytalloc_get_ptr(in); break; case ALIASINFONAME: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->name"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(lsa_String_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->name = *(struct lsa_String *)pytalloc_get_ptr(in); break; case ALIASINFODESCRIPTION: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->description"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(lsa_String_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->description = *(struct lsa_String *)pytalloc_get_ptr(in); break; default: PyErr_SetString(PyExc_TypeError, "invalid union level value"); talloc_free(ret); ret = NULL; } return ret; } static PyObject *py_samr_AliasInfo_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 samr_AliasInfo *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 samr_AliasInfo *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_AliasInfo!"); return NULL; } return py_import_samr_AliasInfo(mem_ctx, level, in); } static PyObject *py_samr_AliasInfo_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 samr_AliasInfo *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_samr_AliasInfo(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_samr_AliasInfo_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AliasInfo_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AliasInfo_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_samr_AliasInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject samr_AliasInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.AliasInfo", .tp_getset = NULL, .tp_methods = py_samr_AliasInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_AliasInfo_new, }; static PyObject *py_samr_UserInfo1_get_account_name(PyObject *obj, void *closure) { struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj); PyObject *py_account_name; py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name); return py_account_name; } static int py_samr_UserInfo1_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo1_get_full_name(PyObject *obj, void *closure) { struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj); PyObject *py_full_name; py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name); return py_full_name; } static int py_samr_UserInfo1_set_full_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo1_get_primary_gid(PyObject *obj, void *closure) { struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj); PyObject *py_primary_gid; py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid); return py_primary_gid; } static int py_samr_UserInfo1_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid)); 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->primary_gid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo1_get_description(PyObject *obj, void *closure) { struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj); PyObject *py_description; py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description); return py_description; } static int py_samr_UserInfo1_set_description(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->description = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo1_get_comment(PyObject *obj, void *closure) { struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj); PyObject *py_comment; py_comment = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->comment); return py_comment; } static int py_samr_UserInfo1_set_comment(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->comment"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->comment = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_UserInfo1_getsetters[] = { { .name = discard_const_p(char, "account_name"), .get = py_samr_UserInfo1_get_account_name, .set = py_samr_UserInfo1_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "full_name"), .get = py_samr_UserInfo1_get_full_name, .set = py_samr_UserInfo1_set_full_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "primary_gid"), .get = py_samr_UserInfo1_get_primary_gid, .set = py_samr_UserInfo1_set_primary_gid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "description"), .get = py_samr_UserInfo1_get_description, .set = py_samr_UserInfo1_set_description, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "comment"), .get = py_samr_UserInfo1_get_comment, .set = py_samr_UserInfo1_set_comment, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_UserInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo1, type); } static PyTypeObject samr_UserInfo1_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo1", .tp_getset = py_samr_UserInfo1_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo1_new, }; static PyObject *py_samr_UserInfo2_get_comment(PyObject *obj, void *closure) { struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(obj); PyObject *py_comment; py_comment = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->comment); return py_comment; } static int py_samr_UserInfo2_set_comment(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->comment"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->comment = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo2_get_reserved(PyObject *obj, void *closure) { struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(obj); PyObject *py_reserved; py_reserved = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->reserved); return py_reserved; } static int py_samr_UserInfo2_set_reserved(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->reserved = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo2_get_country_code(PyObject *obj, void *closure) { struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(obj); PyObject *py_country_code; py_country_code = PyLong_FromLong((uint16_t)object->country_code); return py_country_code; } static int py_samr_UserInfo2_set_country_code(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->country_code"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->country_code)); 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->country_code = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo2_get_code_page(PyObject *obj, void *closure) { struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(obj); PyObject *py_code_page; py_code_page = PyLong_FromLong((uint16_t)object->code_page); return py_code_page; } static int py_samr_UserInfo2_set_code_page(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->code_page"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->code_page)); 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->code_page = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_UserInfo2_getsetters[] = { { .name = discard_const_p(char, "comment"), .get = py_samr_UserInfo2_get_comment, .set = py_samr_UserInfo2_set_comment, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "reserved"), .get = py_samr_UserInfo2_get_reserved, .set = py_samr_UserInfo2_set_reserved, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "country_code"), .get = py_samr_UserInfo2_get_country_code, .set = py_samr_UserInfo2_set_country_code, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "code_page"), .get = py_samr_UserInfo2_get_code_page, .set = py_samr_UserInfo2_set_code_page, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = NULL } }; static PyObject *py_samr_UserInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo2, type); } static PyTypeObject samr_UserInfo2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo2", .tp_getset = py_samr_UserInfo2_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo2_new, }; static PyObject *py_samr_LogonHours_get_units_per_week(PyObject *obj, void *closure) { struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(obj); PyObject *py_units_per_week; py_units_per_week = PyLong_FromLong((uint16_t)object->units_per_week); return py_units_per_week; } static int py_samr_LogonHours_set_units_per_week(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->units_per_week"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->units_per_week)); 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->units_per_week = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_LogonHours_get_bits(PyObject *obj, void *closure) { struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(obj); PyObject *py_bits; if (object->bits == NULL) { Py_RETURN_NONE; } if (object->bits == NULL) { py_bits = Py_None; Py_INCREF(py_bits); } else { py_bits = PyList_New(object->units_per_week / 8); if (py_bits == NULL) { return NULL; } { int bits_cntr_1; for (bits_cntr_1 = 0; bits_cntr_1 < (object->units_per_week / 8); bits_cntr_1++) { PyObject *py_bits_1; py_bits_1 = PyLong_FromLong((uint16_t)object->bits[bits_cntr_1]); PyList_SetItem(py_bits, bits_cntr_1, py_bits_1); } } } return py_bits; } static int py_samr_LogonHours_set_bits(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->bits)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bits"); return -1; } if (value == Py_None) { object->bits = NULL; } else { object->bits = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int bits_cntr_1; object->bits = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->bits, PyList_GET_SIZE(value)); if (!object->bits) { return -1;; } talloc_set_name_const(object->bits, "ARRAY: object->bits"); for (bits_cntr_1 = 0; bits_cntr_1 < PyList_GET_SIZE(value); bits_cntr_1++) { if (PyList_GET_ITEM(value, bits_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bits[bits_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bits[bits_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, bits_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, bits_cntr_1)); 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->bits[bits_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyGetSetDef py_samr_LogonHours_getsetters[] = { { .name = discard_const_p(char, "units_per_week"), .get = py_samr_LogonHours_get_units_per_week, .set = py_samr_LogonHours_set_units_per_week, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "bits"), .get = py_samr_LogonHours_get_bits, .set = py_samr_LogonHours_set_bits, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_samr_LogonHours_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_LogonHours, type); } static PyObject *py_samr_LogonHours_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; DATA_BLOB blob; enum ndr_err_code err; TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj)); if (tmp_ctx == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_samr_LogonHours); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(tmp_ctx); PyErr_SetNdrError(err); return NULL; } ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(tmp_ctx); return ret; } static PyObject *py_samr_LogonHours_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj); DATA_BLOB blob = {.data = NULL, .length = 0}; Py_ssize_t blob_length = 0; enum ndr_err_code err; const char * const kwnames[] = { "data_blob", "allow_remaining", NULL }; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } if (allow_remaining) { err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_LogonHours); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_LogonHours); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_samr_LogonHours_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_LogonHours, "samr_LogonHours", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_samr_LogonHours_methods[] = { { "__ndr_pack__", (PyCFunction)py_samr_LogonHours_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LogonHours_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_samr_LogonHours_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_LogonHours_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.LogonHours", .tp_getset = py_samr_LogonHours_getsetters, .tp_methods = py_samr_LogonHours_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_LogonHours_new, }; static PyObject *py_samr_UserInfo3_get_account_name(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_account_name; py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name); return py_account_name; } static int py_samr_UserInfo3_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo3_get_full_name(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_full_name; py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name); return py_full_name; } static int py_samr_UserInfo3_set_full_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo3_get_rid(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid); return py_rid; } static int py_samr_UserInfo3_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid)); 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->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo3_get_primary_gid(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_primary_gid; py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid); return py_primary_gid; } static int py_samr_UserInfo3_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid)); 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->primary_gid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo3_get_home_directory(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_home_directory; py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory); return py_home_directory; } static int py_samr_UserInfo3_set_home_directory(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_directory"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo3_get_home_drive(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_home_drive; py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive); return py_home_drive; } static int py_samr_UserInfo3_set_home_drive(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_drive"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo3_get_logon_script(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_logon_script; py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script); return py_logon_script; } static int py_samr_UserInfo3_set_logon_script(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_script"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo3_get_profile_path(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_profile_path; py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path); return py_profile_path; } static int py_samr_UserInfo3_set_profile_path(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->profile_path"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo3_get_workstations(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_workstations; py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations); return py_workstations; } static int py_samr_UserInfo3_set_workstations(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstations"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo3_get_last_logon(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_last_logon; py_last_logon = PyLong_FromUnsignedLongLong(object->last_logon); return py_last_logon; } static int py_samr_UserInfo3_set_last_logon(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logon"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logon)); 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->last_logon = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo3_get_last_logoff(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_last_logoff; py_last_logoff = PyLong_FromUnsignedLongLong(object->last_logoff); return py_last_logoff; } static int py_samr_UserInfo3_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logoff"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logoff)); 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->last_logoff = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo3_get_last_password_change(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_last_password_change; py_last_password_change = PyLong_FromUnsignedLongLong(object->last_password_change); return py_last_password_change; } static int py_samr_UserInfo3_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_password_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_password_change)); 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->last_password_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo3_get_allow_password_change(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_allow_password_change; py_allow_password_change = PyLong_FromUnsignedLongLong(object->allow_password_change); return py_allow_password_change; } static int py_samr_UserInfo3_set_allow_password_change(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->allow_password_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->allow_password_change)); 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->allow_password_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo3_get_force_password_change(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_force_password_change; py_force_password_change = PyLong_FromUnsignedLongLong(object->force_password_change); return py_force_password_change; } static int py_samr_UserInfo3_set_force_password_change(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->force_password_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->force_password_change)); 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->force_password_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo3_get_logon_hours(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_logon_hours; py_logon_hours = pytalloc_reference_ex(&samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours); return py_logon_hours; } static int py_samr_UserInfo3_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_hours"); return -1; } PY_CHECK_TYPE(&samr_LogonHours_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo3_get_bad_password_count(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_bad_password_count; py_bad_password_count = PyLong_FromLong((uint16_t)object->bad_password_count); return py_bad_password_count; } static int py_samr_UserInfo3_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_password_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_password_count)); 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->bad_password_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo3_get_logon_count(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_logon_count; py_logon_count = PyLong_FromLong((uint16_t)object->logon_count); return py_logon_count; } static int py_samr_UserInfo3_set_logon_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count)); 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->logon_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo3_get_acct_flags(PyObject *obj, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj); PyObject *py_acct_flags; py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags); return py_acct_flags; } static int py_samr_UserInfo3_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags)); 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->acct_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_UserInfo3_getsetters[] = { { .name = discard_const_p(char, "account_name"), .get = py_samr_UserInfo3_get_account_name, .set = py_samr_UserInfo3_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "full_name"), .get = py_samr_UserInfo3_get_full_name, .set = py_samr_UserInfo3_set_full_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "rid"), .get = py_samr_UserInfo3_get_rid, .set = py_samr_UserInfo3_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "primary_gid"), .get = py_samr_UserInfo3_get_primary_gid, .set = py_samr_UserInfo3_set_primary_gid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "home_directory"), .get = py_samr_UserInfo3_get_home_directory, .set = py_samr_UserInfo3_set_home_directory, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "home_drive"), .get = py_samr_UserInfo3_get_home_drive, .set = py_samr_UserInfo3_set_home_drive, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "logon_script"), .get = py_samr_UserInfo3_get_logon_script, .set = py_samr_UserInfo3_set_logon_script, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "profile_path"), .get = py_samr_UserInfo3_get_profile_path, .set = py_samr_UserInfo3_set_profile_path, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "workstations"), .get = py_samr_UserInfo3_get_workstations, .set = py_samr_UserInfo3_set_workstations, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "last_logon"), .get = py_samr_UserInfo3_get_last_logon, .set = py_samr_UserInfo3_set_last_logon, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "last_logoff"), .get = py_samr_UserInfo3_get_last_logoff, .set = py_samr_UserInfo3_set_last_logoff, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "last_password_change"), .get = py_samr_UserInfo3_get_last_password_change, .set = py_samr_UserInfo3_set_last_password_change, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "allow_password_change"), .get = py_samr_UserInfo3_get_allow_password_change, .set = py_samr_UserInfo3_set_allow_password_change, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "force_password_change"), .get = py_samr_UserInfo3_get_force_password_change, .set = py_samr_UserInfo3_set_force_password_change, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "logon_hours"), .get = py_samr_UserInfo3_get_logon_hours, .set = py_samr_UserInfo3_set_logon_hours, .doc = discard_const_p(char, "PIDL-generated element of base type samr_LogonHours") }, { .name = discard_const_p(char, "bad_password_count"), .get = py_samr_UserInfo3_get_bad_password_count, .set = py_samr_UserInfo3_set_bad_password_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "logon_count"), .get = py_samr_UserInfo3_get_logon_count, .set = py_samr_UserInfo3_set_logon_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "acct_flags"), .get = py_samr_UserInfo3_get_acct_flags, .set = py_samr_UserInfo3_set_acct_flags, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags") }, { .name = NULL } }; static PyObject *py_samr_UserInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo3, type); } static PyTypeObject samr_UserInfo3_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo3", .tp_getset = py_samr_UserInfo3_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo3_new, }; static PyObject *py_samr_UserInfo4_get_logon_hours(PyObject *obj, void *closure) { struct samr_UserInfo4 *object = (struct samr_UserInfo4 *)pytalloc_get_ptr(obj); PyObject *py_logon_hours; py_logon_hours = pytalloc_reference_ex(&samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours); return py_logon_hours; } static int py_samr_UserInfo4_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo4 *object = (struct samr_UserInfo4 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_hours"); return -1; } PY_CHECK_TYPE(&samr_LogonHours_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_UserInfo4_getsetters[] = { { .name = discard_const_p(char, "logon_hours"), .get = py_samr_UserInfo4_get_logon_hours, .set = py_samr_UserInfo4_set_logon_hours, .doc = discard_const_p(char, "PIDL-generated element of base type samr_LogonHours") }, { .name = NULL } }; static PyObject *py_samr_UserInfo4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo4, type); } static PyTypeObject samr_UserInfo4_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo4", .tp_getset = py_samr_UserInfo4_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo4_new, }; static PyObject *py_samr_UserInfo5_get_account_name(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_account_name; py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name); return py_account_name; } static int py_samr_UserInfo5_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo5_get_full_name(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_full_name; py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name); return py_full_name; } static int py_samr_UserInfo5_set_full_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo5_get_rid(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid); return py_rid; } static int py_samr_UserInfo5_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid)); 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->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo5_get_primary_gid(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_primary_gid; py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid); return py_primary_gid; } static int py_samr_UserInfo5_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid)); 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->primary_gid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo5_get_home_directory(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_home_directory; py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory); return py_home_directory; } static int py_samr_UserInfo5_set_home_directory(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_directory"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo5_get_home_drive(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_home_drive; py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive); return py_home_drive; } static int py_samr_UserInfo5_set_home_drive(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_drive"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo5_get_logon_script(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_logon_script; py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script); return py_logon_script; } static int py_samr_UserInfo5_set_logon_script(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_script"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo5_get_profile_path(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_profile_path; py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path); return py_profile_path; } static int py_samr_UserInfo5_set_profile_path(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->profile_path"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo5_get_description(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_description; py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description); return py_description; } static int py_samr_UserInfo5_set_description(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->description = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo5_get_workstations(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_workstations; py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations); return py_workstations; } static int py_samr_UserInfo5_set_workstations(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstations"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo5_get_last_logon(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_last_logon; py_last_logon = PyLong_FromUnsignedLongLong(object->last_logon); return py_last_logon; } static int py_samr_UserInfo5_set_last_logon(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logon"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logon)); 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->last_logon = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo5_get_last_logoff(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_last_logoff; py_last_logoff = PyLong_FromUnsignedLongLong(object->last_logoff); return py_last_logoff; } static int py_samr_UserInfo5_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logoff"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logoff)); 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->last_logoff = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo5_get_logon_hours(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_logon_hours; py_logon_hours = pytalloc_reference_ex(&samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours); return py_logon_hours; } static int py_samr_UserInfo5_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_hours"); return -1; } PY_CHECK_TYPE(&samr_LogonHours_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo5_get_bad_password_count(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_bad_password_count; py_bad_password_count = PyLong_FromLong((uint16_t)object->bad_password_count); return py_bad_password_count; } static int py_samr_UserInfo5_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_password_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_password_count)); 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->bad_password_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo5_get_logon_count(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_logon_count; py_logon_count = PyLong_FromLong((uint16_t)object->logon_count); return py_logon_count; } static int py_samr_UserInfo5_set_logon_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count)); 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->logon_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo5_get_last_password_change(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_last_password_change; py_last_password_change = PyLong_FromUnsignedLongLong(object->last_password_change); return py_last_password_change; } static int py_samr_UserInfo5_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_password_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_password_change)); 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->last_password_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo5_get_acct_expiry(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_acct_expiry; py_acct_expiry = PyLong_FromUnsignedLongLong(object->acct_expiry); return py_acct_expiry; } static int py_samr_UserInfo5_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_expiry"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_expiry)); 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->acct_expiry = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo5_get_acct_flags(PyObject *obj, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj); PyObject *py_acct_flags; py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags); return py_acct_flags; } static int py_samr_UserInfo5_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags)); 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->acct_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_UserInfo5_getsetters[] = { { .name = discard_const_p(char, "account_name"), .get = py_samr_UserInfo5_get_account_name, .set = py_samr_UserInfo5_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "full_name"), .get = py_samr_UserInfo5_get_full_name, .set = py_samr_UserInfo5_set_full_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "rid"), .get = py_samr_UserInfo5_get_rid, .set = py_samr_UserInfo5_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "primary_gid"), .get = py_samr_UserInfo5_get_primary_gid, .set = py_samr_UserInfo5_set_primary_gid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "home_directory"), .get = py_samr_UserInfo5_get_home_directory, .set = py_samr_UserInfo5_set_home_directory, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "home_drive"), .get = py_samr_UserInfo5_get_home_drive, .set = py_samr_UserInfo5_set_home_drive, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "logon_script"), .get = py_samr_UserInfo5_get_logon_script, .set = py_samr_UserInfo5_set_logon_script, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "profile_path"), .get = py_samr_UserInfo5_get_profile_path, .set = py_samr_UserInfo5_set_profile_path, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "description"), .get = py_samr_UserInfo5_get_description, .set = py_samr_UserInfo5_set_description, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "workstations"), .get = py_samr_UserInfo5_get_workstations, .set = py_samr_UserInfo5_set_workstations, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "last_logon"), .get = py_samr_UserInfo5_get_last_logon, .set = py_samr_UserInfo5_set_last_logon, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "last_logoff"), .get = py_samr_UserInfo5_get_last_logoff, .set = py_samr_UserInfo5_set_last_logoff, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "logon_hours"), .get = py_samr_UserInfo5_get_logon_hours, .set = py_samr_UserInfo5_set_logon_hours, .doc = discard_const_p(char, "PIDL-generated element of base type samr_LogonHours") }, { .name = discard_const_p(char, "bad_password_count"), .get = py_samr_UserInfo5_get_bad_password_count, .set = py_samr_UserInfo5_set_bad_password_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "logon_count"), .get = py_samr_UserInfo5_get_logon_count, .set = py_samr_UserInfo5_set_logon_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "last_password_change"), .get = py_samr_UserInfo5_get_last_password_change, .set = py_samr_UserInfo5_set_last_password_change, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "acct_expiry"), .get = py_samr_UserInfo5_get_acct_expiry, .set = py_samr_UserInfo5_set_acct_expiry, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "acct_flags"), .get = py_samr_UserInfo5_get_acct_flags, .set = py_samr_UserInfo5_set_acct_flags, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags") }, { .name = NULL } }; static PyObject *py_samr_UserInfo5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo5, type); } static PyTypeObject samr_UserInfo5_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo5", .tp_getset = py_samr_UserInfo5_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo5_new, }; static PyObject *py_samr_UserInfo6_get_account_name(PyObject *obj, void *closure) { struct samr_UserInfo6 *object = (struct samr_UserInfo6 *)pytalloc_get_ptr(obj); PyObject *py_account_name; py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name); return py_account_name; } static int py_samr_UserInfo6_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo6 *object = (struct samr_UserInfo6 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo6_get_full_name(PyObject *obj, void *closure) { struct samr_UserInfo6 *object = (struct samr_UserInfo6 *)pytalloc_get_ptr(obj); PyObject *py_full_name; py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name); return py_full_name; } static int py_samr_UserInfo6_set_full_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo6 *object = (struct samr_UserInfo6 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_UserInfo6_getsetters[] = { { .name = discard_const_p(char, "account_name"), .get = py_samr_UserInfo6_get_account_name, .set = py_samr_UserInfo6_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "full_name"), .get = py_samr_UserInfo6_get_full_name, .set = py_samr_UserInfo6_set_full_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_UserInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo6, type); } static PyTypeObject samr_UserInfo6_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo6", .tp_getset = py_samr_UserInfo6_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo6_new, }; static PyObject *py_samr_UserInfo7_get_account_name(PyObject *obj, void *closure) { struct samr_UserInfo7 *object = (struct samr_UserInfo7 *)pytalloc_get_ptr(obj); PyObject *py_account_name; py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name); return py_account_name; } static int py_samr_UserInfo7_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo7 *object = (struct samr_UserInfo7 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_UserInfo7_getsetters[] = { { .name = discard_const_p(char, "account_name"), .get = py_samr_UserInfo7_get_account_name, .set = py_samr_UserInfo7_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_UserInfo7_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo7, type); } static PyTypeObject samr_UserInfo7_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo7", .tp_getset = py_samr_UserInfo7_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo7_new, }; static PyObject *py_samr_UserInfo8_get_full_name(PyObject *obj, void *closure) { struct samr_UserInfo8 *object = (struct samr_UserInfo8 *)pytalloc_get_ptr(obj); PyObject *py_full_name; py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name); return py_full_name; } static int py_samr_UserInfo8_set_full_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo8 *object = (struct samr_UserInfo8 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_UserInfo8_getsetters[] = { { .name = discard_const_p(char, "full_name"), .get = py_samr_UserInfo8_get_full_name, .set = py_samr_UserInfo8_set_full_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_UserInfo8_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo8, type); } static PyTypeObject samr_UserInfo8_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo8", .tp_getset = py_samr_UserInfo8_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo8_new, }; static PyObject *py_samr_UserInfo9_get_primary_gid(PyObject *obj, void *closure) { struct samr_UserInfo9 *object = (struct samr_UserInfo9 *)pytalloc_get_ptr(obj); PyObject *py_primary_gid; py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid); return py_primary_gid; } static int py_samr_UserInfo9_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo9 *object = (struct samr_UserInfo9 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid)); 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->primary_gid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_UserInfo9_getsetters[] = { { .name = discard_const_p(char, "primary_gid"), .get = py_samr_UserInfo9_get_primary_gid, .set = py_samr_UserInfo9_set_primary_gid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_samr_UserInfo9_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo9, type); } static PyTypeObject samr_UserInfo9_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo9", .tp_getset = py_samr_UserInfo9_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo9_new, }; static PyObject *py_samr_UserInfo10_get_home_directory(PyObject *obj, void *closure) { struct samr_UserInfo10 *object = (struct samr_UserInfo10 *)pytalloc_get_ptr(obj); PyObject *py_home_directory; py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory); return py_home_directory; } static int py_samr_UserInfo10_set_home_directory(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo10 *object = (struct samr_UserInfo10 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_directory"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo10_get_home_drive(PyObject *obj, void *closure) { struct samr_UserInfo10 *object = (struct samr_UserInfo10 *)pytalloc_get_ptr(obj); PyObject *py_home_drive; py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive); return py_home_drive; } static int py_samr_UserInfo10_set_home_drive(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo10 *object = (struct samr_UserInfo10 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_drive"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_UserInfo10_getsetters[] = { { .name = discard_const_p(char, "home_directory"), .get = py_samr_UserInfo10_get_home_directory, .set = py_samr_UserInfo10_set_home_directory, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "home_drive"), .get = py_samr_UserInfo10_get_home_drive, .set = py_samr_UserInfo10_set_home_drive, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_UserInfo10_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo10, type); } static PyTypeObject samr_UserInfo10_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo10", .tp_getset = py_samr_UserInfo10_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo10_new, }; static PyObject *py_samr_UserInfo11_get_logon_script(PyObject *obj, void *closure) { struct samr_UserInfo11 *object = (struct samr_UserInfo11 *)pytalloc_get_ptr(obj); PyObject *py_logon_script; py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script); return py_logon_script; } static int py_samr_UserInfo11_set_logon_script(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo11 *object = (struct samr_UserInfo11 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_script"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_UserInfo11_getsetters[] = { { .name = discard_const_p(char, "logon_script"), .get = py_samr_UserInfo11_get_logon_script, .set = py_samr_UserInfo11_set_logon_script, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_UserInfo11_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo11, type); } static PyTypeObject samr_UserInfo11_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo11", .tp_getset = py_samr_UserInfo11_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo11_new, }; static PyObject *py_samr_UserInfo12_get_profile_path(PyObject *obj, void *closure) { struct samr_UserInfo12 *object = (struct samr_UserInfo12 *)pytalloc_get_ptr(obj); PyObject *py_profile_path; py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path); return py_profile_path; } static int py_samr_UserInfo12_set_profile_path(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo12 *object = (struct samr_UserInfo12 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->profile_path"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_UserInfo12_getsetters[] = { { .name = discard_const_p(char, "profile_path"), .get = py_samr_UserInfo12_get_profile_path, .set = py_samr_UserInfo12_set_profile_path, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_UserInfo12_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo12, type); } static PyTypeObject samr_UserInfo12_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo12", .tp_getset = py_samr_UserInfo12_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo12_new, }; static PyObject *py_samr_UserInfo13_get_description(PyObject *obj, void *closure) { struct samr_UserInfo13 *object = (struct samr_UserInfo13 *)pytalloc_get_ptr(obj); PyObject *py_description; py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description); return py_description; } static int py_samr_UserInfo13_set_description(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo13 *object = (struct samr_UserInfo13 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->description = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_UserInfo13_getsetters[] = { { .name = discard_const_p(char, "description"), .get = py_samr_UserInfo13_get_description, .set = py_samr_UserInfo13_set_description, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_UserInfo13_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo13, type); } static PyTypeObject samr_UserInfo13_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo13", .tp_getset = py_samr_UserInfo13_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo13_new, }; static PyObject *py_samr_UserInfo14_get_workstations(PyObject *obj, void *closure) { struct samr_UserInfo14 *object = (struct samr_UserInfo14 *)pytalloc_get_ptr(obj); PyObject *py_workstations; py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations); return py_workstations; } static int py_samr_UserInfo14_set_workstations(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo14 *object = (struct samr_UserInfo14 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstations"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_UserInfo14_getsetters[] = { { .name = discard_const_p(char, "workstations"), .get = py_samr_UserInfo14_get_workstations, .set = py_samr_UserInfo14_set_workstations, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_UserInfo14_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo14, type); } static PyTypeObject samr_UserInfo14_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo14", .tp_getset = py_samr_UserInfo14_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo14_new, }; static PyObject *py_samr_UserInfo16_get_acct_flags(PyObject *obj, void *closure) { struct samr_UserInfo16 *object = (struct samr_UserInfo16 *)pytalloc_get_ptr(obj); PyObject *py_acct_flags; py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags); return py_acct_flags; } static int py_samr_UserInfo16_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo16 *object = (struct samr_UserInfo16 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags)); 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->acct_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_UserInfo16_getsetters[] = { { .name = discard_const_p(char, "acct_flags"), .get = py_samr_UserInfo16_get_acct_flags, .set = py_samr_UserInfo16_set_acct_flags, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags") }, { .name = NULL } }; static PyObject *py_samr_UserInfo16_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo16, type); } static PyTypeObject samr_UserInfo16_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo16", .tp_getset = py_samr_UserInfo16_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo16_new, }; static PyObject *py_samr_UserInfo17_get_acct_expiry(PyObject *obj, void *closure) { struct samr_UserInfo17 *object = (struct samr_UserInfo17 *)pytalloc_get_ptr(obj); PyObject *py_acct_expiry; py_acct_expiry = PyLong_FromUnsignedLongLong(object->acct_expiry); return py_acct_expiry; } static int py_samr_UserInfo17_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo17 *object = (struct samr_UserInfo17 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_expiry"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_expiry)); 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->acct_expiry = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_UserInfo17_getsetters[] = { { .name = discard_const_p(char, "acct_expiry"), .get = py_samr_UserInfo17_get_acct_expiry, .set = py_samr_UserInfo17_set_acct_expiry, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = NULL } }; static PyObject *py_samr_UserInfo17_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo17, type); } static PyTypeObject samr_UserInfo17_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo17", .tp_getset = py_samr_UserInfo17_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo17_new, }; static PyObject *py_samr_Password_get_hash(PyObject *obj, void *closure) { struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(obj); PyObject *py_hash; py_hash = PyList_New(16); if (py_hash == NULL) { return NULL; } { int hash_cntr_0; for (hash_cntr_0 = 0; hash_cntr_0 < (16); hash_cntr_0++) { PyObject *py_hash_0; py_hash_0 = PyLong_FromLong((uint16_t)object->hash[hash_cntr_0]); PyList_SetItem(py_hash, hash_cntr_0, py_hash_0); } } return py_hash; } static int py_samr_Password_set_hash(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int hash_cntr_0; if (ARRAY_SIZE(object->hash) != PyList_GET_SIZE(value)) { PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->hash), PyList_GET_SIZE(value)); return -1; } for (hash_cntr_0 = 0; hash_cntr_0 < PyList_GET_SIZE(value); hash_cntr_0++) { if (PyList_GET_ITEM(value, hash_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash[hash_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->hash[hash_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, hash_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, hash_cntr_0)); 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->hash[hash_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyGetSetDef py_samr_Password_getsetters[] = { { .name = discard_const_p(char, "hash"), .get = py_samr_Password_get_hash, .set = py_samr_Password_set_hash, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_samr_Password_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_Password, type); } static PyObject *py_samr_Password_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; DATA_BLOB blob; enum ndr_err_code err; TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj)); if (tmp_ctx == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_samr_Password); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(tmp_ctx); PyErr_SetNdrError(err); return NULL; } ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(tmp_ctx); return ret; } static PyObject *py_samr_Password_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj); DATA_BLOB blob = {.data = NULL, .length = 0}; Py_ssize_t blob_length = 0; enum ndr_err_code err; const char * const kwnames[] = { "data_blob", "allow_remaining", NULL }; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } if (allow_remaining) { err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_Password); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_Password); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_samr_Password_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_Password, "samr_Password", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_samr_Password_methods[] = { { "__ndr_pack__", (PyCFunction)py_samr_Password_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Password_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_samr_Password_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_Password_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.Password", .tp_getset = py_samr_Password_getsetters, .tp_methods = py_samr_Password_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_Password_new, }; static PyObject *py_samr_UserInfo18_get_nt_pwd(PyObject *obj, void *closure) { struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj); PyObject *py_nt_pwd; py_nt_pwd = pytalloc_reference_ex(&samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->nt_pwd); return py_nt_pwd; } static int py_samr_UserInfo18_set_nt_pwd(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_pwd"); return -1; } PY_CHECK_TYPE(&samr_Password_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->nt_pwd = *(struct samr_Password *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo18_get_lm_pwd(PyObject *obj, void *closure) { struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj); PyObject *py_lm_pwd; py_lm_pwd = pytalloc_reference_ex(&samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->lm_pwd); return py_lm_pwd; } static int py_samr_UserInfo18_set_lm_pwd(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_pwd"); return -1; } PY_CHECK_TYPE(&samr_Password_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->lm_pwd = *(struct samr_Password *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo18_get_nt_pwd_active(PyObject *obj, void *closure) { struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj); PyObject *py_nt_pwd_active; py_nt_pwd_active = PyLong_FromLong((uint16_t)object->nt_pwd_active); return py_nt_pwd_active; } static int py_samr_UserInfo18_set_nt_pwd_active(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_pwd_active"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_pwd_active)); 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->nt_pwd_active = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo18_get_lm_pwd_active(PyObject *obj, void *closure) { struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj); PyObject *py_lm_pwd_active; py_lm_pwd_active = PyLong_FromLong((uint16_t)object->lm_pwd_active); return py_lm_pwd_active; } static int py_samr_UserInfo18_set_lm_pwd_active(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_pwd_active"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_pwd_active)); 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->lm_pwd_active = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo18_get_password_expired(PyObject *obj, void *closure) { struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj); PyObject *py_password_expired; py_password_expired = PyLong_FromLong((uint16_t)object->password_expired); return py_password_expired; } static int py_samr_UserInfo18_set_password_expired(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_expired"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_expired)); 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->password_expired = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_UserInfo18_getsetters[] = { { .name = discard_const_p(char, "nt_pwd"), .get = py_samr_UserInfo18_get_nt_pwd, .set = py_samr_UserInfo18_set_nt_pwd, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "lm_pwd"), .get = py_samr_UserInfo18_get_lm_pwd, .set = py_samr_UserInfo18_set_lm_pwd, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "nt_pwd_active"), .get = py_samr_UserInfo18_get_nt_pwd_active, .set = py_samr_UserInfo18_set_nt_pwd_active, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "lm_pwd_active"), .get = py_samr_UserInfo18_get_lm_pwd_active, .set = py_samr_UserInfo18_set_lm_pwd_active, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "password_expired"), .get = py_samr_UserInfo18_get_password_expired, .set = py_samr_UserInfo18_set_password_expired, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_samr_UserInfo18_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo18, type); } static PyTypeObject samr_UserInfo18_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo18", .tp_getset = py_samr_UserInfo18_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo18_new, }; static PyObject *py_samr_UserInfo20_get_parameters(PyObject *obj, void *closure) { struct samr_UserInfo20 *object = (struct samr_UserInfo20 *)pytalloc_get_ptr(obj); PyObject *py_parameters; py_parameters = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->parameters); return py_parameters; } static int py_samr_UserInfo20_set_parameters(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo20 *object = (struct samr_UserInfo20 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->parameters"); return -1; } PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->parameters = *(struct lsa_BinaryString *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_UserInfo20_getsetters[] = { { .name = discard_const_p(char, "parameters"), .get = py_samr_UserInfo20_get_parameters, .set = py_samr_UserInfo20_set_parameters, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_BinaryString") }, { .name = NULL } }; static PyObject *py_samr_UserInfo20_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo20, type); } static PyTypeObject samr_UserInfo20_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo20", .tp_getset = py_samr_UserInfo20_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo20_new, }; static PyObject *py_samr_UserInfo21_get_last_logon(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_last_logon; py_last_logon = PyLong_FromUnsignedLongLong(object->last_logon); return py_last_logon; } static int py_samr_UserInfo21_set_last_logon(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logon"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logon)); 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->last_logon = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_last_logoff(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_last_logoff; py_last_logoff = PyLong_FromUnsignedLongLong(object->last_logoff); return py_last_logoff; } static int py_samr_UserInfo21_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logoff"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logoff)); 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->last_logoff = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_last_password_change(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_last_password_change; py_last_password_change = PyLong_FromUnsignedLongLong(object->last_password_change); return py_last_password_change; } static int py_samr_UserInfo21_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_password_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_password_change)); 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->last_password_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_acct_expiry(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_acct_expiry; py_acct_expiry = PyLong_FromUnsignedLongLong(object->acct_expiry); return py_acct_expiry; } static int py_samr_UserInfo21_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_expiry"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_expiry)); 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->acct_expiry = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_allow_password_change(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_allow_password_change; py_allow_password_change = PyLong_FromUnsignedLongLong(object->allow_password_change); return py_allow_password_change; } static int py_samr_UserInfo21_set_allow_password_change(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->allow_password_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->allow_password_change)); 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->allow_password_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_force_password_change(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_force_password_change; py_force_password_change = PyLong_FromUnsignedLongLong(object->force_password_change); return py_force_password_change; } static int py_samr_UserInfo21_set_force_password_change(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->force_password_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->force_password_change)); 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->force_password_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_account_name(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_account_name; py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name); return py_account_name; } static int py_samr_UserInfo21_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_full_name(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_full_name; py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name); return py_full_name; } static int py_samr_UserInfo21_set_full_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_home_directory(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_home_directory; py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory); return py_home_directory; } static int py_samr_UserInfo21_set_home_directory(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_directory"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_home_drive(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_home_drive; py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive); return py_home_drive; } static int py_samr_UserInfo21_set_home_drive(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_drive"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_logon_script(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_logon_script; py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script); return py_logon_script; } static int py_samr_UserInfo21_set_logon_script(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_script"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_profile_path(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_profile_path; py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path); return py_profile_path; } static int py_samr_UserInfo21_set_profile_path(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->profile_path"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_description(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_description; py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description); return py_description; } static int py_samr_UserInfo21_set_description(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->description = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_workstations(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_workstations; py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations); return py_workstations; } static int py_samr_UserInfo21_set_workstations(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstations"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_comment(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_comment; py_comment = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->comment); return py_comment; } static int py_samr_UserInfo21_set_comment(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->comment"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->comment = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_parameters(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_parameters; py_parameters = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->parameters); return py_parameters; } static int py_samr_UserInfo21_set_parameters(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->parameters"); return -1; } PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->parameters = *(struct lsa_BinaryString *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_lm_owf_password(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_lm_owf_password; py_lm_owf_password = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->lm_owf_password); return py_lm_owf_password; } static int py_samr_UserInfo21_set_lm_owf_password(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_owf_password"); return -1; } PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->lm_owf_password = *(struct lsa_BinaryString *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_nt_owf_password(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_nt_owf_password; py_nt_owf_password = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->nt_owf_password); return py_nt_owf_password; } static int py_samr_UserInfo21_set_nt_owf_password(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_owf_password"); return -1; } PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->nt_owf_password = *(struct lsa_BinaryString *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_private_data(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_private_data; py_private_data = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->private_data); return py_private_data; } static int py_samr_UserInfo21_set_private_data(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->private_data"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->private_data = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_buf_count(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_buf_count; py_buf_count = PyLong_FromUnsignedLongLong((uint32_t)object->buf_count); return py_buf_count; } static int py_samr_UserInfo21_set_buf_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buf_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->buf_count)); 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->buf_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_buffer(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_buffer; if (object->buffer == NULL) { Py_RETURN_NONE; } if (object->buffer == NULL) { py_buffer = Py_None; Py_INCREF(py_buffer); } else { py_buffer = PyList_New(object->buf_count); if (py_buffer == NULL) { return NULL; } { int buffer_cntr_1; for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->buf_count); buffer_cntr_1++) { PyObject *py_buffer_1; py_buffer_1 = PyLong_FromLong((uint16_t)object->buffer[buffer_cntr_1]); PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1); } } } return py_buffer; } static int py_samr_UserInfo21_set_buffer(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->buffer)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffer"); return -1; } if (value == Py_None) { object->buffer = NULL; } else { object->buffer = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int buffer_cntr_1; object->buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->buffer, PyList_GET_SIZE(value)); if (!object->buffer) { return -1;; } talloc_set_name_const(object->buffer, "ARRAY: object->buffer"); for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) { if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffer[buffer_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->buffer[buffer_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1)); 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->buffer[buffer_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyObject *py_samr_UserInfo21_get_rid(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid); return py_rid; } static int py_samr_UserInfo21_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid)); 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->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_primary_gid(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_primary_gid; py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid); return py_primary_gid; } static int py_samr_UserInfo21_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid)); 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->primary_gid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_acct_flags(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_acct_flags; py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags); return py_acct_flags; } static int py_samr_UserInfo21_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags)); 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->acct_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_fields_present(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_fields_present; py_fields_present = PyLong_FromUnsignedLongLong((uint32_t)object->fields_present); return py_fields_present; } static int py_samr_UserInfo21_set_fields_present(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->fields_present"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fields_present)); 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->fields_present = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_logon_hours(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_logon_hours; py_logon_hours = pytalloc_reference_ex(&samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours); return py_logon_hours; } static int py_samr_UserInfo21_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_hours"); return -1; } PY_CHECK_TYPE(&samr_LogonHours_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo21_get_bad_password_count(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_bad_password_count; py_bad_password_count = PyLong_FromLong((uint16_t)object->bad_password_count); return py_bad_password_count; } static int py_samr_UserInfo21_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_password_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_password_count)); 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->bad_password_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_logon_count(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_logon_count; py_logon_count = PyLong_FromLong((uint16_t)object->logon_count); return py_logon_count; } static int py_samr_UserInfo21_set_logon_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count)); 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->logon_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_country_code(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_country_code; py_country_code = PyLong_FromLong((uint16_t)object->country_code); return py_country_code; } static int py_samr_UserInfo21_set_country_code(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->country_code"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->country_code)); 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->country_code = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_code_page(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_code_page; py_code_page = PyLong_FromLong((uint16_t)object->code_page); return py_code_page; } static int py_samr_UserInfo21_set_code_page(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->code_page"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->code_page)); 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->code_page = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_lm_password_set(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_lm_password_set; py_lm_password_set = PyLong_FromLong((uint16_t)object->lm_password_set); return py_lm_password_set; } static int py_samr_UserInfo21_set_lm_password_set(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_password_set"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_password_set)); 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->lm_password_set = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_nt_password_set(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_nt_password_set; py_nt_password_set = PyLong_FromLong((uint16_t)object->nt_password_set); return py_nt_password_set; } static int py_samr_UserInfo21_set_nt_password_set(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_password_set"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_password_set)); 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->nt_password_set = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_password_expired(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_password_expired; py_password_expired = PyLong_FromLong((uint16_t)object->password_expired); return py_password_expired; } static int py_samr_UserInfo21_set_password_expired(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_expired"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_expired)); 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->password_expired = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_UserInfo21_get_private_data_sensitive(PyObject *obj, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj); PyObject *py_private_data_sensitive; py_private_data_sensitive = PyLong_FromLong((uint16_t)object->private_data_sensitive); return py_private_data_sensitive; } static int py_samr_UserInfo21_set_private_data_sensitive(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->private_data_sensitive"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->private_data_sensitive)); 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->private_data_sensitive = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_UserInfo21_getsetters[] = { { .name = discard_const_p(char, "last_logon"), .get = py_samr_UserInfo21_get_last_logon, .set = py_samr_UserInfo21_set_last_logon, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "last_logoff"), .get = py_samr_UserInfo21_get_last_logoff, .set = py_samr_UserInfo21_set_last_logoff, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "last_password_change"), .get = py_samr_UserInfo21_get_last_password_change, .set = py_samr_UserInfo21_set_last_password_change, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "acct_expiry"), .get = py_samr_UserInfo21_get_acct_expiry, .set = py_samr_UserInfo21_set_acct_expiry, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "allow_password_change"), .get = py_samr_UserInfo21_get_allow_password_change, .set = py_samr_UserInfo21_set_allow_password_change, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "force_password_change"), .get = py_samr_UserInfo21_get_force_password_change, .set = py_samr_UserInfo21_set_force_password_change, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME") }, { .name = discard_const_p(char, "account_name"), .get = py_samr_UserInfo21_get_account_name, .set = py_samr_UserInfo21_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "full_name"), .get = py_samr_UserInfo21_get_full_name, .set = py_samr_UserInfo21_set_full_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "home_directory"), .get = py_samr_UserInfo21_get_home_directory, .set = py_samr_UserInfo21_set_home_directory, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "home_drive"), .get = py_samr_UserInfo21_get_home_drive, .set = py_samr_UserInfo21_set_home_drive, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "logon_script"), .get = py_samr_UserInfo21_get_logon_script, .set = py_samr_UserInfo21_set_logon_script, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "profile_path"), .get = py_samr_UserInfo21_get_profile_path, .set = py_samr_UserInfo21_set_profile_path, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "description"), .get = py_samr_UserInfo21_get_description, .set = py_samr_UserInfo21_set_description, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "workstations"), .get = py_samr_UserInfo21_get_workstations, .set = py_samr_UserInfo21_set_workstations, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "comment"), .get = py_samr_UserInfo21_get_comment, .set = py_samr_UserInfo21_set_comment, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "parameters"), .get = py_samr_UserInfo21_get_parameters, .set = py_samr_UserInfo21_set_parameters, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_BinaryString") }, { .name = discard_const_p(char, "lm_owf_password"), .get = py_samr_UserInfo21_get_lm_owf_password, .set = py_samr_UserInfo21_set_lm_owf_password, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_BinaryString") }, { .name = discard_const_p(char, "nt_owf_password"), .get = py_samr_UserInfo21_get_nt_owf_password, .set = py_samr_UserInfo21_set_nt_owf_password, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_BinaryString") }, { .name = discard_const_p(char, "private_data"), .get = py_samr_UserInfo21_get_private_data, .set = py_samr_UserInfo21_set_private_data, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "buf_count"), .get = py_samr_UserInfo21_get_buf_count, .set = py_samr_UserInfo21_set_buf_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "buffer"), .get = py_samr_UserInfo21_get_buffer, .set = py_samr_UserInfo21_set_buffer, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "rid"), .get = py_samr_UserInfo21_get_rid, .set = py_samr_UserInfo21_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "primary_gid"), .get = py_samr_UserInfo21_get_primary_gid, .set = py_samr_UserInfo21_set_primary_gid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "acct_flags"), .get = py_samr_UserInfo21_get_acct_flags, .set = py_samr_UserInfo21_set_acct_flags, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags") }, { .name = discard_const_p(char, "fields_present"), .get = py_samr_UserInfo21_get_fields_present, .set = py_samr_UserInfo21_set_fields_present, .doc = discard_const_p(char, "PIDL-generated element of base type samr_FieldsPresent") }, { .name = discard_const_p(char, "logon_hours"), .get = py_samr_UserInfo21_get_logon_hours, .set = py_samr_UserInfo21_set_logon_hours, .doc = discard_const_p(char, "PIDL-generated element of base type samr_LogonHours") }, { .name = discard_const_p(char, "bad_password_count"), .get = py_samr_UserInfo21_get_bad_password_count, .set = py_samr_UserInfo21_set_bad_password_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "logon_count"), .get = py_samr_UserInfo21_get_logon_count, .set = py_samr_UserInfo21_set_logon_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "country_code"), .get = py_samr_UserInfo21_get_country_code, .set = py_samr_UserInfo21_set_country_code, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "code_page"), .get = py_samr_UserInfo21_get_code_page, .set = py_samr_UserInfo21_set_code_page, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "lm_password_set"), .get = py_samr_UserInfo21_get_lm_password_set, .set = py_samr_UserInfo21_set_lm_password_set, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "nt_password_set"), .get = py_samr_UserInfo21_get_nt_password_set, .set = py_samr_UserInfo21_set_nt_password_set, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "password_expired"), .get = py_samr_UserInfo21_get_password_expired, .set = py_samr_UserInfo21_set_password_expired, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "private_data_sensitive"), .get = py_samr_UserInfo21_get_private_data_sensitive, .set = py_samr_UserInfo21_set_private_data_sensitive, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_samr_UserInfo21_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo21, type); } static PyTypeObject samr_UserInfo21_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo21", .tp_getset = py_samr_UserInfo21_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo21_new, }; static PyObject *py_samr_CryptPassword_get_data(PyObject *obj, void *closure) { struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(obj); PyObject *py_data; py_data = PyList_New(516); if (py_data == NULL) { return NULL; } { int data_cntr_0; for (data_cntr_0 = 0; data_cntr_0 < (516); data_cntr_0++) { PyObject *py_data_0; py_data_0 = PyLong_FromLong((uint16_t)object->data[data_cntr_0]); PyList_SetItem(py_data, data_cntr_0, py_data_0); } } return py_data; } static int py_samr_CryptPassword_set_data(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int data_cntr_0; if (ARRAY_SIZE(object->data) != PyList_GET_SIZE(value)) { PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->data), PyList_GET_SIZE(value)); return -1; } for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) { if (PyList_GET_ITEM(value, data_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_0)); 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->data[data_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyGetSetDef py_samr_CryptPassword_getsetters[] = { { .name = discard_const_p(char, "data"), .get = py_samr_CryptPassword_get_data, .set = py_samr_CryptPassword_set_data, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_samr_CryptPassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_CryptPassword, type); } static PyObject *py_samr_CryptPassword_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; DATA_BLOB blob; enum ndr_err_code err; TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj)); if (tmp_ctx == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_samr_CryptPassword); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(tmp_ctx); PyErr_SetNdrError(err); return NULL; } ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(tmp_ctx); return ret; } static PyObject *py_samr_CryptPassword_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj); DATA_BLOB blob = {.data = NULL, .length = 0}; Py_ssize_t blob_length = 0; enum ndr_err_code err; const char * const kwnames[] = { "data_blob", "allow_remaining", NULL }; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } if (allow_remaining) { err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_CryptPassword); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_CryptPassword); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_samr_CryptPassword_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_CryptPassword, "samr_CryptPassword", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_samr_CryptPassword_methods[] = { { "__ndr_pack__", (PyCFunction)py_samr_CryptPassword_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CryptPassword_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_samr_CryptPassword_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_CryptPassword_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.CryptPassword", .tp_getset = py_samr_CryptPassword_getsetters, .tp_methods = py_samr_CryptPassword_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_CryptPassword_new, }; static PyObject *py_samr_UserInfo23_get_info(PyObject *obj, void *closure) { struct samr_UserInfo23 *object = (struct samr_UserInfo23 *)pytalloc_get_ptr(obj); PyObject *py_info; py_info = pytalloc_reference_ex(&samr_UserInfo21_Type, pytalloc_get_mem_ctx(obj), &object->info); return py_info; } static int py_samr_UserInfo23_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo23 *object = (struct samr_UserInfo23 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info"); return -1; } PY_CHECK_TYPE(&samr_UserInfo21_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->info = *(struct samr_UserInfo21 *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo23_get_password(PyObject *obj, void *closure) { struct samr_UserInfo23 *object = (struct samr_UserInfo23 *)pytalloc_get_ptr(obj); PyObject *py_password; py_password = pytalloc_reference_ex(&samr_CryptPassword_Type, pytalloc_get_mem_ctx(obj), &object->password); return py_password; } static int py_samr_UserInfo23_set_password(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo23 *object = (struct samr_UserInfo23 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password"); return -1; } PY_CHECK_TYPE(&samr_CryptPassword_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->password = *(struct samr_CryptPassword *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_UserInfo23_getsetters[] = { { .name = discard_const_p(char, "info"), .get = py_samr_UserInfo23_get_info, .set = py_samr_UserInfo23_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfo21") }, { .name = discard_const_p(char, "password"), .get = py_samr_UserInfo23_get_password, .set = py_samr_UserInfo23_set_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword") }, { .name = NULL } }; static PyObject *py_samr_UserInfo23_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo23, type); } static PyTypeObject samr_UserInfo23_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo23", .tp_getset = py_samr_UserInfo23_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo23_new, }; static PyObject *py_samr_UserInfo24_get_password(PyObject *obj, void *closure) { struct samr_UserInfo24 *object = (struct samr_UserInfo24 *)pytalloc_get_ptr(obj); PyObject *py_password; py_password = pytalloc_reference_ex(&samr_CryptPassword_Type, pytalloc_get_mem_ctx(obj), &object->password); return py_password; } static int py_samr_UserInfo24_set_password(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo24 *object = (struct samr_UserInfo24 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password"); return -1; } PY_CHECK_TYPE(&samr_CryptPassword_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->password = *(struct samr_CryptPassword *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo24_get_password_expired(PyObject *obj, void *closure) { struct samr_UserInfo24 *object = (struct samr_UserInfo24 *)pytalloc_get_ptr(obj); PyObject *py_password_expired; py_password_expired = PyLong_FromLong((uint16_t)object->password_expired); return py_password_expired; } static int py_samr_UserInfo24_set_password_expired(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo24 *object = (struct samr_UserInfo24 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_expired"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_expired)); 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->password_expired = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_UserInfo24_getsetters[] = { { .name = discard_const_p(char, "password"), .get = py_samr_UserInfo24_get_password, .set = py_samr_UserInfo24_set_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword") }, { .name = discard_const_p(char, "password_expired"), .get = py_samr_UserInfo24_get_password_expired, .set = py_samr_UserInfo24_set_password_expired, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_samr_UserInfo24_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo24, type); } static PyTypeObject samr_UserInfo24_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo24", .tp_getset = py_samr_UserInfo24_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo24_new, }; static PyObject *py_samr_CryptPasswordEx_get_data(PyObject *obj, void *closure) { struct samr_CryptPasswordEx *object = (struct samr_CryptPasswordEx *)pytalloc_get_ptr(obj); PyObject *py_data; py_data = PyList_New(532); if (py_data == NULL) { return NULL; } { int data_cntr_0; for (data_cntr_0 = 0; data_cntr_0 < (532); data_cntr_0++) { PyObject *py_data_0; py_data_0 = PyLong_FromLong((uint16_t)object->data[data_cntr_0]); PyList_SetItem(py_data, data_cntr_0, py_data_0); } } return py_data; } static int py_samr_CryptPasswordEx_set_data(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CryptPasswordEx *object = (struct samr_CryptPasswordEx *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int data_cntr_0; if (ARRAY_SIZE(object->data) != PyList_GET_SIZE(value)) { PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->data), PyList_GET_SIZE(value)); return -1; } for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) { if (PyList_GET_ITEM(value, data_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_0)); 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->data[data_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyGetSetDef py_samr_CryptPasswordEx_getsetters[] = { { .name = discard_const_p(char, "data"), .get = py_samr_CryptPasswordEx_get_data, .set = py_samr_CryptPasswordEx_set_data, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_samr_CryptPasswordEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_CryptPasswordEx, type); } static PyTypeObject samr_CryptPasswordEx_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.CryptPasswordEx", .tp_getset = py_samr_CryptPasswordEx_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_CryptPasswordEx_new, }; static PyObject *py_samr_UserInfo25_get_info(PyObject *obj, void *closure) { struct samr_UserInfo25 *object = (struct samr_UserInfo25 *)pytalloc_get_ptr(obj); PyObject *py_info; py_info = pytalloc_reference_ex(&samr_UserInfo21_Type, pytalloc_get_mem_ctx(obj), &object->info); return py_info; } static int py_samr_UserInfo25_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo25 *object = (struct samr_UserInfo25 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info"); return -1; } PY_CHECK_TYPE(&samr_UserInfo21_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->info = *(struct samr_UserInfo21 *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo25_get_password(PyObject *obj, void *closure) { struct samr_UserInfo25 *object = (struct samr_UserInfo25 *)pytalloc_get_ptr(obj); PyObject *py_password; py_password = pytalloc_reference_ex(&samr_CryptPasswordEx_Type, pytalloc_get_mem_ctx(obj), &object->password); return py_password; } static int py_samr_UserInfo25_set_password(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo25 *object = (struct samr_UserInfo25 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password"); return -1; } PY_CHECK_TYPE(&samr_CryptPasswordEx_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->password = *(struct samr_CryptPasswordEx *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_UserInfo25_getsetters[] = { { .name = discard_const_p(char, "info"), .get = py_samr_UserInfo25_get_info, .set = py_samr_UserInfo25_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfo21") }, { .name = discard_const_p(char, "password"), .get = py_samr_UserInfo25_get_password, .set = py_samr_UserInfo25_set_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPasswordEx") }, { .name = NULL } }; static PyObject *py_samr_UserInfo25_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo25, type); } static PyTypeObject samr_UserInfo25_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo25", .tp_getset = py_samr_UserInfo25_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo25_new, }; static PyObject *py_samr_UserInfo26_get_password(PyObject *obj, void *closure) { struct samr_UserInfo26 *object = (struct samr_UserInfo26 *)pytalloc_get_ptr(obj); PyObject *py_password; py_password = pytalloc_reference_ex(&samr_CryptPasswordEx_Type, pytalloc_get_mem_ctx(obj), &object->password); return py_password; } static int py_samr_UserInfo26_set_password(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo26 *object = (struct samr_UserInfo26 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password"); return -1; } PY_CHECK_TYPE(&samr_CryptPasswordEx_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->password = *(struct samr_CryptPasswordEx *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_UserInfo26_get_password_expired(PyObject *obj, void *closure) { struct samr_UserInfo26 *object = (struct samr_UserInfo26 *)pytalloc_get_ptr(obj); PyObject *py_password_expired; py_password_expired = PyLong_FromLong((uint16_t)object->password_expired); return py_password_expired; } static int py_samr_UserInfo26_set_password_expired(PyObject *py_obj, PyObject *value, void *closure) { struct samr_UserInfo26 *object = (struct samr_UserInfo26 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_expired"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_expired)); 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->password_expired = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_UserInfo26_getsetters[] = { { .name = discard_const_p(char, "password"), .get = py_samr_UserInfo26_get_password, .set = py_samr_UserInfo26_set_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPasswordEx") }, { .name = discard_const_p(char, "password_expired"), .get = py_samr_UserInfo26_get_password_expired, .set = py_samr_UserInfo26_set_password_expired, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_samr_UserInfo26_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_UserInfo26, type); } static PyTypeObject samr_UserInfo26_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo26", .tp_getset = py_samr_UserInfo26_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo26_new, }; static PyObject *py_import_samr_UserInfo(TALLOC_CTX *mem_ctx, int level, union samr_UserInfo *in) { PyObject *ret; switch (level) { case 1: ret = pytalloc_reference_ex(&samr_UserInfo1_Type, mem_ctx, &in->info1); return ret; case 2: ret = pytalloc_reference_ex(&samr_UserInfo2_Type, mem_ctx, &in->info2); return ret; case 3: ret = pytalloc_reference_ex(&samr_UserInfo3_Type, mem_ctx, &in->info3); return ret; case 4: ret = pytalloc_reference_ex(&samr_UserInfo4_Type, mem_ctx, &in->info4); return ret; case 5: ret = pytalloc_reference_ex(&samr_UserInfo5_Type, mem_ctx, &in->info5); return ret; case 6: ret = pytalloc_reference_ex(&samr_UserInfo6_Type, mem_ctx, &in->info6); return ret; case 7: ret = pytalloc_reference_ex(&samr_UserInfo7_Type, mem_ctx, &in->info7); return ret; case 8: ret = pytalloc_reference_ex(&samr_UserInfo8_Type, mem_ctx, &in->info8); return ret; case 9: ret = pytalloc_reference_ex(&samr_UserInfo9_Type, mem_ctx, &in->info9); return ret; case 10: ret = pytalloc_reference_ex(&samr_UserInfo10_Type, mem_ctx, &in->info10); return ret; case 11: ret = pytalloc_reference_ex(&samr_UserInfo11_Type, mem_ctx, &in->info11); return ret; case 12: ret = pytalloc_reference_ex(&samr_UserInfo12_Type, mem_ctx, &in->info12); return ret; case 13: ret = pytalloc_reference_ex(&samr_UserInfo13_Type, mem_ctx, &in->info13); return ret; case 14: ret = pytalloc_reference_ex(&samr_UserInfo14_Type, mem_ctx, &in->info14); return ret; case 16: ret = pytalloc_reference_ex(&samr_UserInfo16_Type, mem_ctx, &in->info16); return ret; case 17: ret = pytalloc_reference_ex(&samr_UserInfo17_Type, mem_ctx, &in->info17); return ret; case 18: ret = pytalloc_reference_ex(&samr_UserInfo18_Type, mem_ctx, &in->info18); return ret; case 20: ret = pytalloc_reference_ex(&samr_UserInfo20_Type, mem_ctx, &in->info20); return ret; case 21: ret = pytalloc_reference_ex(&samr_UserInfo21_Type, mem_ctx, &in->info21); return ret; case 23: ret = pytalloc_reference_ex(&samr_UserInfo23_Type, mem_ctx, &in->info23); return ret; case 24: ret = pytalloc_reference_ex(&samr_UserInfo24_Type, mem_ctx, &in->info24); return ret; case 25: ret = pytalloc_reference_ex(&samr_UserInfo25_Type, mem_ctx, &in->info25); return ret; case 26: ret = pytalloc_reference_ex(&samr_UserInfo26_Type, mem_ctx, &in->info26); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union samr_UserInfo *py_export_samr_UserInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union samr_UserInfo *ret = talloc_zero(mem_ctx, union samr_UserInfo); switch (level) { case 1: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo1_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->info1 = *(struct samr_UserInfo1 *)pytalloc_get_ptr(in); break; case 2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info2"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo2_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->info2 = *(struct samr_UserInfo2 *)pytalloc_get_ptr(in); break; case 3: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info3"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo3_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->info3 = *(struct samr_UserInfo3 *)pytalloc_get_ptr(in); break; case 4: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info4"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo4_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->info4 = *(struct samr_UserInfo4 *)pytalloc_get_ptr(in); break; case 5: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info5"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo5_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->info5 = *(struct samr_UserInfo5 *)pytalloc_get_ptr(in); break; case 6: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info6"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo6_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->info6 = *(struct samr_UserInfo6 *)pytalloc_get_ptr(in); break; case 7: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info7"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo7_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->info7 = *(struct samr_UserInfo7 *)pytalloc_get_ptr(in); break; case 8: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info8"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo8_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->info8 = *(struct samr_UserInfo8 *)pytalloc_get_ptr(in); break; case 9: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info9"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo9_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->info9 = *(struct samr_UserInfo9 *)pytalloc_get_ptr(in); break; case 10: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info10"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo10_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->info10 = *(struct samr_UserInfo10 *)pytalloc_get_ptr(in); break; case 11: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info11"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo11_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->info11 = *(struct samr_UserInfo11 *)pytalloc_get_ptr(in); break; case 12: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info12"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo12_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->info12 = *(struct samr_UserInfo12 *)pytalloc_get_ptr(in); break; case 13: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info13"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo13_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->info13 = *(struct samr_UserInfo13 *)pytalloc_get_ptr(in); break; case 14: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info14"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo14_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->info14 = *(struct samr_UserInfo14 *)pytalloc_get_ptr(in); break; case 16: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info16"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo16_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->info16 = *(struct samr_UserInfo16 *)pytalloc_get_ptr(in); break; case 17: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info17"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo17_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->info17 = *(struct samr_UserInfo17 *)pytalloc_get_ptr(in); break; case 18: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info18"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo18_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->info18 = *(struct samr_UserInfo18 *)pytalloc_get_ptr(in); break; case 20: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info20"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo20_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->info20 = *(struct samr_UserInfo20 *)pytalloc_get_ptr(in); break; case 21: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info21"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo21_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->info21 = *(struct samr_UserInfo21 *)pytalloc_get_ptr(in); break; case 23: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info23"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo23_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->info23 = *(struct samr_UserInfo23 *)pytalloc_get_ptr(in); break; case 24: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info24"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo24_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->info24 = *(struct samr_UserInfo24 *)pytalloc_get_ptr(in); break; case 25: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info25"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo25_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->info25 = *(struct samr_UserInfo25 *)pytalloc_get_ptr(in); break; case 26: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info26"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_UserInfo26_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->info26 = *(struct samr_UserInfo26 *)pytalloc_get_ptr(in); break; default: PyErr_SetString(PyExc_TypeError, "invalid union level value"); talloc_free(ret); ret = NULL; } return ret; } static PyObject *py_samr_UserInfo_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 samr_UserInfo *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 samr_UserInfo *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_UserInfo!"); return NULL; } return py_import_samr_UserInfo(mem_ctx, level, in); } static PyObject *py_samr_UserInfo_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 samr_UserInfo *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_samr_UserInfo(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_samr_UserInfo_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_UserInfo_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_UserInfo_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_samr_UserInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject samr_UserInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.UserInfo", .tp_getset = NULL, .tp_methods = py_samr_UserInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_UserInfo_new, }; static PyObject *py_samr_RidWithAttribute_get_rid(PyObject *obj, void *closure) { struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid); return py_rid; } static int py_samr_RidWithAttribute_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid)); 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->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_RidWithAttribute_get_attributes(PyObject *obj, void *closure) { struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(obj); PyObject *py_attributes; py_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->attributes); return py_attributes; } static int py_samr_RidWithAttribute_set_attributes(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes)); 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->attributes = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_RidWithAttribute_getsetters[] = { { .name = discard_const_p(char, "rid"), .get = py_samr_RidWithAttribute_get_rid, .set = py_samr_RidWithAttribute_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "attributes"), .get = py_samr_RidWithAttribute_get_attributes, .set = py_samr_RidWithAttribute_set_attributes, .doc = discard_const_p(char, "PIDL-generated element of base type security_GroupAttrs") }, { .name = NULL } }; static PyObject *py_samr_RidWithAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_RidWithAttribute, type); } static PyObject *py_samr_RidWithAttribute_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; DATA_BLOB blob; enum ndr_err_code err; TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj)); if (tmp_ctx == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_samr_RidWithAttribute); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(tmp_ctx); PyErr_SetNdrError(err); return NULL; } ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(tmp_ctx); return ret; } static PyObject *py_samr_RidWithAttribute_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj); DATA_BLOB blob = {.data = NULL, .length = 0}; Py_ssize_t blob_length = 0; enum ndr_err_code err; const char * const kwnames[] = { "data_blob", "allow_remaining", NULL }; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } if (allow_remaining) { err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttribute); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttribute); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_samr_RidWithAttribute_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_RidWithAttribute, "samr_RidWithAttribute", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_samr_RidWithAttribute_methods[] = { { "__ndr_pack__", (PyCFunction)py_samr_RidWithAttribute_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RidWithAttribute_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_samr_RidWithAttribute_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_RidWithAttribute_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.RidWithAttribute", .tp_getset = py_samr_RidWithAttribute_getsetters, .tp_methods = py_samr_RidWithAttribute_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_RidWithAttribute_new, }; static PyObject *py_samr_RidWithAttributeArray_get_count(PyObject *obj, void *closure) { struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_samr_RidWithAttributeArray_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); 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->count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_RidWithAttributeArray_get_rids(PyObject *obj, void *closure) { struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(obj); PyObject *py_rids; if (object->rids == NULL) { Py_RETURN_NONE; } if (object->rids == NULL) { py_rids = Py_None; Py_INCREF(py_rids); } else { py_rids = PyList_New(object->count); if (py_rids == NULL) { return NULL; } { int rids_cntr_1; for (rids_cntr_1 = 0; rids_cntr_1 < (object->count); rids_cntr_1++) { PyObject *py_rids_1; py_rids_1 = pytalloc_reference_ex(&samr_RidWithAttribute_Type, object->rids, &object->rids[rids_cntr_1]); PyList_SetItem(py_rids, rids_cntr_1, py_rids_1); } } } return py_rids; } static int py_samr_RidWithAttributeArray_set_rids(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->rids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids"); return -1; } if (value == Py_None) { object->rids = NULL; } else { object->rids = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int rids_cntr_1; object->rids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->rids, PyList_GET_SIZE(value)); if (!object->rids) { return -1;; } talloc_set_name_const(object->rids, "ARRAY: object->rids"); for (rids_cntr_1 = 0; rids_cntr_1 < PyList_GET_SIZE(value); rids_cntr_1++) { if (PyList_GET_ITEM(value, rids_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids[rids_cntr_1]"); return -1; } PY_CHECK_TYPE(&samr_RidWithAttribute_Type, PyList_GET_ITEM(value, rids_cntr_1), return -1;); if (talloc_reference(object->rids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, rids_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->rids[rids_cntr_1] = *(struct samr_RidWithAttribute *)pytalloc_get_ptr(PyList_GET_ITEM(value, rids_cntr_1)); } } } return 0; } static PyGetSetDef py_samr_RidWithAttributeArray_getsetters[] = { { .name = discard_const_p(char, "count"), .get = py_samr_RidWithAttributeArray_get_count, .set = py_samr_RidWithAttributeArray_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "rids"), .get = py_samr_RidWithAttributeArray_get_rids, .set = py_samr_RidWithAttributeArray_set_rids, .doc = discard_const_p(char, "PIDL-generated element of base type samr_RidWithAttribute") }, { .name = NULL } }; static PyObject *py_samr_RidWithAttributeArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_RidWithAttributeArray, type); } static PyObject *py_samr_RidWithAttributeArray_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; DATA_BLOB blob; enum ndr_err_code err; TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj)); if (tmp_ctx == NULL) { PyErr_SetNdrError(NDR_ERR_ALLOC); return NULL; } err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_samr_RidWithAttributeArray); if (!NDR_ERR_CODE_IS_SUCCESS(err)) { TALLOC_FREE(tmp_ctx); PyErr_SetNdrError(err); return NULL; } ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length); TALLOC_FREE(tmp_ctx); return ret; } static PyObject *py_samr_RidWithAttributeArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs) { struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj); DATA_BLOB blob = {.data = NULL, .length = 0}; Py_ssize_t blob_length = 0; enum ndr_err_code err; const char * const kwnames[] = { "data_blob", "allow_remaining", NULL }; PyObject *allow_remaining_obj = NULL; bool allow_remaining = false; if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__", discard_const_p(char *, kwnames), &blob.data, &blob_length, &allow_remaining_obj)) { return NULL; } blob.length = blob_length; if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) { allow_remaining = true; } if (allow_remaining) { err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttributeArray); } else { err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttributeArray); } if (!NDR_ERR_CODE_IS_SUCCESS(err)) { PyErr_SetNdrError(err); return NULL; } Py_RETURN_NONE; } static PyObject *py_samr_RidWithAttributeArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_RidWithAttributeArray, "samr_RidWithAttributeArray", object); ret = PyUnicode_FromString(retstr); talloc_free(retstr); return ret; } static PyMethodDef py_samr_RidWithAttributeArray_methods[] = { { "__ndr_pack__", (PyCFunction)py_samr_RidWithAttributeArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" }, { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RidWithAttributeArray_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" }, { "__ndr_print__", (PyCFunction)py_samr_RidWithAttributeArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_RidWithAttributeArray_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.RidWithAttributeArray", .tp_getset = py_samr_RidWithAttributeArray_getsetters, .tp_methods = py_samr_RidWithAttributeArray_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_RidWithAttributeArray_new, }; static PyObject *py_samr_DispEntryGeneral_get_idx(PyObject *obj, void *closure) { struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj); PyObject *py_idx; py_idx = PyLong_FromUnsignedLongLong((uint32_t)object->idx); return py_idx; } static int py_samr_DispEntryGeneral_set_idx(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idx"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idx)); 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->idx = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispEntryGeneral_get_rid(PyObject *obj, void *closure) { struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid); return py_rid; } static int py_samr_DispEntryGeneral_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid)); 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->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispEntryGeneral_get_acct_flags(PyObject *obj, void *closure) { struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj); PyObject *py_acct_flags; py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags); return py_acct_flags; } static int py_samr_DispEntryGeneral_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags)); 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->acct_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispEntryGeneral_get_account_name(PyObject *obj, void *closure) { struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj); PyObject *py_account_name; py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name); return py_account_name; } static int py_samr_DispEntryGeneral_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DispEntryGeneral_get_description(PyObject *obj, void *closure) { struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj); PyObject *py_description; py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description); return py_description; } static int py_samr_DispEntryGeneral_set_description(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->description = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DispEntryGeneral_get_full_name(PyObject *obj, void *closure) { struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj); PyObject *py_full_name; py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name); return py_full_name; } static int py_samr_DispEntryGeneral_set_full_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_DispEntryGeneral_getsetters[] = { { .name = discard_const_p(char, "idx"), .get = py_samr_DispEntryGeneral_get_idx, .set = py_samr_DispEntryGeneral_set_idx, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "rid"), .get = py_samr_DispEntryGeneral_get_rid, .set = py_samr_DispEntryGeneral_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "acct_flags"), .get = py_samr_DispEntryGeneral_get_acct_flags, .set = py_samr_DispEntryGeneral_set_acct_flags, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags") }, { .name = discard_const_p(char, "account_name"), .get = py_samr_DispEntryGeneral_get_account_name, .set = py_samr_DispEntryGeneral_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "description"), .get = py_samr_DispEntryGeneral_get_description, .set = py_samr_DispEntryGeneral_set_description, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "full_name"), .get = py_samr_DispEntryGeneral_get_full_name, .set = py_samr_DispEntryGeneral_set_full_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_DispEntryGeneral_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DispEntryGeneral, type); } static PyTypeObject samr_DispEntryGeneral_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DispEntryGeneral", .tp_getset = py_samr_DispEntryGeneral_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DispEntryGeneral_new, }; static PyObject *py_samr_DispInfoGeneral_get_count(PyObject *obj, void *closure) { struct samr_DispInfoGeneral *object = (struct samr_DispInfoGeneral *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_samr_DispInfoGeneral_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispInfoGeneral *object = (struct samr_DispInfoGeneral *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); 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->count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispInfoGeneral_get_entries(PyObject *obj, void *closure) { struct samr_DispInfoGeneral *object = (struct samr_DispInfoGeneral *)pytalloc_get_ptr(obj); PyObject *py_entries; if (object->entries == NULL) { Py_RETURN_NONE; } if (object->entries == NULL) { py_entries = Py_None; Py_INCREF(py_entries); } else { py_entries = PyList_New(object->count); if (py_entries == NULL) { return NULL; } { int entries_cntr_1; for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) { PyObject *py_entries_1; py_entries_1 = pytalloc_reference_ex(&samr_DispEntryGeneral_Type, object->entries, &object->entries[entries_cntr_1]); PyList_SetItem(py_entries, entries_cntr_1, py_entries_1); } } } return py_entries; } static int py_samr_DispInfoGeneral_set_entries(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispInfoGeneral *object = (struct samr_DispInfoGeneral *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries"); return -1; } if (value == Py_None) { object->entries = NULL; } else { object->entries = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int entries_cntr_1; object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value)); if (!object->entries) { return -1;; } talloc_set_name_const(object->entries, "ARRAY: object->entries"); for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) { if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]"); return -1; } PY_CHECK_TYPE(&samr_DispEntryGeneral_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;); if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->entries[entries_cntr_1] = *(struct samr_DispEntryGeneral *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1)); } } } return 0; } static PyGetSetDef py_samr_DispInfoGeneral_getsetters[] = { { .name = discard_const_p(char, "count"), .get = py_samr_DispInfoGeneral_get_count, .set = py_samr_DispInfoGeneral_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "entries"), .get = py_samr_DispInfoGeneral_get_entries, .set = py_samr_DispInfoGeneral_set_entries, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispEntryGeneral") }, { .name = NULL } }; static PyObject *py_samr_DispInfoGeneral_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DispInfoGeneral, type); } static PyTypeObject samr_DispInfoGeneral_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DispInfoGeneral", .tp_getset = py_samr_DispInfoGeneral_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DispInfoGeneral_new, }; static PyObject *py_samr_DispEntryFull_get_idx(PyObject *obj, void *closure) { struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj); PyObject *py_idx; py_idx = PyLong_FromUnsignedLongLong((uint32_t)object->idx); return py_idx; } static int py_samr_DispEntryFull_set_idx(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idx"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idx)); 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->idx = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispEntryFull_get_rid(PyObject *obj, void *closure) { struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid); return py_rid; } static int py_samr_DispEntryFull_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid)); 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->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispEntryFull_get_acct_flags(PyObject *obj, void *closure) { struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj); PyObject *py_acct_flags; py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags); return py_acct_flags; } static int py_samr_DispEntryFull_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags)); 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->acct_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispEntryFull_get_account_name(PyObject *obj, void *closure) { struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj); PyObject *py_account_name; py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name); return py_account_name; } static int py_samr_DispEntryFull_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DispEntryFull_get_description(PyObject *obj, void *closure) { struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj); PyObject *py_description; py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description); return py_description; } static int py_samr_DispEntryFull_set_description(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->description = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_DispEntryFull_getsetters[] = { { .name = discard_const_p(char, "idx"), .get = py_samr_DispEntryFull_get_idx, .set = py_samr_DispEntryFull_set_idx, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "rid"), .get = py_samr_DispEntryFull_get_rid, .set = py_samr_DispEntryFull_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "acct_flags"), .get = py_samr_DispEntryFull_get_acct_flags, .set = py_samr_DispEntryFull_set_acct_flags, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags") }, { .name = discard_const_p(char, "account_name"), .get = py_samr_DispEntryFull_get_account_name, .set = py_samr_DispEntryFull_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "description"), .get = py_samr_DispEntryFull_get_description, .set = py_samr_DispEntryFull_set_description, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_DispEntryFull_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DispEntryFull, type); } static PyTypeObject samr_DispEntryFull_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DispEntryFull", .tp_getset = py_samr_DispEntryFull_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DispEntryFull_new, }; static PyObject *py_samr_DispInfoFull_get_count(PyObject *obj, void *closure) { struct samr_DispInfoFull *object = (struct samr_DispInfoFull *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_samr_DispInfoFull_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispInfoFull *object = (struct samr_DispInfoFull *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); 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->count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispInfoFull_get_entries(PyObject *obj, void *closure) { struct samr_DispInfoFull *object = (struct samr_DispInfoFull *)pytalloc_get_ptr(obj); PyObject *py_entries; if (object->entries == NULL) { Py_RETURN_NONE; } if (object->entries == NULL) { py_entries = Py_None; Py_INCREF(py_entries); } else { py_entries = PyList_New(object->count); if (py_entries == NULL) { return NULL; } { int entries_cntr_1; for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) { PyObject *py_entries_1; py_entries_1 = pytalloc_reference_ex(&samr_DispEntryFull_Type, object->entries, &object->entries[entries_cntr_1]); PyList_SetItem(py_entries, entries_cntr_1, py_entries_1); } } } return py_entries; } static int py_samr_DispInfoFull_set_entries(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispInfoFull *object = (struct samr_DispInfoFull *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries"); return -1; } if (value == Py_None) { object->entries = NULL; } else { object->entries = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int entries_cntr_1; object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value)); if (!object->entries) { return -1;; } talloc_set_name_const(object->entries, "ARRAY: object->entries"); for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) { if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]"); return -1; } PY_CHECK_TYPE(&samr_DispEntryFull_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;); if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->entries[entries_cntr_1] = *(struct samr_DispEntryFull *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1)); } } } return 0; } static PyGetSetDef py_samr_DispInfoFull_getsetters[] = { { .name = discard_const_p(char, "count"), .get = py_samr_DispInfoFull_get_count, .set = py_samr_DispInfoFull_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "entries"), .get = py_samr_DispInfoFull_get_entries, .set = py_samr_DispInfoFull_set_entries, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispEntryFull") }, { .name = NULL } }; static PyObject *py_samr_DispInfoFull_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DispInfoFull, type); } static PyTypeObject samr_DispInfoFull_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DispInfoFull", .tp_getset = py_samr_DispInfoFull_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DispInfoFull_new, }; static PyObject *py_samr_DispEntryFullGroup_get_idx(PyObject *obj, void *closure) { struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj); PyObject *py_idx; py_idx = PyLong_FromUnsignedLongLong((uint32_t)object->idx); return py_idx; } static int py_samr_DispEntryFullGroup_set_idx(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idx"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idx)); 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->idx = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispEntryFullGroup_get_rid(PyObject *obj, void *closure) { struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid); return py_rid; } static int py_samr_DispEntryFullGroup_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid)); 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->rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispEntryFullGroup_get_acct_flags(PyObject *obj, void *closure) { struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj); PyObject *py_acct_flags; py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags); return py_acct_flags; } static int py_samr_DispEntryFullGroup_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags)); 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->acct_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispEntryFullGroup_get_account_name(PyObject *obj, void *closure) { struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj); PyObject *py_account_name; py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name); return py_account_name; } static int py_samr_DispEntryFullGroup_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DispEntryFullGroup_get_description(PyObject *obj, void *closure) { struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj); PyObject *py_description; py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description); return py_description; } static int py_samr_DispEntryFullGroup_set_description(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->description = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_DispEntryFullGroup_getsetters[] = { { .name = discard_const_p(char, "idx"), .get = py_samr_DispEntryFullGroup_get_idx, .set = py_samr_DispEntryFullGroup_set_idx, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "rid"), .get = py_samr_DispEntryFullGroup_get_rid, .set = py_samr_DispEntryFullGroup_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "acct_flags"), .get = py_samr_DispEntryFullGroup_get_acct_flags, .set = py_samr_DispEntryFullGroup_set_acct_flags, .doc = discard_const_p(char, "PIDL-generated element of base type security_GroupAttrs") }, { .name = discard_const_p(char, "account_name"), .get = py_samr_DispEntryFullGroup_get_account_name, .set = py_samr_DispEntryFullGroup_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "description"), .get = py_samr_DispEntryFullGroup_get_description, .set = py_samr_DispEntryFullGroup_set_description, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_samr_DispEntryFullGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DispEntryFullGroup, type); } static PyTypeObject samr_DispEntryFullGroup_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DispEntryFullGroup", .tp_getset = py_samr_DispEntryFullGroup_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DispEntryFullGroup_new, }; static PyObject *py_samr_DispInfoFullGroups_get_count(PyObject *obj, void *closure) { struct samr_DispInfoFullGroups *object = (struct samr_DispInfoFullGroups *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_samr_DispInfoFullGroups_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispInfoFullGroups *object = (struct samr_DispInfoFullGroups *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); 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->count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispInfoFullGroups_get_entries(PyObject *obj, void *closure) { struct samr_DispInfoFullGroups *object = (struct samr_DispInfoFullGroups *)pytalloc_get_ptr(obj); PyObject *py_entries; if (object->entries == NULL) { Py_RETURN_NONE; } if (object->entries == NULL) { py_entries = Py_None; Py_INCREF(py_entries); } else { py_entries = PyList_New(object->count); if (py_entries == NULL) { return NULL; } { int entries_cntr_1; for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) { PyObject *py_entries_1; py_entries_1 = pytalloc_reference_ex(&samr_DispEntryFullGroup_Type, object->entries, &object->entries[entries_cntr_1]); PyList_SetItem(py_entries, entries_cntr_1, py_entries_1); } } } return py_entries; } static int py_samr_DispInfoFullGroups_set_entries(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispInfoFullGroups *object = (struct samr_DispInfoFullGroups *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries"); return -1; } if (value == Py_None) { object->entries = NULL; } else { object->entries = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int entries_cntr_1; object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value)); if (!object->entries) { return -1;; } talloc_set_name_const(object->entries, "ARRAY: object->entries"); for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) { if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]"); return -1; } PY_CHECK_TYPE(&samr_DispEntryFullGroup_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;); if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->entries[entries_cntr_1] = *(struct samr_DispEntryFullGroup *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1)); } } } return 0; } static PyGetSetDef py_samr_DispInfoFullGroups_getsetters[] = { { .name = discard_const_p(char, "count"), .get = py_samr_DispInfoFullGroups_get_count, .set = py_samr_DispInfoFullGroups_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "entries"), .get = py_samr_DispInfoFullGroups_get_entries, .set = py_samr_DispInfoFullGroups_set_entries, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispEntryFullGroup") }, { .name = NULL } }; static PyObject *py_samr_DispInfoFullGroups_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DispInfoFullGroups, type); } static PyTypeObject samr_DispInfoFullGroups_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DispInfoFullGroups", .tp_getset = py_samr_DispInfoFullGroups_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DispInfoFullGroups_new, }; static PyObject *py_samr_DispEntryAscii_get_idx(PyObject *obj, void *closure) { struct samr_DispEntryAscii *object = (struct samr_DispEntryAscii *)pytalloc_get_ptr(obj); PyObject *py_idx; py_idx = PyLong_FromUnsignedLongLong((uint32_t)object->idx); return py_idx; } static int py_samr_DispEntryAscii_set_idx(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryAscii *object = (struct samr_DispEntryAscii *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idx"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idx)); 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->idx = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispEntryAscii_get_account_name(PyObject *obj, void *closure) { struct samr_DispEntryAscii *object = (struct samr_DispEntryAscii *)pytalloc_get_ptr(obj); PyObject *py_account_name; py_account_name = pytalloc_reference_ex(lsa_AsciiStringLarge_Type, pytalloc_get_mem_ctx(obj), &object->account_name); return py_account_name; } static int py_samr_DispEntryAscii_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispEntryAscii *object = (struct samr_DispEntryAscii *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name"); return -1; } PY_CHECK_TYPE(lsa_AsciiStringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account_name = *(struct lsa_AsciiStringLarge *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_samr_DispEntryAscii_getsetters[] = { { .name = discard_const_p(char, "idx"), .get = py_samr_DispEntryAscii_get_idx, .set = py_samr_DispEntryAscii_set_idx, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "account_name"), .get = py_samr_DispEntryAscii_get_account_name, .set = py_samr_DispEntryAscii_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AsciiStringLarge") }, { .name = NULL } }; static PyObject *py_samr_DispEntryAscii_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DispEntryAscii, type); } static PyTypeObject samr_DispEntryAscii_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DispEntryAscii", .tp_getset = py_samr_DispEntryAscii_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DispEntryAscii_new, }; static PyObject *py_samr_DispInfoAscii_get_count(PyObject *obj, void *closure) { struct samr_DispInfoAscii *object = (struct samr_DispInfoAscii *)pytalloc_get_ptr(obj); PyObject *py_count; py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count); return py_count; } static int py_samr_DispInfoAscii_set_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispInfoAscii *object = (struct samr_DispInfoAscii *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count)); 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->count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DispInfoAscii_get_entries(PyObject *obj, void *closure) { struct samr_DispInfoAscii *object = (struct samr_DispInfoAscii *)pytalloc_get_ptr(obj); PyObject *py_entries; if (object->entries == NULL) { Py_RETURN_NONE; } if (object->entries == NULL) { py_entries = Py_None; Py_INCREF(py_entries); } else { py_entries = PyList_New(object->count); if (py_entries == NULL) { return NULL; } { int entries_cntr_1; for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) { PyObject *py_entries_1; py_entries_1 = pytalloc_reference_ex(&samr_DispEntryAscii_Type, object->entries, &object->entries[entries_cntr_1]); PyList_SetItem(py_entries, entries_cntr_1, py_entries_1); } } } return py_entries; } static int py_samr_DispInfoAscii_set_entries(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DispInfoAscii *object = (struct samr_DispInfoAscii *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries"); return -1; } if (value == Py_None) { object->entries = NULL; } else { object->entries = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int entries_cntr_1; object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value)); if (!object->entries) { return -1;; } talloc_set_name_const(object->entries, "ARRAY: object->entries"); for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) { if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]"); return -1; } PY_CHECK_TYPE(&samr_DispEntryAscii_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;); if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->entries[entries_cntr_1] = *(struct samr_DispEntryAscii *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1)); } } } return 0; } static PyGetSetDef py_samr_DispInfoAscii_getsetters[] = { { .name = discard_const_p(char, "count"), .get = py_samr_DispInfoAscii_get_count, .set = py_samr_DispInfoAscii_set_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "entries"), .get = py_samr_DispInfoAscii_get_entries, .set = py_samr_DispInfoAscii_set_entries, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispEntryAscii") }, { .name = NULL } }; static PyObject *py_samr_DispInfoAscii_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_DispInfoAscii, type); } static PyTypeObject samr_DispInfoAscii_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DispInfoAscii", .tp_getset = py_samr_DispInfoAscii_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DispInfoAscii_new, }; static PyObject *py_import_samr_DispInfo(TALLOC_CTX *mem_ctx, int level, union samr_DispInfo *in) { PyObject *ret; switch (level) { case 1: ret = pytalloc_reference_ex(&samr_DispInfoGeneral_Type, mem_ctx, &in->info1); return ret; case 2: ret = pytalloc_reference_ex(&samr_DispInfoFull_Type, mem_ctx, &in->info2); return ret; case 3: ret = pytalloc_reference_ex(&samr_DispInfoFullGroups_Type, mem_ctx, &in->info3); return ret; case 4: ret = pytalloc_reference_ex(&samr_DispInfoAscii_Type, mem_ctx, &in->info4); return ret; case 5: ret = pytalloc_reference_ex(&samr_DispInfoAscii_Type, mem_ctx, &in->info5); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union samr_DispInfo *py_export_samr_DispInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union samr_DispInfo *ret = talloc_zero(mem_ctx, union samr_DispInfo); switch (level) { case 1: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DispInfoGeneral_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->info1 = *(struct samr_DispInfoGeneral *)pytalloc_get_ptr(in); break; case 2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info2"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DispInfoFull_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->info2 = *(struct samr_DispInfoFull *)pytalloc_get_ptr(in); break; case 3: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info3"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DispInfoFullGroups_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->info3 = *(struct samr_DispInfoFullGroups *)pytalloc_get_ptr(in); break; case 4: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info4"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DispInfoAscii_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->info4 = *(struct samr_DispInfoAscii *)pytalloc_get_ptr(in); break; case 5: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info5"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_DispInfoAscii_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->info5 = *(struct samr_DispInfoAscii *)pytalloc_get_ptr(in); break; default: PyErr_SetString(PyExc_TypeError, "invalid union level value"); talloc_free(ret); ret = NULL; } return ret; } static PyObject *py_samr_DispInfo_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 samr_DispInfo *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 samr_DispInfo *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_DispInfo!"); return NULL; } return py_import_samr_DispInfo(mem_ctx, level, in); } static PyObject *py_samr_DispInfo_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 samr_DispInfo *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_samr_DispInfo(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_samr_DispInfo_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DispInfo_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DispInfo_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_samr_DispInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject samr_DispInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DispInfo", .tp_getset = NULL, .tp_methods = py_samr_DispInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DispInfo_new, }; static PyObject *py_samr_PwInfo_get_min_password_length(PyObject *obj, void *closure) { struct samr_PwInfo *object = (struct samr_PwInfo *)pytalloc_get_ptr(obj); PyObject *py_min_password_length; py_min_password_length = PyLong_FromLong((uint16_t)object->min_password_length); return py_min_password_length; } static int py_samr_PwInfo_set_min_password_length(PyObject *py_obj, PyObject *value, void *closure) { struct samr_PwInfo *object = (struct samr_PwInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->min_password_length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_password_length)); 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->min_password_length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_PwInfo_get_password_properties(PyObject *obj, void *closure) { struct samr_PwInfo *object = (struct samr_PwInfo *)pytalloc_get_ptr(obj); PyObject *py_password_properties; py_password_properties = PyLong_FromUnsignedLongLong((uint32_t)object->password_properties); return py_password_properties; } static int py_samr_PwInfo_set_password_properties(PyObject *py_obj, PyObject *value, void *closure) { struct samr_PwInfo *object = (struct samr_PwInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_properties"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_properties)); 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->password_properties = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_PwInfo_getsetters[] = { { .name = discard_const_p(char, "min_password_length"), .get = py_samr_PwInfo_get_min_password_length, .set = py_samr_PwInfo_set_min_password_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "password_properties"), .get = py_samr_PwInfo_get_password_properties, .set = py_samr_PwInfo_set_password_properties, .doc = discard_const_p(char, "PIDL-generated element of base type samr_PasswordProperties") }, { .name = NULL } }; static PyObject *py_samr_PwInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_PwInfo, type); } static PyTypeObject samr_PwInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.PwInfo", .tp_getset = py_samr_PwInfo_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_PwInfo_new, }; static PyObject *py_userPwdChangeFailureInformation_get_extendedFailureReason(PyObject *obj, void *closure) { struct userPwdChangeFailureInformation *object = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(obj); PyObject *py_extendedFailureReason; py_extendedFailureReason = PyLong_FromUnsignedLongLong((uint32_t)object->extendedFailureReason); return py_extendedFailureReason; } static int py_userPwdChangeFailureInformation_set_extendedFailureReason(PyObject *py_obj, PyObject *value, void *closure) { struct userPwdChangeFailureInformation *object = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->extendedFailureReason"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->extendedFailureReason)); 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->extendedFailureReason = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_userPwdChangeFailureInformation_get_filterModuleName(PyObject *obj, void *closure) { struct userPwdChangeFailureInformation *object = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(obj); PyObject *py_filterModuleName; py_filterModuleName = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->filterModuleName); return py_filterModuleName; } static int py_userPwdChangeFailureInformation_set_filterModuleName(PyObject *py_obj, PyObject *value, void *closure) { struct userPwdChangeFailureInformation *object = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->filterModuleName"); return -1; } PY_CHECK_TYPE(lsa_String_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->filterModuleName = *(struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyGetSetDef py_userPwdChangeFailureInformation_getsetters[] = { { .name = discard_const_p(char, "extendedFailureReason"), .get = py_userPwdChangeFailureInformation_get_extendedFailureReason, .set = py_userPwdChangeFailureInformation_set_extendedFailureReason, .doc = discard_const_p(char, "PIDL-generated element of base type samPwdChangeReason") }, { .name = discard_const_p(char, "filterModuleName"), .get = py_userPwdChangeFailureInformation_get_filterModuleName, .set = py_userPwdChangeFailureInformation_set_filterModuleName, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = NULL } }; static PyObject *py_userPwdChangeFailureInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct userPwdChangeFailureInformation, type); } static PyTypeObject userPwdChangeFailureInformation_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.userPwdChangeFailureInformation", .tp_getset = py_userPwdChangeFailureInformation_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_userPwdChangeFailureInformation_new, }; static PyObject *py_samr_ConnectInfo1_get_client_version(PyObject *obj, void *closure) { struct samr_ConnectInfo1 *object = (struct samr_ConnectInfo1 *)pytalloc_get_ptr(obj); PyObject *py_client_version; py_client_version = PyLong_FromUnsignedLongLong((uint32_t)object->client_version); return py_client_version; } static int py_samr_ConnectInfo1_set_client_version(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ConnectInfo1 *object = (struct samr_ConnectInfo1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client_version"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->client_version)); 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->client_version = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ConnectInfo1_get_unknown2(PyObject *obj, void *closure) { struct samr_ConnectInfo1 *object = (struct samr_ConnectInfo1 *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown2); return py_unknown2; } static int py_samr_ConnectInfo1_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ConnectInfo1 *object = (struct samr_ConnectInfo1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown2)); 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->unknown2 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_ConnectInfo1_getsetters[] = { { .name = discard_const_p(char, "client_version"), .get = py_samr_ConnectInfo1_get_client_version, .set = py_samr_ConnectInfo1_set_client_version, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectVersion") }, { .name = discard_const_p(char, "unknown2"), .get = py_samr_ConnectInfo1_get_unknown2, .set = py_samr_ConnectInfo1_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = NULL } }; static PyObject *py_samr_ConnectInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_ConnectInfo1, type); } static PyTypeObject samr_ConnectInfo1_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ConnectInfo1", .tp_getset = py_samr_ConnectInfo1_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ConnectInfo1_new, }; static PyObject *py_import_samr_ConnectInfo(TALLOC_CTX *mem_ctx, int level, union samr_ConnectInfo *in) { PyObject *ret; switch (level) { case 1: ret = pytalloc_reference_ex(&samr_ConnectInfo1_Type, mem_ctx, &in->info1); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union samr_ConnectInfo *py_export_samr_ConnectInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union samr_ConnectInfo *ret = talloc_zero(mem_ctx, union samr_ConnectInfo); switch (level) { case 1: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_ConnectInfo1_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->info1 = *(struct samr_ConnectInfo1 *)pytalloc_get_ptr(in); break; default: PyErr_SetString(PyExc_TypeError, "invalid union level value"); talloc_free(ret); ret = NULL; } return ret; } static PyObject *py_samr_ConnectInfo_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 samr_ConnectInfo *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 samr_ConnectInfo *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_ConnectInfo!"); return NULL; } return py_import_samr_ConnectInfo(mem_ctx, level, in); } static PyObject *py_samr_ConnectInfo_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 samr_ConnectInfo *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_samr_ConnectInfo(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_samr_ConnectInfo_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ConnectInfo_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ConnectInfo_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_samr_ConnectInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject samr_ConnectInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ConnectInfo", .tp_getset = NULL, .tp_methods = py_samr_ConnectInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ConnectInfo_new, }; static PyObject *py_samr_ValidationBlob_get_length(PyObject *obj, void *closure) { struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(obj); PyObject *py_length; py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length); return py_length; } static int py_samr_ValidationBlob_set_length(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length)); 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->length = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ValidationBlob_get_data(PyObject *obj, void *closure) { struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(obj); PyObject *py_data; if (object->data == NULL) { Py_RETURN_NONE; } if (object->data == NULL) { py_data = Py_None; Py_INCREF(py_data); } else { py_data = PyList_New(object->length); if (py_data == NULL) { return NULL; } { int data_cntr_1; for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) { PyObject *py_data_1; py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]); PyList_SetItem(py_data, data_cntr_1, py_data_1); } } } return py_data; } static int py_samr_ValidationBlob_set_data(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data"); return -1; } if (value == Py_None) { object->data = NULL; } else { object->data = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int data_cntr_1; object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value)); if (!object->data) { return -1;; } talloc_set_name_const(object->data, "ARRAY: object->data"); for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) { if (PyList_GET_ITEM(value, data_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1])); if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1)); 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->data[data_cntr_1] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } } return 0; } static PyGetSetDef py_samr_ValidationBlob_getsetters[] = { { .name = discard_const_p(char, "length"), .get = py_samr_ValidationBlob_get_length, .set = py_samr_ValidationBlob_set_length, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "data"), .get = py_samr_ValidationBlob_get_data, .set = py_samr_ValidationBlob_set_data, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_samr_ValidationBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_ValidationBlob, type); } static PyTypeObject samr_ValidationBlob_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ValidationBlob", .tp_getset = py_samr_ValidationBlob_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ValidationBlob_new, }; static PyObject *py_samr_ValidatePasswordInfo_get_fields_present(PyObject *obj, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj); PyObject *py_fields_present; py_fields_present = PyLong_FromUnsignedLongLong((uint32_t)object->fields_present); return py_fields_present; } static int py_samr_ValidatePasswordInfo_set_fields_present(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->fields_present"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fields_present)); 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->fields_present = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ValidatePasswordInfo_get_last_password_change(PyObject *obj, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj); PyObject *py_last_password_change; py_last_password_change = PyLong_FromUnsignedLongLong(object->last_password_change); return py_last_password_change; } static int py_samr_ValidatePasswordInfo_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_password_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_password_change)); 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->last_password_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ValidatePasswordInfo_get_bad_password_time(PyObject *obj, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj); PyObject *py_bad_password_time; py_bad_password_time = PyLong_FromUnsignedLongLong(object->bad_password_time); return py_bad_password_time; } static int py_samr_ValidatePasswordInfo_set_bad_password_time(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_password_time"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_password_time)); 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->bad_password_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ValidatePasswordInfo_get_lockout_time(PyObject *obj, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj); PyObject *py_lockout_time; py_lockout_time = PyLong_FromUnsignedLongLong(object->lockout_time); return py_lockout_time; } static int py_samr_ValidatePasswordInfo_set_lockout_time(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_time"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_time)); 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->lockout_time = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ValidatePasswordInfo_get_bad_pwd_count(PyObject *obj, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj); PyObject *py_bad_pwd_count; py_bad_pwd_count = PyLong_FromUnsignedLongLong((uint32_t)object->bad_pwd_count); return py_bad_pwd_count; } static int py_samr_ValidatePasswordInfo_set_bad_pwd_count(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_pwd_count"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_pwd_count)); 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->bad_pwd_count = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ValidatePasswordInfo_get_pwd_history_len(PyObject *obj, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj); PyObject *py_pwd_history_len; py_pwd_history_len = PyLong_FromUnsignedLongLong((uint32_t)object->pwd_history_len); return py_pwd_history_len; } static int py_samr_ValidatePasswordInfo_set_pwd_history_len(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pwd_history_len"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pwd_history_len)); 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->pwd_history_len = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ValidatePasswordInfo_get_pwd_history(PyObject *obj, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj); PyObject *py_pwd_history; if (object->pwd_history == NULL) { Py_RETURN_NONE; } if (object->pwd_history == NULL) { py_pwd_history = Py_None; Py_INCREF(py_pwd_history); } else { py_pwd_history = PyList_New(object->pwd_history_len); if (py_pwd_history == NULL) { return NULL; } { int pwd_history_cntr_1; for (pwd_history_cntr_1 = 0; pwd_history_cntr_1 < (object->pwd_history_len); pwd_history_cntr_1++) { PyObject *py_pwd_history_1; py_pwd_history_1 = pytalloc_reference_ex(&samr_ValidationBlob_Type, object->pwd_history, &object->pwd_history[pwd_history_cntr_1]); PyList_SetItem(py_pwd_history, pwd_history_cntr_1, py_pwd_history_1); } } } return py_pwd_history; } static int py_samr_ValidatePasswordInfo_set_pwd_history(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->pwd_history)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pwd_history"); return -1; } if (value == Py_None) { object->pwd_history = NULL; } else { object->pwd_history = NULL; PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int pwd_history_cntr_1; object->pwd_history = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->pwd_history, PyList_GET_SIZE(value)); if (!object->pwd_history) { return -1;; } talloc_set_name_const(object->pwd_history, "ARRAY: object->pwd_history"); for (pwd_history_cntr_1 = 0; pwd_history_cntr_1 < PyList_GET_SIZE(value); pwd_history_cntr_1++) { if (PyList_GET_ITEM(value, pwd_history_cntr_1) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pwd_history[pwd_history_cntr_1]"); return -1; } PY_CHECK_TYPE(&samr_ValidationBlob_Type, PyList_GET_ITEM(value, pwd_history_cntr_1), return -1;); if (talloc_reference(object->pwd_history, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, pwd_history_cntr_1))) == NULL) { PyErr_NoMemory(); return -1; } object->pwd_history[pwd_history_cntr_1] = *(struct samr_ValidationBlob *)pytalloc_get_ptr(PyList_GET_ITEM(value, pwd_history_cntr_1)); } } } return 0; } static PyGetSetDef py_samr_ValidatePasswordInfo_getsetters[] = { { .name = discard_const_p(char, "fields_present"), .get = py_samr_ValidatePasswordInfo_get_fields_present, .set = py_samr_ValidatePasswordInfo_set_fields_present, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidateFieldsPresent") }, { .name = discard_const_p(char, "last_password_change"), .get = py_samr_ValidatePasswordInfo_get_last_password_change, .set = py_samr_ValidatePasswordInfo_set_last_password_change, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper") }, { .name = discard_const_p(char, "bad_password_time"), .get = py_samr_ValidatePasswordInfo_get_bad_password_time, .set = py_samr_ValidatePasswordInfo_set_bad_password_time, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper") }, { .name = discard_const_p(char, "lockout_time"), .get = py_samr_ValidatePasswordInfo_get_lockout_time, .set = py_samr_ValidatePasswordInfo_set_lockout_time, .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper") }, { .name = discard_const_p(char, "bad_pwd_count"), .get = py_samr_ValidatePasswordInfo_get_bad_pwd_count, .set = py_samr_ValidatePasswordInfo_set_bad_pwd_count, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "pwd_history_len"), .get = py_samr_ValidatePasswordInfo_get_pwd_history_len, .set = py_samr_ValidatePasswordInfo_set_pwd_history_len, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "pwd_history"), .get = py_samr_ValidatePasswordInfo_get_pwd_history, .set = py_samr_ValidatePasswordInfo_set_pwd_history, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidationBlob") }, { .name = NULL } }; static PyObject *py_samr_ValidatePasswordInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_ValidatePasswordInfo, type); } static PyTypeObject samr_ValidatePasswordInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ValidatePasswordInfo", .tp_getset = py_samr_ValidatePasswordInfo_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ValidatePasswordInfo_new, }; static PyObject *py_samr_ValidatePasswordRepCtr_get_info(PyObject *obj, void *closure) { struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(obj); PyObject *py_info; py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info); return py_info; } static int py_samr_ValidatePasswordRepCtr_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info"); return -1; } PY_CHECK_TYPE(&samr_ValidatePasswordInfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_ValidatePasswordRepCtr_get_status(PyObject *obj, void *closure) { struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(obj); PyObject *py_status; py_status = PyLong_FromLong((uint16_t)object->status); return py_status; } static int py_samr_ValidatePasswordRepCtr_set_status(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status)); 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->status = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_ValidatePasswordRepCtr_getsetters[] = { { .name = discard_const_p(char, "info"), .get = py_samr_ValidatePasswordRepCtr_get_info, .set = py_samr_ValidatePasswordRepCtr_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordInfo") }, { .name = discard_const_p(char, "status"), .get = py_samr_ValidatePasswordRepCtr_get_status, .set = py_samr_ValidatePasswordRepCtr_set_status, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidationStatus") }, { .name = NULL } }; static PyObject *py_samr_ValidatePasswordRepCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_ValidatePasswordRepCtr, type); } static PyTypeObject samr_ValidatePasswordRepCtr_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ValidatePasswordRepCtr", .tp_getset = py_samr_ValidatePasswordRepCtr_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ValidatePasswordRepCtr_new, }; static PyObject *py_import_samr_ValidatePasswordRep(TALLOC_CTX *mem_ctx, int level, union samr_ValidatePasswordRep *in) { PyObject *ret; switch (level) { case 1: ret = pytalloc_reference_ex(&samr_ValidatePasswordRepCtr_Type, mem_ctx, &in->ctr1); return ret; case 2: ret = pytalloc_reference_ex(&samr_ValidatePasswordRepCtr_Type, mem_ctx, &in->ctr2); return ret; case 3: ret = pytalloc_reference_ex(&samr_ValidatePasswordRepCtr_Type, mem_ctx, &in->ctr3); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union samr_ValidatePasswordRep *py_export_samr_ValidatePasswordRep(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union samr_ValidatePasswordRep *ret = talloc_zero(mem_ctx, union samr_ValidatePasswordRep); switch (level) { case 1: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr1"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_ValidatePasswordRepCtr_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->ctr1 = *(struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(in); break; case 2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr2"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_ValidatePasswordRepCtr_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->ctr2 = *(struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(in); break; case 3: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr3"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_ValidatePasswordRepCtr_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->ctr3 = *(struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(in); break; default: PyErr_SetString(PyExc_TypeError, "invalid union level value"); talloc_free(ret); ret = NULL; } return ret; } static PyObject *py_samr_ValidatePasswordRep_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 samr_ValidatePasswordRep *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 samr_ValidatePasswordRep *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_ValidatePasswordRep!"); return NULL; } return py_import_samr_ValidatePasswordRep(mem_ctx, level, in); } static PyObject *py_samr_ValidatePasswordRep_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 samr_ValidatePasswordRep *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_samr_ValidatePasswordRep(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_samr_ValidatePasswordRep_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ValidatePasswordRep_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ValidatePasswordRep_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_samr_ValidatePasswordRep_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject samr_ValidatePasswordRep_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ValidatePasswordRep", .tp_getset = NULL, .tp_methods = py_samr_ValidatePasswordRep_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ValidatePasswordRep_new, }; static PyObject *py_samr_ValidatePasswordReq3_get_info(PyObject *obj, void *closure) { struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj); PyObject *py_info; py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info); return py_info; } static int py_samr_ValidatePasswordReq3_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info"); return -1; } PY_CHECK_TYPE(&samr_ValidatePasswordInfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_ValidatePasswordReq3_get_password(PyObject *obj, void *closure) { struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj); PyObject *py_password; py_password = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->password); return py_password; } static int py_samr_ValidatePasswordReq3_set_password(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->password = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_ValidatePasswordReq3_get_account(PyObject *obj, void *closure) { struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj); PyObject *py_account; py_account = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->account); return py_account; } static int py_samr_ValidatePasswordReq3_set_account(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_ValidatePasswordReq3_get_hash(PyObject *obj, void *closure) { struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj); PyObject *py_hash; py_hash = pytalloc_reference_ex(&samr_ValidationBlob_Type, pytalloc_get_mem_ctx(obj), &object->hash); return py_hash; } static int py_samr_ValidatePasswordReq3_set_hash(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash"); return -1; } PY_CHECK_TYPE(&samr_ValidationBlob_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->hash = *(struct samr_ValidationBlob *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_ValidatePasswordReq3_get_pwd_must_change_at_next_logon(PyObject *obj, void *closure) { struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj); PyObject *py_pwd_must_change_at_next_logon; py_pwd_must_change_at_next_logon = PyLong_FromLong((uint16_t)object->pwd_must_change_at_next_logon); return py_pwd_must_change_at_next_logon; } static int py_samr_ValidatePasswordReq3_set_pwd_must_change_at_next_logon(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pwd_must_change_at_next_logon"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pwd_must_change_at_next_logon)); 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->pwd_must_change_at_next_logon = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ValidatePasswordReq3_get_clear_lockout(PyObject *obj, void *closure) { struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj); PyObject *py_clear_lockout; py_clear_lockout = PyLong_FromLong((uint16_t)object->clear_lockout); return py_clear_lockout; } static int py_samr_ValidatePasswordReq3_set_clear_lockout(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->clear_lockout"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->clear_lockout)); 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->clear_lockout = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_ValidatePasswordReq3_getsetters[] = { { .name = discard_const_p(char, "info"), .get = py_samr_ValidatePasswordReq3_get_info, .set = py_samr_ValidatePasswordReq3_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordInfo") }, { .name = discard_const_p(char, "password"), .get = py_samr_ValidatePasswordReq3_get_password, .set = py_samr_ValidatePasswordReq3_set_password, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "account"), .get = py_samr_ValidatePasswordReq3_get_account, .set = py_samr_ValidatePasswordReq3_set_account, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "hash"), .get = py_samr_ValidatePasswordReq3_get_hash, .set = py_samr_ValidatePasswordReq3_set_hash, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidationBlob") }, { .name = discard_const_p(char, "pwd_must_change_at_next_logon"), .get = py_samr_ValidatePasswordReq3_get_pwd_must_change_at_next_logon, .set = py_samr_ValidatePasswordReq3_set_pwd_must_change_at_next_logon, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "clear_lockout"), .get = py_samr_ValidatePasswordReq3_get_clear_lockout, .set = py_samr_ValidatePasswordReq3_set_clear_lockout, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_samr_ValidatePasswordReq3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_ValidatePasswordReq3, type); } static PyTypeObject samr_ValidatePasswordReq3_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ValidatePasswordReq3", .tp_getset = py_samr_ValidatePasswordReq3_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ValidatePasswordReq3_new, }; static PyObject *py_samr_ValidatePasswordReq2_get_info(PyObject *obj, void *closure) { struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj); PyObject *py_info; py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info); return py_info; } static int py_samr_ValidatePasswordReq2_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info"); return -1; } PY_CHECK_TYPE(&samr_ValidatePasswordInfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_ValidatePasswordReq2_get_password(PyObject *obj, void *closure) { struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj); PyObject *py_password; py_password = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->password); return py_password; } static int py_samr_ValidatePasswordReq2_set_password(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->password = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_ValidatePasswordReq2_get_account(PyObject *obj, void *closure) { struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj); PyObject *py_account; py_account = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->account); return py_account; } static int py_samr_ValidatePasswordReq2_set_account(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account"); return -1; } PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->account = *(struct lsa_StringLarge *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_ValidatePasswordReq2_get_hash(PyObject *obj, void *closure) { struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj); PyObject *py_hash; py_hash = pytalloc_reference_ex(&samr_ValidationBlob_Type, pytalloc_get_mem_ctx(obj), &object->hash); return py_hash; } static int py_samr_ValidatePasswordReq2_set_hash(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash"); return -1; } PY_CHECK_TYPE(&samr_ValidationBlob_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->hash = *(struct samr_ValidationBlob *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_ValidatePasswordReq2_get_password_matched(PyObject *obj, void *closure) { struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj); PyObject *py_password_matched; py_password_matched = PyLong_FromLong((uint16_t)object->password_matched); return py_password_matched; } static int py_samr_ValidatePasswordReq2_set_password_matched(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_matched"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_matched)); 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->password_matched = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_ValidatePasswordReq2_getsetters[] = { { .name = discard_const_p(char, "info"), .get = py_samr_ValidatePasswordReq2_get_info, .set = py_samr_ValidatePasswordReq2_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordInfo") }, { .name = discard_const_p(char, "password"), .get = py_samr_ValidatePasswordReq2_get_password, .set = py_samr_ValidatePasswordReq2_set_password, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "account"), .get = py_samr_ValidatePasswordReq2_get_account, .set = py_samr_ValidatePasswordReq2_set_account, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge") }, { .name = discard_const_p(char, "hash"), .get = py_samr_ValidatePasswordReq2_get_hash, .set = py_samr_ValidatePasswordReq2_set_hash, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidationBlob") }, { .name = discard_const_p(char, "password_matched"), .get = py_samr_ValidatePasswordReq2_get_password_matched, .set = py_samr_ValidatePasswordReq2_set_password_matched, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_samr_ValidatePasswordReq2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_ValidatePasswordReq2, type); } static PyTypeObject samr_ValidatePasswordReq2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ValidatePasswordReq2", .tp_getset = py_samr_ValidatePasswordReq2_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ValidatePasswordReq2_new, }; static PyObject *py_samr_ValidatePasswordReq1_get_info(PyObject *obj, void *closure) { struct samr_ValidatePasswordReq1 *object = (struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(obj); PyObject *py_info; py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info); return py_info; } static int py_samr_ValidatePasswordReq1_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordReq1 *object = (struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info"); return -1; } PY_CHECK_TYPE(&samr_ValidatePasswordInfo_Type, value, return -1;); if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) { PyErr_NoMemory(); return -1; } object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_ValidatePasswordReq1_get_password_matched(PyObject *obj, void *closure) { struct samr_ValidatePasswordReq1 *object = (struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(obj); PyObject *py_password_matched; py_password_matched = PyLong_FromLong((uint16_t)object->password_matched); return py_password_matched; } static int py_samr_ValidatePasswordReq1_set_password_matched(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePasswordReq1 *object = (struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_matched"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_matched)); 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->password_matched = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyGetSetDef py_samr_ValidatePasswordReq1_getsetters[] = { { .name = discard_const_p(char, "info"), .get = py_samr_ValidatePasswordReq1_get_info, .set = py_samr_ValidatePasswordReq1_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordInfo") }, { .name = discard_const_p(char, "password_matched"), .get = py_samr_ValidatePasswordReq1_get_password_matched, .set = py_samr_ValidatePasswordReq1_set_password_matched, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = NULL } }; static PyObject *py_samr_ValidatePasswordReq1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return pytalloc_new(struct samr_ValidatePasswordReq1, type); } static PyTypeObject samr_ValidatePasswordReq1_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ValidatePasswordReq1", .tp_getset = py_samr_ValidatePasswordReq1_getsetters, .tp_methods = NULL, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ValidatePasswordReq1_new, }; static PyObject *py_import_samr_ValidatePasswordReq(TALLOC_CTX *mem_ctx, int level, union samr_ValidatePasswordReq *in) { PyObject *ret; switch (level) { case 1: ret = pytalloc_reference_ex(&samr_ValidatePasswordReq1_Type, mem_ctx, &in->req1); return ret; case 2: ret = pytalloc_reference_ex(&samr_ValidatePasswordReq2_Type, mem_ctx, &in->req2); return ret; case 3: ret = pytalloc_reference_ex(&samr_ValidatePasswordReq3_Type, mem_ctx, &in->req3); return ret; } PyErr_SetString(PyExc_TypeError, "unknown union level"); return NULL; } static union samr_ValidatePasswordReq *py_export_samr_ValidatePasswordReq(TALLOC_CTX *mem_ctx, int level, PyObject *in) { union samr_ValidatePasswordReq *ret = talloc_zero(mem_ctx, union samr_ValidatePasswordReq); switch (level) { case 1: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->req1"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_ValidatePasswordReq1_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->req1 = *(struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(in); break; case 2: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->req2"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_ValidatePasswordReq2_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->req2 = *(struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(in); break; case 3: if (in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->req3"); talloc_free(ret); return NULL; } PY_CHECK_TYPE(&samr_ValidatePasswordReq3_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->req3 = *(struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(in); break; default: PyErr_SetString(PyExc_TypeError, "invalid union level value"); talloc_free(ret); ret = NULL; } return ret; } static PyObject *py_samr_ValidatePasswordReq_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 samr_ValidatePasswordReq *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 samr_ValidatePasswordReq *)pytalloc_get_ptr(in_obj); if (in == NULL) { PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_ValidatePasswordReq!"); return NULL; } return py_import_samr_ValidatePasswordReq(mem_ctx, level, in); } static PyObject *py_samr_ValidatePasswordReq_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 samr_ValidatePasswordReq *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_samr_ValidatePasswordReq(mem_ctx, level, in); if (out == NULL) { return NULL; } return pytalloc_GenericObject_reference(out); } static PyMethodDef py_samr_ValidatePasswordReq_methods[] = { { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ValidatePasswordReq_import), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__import__(mem_ctx, level, in) => ret." }, { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ValidatePasswordReq_export), METH_VARARGS|METH_KEYWORDS|METH_CLASS, "T.__export__(mem_ctx, level, in) => ret." }, { NULL, NULL, 0, NULL } }; static PyObject *py_samr_ValidatePasswordReq_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name); return NULL; } static PyTypeObject samr_ValidatePasswordReq_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ValidatePasswordReq", .tp_getset = NULL, .tp_methods = py_samr_ValidatePasswordReq_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ValidatePasswordReq_new, }; static PyObject *py_samr_Connect_in_get_system_name(PyObject *obj, void *closure) { struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(obj); PyObject *py_system_name; if (object->in.system_name == NULL) { Py_RETURN_NONE; } if (object->in.system_name == NULL) { py_system_name = Py_None; Py_INCREF(py_system_name); } else { py_system_name = PyLong_FromLong((uint16_t)*object->in.system_name); } return py_system_name; } static int py_samr_Connect_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.system_name)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name"); return -1; } if (value == Py_None) { object->in.system_name = NULL; } else { object->in.system_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.system_name); if (object->in.system_name == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.system_name)); 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.system_name = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } return 0; } static PyObject *py_samr_Connect_in_get_access_mask(PyObject *obj, void *closure) { struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(obj); PyObject *py_access_mask; py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask); return py_access_mask; } static int py_samr_Connect_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask)); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_Connect_out_get_connect_handle(PyObject *obj, void *closure) { struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(obj); PyObject *py_connect_handle; if (object->out.connect_handle == NULL) { Py_RETURN_NONE; } py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->out.connect_handle, object->out.connect_handle); return py_connect_handle; } static int py_samr_Connect_out_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.connect_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.connect_handle"); return -1; } object->out.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.connect_handle); if (object->out.connect_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_Connect_get_result(PyObject *obj, void *closure) { struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_Connect_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_Connect_getsetters[] = { { .name = discard_const_p(char, "in_system_name"), .get = py_samr_Connect_in_get_system_name, .set = py_samr_Connect_in_set_system_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_access_mask"), .get = py_samr_Connect_in_get_access_mask, .set = py_samr_Connect_in_set_access_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectAccessMask") }, { .name = discard_const_p(char, "out_connect_handle"), .get = py_samr_Connect_out_get_connect_handle, .set = py_samr_Connect_out_set_connect_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_Connect_get_result, .set = py_samr_Connect_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_Connect_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_Connect, type); struct samr_Connect *_self = (struct samr_Connect *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_Connect_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(0); } static PyObject *py_samr_Connect_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 1) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect_ndr_pack"); return NULL; } call = &ndr_table_samr.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_samr_Connect_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_samr_Connect_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_Connect_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_samr_Connect_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_Connect_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 samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 1) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect_ndr_unpack"); return NULL; } call = &ndr_table_samr.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_samr_Connect_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_samr_Connect_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Connect_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_samr_Connect_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Connect_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 1) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect_ndr_print"); return NULL; } call = &ndr_table_samr.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_samr_Connect_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Connect_ndr_print(py_obj, "samr_Connect_in", NDR_IN); } static PyObject *py_samr_Connect_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Connect_ndr_print(py_obj, "samr_Connect_out", NDR_OUT); } static PyMethodDef py_samr_Connect_methods[] = { { "opnum", (PyCFunction)py_samr_Connect_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.Connect.opnum() -> 0 (0x00) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect_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_samr_Connect_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_samr_Connect_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_samr_Connect_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_samr_Connect_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_Connect_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_Connect_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.Connect", .tp_getset = py_samr_Connect_getsetters, .tp_methods = py_samr_Connect_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_Connect_new, }; static bool pack_py_samr_Connect_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect *r) { PyObject *py_system_name; PyObject *py_access_mask; const char *kwnames[] = { "system_name", "access_mask", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_Connect", discard_const_p(char *, kwnames), &py_system_name, &py_access_mask)) { return false; } if (py_system_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name"); return false; } if (py_system_name == Py_None) { r->in.system_name = NULL; } else { r->in.system_name = talloc_ptrtype(r, r->in.system_name); if (r->in.system_name == NULL) { PyErr_NoMemory(); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.system_name)); if (PyLong_Check(py_system_name)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_system_name); 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.system_name = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } } if (py_access_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask)); if (PyLong_Check(py_access_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_access_mask); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_Connect_args_out(struct samr_Connect *r) { PyObject *result; PyObject *py_connect_handle; py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle); result = py_connect_handle; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_Close_in_get_handle(PyObject *obj, void *closure) { struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(obj); PyObject *py_handle; if (object->in.handle == NULL) { Py_RETURN_NONE; } py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle); return py_handle; } static int py_samr_Close_in_set_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle"); return -1; } object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle); if (object->in.handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_Close_out_get_handle(PyObject *obj, void *closure) { struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(obj); PyObject *py_handle; if (object->out.handle == NULL) { Py_RETURN_NONE; } py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle); return py_handle; } static int py_samr_Close_out_set_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle"); return -1; } object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle); if (object->out.handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_Close_get_result(PyObject *obj, void *closure) { struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_Close_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_Close_getsetters[] = { { .name = discard_const_p(char, "in_handle"), .get = py_samr_Close_in_get_handle, .set = py_samr_Close_in_set_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "out_handle"), .get = py_samr_Close_out_get_handle, .set = py_samr_Close_out_set_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_Close_get_result, .set = py_samr_Close_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_Close_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_Close, type); struct samr_Close *_self = (struct samr_Close *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_Close_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(1); } static PyObject *py_samr_Close_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 2) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Close_ndr_pack"); return NULL; } call = &ndr_table_samr.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_samr_Close_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_samr_Close_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_Close_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_samr_Close_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_Close_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 samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 2) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Close_ndr_unpack"); return NULL; } call = &ndr_table_samr.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_samr_Close_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_samr_Close_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Close_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_samr_Close_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Close_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 2) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Close_ndr_print"); return NULL; } call = &ndr_table_samr.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_samr_Close_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Close_ndr_print(py_obj, "samr_Close_in", NDR_IN); } static PyObject *py_samr_Close_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Close_ndr_print(py_obj, "samr_Close_out", NDR_OUT); } static PyMethodDef py_samr_Close_methods[] = { { "opnum", (PyCFunction)py_samr_Close_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.Close.opnum() -> 1 (0x01) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Close_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_samr_Close_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_samr_Close_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_samr_Close_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_samr_Close_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_Close_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_Close_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.Close", .tp_getset = py_samr_Close_getsetters, .tp_methods = py_samr_Close_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_Close_new, }; static bool pack_py_samr_Close_args_in(PyObject *args, PyObject *kwargs, struct samr_Close *r) { PyObject *py_handle; const char *kwnames[] = { "handle", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_Close", discard_const_p(char *, kwnames), &py_handle)) { return false; } if (py_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle"); return false; } r->in.handle = talloc_ptrtype(r, r->in.handle); if (r->in.handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle); return true; } static PyObject *unpack_py_samr_Close_args_out(struct samr_Close *r) { PyObject *result; PyObject *py_handle; py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle); result = py_handle; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_SetSecurity_in_get_handle(PyObject *obj, void *closure) { struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(obj); PyObject *py_handle; if (object->in.handle == NULL) { Py_RETURN_NONE; } py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle); return py_handle; } static int py_samr_SetSecurity_in_set_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle"); return -1; } object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle); if (object->in.handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_SetSecurity_in_get_sec_info(PyObject *obj, void *closure) { struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(obj); PyObject *py_sec_info; py_sec_info = PyLong_FromUnsignedLongLong((uint32_t)object->in.sec_info); return py_sec_info; } static int py_samr_SetSecurity_in_set_sec_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sec_info"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.sec_info)); 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.sec_info = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_SetSecurity_in_get_sdbuf(PyObject *obj, void *closure) { struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(obj); PyObject *py_sdbuf; if (object->in.sdbuf == NULL) { Py_RETURN_NONE; } py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, object->in.sdbuf, object->in.sdbuf); return py_sdbuf; } static int py_samr_SetSecurity_in_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sdbuf)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sdbuf"); return -1; } object->in.sdbuf = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sdbuf); if (object->in.sdbuf == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(sec_desc_buf_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.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_SetSecurity_get_result(PyObject *obj, void *closure) { struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_SetSecurity_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_SetSecurity_getsetters[] = { { .name = discard_const_p(char, "in_handle"), .get = py_samr_SetSecurity_in_get_handle, .set = py_samr_SetSecurity_in_set_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_sec_info"), .get = py_samr_SetSecurity_in_get_sec_info, .set = py_samr_SetSecurity_in_set_sec_info, .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo") }, { .name = discard_const_p(char, "in_sdbuf"), .get = py_samr_SetSecurity_in_get_sdbuf, .set = py_samr_SetSecurity_in_set_sdbuf, .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf") }, { .name = discard_const_p(char, "result"), .get = py_samr_SetSecurity_get_result, .set = py_samr_SetSecurity_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_SetSecurity_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_SetSecurity, type); struct samr_SetSecurity *_self = (struct samr_SetSecurity *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.sdbuf = talloc_zero(mem_ctx, struct sec_desc_buf); return self; } static PyObject *py_samr_SetSecurity_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(2); } static PyObject *py_samr_SetSecurity_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 3) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetSecurity_ndr_pack"); return NULL; } call = &ndr_table_samr.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_samr_SetSecurity_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_samr_SetSecurity_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_SetSecurity_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_samr_SetSecurity_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_SetSecurity_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 samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 3) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetSecurity_ndr_unpack"); return NULL; } call = &ndr_table_samr.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_samr_SetSecurity_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_samr_SetSecurity_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetSecurity_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_samr_SetSecurity_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetSecurity_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 3) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetSecurity_ndr_print"); return NULL; } call = &ndr_table_samr.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_samr_SetSecurity_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetSecurity_ndr_print(py_obj, "samr_SetSecurity_in", NDR_IN); } static PyObject *py_samr_SetSecurity_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetSecurity_ndr_print(py_obj, "samr_SetSecurity_out", NDR_OUT); } static PyMethodDef py_samr_SetSecurity_methods[] = { { "opnum", (PyCFunction)py_samr_SetSecurity_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.SetSecurity.opnum() -> 2 (0x02) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetSecurity_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_samr_SetSecurity_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_samr_SetSecurity_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_samr_SetSecurity_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_samr_SetSecurity_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_SetSecurity_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_SetSecurity_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.SetSecurity", .tp_getset = py_samr_SetSecurity_getsetters, .tp_methods = py_samr_SetSecurity_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_SetSecurity_new, }; static bool pack_py_samr_SetSecurity_args_in(PyObject *args, PyObject *kwargs, struct samr_SetSecurity *r) { PyObject *py_handle; PyObject *py_sec_info; PyObject *py_sdbuf; const char *kwnames[] = { "handle", "sec_info", "sdbuf", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetSecurity", discard_const_p(char *, kwnames), &py_handle, &py_sec_info, &py_sdbuf)) { return false; } if (py_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle"); return false; } r->in.handle = talloc_ptrtype(r, r->in.handle); if (r->in.handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle); if (py_sec_info == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sec_info"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.sec_info)); if (PyLong_Check(py_sec_info)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_sec_info); 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.sec_info = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_sdbuf == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sdbuf"); return false; } r->in.sdbuf = talloc_ptrtype(r, r->in.sdbuf); if (r->in.sdbuf == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(sec_desc_buf_Type, py_sdbuf, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_sdbuf)) == NULL) { PyErr_NoMemory(); return false; } r->in.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(py_sdbuf); return true; } static PyObject *unpack_py_samr_SetSecurity_args_out(struct samr_SetSecurity *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_QuerySecurity_in_get_handle(PyObject *obj, void *closure) { struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(obj); PyObject *py_handle; if (object->in.handle == NULL) { Py_RETURN_NONE; } py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle); return py_handle; } static int py_samr_QuerySecurity_in_set_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle"); return -1; } object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle); if (object->in.handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_QuerySecurity_in_get_sec_info(PyObject *obj, void *closure) { struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(obj); PyObject *py_sec_info; py_sec_info = PyLong_FromUnsignedLongLong((uint32_t)object->in.sec_info); return py_sec_info; } static int py_samr_QuerySecurity_in_set_sec_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sec_info"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.sec_info)); 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.sec_info = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QuerySecurity_out_get_sdbuf(PyObject *obj, void *closure) { struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(obj); PyObject *py_sdbuf; if (object->out.sdbuf == NULL) { Py_RETURN_NONE; } if (*object->out.sdbuf == NULL) { py_sdbuf = Py_None; Py_INCREF(py_sdbuf); } else { py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *object->out.sdbuf, *object->out.sdbuf); } return py_sdbuf; } static int py_samr_QuerySecurity_out_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sdbuf)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sdbuf"); return -1; } object->out.sdbuf = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sdbuf); if (object->out.sdbuf == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.sdbuf = NULL; } else { *object->out.sdbuf = NULL; PY_CHECK_TYPE(sec_desc_buf_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.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_QuerySecurity_get_result(PyObject *obj, void *closure) { struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_QuerySecurity_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_QuerySecurity_getsetters[] = { { .name = discard_const_p(char, "in_handle"), .get = py_samr_QuerySecurity_in_get_handle, .set = py_samr_QuerySecurity_in_set_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_sec_info"), .get = py_samr_QuerySecurity_in_get_sec_info, .set = py_samr_QuerySecurity_in_set_sec_info, .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo") }, { .name = discard_const_p(char, "out_sdbuf"), .get = py_samr_QuerySecurity_out_get_sdbuf, .set = py_samr_QuerySecurity_out_set_sdbuf, .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf") }, { .name = discard_const_p(char, "result"), .get = py_samr_QuerySecurity_get_result, .set = py_samr_QuerySecurity_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_QuerySecurity_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_QuerySecurity, type); struct samr_QuerySecurity *_self = (struct samr_QuerySecurity *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.handle = talloc_zero(mem_ctx, struct policy_handle); /* a pointer to a NULL pointer */ _self->out.sdbuf = talloc_zero(mem_ctx, struct sec_desc_buf *); return self; } static PyObject *py_samr_QuerySecurity_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(3); } static PyObject *py_samr_QuerySecurity_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 4) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QuerySecurity_ndr_pack"); return NULL; } call = &ndr_table_samr.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_samr_QuerySecurity_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_samr_QuerySecurity_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_QuerySecurity_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_samr_QuerySecurity_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_QuerySecurity_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 samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 4) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QuerySecurity_ndr_unpack"); return NULL; } call = &ndr_table_samr.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_samr_QuerySecurity_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_samr_QuerySecurity_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QuerySecurity_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_samr_QuerySecurity_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QuerySecurity_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 4) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QuerySecurity_ndr_print"); return NULL; } call = &ndr_table_samr.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_samr_QuerySecurity_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QuerySecurity_ndr_print(py_obj, "samr_QuerySecurity_in", NDR_IN); } static PyObject *py_samr_QuerySecurity_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QuerySecurity_ndr_print(py_obj, "samr_QuerySecurity_out", NDR_OUT); } static PyMethodDef py_samr_QuerySecurity_methods[] = { { "opnum", (PyCFunction)py_samr_QuerySecurity_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.QuerySecurity.opnum() -> 3 (0x03) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QuerySecurity_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_samr_QuerySecurity_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_samr_QuerySecurity_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_samr_QuerySecurity_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_samr_QuerySecurity_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_QuerySecurity_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_QuerySecurity_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.QuerySecurity", .tp_getset = py_samr_QuerySecurity_getsetters, .tp_methods = py_samr_QuerySecurity_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_QuerySecurity_new, }; static bool pack_py_samr_QuerySecurity_args_in(PyObject *args, PyObject *kwargs, struct samr_QuerySecurity *r) { PyObject *py_handle; PyObject *py_sec_info; const char *kwnames[] = { "handle", "sec_info", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QuerySecurity", discard_const_p(char *, kwnames), &py_handle, &py_sec_info)) { return false; } if (py_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle"); return false; } r->in.handle = talloc_ptrtype(r, r->in.handle); if (r->in.handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle); if (py_sec_info == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sec_info"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.sec_info)); if (PyLong_Check(py_sec_info)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_sec_info); 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.sec_info = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_QuerySecurity_args_out(struct samr_QuerySecurity *r) { PyObject *result; PyObject *py_sdbuf; if (*r->out.sdbuf == NULL) { py_sdbuf = Py_None; Py_INCREF(py_sdbuf); } else { py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *r->out.sdbuf, *r->out.sdbuf); } result = py_sdbuf; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_Shutdown_in_get_connect_handle(PyObject *obj, void *closure) { struct samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(obj); PyObject *py_connect_handle; if (object->in.connect_handle == NULL) { Py_RETURN_NONE; } py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->in.connect_handle, object->in.connect_handle); return py_connect_handle; } static int py_samr_Shutdown_in_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.connect_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.connect_handle"); return -1; } object->in.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.connect_handle); if (object->in.connect_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_Shutdown_get_result(PyObject *obj, void *closure) { struct samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_Shutdown_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_Shutdown_getsetters[] = { { .name = discard_const_p(char, "in_connect_handle"), .get = py_samr_Shutdown_in_get_connect_handle, .set = py_samr_Shutdown_in_set_connect_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_Shutdown_get_result, .set = py_samr_Shutdown_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_Shutdown_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_Shutdown, type); struct samr_Shutdown *_self = (struct samr_Shutdown *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.connect_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_Shutdown_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(4); } static PyObject *py_samr_Shutdown_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 5) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Shutdown_ndr_pack"); return NULL; } call = &ndr_table_samr.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_samr_Shutdown_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_samr_Shutdown_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_Shutdown_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_samr_Shutdown_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_Shutdown_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 samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 5) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Shutdown_ndr_unpack"); return NULL; } call = &ndr_table_samr.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_samr_Shutdown_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_samr_Shutdown_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Shutdown_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_samr_Shutdown_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Shutdown_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 5) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Shutdown_ndr_print"); return NULL; } call = &ndr_table_samr.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_samr_Shutdown_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Shutdown_ndr_print(py_obj, "samr_Shutdown_in", NDR_IN); } static PyObject *py_samr_Shutdown_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Shutdown_ndr_print(py_obj, "samr_Shutdown_out", NDR_OUT); } static PyMethodDef py_samr_Shutdown_methods[] = { { "opnum", (PyCFunction)py_samr_Shutdown_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.Shutdown.opnum() -> 4 (0x04) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Shutdown_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_samr_Shutdown_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_samr_Shutdown_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_samr_Shutdown_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_samr_Shutdown_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_Shutdown_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_Shutdown_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.Shutdown", .tp_getset = py_samr_Shutdown_getsetters, .tp_methods = py_samr_Shutdown_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_Shutdown_new, }; static bool pack_py_samr_Shutdown_args_in(PyObject *args, PyObject *kwargs, struct samr_Shutdown *r) { PyObject *py_connect_handle; const char *kwnames[] = { "connect_handle", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_Shutdown", discard_const_p(char *, kwnames), &py_connect_handle)) { return false; } if (py_connect_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.connect_handle"); return false; } r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle); if (r->in.connect_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle); return true; } static PyObject *unpack_py_samr_Shutdown_args_out(struct samr_Shutdown *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_LookupDomain_in_get_connect_handle(PyObject *obj, void *closure) { struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(obj); PyObject *py_connect_handle; if (object->in.connect_handle == NULL) { Py_RETURN_NONE; } py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->in.connect_handle, object->in.connect_handle); return py_connect_handle; } static int py_samr_LookupDomain_in_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.connect_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.connect_handle"); return -1; } object->in.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.connect_handle); if (object->in.connect_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_LookupDomain_in_get_domain_name(PyObject *obj, void *closure) { struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(obj); PyObject *py_domain_name; if (object->in.domain_name == NULL) { Py_RETURN_NONE; } py_domain_name = pytalloc_reference_ex(lsa_String_Type, object->in.domain_name, object->in.domain_name); return py_domain_name; } static int py_samr_LookupDomain_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_name)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name"); return -1; } object->in.domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_name); if (object->in.domain_name == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_String_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.domain_name = (struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_LookupDomain_out_get_sid(PyObject *obj, void *closure) { struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(obj); PyObject *py_sid; if (object->out.sid == NULL) { Py_RETURN_NONE; } if (*object->out.sid == NULL) { py_sid = Py_None; Py_INCREF(py_sid); } else { py_sid = pytalloc_reference_ex(dom_sid_Type, *object->out.sid, *object->out.sid); } return py_sid; } static int py_samr_LookupDomain_out_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sid"); return -1; } object->out.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sid); if (object->out.sid == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.sid = NULL; } else { *object->out.sid = NULL; PY_CHECK_TYPE(dom_sid_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.sid = (struct dom_sid *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_LookupDomain_get_result(PyObject *obj, void *closure) { struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_LookupDomain_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_LookupDomain_getsetters[] = { { .name = discard_const_p(char, "in_connect_handle"), .get = py_samr_LookupDomain_in_get_connect_handle, .set = py_samr_LookupDomain_in_set_connect_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_domain_name"), .get = py_samr_LookupDomain_in_get_domain_name, .set = py_samr_LookupDomain_in_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "out_sid"), .get = py_samr_LookupDomain_out_get_sid, .set = py_samr_LookupDomain_out_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2") }, { .name = discard_const_p(char, "result"), .get = py_samr_LookupDomain_get_result, .set = py_samr_LookupDomain_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_LookupDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_LookupDomain, type); struct samr_LookupDomain *_self = (struct samr_LookupDomain *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.connect_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.domain_name = talloc_zero(mem_ctx, struct lsa_String); /* a pointer to a NULL pointer */ _self->out.sid = talloc_zero(mem_ctx, struct dom_sid2 *); return self; } static PyObject *py_samr_LookupDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(5); } static PyObject *py_samr_LookupDomain_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 6) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupDomain_ndr_pack"); return NULL; } call = &ndr_table_samr.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_samr_LookupDomain_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_samr_LookupDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_LookupDomain_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_samr_LookupDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_LookupDomain_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 samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 6) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupDomain_ndr_unpack"); return NULL; } call = &ndr_table_samr.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_samr_LookupDomain_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_samr_LookupDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_LookupDomain_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_samr_LookupDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_LookupDomain_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 6) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupDomain_ndr_print"); return NULL; } call = &ndr_table_samr.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_samr_LookupDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_LookupDomain_ndr_print(py_obj, "samr_LookupDomain_in", NDR_IN); } static PyObject *py_samr_LookupDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_LookupDomain_ndr_print(py_obj, "samr_LookupDomain_out", NDR_OUT); } static PyMethodDef py_samr_LookupDomain_methods[] = { { "opnum", (PyCFunction)py_samr_LookupDomain_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.LookupDomain.opnum() -> 5 (0x05) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupDomain_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_samr_LookupDomain_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_samr_LookupDomain_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_samr_LookupDomain_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_samr_LookupDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_LookupDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_LookupDomain_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.LookupDomain", .tp_getset = py_samr_LookupDomain_getsetters, .tp_methods = py_samr_LookupDomain_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_LookupDomain_new, }; static bool pack_py_samr_LookupDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_LookupDomain *r) { PyObject *py_connect_handle; PyObject *py_domain_name; const char *kwnames[] = { "connect_handle", "domain_name", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_LookupDomain", discard_const_p(char *, kwnames), &py_connect_handle, &py_domain_name)) { return false; } if (py_connect_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.connect_handle"); return false; } r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle); if (r->in.connect_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle); if (py_domain_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name"); return false; } r->in.domain_name = talloc_ptrtype(r, r->in.domain_name); if (r->in.domain_name == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_String_Type, py_domain_name, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_name)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_name = (struct lsa_String *)pytalloc_get_ptr(py_domain_name); return true; } static PyObject *unpack_py_samr_LookupDomain_args_out(struct samr_LookupDomain *r) { PyObject *result; PyObject *py_sid; if (*r->out.sid == NULL) { py_sid = Py_None; Py_INCREF(py_sid); } else { py_sid = pytalloc_reference_ex(dom_sid_Type, *r->out.sid, *r->out.sid); } result = py_sid; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_EnumDomains_in_get_connect_handle(PyObject *obj, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj); PyObject *py_connect_handle; if (object->in.connect_handle == NULL) { Py_RETURN_NONE; } py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->in.connect_handle, object->in.connect_handle); return py_connect_handle; } static int py_samr_EnumDomains_in_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.connect_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.connect_handle"); return -1; } object->in.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.connect_handle); if (object->in.connect_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_EnumDomains_in_get_resume_handle(PyObject *obj, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj); PyObject *py_resume_handle; if (object->in.resume_handle == NULL) { Py_RETURN_NONE; } py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle); return py_resume_handle; } static int py_samr_EnumDomains_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle"); return -1; } object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle); if (object->in.resume_handle == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle)); 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.resume_handle = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomains_out_get_resume_handle(PyObject *obj, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj); PyObject *py_resume_handle; if (object->out.resume_handle == NULL) { Py_RETURN_NONE; } py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle); return py_resume_handle; } static int py_samr_EnumDomains_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle"); return -1; } object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle); if (object->out.resume_handle == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle)); 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.resume_handle = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomains_out_get_sam(PyObject *obj, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj); PyObject *py_sam; if (object->out.sam == NULL) { Py_RETURN_NONE; } if (*object->out.sam == NULL) { py_sam = Py_None; Py_INCREF(py_sam); } else { py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *object->out.sam, *object->out.sam); } return py_sam; } static int py_samr_EnumDomains_out_set_sam(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sam)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sam"); return -1; } object->out.sam = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sam); if (object->out.sam == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.sam = NULL; } else { *object->out.sam = NULL; PY_CHECK_TYPE(&samr_SamArray_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.sam = (struct samr_SamArray *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_EnumDomains_in_get_buf_size(PyObject *obj, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj); PyObject *py_buf_size; py_buf_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.buf_size); return py_buf_size; } static int py_samr_EnumDomains_in_set_buf_size(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buf_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buf_size)); 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.buf_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomains_out_get_num_entries(PyObject *obj, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj); PyObject *py_num_entries; if (object->out.num_entries == NULL) { Py_RETURN_NONE; } py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*object->out.num_entries); return py_num_entries; } static int py_samr_EnumDomains_out_set_num_entries(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.num_entries)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.num_entries"); return -1; } object->out.num_entries = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.num_entries); if (object->out.num_entries == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.num_entries)); 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.num_entries = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomains_get_result(PyObject *obj, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_EnumDomains_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_EnumDomains_getsetters[] = { { .name = discard_const_p(char, "in_connect_handle"), .get = py_samr_EnumDomains_in_get_connect_handle, .set = py_samr_EnumDomains_in_set_connect_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_resume_handle"), .get = py_samr_EnumDomains_in_get_resume_handle, .set = py_samr_EnumDomains_in_set_resume_handle, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_resume_handle"), .get = py_samr_EnumDomains_out_get_resume_handle, .set = py_samr_EnumDomains_out_set_resume_handle, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_sam"), .get = py_samr_EnumDomains_out_get_sam, .set = py_samr_EnumDomains_out_set_sam, .doc = discard_const_p(char, "PIDL-generated element of base type samr_SamArray") }, { .name = discard_const_p(char, "in_buf_size"), .get = py_samr_EnumDomains_in_get_buf_size, .set = py_samr_EnumDomains_in_set_buf_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_num_entries"), .get = py_samr_EnumDomains_out_get_num_entries, .set = py_samr_EnumDomains_out_set_num_entries, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_EnumDomains_get_result, .set = py_samr_EnumDomains_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_EnumDomains_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_EnumDomains, type); struct samr_EnumDomains *_self = (struct samr_EnumDomains *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.connect_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t); _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t); /* a pointer to a NULL pointer */ _self->out.sam = talloc_zero(mem_ctx, struct samr_SamArray *); _self->out.num_entries = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_samr_EnumDomains_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(6); } static PyObject *py_samr_EnumDomains_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 7) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomains_ndr_pack"); return NULL; } call = &ndr_table_samr.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_samr_EnumDomains_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_samr_EnumDomains_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_EnumDomains_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_samr_EnumDomains_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_EnumDomains_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 samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 7) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomains_ndr_unpack"); return NULL; } call = &ndr_table_samr.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_samr_EnumDomains_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_samr_EnumDomains_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_EnumDomains_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_samr_EnumDomains_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_EnumDomains_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 7) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomains_ndr_print"); return NULL; } call = &ndr_table_samr.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_samr_EnumDomains_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_EnumDomains_ndr_print(py_obj, "samr_EnumDomains_in", NDR_IN); } static PyObject *py_samr_EnumDomains_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_EnumDomains_ndr_print(py_obj, "samr_EnumDomains_out", NDR_OUT); } static PyMethodDef py_samr_EnumDomains_methods[] = { { "opnum", (PyCFunction)py_samr_EnumDomains_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.EnumDomains.opnum() -> 6 (0x06) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomains_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_samr_EnumDomains_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_samr_EnumDomains_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_samr_EnumDomains_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_samr_EnumDomains_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_EnumDomains_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_EnumDomains_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.EnumDomains", .tp_getset = py_samr_EnumDomains_getsetters, .tp_methods = py_samr_EnumDomains_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_EnumDomains_new, }; static bool pack_py_samr_EnumDomains_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomains *r) { PyObject *py_connect_handle; PyObject *py_resume_handle; PyObject *py_buf_size; const char *kwnames[] = { "connect_handle", "resume_handle", "buf_size", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_EnumDomains", discard_const_p(char *, kwnames), &py_connect_handle, &py_resume_handle, &py_buf_size)) { return false; } if (py_connect_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.connect_handle"); return false; } r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle); if (r->in.connect_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle); if (py_resume_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle"); return false; } r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle); if (r->in.resume_handle == NULL) { PyErr_NoMemory(); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle)); if (PyLong_Check(py_resume_handle)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_resume_handle); 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.resume_handle = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_buf_size == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buf_size"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buf_size)); if (PyLong_Check(py_buf_size)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_buf_size); 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.buf_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_EnumDomains_args_out(struct samr_EnumDomains *r) { PyObject *result; PyObject *py_resume_handle; PyObject *py_sam; PyObject *py_num_entries; result = PyTuple_New(3); py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle); PyTuple_SetItem(result, 0, py_resume_handle); if (*r->out.sam == NULL) { py_sam = Py_None; Py_INCREF(py_sam); } else { py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam); } PyTuple_SetItem(result, 1, py_sam); py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*r->out.num_entries); PyTuple_SetItem(result, 2, py_num_entries); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_OpenDomain_in_get_connect_handle(PyObject *obj, void *closure) { struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(obj); PyObject *py_connect_handle; if (object->in.connect_handle == NULL) { Py_RETURN_NONE; } py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->in.connect_handle, object->in.connect_handle); return py_connect_handle; } static int py_samr_OpenDomain_in_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.connect_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.connect_handle"); return -1; } object->in.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.connect_handle); if (object->in.connect_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_OpenDomain_in_get_access_mask(PyObject *obj, void *closure) { struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(obj); PyObject *py_access_mask; py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask); return py_access_mask; } static int py_samr_OpenDomain_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask)); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_OpenDomain_in_get_sid(PyObject *obj, void *closure) { struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(obj); PyObject *py_sid; if (object->in.sid == NULL) { Py_RETURN_NONE; } py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid); return py_sid; } static int py_samr_OpenDomain_in_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid"); return -1; } object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid); if (object->in.sid == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(dom_sid_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.sid = (struct dom_sid *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_OpenDomain_out_get_domain_handle(PyObject *obj, void *closure) { struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->out.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->out.domain_handle, object->out.domain_handle); return py_domain_handle; } static int py_samr_OpenDomain_out_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domain_handle"); return -1; } object->out.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domain_handle); if (object->out.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_OpenDomain_get_result(PyObject *obj, void *closure) { struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_OpenDomain_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_OpenDomain_getsetters[] = { { .name = discard_const_p(char, "in_connect_handle"), .get = py_samr_OpenDomain_in_get_connect_handle, .set = py_samr_OpenDomain_in_set_connect_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_access_mask"), .get = py_samr_OpenDomain_in_get_access_mask, .set = py_samr_OpenDomain_in_set_access_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainAccessMask") }, { .name = discard_const_p(char, "in_sid"), .get = py_samr_OpenDomain_in_get_sid, .set = py_samr_OpenDomain_in_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2") }, { .name = discard_const_p(char, "out_domain_handle"), .get = py_samr_OpenDomain_out_get_domain_handle, .set = py_samr_OpenDomain_out_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_OpenDomain_get_result, .set = py_samr_OpenDomain_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_OpenDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_OpenDomain, type); struct samr_OpenDomain *_self = (struct samr_OpenDomain *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.connect_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2); _self->out.domain_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_OpenDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(7); } static PyObject *py_samr_OpenDomain_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 8) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenDomain_ndr_pack"); return NULL; } call = &ndr_table_samr.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_samr_OpenDomain_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_samr_OpenDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_OpenDomain_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_samr_OpenDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_OpenDomain_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 samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 8) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenDomain_ndr_unpack"); return NULL; } call = &ndr_table_samr.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_samr_OpenDomain_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_samr_OpenDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_OpenDomain_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_samr_OpenDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_OpenDomain_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 8) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenDomain_ndr_print"); return NULL; } call = &ndr_table_samr.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_samr_OpenDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_OpenDomain_ndr_print(py_obj, "samr_OpenDomain_in", NDR_IN); } static PyObject *py_samr_OpenDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_OpenDomain_ndr_print(py_obj, "samr_OpenDomain_out", NDR_OUT); } static PyMethodDef py_samr_OpenDomain_methods[] = { { "opnum", (PyCFunction)py_samr_OpenDomain_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.OpenDomain.opnum() -> 7 (0x07) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenDomain_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_samr_OpenDomain_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_samr_OpenDomain_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_samr_OpenDomain_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_samr_OpenDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_OpenDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_OpenDomain_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.OpenDomain", .tp_getset = py_samr_OpenDomain_getsetters, .tp_methods = py_samr_OpenDomain_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_OpenDomain_new, }; static bool pack_py_samr_OpenDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenDomain *r) { PyObject *py_connect_handle; PyObject *py_access_mask; PyObject *py_sid; const char *kwnames[] = { "connect_handle", "access_mask", "sid", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenDomain", discard_const_p(char *, kwnames), &py_connect_handle, &py_access_mask, &py_sid)) { return false; } if (py_connect_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.connect_handle"); return false; } r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle); if (r->in.connect_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle); if (py_access_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask)); if (PyLong_Check(py_access_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_access_mask); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_sid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid"); return false; } r->in.sid = talloc_ptrtype(r, r->in.sid); if (r->in.sid == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) { PyErr_NoMemory(); return false; } r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid); return true; } static PyObject *unpack_py_samr_OpenDomain_args_out(struct samr_OpenDomain *r) { PyObject *result; PyObject *py_domain_handle; py_domain_handle = pytalloc_reference_ex(policy_handle_Type, r->out.domain_handle, r->out.domain_handle); result = py_domain_handle; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_QueryDomainInfo_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_QueryDomainInfo_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_QueryDomainInfo_in_get_level(PyObject *obj, void *closure) { struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_QueryDomainInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)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_samr_QueryDomainInfo_out_get_info(PyObject *obj, void *closure) { struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } if (*object->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pyrpc_import_union(&samr_DomainInfo_Type, *object->out.info, object->in.level, *object->out.info, "union samr_DomainInfo"); if (py_info == NULL) { return NULL; } } return py_info; } static int py_samr_QueryDomainInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info"); return -1; } object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info); if (object->out.info == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.info = NULL; } else { *object->out.info = NULL; { union samr_DomainInfo *info_switch_2; info_switch_2 = (union samr_DomainInfo *)pyrpc_export_union(&samr_DomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_DomainInfo"); if (info_switch_2 == NULL) { return -1; } *object->out.info = info_switch_2; } } return 0; } static PyObject *py_samr_QueryDomainInfo_get_result(PyObject *obj, void *closure) { struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_QueryDomainInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_QueryDomainInfo_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_QueryDomainInfo_in_get_domain_handle, .set = py_samr_QueryDomainInfo_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_QueryDomainInfo_in_get_level, .set = py_samr_QueryDomainInfo_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainInfoClass") }, { .name = discard_const_p(char, "out_info"), .get = py_samr_QueryDomainInfo_out_get_info, .set = py_samr_QueryDomainInfo_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_QueryDomainInfo_get_result, .set = py_samr_QueryDomainInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_QueryDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_QueryDomainInfo, type); struct samr_QueryDomainInfo *_self = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); /* a pointer to a NULL pointer */ _self->out.info = talloc_zero(mem_ctx, union samr_DomainInfo *); return self; } static PyObject *py_samr_QueryDomainInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(8); } static PyObject *py_samr_QueryDomainInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 9) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDomainInfo_ndr_pack"); return NULL; } call = &ndr_table_samr.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_samr_QueryDomainInfo_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_samr_QueryDomainInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_QueryDomainInfo_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_samr_QueryDomainInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_QueryDomainInfo_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 samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 9) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDomainInfo_ndr_unpack"); return NULL; } call = &ndr_table_samr.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_samr_QueryDomainInfo_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_samr_QueryDomainInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryDomainInfo_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_samr_QueryDomainInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryDomainInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 9) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDomainInfo_ndr_print"); return NULL; } call = &ndr_table_samr.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_samr_QueryDomainInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryDomainInfo_ndr_print(py_obj, "samr_QueryDomainInfo_in", NDR_IN); } static PyObject *py_samr_QueryDomainInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryDomainInfo_ndr_print(py_obj, "samr_QueryDomainInfo_out", NDR_OUT); } static PyMethodDef py_samr_QueryDomainInfo_methods[] = { { "opnum", (PyCFunction)py_samr_QueryDomainInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.QueryDomainInfo.opnum() -> 8 (0x08) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDomainInfo_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_samr_QueryDomainInfo_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_samr_QueryDomainInfo_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_samr_QueryDomainInfo_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_samr_QueryDomainInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_QueryDomainInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_QueryDomainInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.QueryDomainInfo", .tp_getset = py_samr_QueryDomainInfo_getsetters, .tp_methods = py_samr_QueryDomainInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_QueryDomainInfo_new, }; static bool pack_py_samr_QueryDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDomainInfo *r) { PyObject *py_domain_handle; PyObject *py_level; const char *kwnames[] = { "domain_handle", "level", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryDomainInfo", discard_const_p(char *, kwnames), &py_domain_handle, &py_level)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); 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_samr_QueryDomainInfo_args_out(struct samr_QueryDomainInfo *r) { PyObject *result; PyObject *py_info; if (*r->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pyrpc_import_union(&samr_DomainInfo_Type, *r->out.info, r->in.level, *r->out.info, "union samr_DomainInfo"); if (py_info == NULL) { return NULL; } } result = py_info; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_SetDomainInfo_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_SetDomainInfo_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_SetDomainInfo_in_get_level(PyObject *obj, void *closure) { struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_SetDomainInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)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_samr_SetDomainInfo_in_get_info(PyObject *obj, void *closure) { struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->in.info == NULL) { Py_RETURN_NONE; } py_info = pyrpc_import_union(&samr_DomainInfo_Type, object->in.info, object->in.level, object->in.info, "union samr_DomainInfo"); if (py_info == NULL) { return NULL; } return py_info; } static int py_samr_SetDomainInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info"); return -1; } object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info); if (object->in.info == NULL) { PyErr_NoMemory(); return -1; } { union samr_DomainInfo *info_switch_1; info_switch_1 = (union samr_DomainInfo *)pyrpc_export_union(&samr_DomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_DomainInfo"); if (info_switch_1 == NULL) { return -1; } object->in.info = info_switch_1; } return 0; } static PyObject *py_samr_SetDomainInfo_get_result(PyObject *obj, void *closure) { struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_SetDomainInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_SetDomainInfo_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_SetDomainInfo_in_get_domain_handle, .set = py_samr_SetDomainInfo_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_SetDomainInfo_in_get_level, .set = py_samr_SetDomainInfo_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainInfoClass") }, { .name = discard_const_p(char, "in_info"), .get = py_samr_SetDomainInfo_in_get_info, .set = py_samr_SetDomainInfo_in_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_SetDomainInfo_get_result, .set = py_samr_SetDomainInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_SetDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_SetDomainInfo, type); struct samr_SetDomainInfo *_self = (struct samr_SetDomainInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.info = talloc_zero(mem_ctx, union samr_DomainInfo); return self; } static PyObject *py_samr_SetDomainInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(9); } static PyObject *py_samr_SetDomainInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 10) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetDomainInfo_ndr_pack"); return NULL; } call = &ndr_table_samr.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_samr_SetDomainInfo_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_samr_SetDomainInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_SetDomainInfo_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_samr_SetDomainInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_SetDomainInfo_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 samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 10) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetDomainInfo_ndr_unpack"); return NULL; } call = &ndr_table_samr.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_samr_SetDomainInfo_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_samr_SetDomainInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetDomainInfo_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_samr_SetDomainInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetDomainInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 10) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetDomainInfo_ndr_print"); return NULL; } call = &ndr_table_samr.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_samr_SetDomainInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetDomainInfo_ndr_print(py_obj, "samr_SetDomainInfo_in", NDR_IN); } static PyObject *py_samr_SetDomainInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetDomainInfo_ndr_print(py_obj, "samr_SetDomainInfo_out", NDR_OUT); } static PyMethodDef py_samr_SetDomainInfo_methods[] = { { "opnum", (PyCFunction)py_samr_SetDomainInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.SetDomainInfo.opnum() -> 9 (0x09) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetDomainInfo_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_samr_SetDomainInfo_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_samr_SetDomainInfo_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_samr_SetDomainInfo_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_samr_SetDomainInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_SetDomainInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_SetDomainInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.SetDomainInfo", .tp_getset = py_samr_SetDomainInfo_getsetters, .tp_methods = py_samr_SetDomainInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_SetDomainInfo_new, }; static bool pack_py_samr_SetDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetDomainInfo *r) { PyObject *py_domain_handle; PyObject *py_level; PyObject *py_info; const char *kwnames[] = { "domain_handle", "level", "info", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetDomainInfo", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_info)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); 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; } } if (py_info == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info"); return false; } r->in.info = talloc_ptrtype(r, r->in.info); if (r->in.info == NULL) { PyErr_NoMemory(); return false; } { union samr_DomainInfo *info_switch_1; info_switch_1 = (union samr_DomainInfo *)pyrpc_export_union(&samr_DomainInfo_Type, r, r->in.level, py_info, "union samr_DomainInfo"); if (info_switch_1 == NULL) { return false; } r->in.info = info_switch_1; } return true; } static PyObject *unpack_py_samr_SetDomainInfo_args_out(struct samr_SetDomainInfo *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_CreateDomainGroup_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_CreateDomainGroup_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_CreateDomainGroup_in_get_name(PyObject *obj, void *closure) { struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(obj); PyObject *py_name; if (object->in.name == NULL) { Py_RETURN_NONE; } py_name = pytalloc_reference_ex(lsa_String_Type, object->in.name, object->in.name); return py_name; } static int py_samr_CreateDomainGroup_in_set_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name"); return -1; } object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name); if (object->in.name == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_String_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.name = (struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_CreateDomainGroup_in_get_access_mask(PyObject *obj, void *closure) { struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(obj); PyObject *py_access_mask; py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask); return py_access_mask; } static int py_samr_CreateDomainGroup_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask)); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_CreateDomainGroup_out_get_group_handle(PyObject *obj, void *closure) { struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(obj); PyObject *py_group_handle; if (object->out.group_handle == NULL) { Py_RETURN_NONE; } py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->out.group_handle, object->out.group_handle); return py_group_handle; } static int py_samr_CreateDomainGroup_out_set_group_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.group_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.group_handle"); return -1; } object->out.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.group_handle); if (object->out.group_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.group_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_CreateDomainGroup_out_get_rid(PyObject *obj, void *closure) { struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(obj); PyObject *py_rid; if (object->out.rid == NULL) { Py_RETURN_NONE; } py_rid = PyLong_FromUnsignedLongLong((uint32_t)*object->out.rid); return py_rid; } static int py_samr_CreateDomainGroup_out_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rid"); return -1; } object->out.rid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rid); if (object->out.rid == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.rid)); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_CreateDomainGroup_get_result(PyObject *obj, void *closure) { struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_CreateDomainGroup_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_CreateDomainGroup_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_CreateDomainGroup_in_get_domain_handle, .set = py_samr_CreateDomainGroup_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_name"), .get = py_samr_CreateDomainGroup_in_get_name, .set = py_samr_CreateDomainGroup_in_set_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "in_access_mask"), .get = py_samr_CreateDomainGroup_in_get_access_mask, .set = py_samr_CreateDomainGroup_in_set_access_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_GroupAccessMask") }, { .name = discard_const_p(char, "out_group_handle"), .get = py_samr_CreateDomainGroup_out_get_group_handle, .set = py_samr_CreateDomainGroup_out_set_group_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "out_rid"), .get = py_samr_CreateDomainGroup_out_get_rid, .set = py_samr_CreateDomainGroup_out_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_CreateDomainGroup_get_result, .set = py_samr_CreateDomainGroup_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_CreateDomainGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_CreateDomainGroup, type); struct samr_CreateDomainGroup *_self = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.name = talloc_zero(mem_ctx, struct lsa_String); _self->out.group_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.rid = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_samr_CreateDomainGroup_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(10); } static PyObject *py_samr_CreateDomainGroup_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 11) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateDomainGroup_ndr_pack"); return NULL; } call = &ndr_table_samr.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_samr_CreateDomainGroup_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_samr_CreateDomainGroup_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_CreateDomainGroup_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_samr_CreateDomainGroup_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_CreateDomainGroup_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 samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 11) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateDomainGroup_ndr_unpack"); return NULL; } call = &ndr_table_samr.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_samr_CreateDomainGroup_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_samr_CreateDomainGroup_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_CreateDomainGroup_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_samr_CreateDomainGroup_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_CreateDomainGroup_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 11) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateDomainGroup_ndr_print"); return NULL; } call = &ndr_table_samr.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_samr_CreateDomainGroup_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_CreateDomainGroup_ndr_print(py_obj, "samr_CreateDomainGroup_in", NDR_IN); } static PyObject *py_samr_CreateDomainGroup_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_CreateDomainGroup_ndr_print(py_obj, "samr_CreateDomainGroup_out", NDR_OUT); } static PyMethodDef py_samr_CreateDomainGroup_methods[] = { { "opnum", (PyCFunction)py_samr_CreateDomainGroup_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.CreateDomainGroup.opnum() -> 10 (0x0a) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateDomainGroup_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_samr_CreateDomainGroup_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_samr_CreateDomainGroup_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_samr_CreateDomainGroup_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_samr_CreateDomainGroup_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_CreateDomainGroup_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_CreateDomainGroup_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.CreateDomainGroup", .tp_getset = py_samr_CreateDomainGroup_getsetters, .tp_methods = py_samr_CreateDomainGroup_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_CreateDomainGroup_new, }; static bool pack_py_samr_CreateDomainGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateDomainGroup *r) { PyObject *py_domain_handle; PyObject *py_name; PyObject *py_access_mask; const char *kwnames[] = { "domain_handle", "name", "access_mask", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_CreateDomainGroup", discard_const_p(char *, kwnames), &py_domain_handle, &py_name, &py_access_mask)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); if (py_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name"); return false; } r->in.name = talloc_ptrtype(r, r->in.name); if (r->in.name == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_String_Type, py_name, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) { PyErr_NoMemory(); return false; } r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name); if (py_access_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask)); if (PyLong_Check(py_access_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_access_mask); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_CreateDomainGroup_args_out(struct samr_CreateDomainGroup *r) { PyObject *result; PyObject *py_group_handle; PyObject *py_rid; result = PyTuple_New(2); py_group_handle = pytalloc_reference_ex(policy_handle_Type, r->out.group_handle, r->out.group_handle); PyTuple_SetItem(result, 0, py_group_handle); py_rid = PyLong_FromUnsignedLongLong((uint32_t)*r->out.rid); PyTuple_SetItem(result, 1, py_rid); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_EnumDomainGroups_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_EnumDomainGroups_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_EnumDomainGroups_in_get_resume_handle(PyObject *obj, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj); PyObject *py_resume_handle; if (object->in.resume_handle == NULL) { Py_RETURN_NONE; } py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle); return py_resume_handle; } static int py_samr_EnumDomainGroups_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle"); return -1; } object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle); if (object->in.resume_handle == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle)); 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.resume_handle = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomainGroups_out_get_resume_handle(PyObject *obj, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj); PyObject *py_resume_handle; if (object->out.resume_handle == NULL) { Py_RETURN_NONE; } py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle); return py_resume_handle; } static int py_samr_EnumDomainGroups_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle"); return -1; } object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle); if (object->out.resume_handle == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle)); 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.resume_handle = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomainGroups_out_get_sam(PyObject *obj, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj); PyObject *py_sam; if (object->out.sam == NULL) { Py_RETURN_NONE; } if (*object->out.sam == NULL) { py_sam = Py_None; Py_INCREF(py_sam); } else { py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *object->out.sam, *object->out.sam); } return py_sam; } static int py_samr_EnumDomainGroups_out_set_sam(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sam)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sam"); return -1; } object->out.sam = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sam); if (object->out.sam == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.sam = NULL; } else { *object->out.sam = NULL; PY_CHECK_TYPE(&samr_SamArray_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.sam = (struct samr_SamArray *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_EnumDomainGroups_in_get_max_size(PyObject *obj, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj); PyObject *py_max_size; py_max_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_size); return py_max_size; } static int py_samr_EnumDomainGroups_in_set_max_size(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_size)); 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.max_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomainGroups_out_get_num_entries(PyObject *obj, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj); PyObject *py_num_entries; if (object->out.num_entries == NULL) { Py_RETURN_NONE; } py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*object->out.num_entries); return py_num_entries; } static int py_samr_EnumDomainGroups_out_set_num_entries(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.num_entries)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.num_entries"); return -1; } object->out.num_entries = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.num_entries); if (object->out.num_entries == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.num_entries)); 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.num_entries = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomainGroups_get_result(PyObject *obj, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_EnumDomainGroups_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_EnumDomainGroups_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_EnumDomainGroups_in_get_domain_handle, .set = py_samr_EnumDomainGroups_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_resume_handle"), .get = py_samr_EnumDomainGroups_in_get_resume_handle, .set = py_samr_EnumDomainGroups_in_set_resume_handle, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_resume_handle"), .get = py_samr_EnumDomainGroups_out_get_resume_handle, .set = py_samr_EnumDomainGroups_out_set_resume_handle, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_sam"), .get = py_samr_EnumDomainGroups_out_get_sam, .set = py_samr_EnumDomainGroups_out_set_sam, .doc = discard_const_p(char, "PIDL-generated element of base type samr_SamArray") }, { .name = discard_const_p(char, "in_max_size"), .get = py_samr_EnumDomainGroups_in_get_max_size, .set = py_samr_EnumDomainGroups_in_set_max_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_num_entries"), .get = py_samr_EnumDomainGroups_out_get_num_entries, .set = py_samr_EnumDomainGroups_out_set_num_entries, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_EnumDomainGroups_get_result, .set = py_samr_EnumDomainGroups_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_EnumDomainGroups_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_EnumDomainGroups, type); struct samr_EnumDomainGroups *_self = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t); _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t); /* a pointer to a NULL pointer */ _self->out.sam = talloc_zero(mem_ctx, struct samr_SamArray *); _self->out.num_entries = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_samr_EnumDomainGroups_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(11); } static PyObject *py_samr_EnumDomainGroups_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 12) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainGroups_ndr_pack"); return NULL; } call = &ndr_table_samr.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_samr_EnumDomainGroups_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_samr_EnumDomainGroups_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_EnumDomainGroups_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_samr_EnumDomainGroups_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_EnumDomainGroups_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 samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 12) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainGroups_ndr_unpack"); return NULL; } call = &ndr_table_samr.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_samr_EnumDomainGroups_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_samr_EnumDomainGroups_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_EnumDomainGroups_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_samr_EnumDomainGroups_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_EnumDomainGroups_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 12) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainGroups_ndr_print"); return NULL; } call = &ndr_table_samr.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_samr_EnumDomainGroups_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_EnumDomainGroups_ndr_print(py_obj, "samr_EnumDomainGroups_in", NDR_IN); } static PyObject *py_samr_EnumDomainGroups_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_EnumDomainGroups_ndr_print(py_obj, "samr_EnumDomainGroups_out", NDR_OUT); } static PyMethodDef py_samr_EnumDomainGroups_methods[] = { { "opnum", (PyCFunction)py_samr_EnumDomainGroups_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.EnumDomainGroups.opnum() -> 11 (0x0b) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainGroups_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_samr_EnumDomainGroups_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_samr_EnumDomainGroups_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_samr_EnumDomainGroups_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_samr_EnumDomainGroups_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_EnumDomainGroups_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_EnumDomainGroups_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.EnumDomainGroups", .tp_getset = py_samr_EnumDomainGroups_getsetters, .tp_methods = py_samr_EnumDomainGroups_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_EnumDomainGroups_new, }; static bool pack_py_samr_EnumDomainGroups_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomainGroups *r) { PyObject *py_domain_handle; PyObject *py_resume_handle; PyObject *py_max_size; const char *kwnames[] = { "domain_handle", "resume_handle", "max_size", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_EnumDomainGroups", discard_const_p(char *, kwnames), &py_domain_handle, &py_resume_handle, &py_max_size)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); if (py_resume_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle"); return false; } r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle); if (r->in.resume_handle == NULL) { PyErr_NoMemory(); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle)); if (PyLong_Check(py_resume_handle)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_resume_handle); 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.resume_handle = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_max_size == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_size"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size)); if (PyLong_Check(py_max_size)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_max_size); 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.max_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_EnumDomainGroups_args_out(struct samr_EnumDomainGroups *r) { PyObject *result; PyObject *py_resume_handle; PyObject *py_sam; PyObject *py_num_entries; result = PyTuple_New(3); py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle); PyTuple_SetItem(result, 0, py_resume_handle); if (*r->out.sam == NULL) { py_sam = Py_None; Py_INCREF(py_sam); } else { py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam); } PyTuple_SetItem(result, 1, py_sam); py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*r->out.num_entries); PyTuple_SetItem(result, 2, py_num_entries); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_CreateUser_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_CreateUser_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_CreateUser_in_get_account_name(PyObject *obj, void *closure) { struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->in.account_name == NULL) { Py_RETURN_NONE; } py_account_name = pytalloc_reference_ex(lsa_String_Type, object->in.account_name, object->in.account_name); return py_account_name; } static int py_samr_CreateUser_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account_name)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name"); return -1; } object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name); if (object->in.account_name == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_String_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.account_name = (struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_CreateUser_in_get_access_mask(PyObject *obj, void *closure) { struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(obj); PyObject *py_access_mask; py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask); return py_access_mask; } static int py_samr_CreateUser_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask)); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_CreateUser_out_get_user_handle(PyObject *obj, void *closure) { struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(obj); PyObject *py_user_handle; if (object->out.user_handle == NULL) { Py_RETURN_NONE; } py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->out.user_handle, object->out.user_handle); return py_user_handle; } static int py_samr_CreateUser_out_set_user_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.user_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.user_handle"); return -1; } object->out.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.user_handle); if (object->out.user_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.user_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_CreateUser_out_get_rid(PyObject *obj, void *closure) { struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(obj); PyObject *py_rid; if (object->out.rid == NULL) { Py_RETURN_NONE; } py_rid = PyLong_FromUnsignedLongLong((uint32_t)*object->out.rid); return py_rid; } static int py_samr_CreateUser_out_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rid"); return -1; } object->out.rid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rid); if (object->out.rid == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.rid)); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_CreateUser_get_result(PyObject *obj, void *closure) { struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_CreateUser_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_CreateUser_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_CreateUser_in_get_domain_handle, .set = py_samr_CreateUser_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_account_name"), .get = py_samr_CreateUser_in_get_account_name, .set = py_samr_CreateUser_in_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "in_access_mask"), .get = py_samr_CreateUser_in_get_access_mask, .set = py_samr_CreateUser_in_set_access_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserAccessMask") }, { .name = discard_const_p(char, "out_user_handle"), .get = py_samr_CreateUser_out_get_user_handle, .set = py_samr_CreateUser_out_set_user_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "out_rid"), .get = py_samr_CreateUser_out_get_rid, .set = py_samr_CreateUser_out_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_CreateUser_get_result, .set = py_samr_CreateUser_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_CreateUser_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_CreateUser, type); struct samr_CreateUser *_self = (struct samr_CreateUser *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.account_name = talloc_zero(mem_ctx, struct lsa_String); _self->out.user_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.rid = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_samr_CreateUser_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(12); } static PyObject *py_samr_CreateUser_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 13) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateUser_ndr_pack"); return NULL; } call = &ndr_table_samr.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_samr_CreateUser_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_samr_CreateUser_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_CreateUser_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_samr_CreateUser_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_CreateUser_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 samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 13) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateUser_ndr_unpack"); return NULL; } call = &ndr_table_samr.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_samr_CreateUser_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_samr_CreateUser_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_CreateUser_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_samr_CreateUser_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_CreateUser_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 13) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateUser_ndr_print"); return NULL; } call = &ndr_table_samr.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_samr_CreateUser_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_CreateUser_ndr_print(py_obj, "samr_CreateUser_in", NDR_IN); } static PyObject *py_samr_CreateUser_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_CreateUser_ndr_print(py_obj, "samr_CreateUser_out", NDR_OUT); } static PyMethodDef py_samr_CreateUser_methods[] = { { "opnum", (PyCFunction)py_samr_CreateUser_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.CreateUser.opnum() -> 12 (0x0c) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateUser_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_samr_CreateUser_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_samr_CreateUser_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_samr_CreateUser_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_samr_CreateUser_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_CreateUser_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_CreateUser_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.CreateUser", .tp_getset = py_samr_CreateUser_getsetters, .tp_methods = py_samr_CreateUser_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_CreateUser_new, }; static bool pack_py_samr_CreateUser_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateUser *r) { PyObject *py_domain_handle; PyObject *py_account_name; PyObject *py_access_mask; const char *kwnames[] = { "domain_handle", "account_name", "access_mask", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_CreateUser", discard_const_p(char *, kwnames), &py_domain_handle, &py_account_name, &py_access_mask)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); if (py_account_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name"); return false; } r->in.account_name = talloc_ptrtype(r, r->in.account_name); if (r->in.account_name == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_String_Type, py_account_name, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_account_name)) == NULL) { PyErr_NoMemory(); return false; } r->in.account_name = (struct lsa_String *)pytalloc_get_ptr(py_account_name); if (py_access_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask)); if (PyLong_Check(py_access_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_access_mask); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_CreateUser_args_out(struct samr_CreateUser *r) { PyObject *result; PyObject *py_user_handle; PyObject *py_rid; result = PyTuple_New(2); py_user_handle = pytalloc_reference_ex(policy_handle_Type, r->out.user_handle, r->out.user_handle); PyTuple_SetItem(result, 0, py_user_handle); py_rid = PyLong_FromUnsignedLongLong((uint32_t)*r->out.rid); PyTuple_SetItem(result, 1, py_rid); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_EnumDomainUsers_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_EnumDomainUsers_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_EnumDomainUsers_in_get_resume_handle(PyObject *obj, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj); PyObject *py_resume_handle; if (object->in.resume_handle == NULL) { Py_RETURN_NONE; } py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle); return py_resume_handle; } static int py_samr_EnumDomainUsers_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle"); return -1; } object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle); if (object->in.resume_handle == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle)); 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.resume_handle = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomainUsers_out_get_resume_handle(PyObject *obj, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj); PyObject *py_resume_handle; if (object->out.resume_handle == NULL) { Py_RETURN_NONE; } py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle); return py_resume_handle; } static int py_samr_EnumDomainUsers_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle"); return -1; } object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle); if (object->out.resume_handle == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle)); 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.resume_handle = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomainUsers_in_get_acct_flags(PyObject *obj, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj); PyObject *py_acct_flags; py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.acct_flags); return py_acct_flags; } static int py_samr_EnumDomainUsers_in_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.acct_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.acct_flags)); 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.acct_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomainUsers_out_get_sam(PyObject *obj, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj); PyObject *py_sam; if (object->out.sam == NULL) { Py_RETURN_NONE; } if (*object->out.sam == NULL) { py_sam = Py_None; Py_INCREF(py_sam); } else { py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *object->out.sam, *object->out.sam); } return py_sam; } static int py_samr_EnumDomainUsers_out_set_sam(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sam)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sam"); return -1; } object->out.sam = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sam); if (object->out.sam == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.sam = NULL; } else { *object->out.sam = NULL; PY_CHECK_TYPE(&samr_SamArray_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.sam = (struct samr_SamArray *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_EnumDomainUsers_in_get_max_size(PyObject *obj, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj); PyObject *py_max_size; py_max_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_size); return py_max_size; } static int py_samr_EnumDomainUsers_in_set_max_size(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_size)); 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.max_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomainUsers_out_get_num_entries(PyObject *obj, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj); PyObject *py_num_entries; if (object->out.num_entries == NULL) { Py_RETURN_NONE; } py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*object->out.num_entries); return py_num_entries; } static int py_samr_EnumDomainUsers_out_set_num_entries(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.num_entries)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.num_entries"); return -1; } object->out.num_entries = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.num_entries); if (object->out.num_entries == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.num_entries)); 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.num_entries = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomainUsers_get_result(PyObject *obj, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_EnumDomainUsers_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_EnumDomainUsers_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_EnumDomainUsers_in_get_domain_handle, .set = py_samr_EnumDomainUsers_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_resume_handle"), .get = py_samr_EnumDomainUsers_in_get_resume_handle, .set = py_samr_EnumDomainUsers_in_set_resume_handle, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_resume_handle"), .get = py_samr_EnumDomainUsers_out_get_resume_handle, .set = py_samr_EnumDomainUsers_out_set_resume_handle, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_acct_flags"), .get = py_samr_EnumDomainUsers_in_get_acct_flags, .set = py_samr_EnumDomainUsers_in_set_acct_flags, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags") }, { .name = discard_const_p(char, "out_sam"), .get = py_samr_EnumDomainUsers_out_get_sam, .set = py_samr_EnumDomainUsers_out_set_sam, .doc = discard_const_p(char, "PIDL-generated element of base type samr_SamArray") }, { .name = discard_const_p(char, "in_max_size"), .get = py_samr_EnumDomainUsers_in_get_max_size, .set = py_samr_EnumDomainUsers_in_set_max_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_num_entries"), .get = py_samr_EnumDomainUsers_out_get_num_entries, .set = py_samr_EnumDomainUsers_out_set_num_entries, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_EnumDomainUsers_get_result, .set = py_samr_EnumDomainUsers_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_EnumDomainUsers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_EnumDomainUsers, type); struct samr_EnumDomainUsers *_self = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t); _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t); /* a pointer to a NULL pointer */ _self->out.sam = talloc_zero(mem_ctx, struct samr_SamArray *); _self->out.num_entries = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_samr_EnumDomainUsers_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(13); } static PyObject *py_samr_EnumDomainUsers_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 14) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainUsers_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[13]; 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_samr_EnumDomainUsers_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_samr_EnumDomainUsers_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_EnumDomainUsers_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_samr_EnumDomainUsers_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_EnumDomainUsers_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 samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 14) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainUsers_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[13]; 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_samr_EnumDomainUsers_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_samr_EnumDomainUsers_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_EnumDomainUsers_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_samr_EnumDomainUsers_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_EnumDomainUsers_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 14) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainUsers_ndr_print"); return NULL; } call = &ndr_table_samr.calls[13]; 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_samr_EnumDomainUsers_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_EnumDomainUsers_ndr_print(py_obj, "samr_EnumDomainUsers_in", NDR_IN); } static PyObject *py_samr_EnumDomainUsers_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_EnumDomainUsers_ndr_print(py_obj, "samr_EnumDomainUsers_out", NDR_OUT); } static PyMethodDef py_samr_EnumDomainUsers_methods[] = { { "opnum", (PyCFunction)py_samr_EnumDomainUsers_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.EnumDomainUsers.opnum() -> 13 (0x0d) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainUsers_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_samr_EnumDomainUsers_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_samr_EnumDomainUsers_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_samr_EnumDomainUsers_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_samr_EnumDomainUsers_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_EnumDomainUsers_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_EnumDomainUsers_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.EnumDomainUsers", .tp_getset = py_samr_EnumDomainUsers_getsetters, .tp_methods = py_samr_EnumDomainUsers_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_EnumDomainUsers_new, }; static bool pack_py_samr_EnumDomainUsers_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomainUsers *r) { PyObject *py_domain_handle; PyObject *py_resume_handle; PyObject *py_acct_flags; PyObject *py_max_size; const char *kwnames[] = { "domain_handle", "resume_handle", "acct_flags", "max_size", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_EnumDomainUsers", discard_const_p(char *, kwnames), &py_domain_handle, &py_resume_handle, &py_acct_flags, &py_max_size)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); if (py_resume_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle"); return false; } r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle); if (r->in.resume_handle == NULL) { PyErr_NoMemory(); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle)); if (PyLong_Check(py_resume_handle)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_resume_handle); 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.resume_handle = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_acct_flags == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.acct_flags"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.acct_flags)); if (PyLong_Check(py_acct_flags)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_acct_flags); 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.acct_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_max_size == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_size"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size)); if (PyLong_Check(py_max_size)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_max_size); 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.max_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_EnumDomainUsers_args_out(struct samr_EnumDomainUsers *r) { PyObject *result; PyObject *py_resume_handle; PyObject *py_sam; PyObject *py_num_entries; result = PyTuple_New(3); py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle); PyTuple_SetItem(result, 0, py_resume_handle); if (*r->out.sam == NULL) { py_sam = Py_None; Py_INCREF(py_sam); } else { py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam); } PyTuple_SetItem(result, 1, py_sam); py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*r->out.num_entries); PyTuple_SetItem(result, 2, py_num_entries); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_CreateDomAlias_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_CreateDomAlias_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_CreateDomAlias_in_get_alias_name(PyObject *obj, void *closure) { struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(obj); PyObject *py_alias_name; if (object->in.alias_name == NULL) { Py_RETURN_NONE; } py_alias_name = pytalloc_reference_ex(lsa_String_Type, object->in.alias_name, object->in.alias_name); return py_alias_name; } static int py_samr_CreateDomAlias_in_set_alias_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_name)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_name"); return -1; } object->in.alias_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_name); if (object->in.alias_name == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_String_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.alias_name = (struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_CreateDomAlias_in_get_access_mask(PyObject *obj, void *closure) { struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(obj); PyObject *py_access_mask; py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask); return py_access_mask; } static int py_samr_CreateDomAlias_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask)); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_CreateDomAlias_out_get_alias_handle(PyObject *obj, void *closure) { struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(obj); PyObject *py_alias_handle; if (object->out.alias_handle == NULL) { Py_RETURN_NONE; } py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->out.alias_handle, object->out.alias_handle); return py_alias_handle; } static int py_samr_CreateDomAlias_out_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.alias_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.alias_handle"); return -1; } object->out.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.alias_handle); if (object->out.alias_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_CreateDomAlias_out_get_rid(PyObject *obj, void *closure) { struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(obj); PyObject *py_rid; if (object->out.rid == NULL) { Py_RETURN_NONE; } py_rid = PyLong_FromUnsignedLongLong((uint32_t)*object->out.rid); return py_rid; } static int py_samr_CreateDomAlias_out_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rid"); return -1; } object->out.rid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rid); if (object->out.rid == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.rid)); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_CreateDomAlias_get_result(PyObject *obj, void *closure) { struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_CreateDomAlias_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_CreateDomAlias_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_CreateDomAlias_in_get_domain_handle, .set = py_samr_CreateDomAlias_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_alias_name"), .get = py_samr_CreateDomAlias_in_get_alias_name, .set = py_samr_CreateDomAlias_in_set_alias_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "in_access_mask"), .get = py_samr_CreateDomAlias_in_get_access_mask, .set = py_samr_CreateDomAlias_in_set_access_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AliasAccessMask") }, { .name = discard_const_p(char, "out_alias_handle"), .get = py_samr_CreateDomAlias_out_get_alias_handle, .set = py_samr_CreateDomAlias_out_set_alias_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "out_rid"), .get = py_samr_CreateDomAlias_out_get_rid, .set = py_samr_CreateDomAlias_out_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_CreateDomAlias_get_result, .set = py_samr_CreateDomAlias_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_CreateDomAlias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_CreateDomAlias, type); struct samr_CreateDomAlias *_self = (struct samr_CreateDomAlias *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.alias_name = talloc_zero(mem_ctx, struct lsa_String); _self->out.alias_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.rid = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_samr_CreateDomAlias_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(14); } static PyObject *py_samr_CreateDomAlias_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 15) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateDomAlias_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[14]; 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_samr_CreateDomAlias_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_samr_CreateDomAlias_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_CreateDomAlias_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_samr_CreateDomAlias_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_CreateDomAlias_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 samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 15) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateDomAlias_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[14]; 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_samr_CreateDomAlias_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_samr_CreateDomAlias_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_CreateDomAlias_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_samr_CreateDomAlias_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_CreateDomAlias_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 15) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateDomAlias_ndr_print"); return NULL; } call = &ndr_table_samr.calls[14]; 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_samr_CreateDomAlias_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_CreateDomAlias_ndr_print(py_obj, "samr_CreateDomAlias_in", NDR_IN); } static PyObject *py_samr_CreateDomAlias_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_CreateDomAlias_ndr_print(py_obj, "samr_CreateDomAlias_out", NDR_OUT); } static PyMethodDef py_samr_CreateDomAlias_methods[] = { { "opnum", (PyCFunction)py_samr_CreateDomAlias_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.CreateDomAlias.opnum() -> 14 (0x0e) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateDomAlias_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_samr_CreateDomAlias_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_samr_CreateDomAlias_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_samr_CreateDomAlias_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_samr_CreateDomAlias_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_CreateDomAlias_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_CreateDomAlias_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.CreateDomAlias", .tp_getset = py_samr_CreateDomAlias_getsetters, .tp_methods = py_samr_CreateDomAlias_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_CreateDomAlias_new, }; static bool pack_py_samr_CreateDomAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateDomAlias *r) { PyObject *py_domain_handle; PyObject *py_alias_name; PyObject *py_access_mask; const char *kwnames[] = { "domain_handle", "alias_name", "access_mask", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_CreateDomAlias", discard_const_p(char *, kwnames), &py_domain_handle, &py_alias_name, &py_access_mask)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); if (py_alias_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_name"); return false; } r->in.alias_name = talloc_ptrtype(r, r->in.alias_name); if (r->in.alias_name == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_String_Type, py_alias_name, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_name)) == NULL) { PyErr_NoMemory(); return false; } r->in.alias_name = (struct lsa_String *)pytalloc_get_ptr(py_alias_name); if (py_access_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask)); if (PyLong_Check(py_access_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_access_mask); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_CreateDomAlias_args_out(struct samr_CreateDomAlias *r) { PyObject *result; PyObject *py_alias_handle; PyObject *py_rid; result = PyTuple_New(2); py_alias_handle = pytalloc_reference_ex(policy_handle_Type, r->out.alias_handle, r->out.alias_handle); PyTuple_SetItem(result, 0, py_alias_handle); py_rid = PyLong_FromUnsignedLongLong((uint32_t)*r->out.rid); PyTuple_SetItem(result, 1, py_rid); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_EnumDomainAliases_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_EnumDomainAliases_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_EnumDomainAliases_in_get_resume_handle(PyObject *obj, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj); PyObject *py_resume_handle; if (object->in.resume_handle == NULL) { Py_RETURN_NONE; } py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle); return py_resume_handle; } static int py_samr_EnumDomainAliases_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle"); return -1; } object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle); if (object->in.resume_handle == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle)); 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.resume_handle = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomainAliases_out_get_resume_handle(PyObject *obj, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj); PyObject *py_resume_handle; if (object->out.resume_handle == NULL) { Py_RETURN_NONE; } py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle); return py_resume_handle; } static int py_samr_EnumDomainAliases_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle"); return -1; } object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle); if (object->out.resume_handle == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle)); 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.resume_handle = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomainAliases_out_get_sam(PyObject *obj, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj); PyObject *py_sam; if (object->out.sam == NULL) { Py_RETURN_NONE; } if (*object->out.sam == NULL) { py_sam = Py_None; Py_INCREF(py_sam); } else { py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *object->out.sam, *object->out.sam); } return py_sam; } static int py_samr_EnumDomainAliases_out_set_sam(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sam)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sam"); return -1; } object->out.sam = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sam); if (object->out.sam == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.sam = NULL; } else { *object->out.sam = NULL; PY_CHECK_TYPE(&samr_SamArray_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.sam = (struct samr_SamArray *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_EnumDomainAliases_in_get_max_size(PyObject *obj, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj); PyObject *py_max_size; py_max_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_size); return py_max_size; } static int py_samr_EnumDomainAliases_in_set_max_size(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_size)); 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.max_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomainAliases_out_get_num_entries(PyObject *obj, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj); PyObject *py_num_entries; if (object->out.num_entries == NULL) { Py_RETURN_NONE; } py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*object->out.num_entries); return py_num_entries; } static int py_samr_EnumDomainAliases_out_set_num_entries(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.num_entries)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.num_entries"); return -1; } object->out.num_entries = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.num_entries); if (object->out.num_entries == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.num_entries)); 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.num_entries = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_EnumDomainAliases_get_result(PyObject *obj, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_EnumDomainAliases_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_EnumDomainAliases_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_EnumDomainAliases_in_get_domain_handle, .set = py_samr_EnumDomainAliases_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_resume_handle"), .get = py_samr_EnumDomainAliases_in_get_resume_handle, .set = py_samr_EnumDomainAliases_in_set_resume_handle, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_resume_handle"), .get = py_samr_EnumDomainAliases_out_get_resume_handle, .set = py_samr_EnumDomainAliases_out_set_resume_handle, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_sam"), .get = py_samr_EnumDomainAliases_out_get_sam, .set = py_samr_EnumDomainAliases_out_set_sam, .doc = discard_const_p(char, "PIDL-generated element of base type samr_SamArray") }, { .name = discard_const_p(char, "in_max_size"), .get = py_samr_EnumDomainAliases_in_get_max_size, .set = py_samr_EnumDomainAliases_in_set_max_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_num_entries"), .get = py_samr_EnumDomainAliases_out_get_num_entries, .set = py_samr_EnumDomainAliases_out_set_num_entries, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_EnumDomainAliases_get_result, .set = py_samr_EnumDomainAliases_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_EnumDomainAliases_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_EnumDomainAliases, type); struct samr_EnumDomainAliases *_self = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t); _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t); /* a pointer to a NULL pointer */ _self->out.sam = talloc_zero(mem_ctx, struct samr_SamArray *); _self->out.num_entries = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_samr_EnumDomainAliases_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(15); } static PyObject *py_samr_EnumDomainAliases_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 16) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainAliases_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[15]; 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_samr_EnumDomainAliases_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_samr_EnumDomainAliases_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_EnumDomainAliases_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_samr_EnumDomainAliases_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_EnumDomainAliases_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 samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 16) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainAliases_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[15]; 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_samr_EnumDomainAliases_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_samr_EnumDomainAliases_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_EnumDomainAliases_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_samr_EnumDomainAliases_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_EnumDomainAliases_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 16) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainAliases_ndr_print"); return NULL; } call = &ndr_table_samr.calls[15]; 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_samr_EnumDomainAliases_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_EnumDomainAliases_ndr_print(py_obj, "samr_EnumDomainAliases_in", NDR_IN); } static PyObject *py_samr_EnumDomainAliases_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_EnumDomainAliases_ndr_print(py_obj, "samr_EnumDomainAliases_out", NDR_OUT); } static PyMethodDef py_samr_EnumDomainAliases_methods[] = { { "opnum", (PyCFunction)py_samr_EnumDomainAliases_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.EnumDomainAliases.opnum() -> 15 (0x0f) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainAliases_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_samr_EnumDomainAliases_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_samr_EnumDomainAliases_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_samr_EnumDomainAliases_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_samr_EnumDomainAliases_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_EnumDomainAliases_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_EnumDomainAliases_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.EnumDomainAliases", .tp_getset = py_samr_EnumDomainAliases_getsetters, .tp_methods = py_samr_EnumDomainAliases_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_EnumDomainAliases_new, }; static bool pack_py_samr_EnumDomainAliases_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomainAliases *r) { PyObject *py_domain_handle; PyObject *py_resume_handle; PyObject *py_max_size; const char *kwnames[] = { "domain_handle", "resume_handle", "max_size", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_EnumDomainAliases", discard_const_p(char *, kwnames), &py_domain_handle, &py_resume_handle, &py_max_size)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); if (py_resume_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle"); return false; } r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle); if (r->in.resume_handle == NULL) { PyErr_NoMemory(); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle)); if (PyLong_Check(py_resume_handle)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_resume_handle); 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.resume_handle = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_max_size == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_size"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size)); if (PyLong_Check(py_max_size)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_max_size); 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.max_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_EnumDomainAliases_args_out(struct samr_EnumDomainAliases *r) { PyObject *result; PyObject *py_resume_handle; PyObject *py_sam; PyObject *py_num_entries; result = PyTuple_New(3); py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle); PyTuple_SetItem(result, 0, py_resume_handle); if (*r->out.sam == NULL) { py_sam = Py_None; Py_INCREF(py_sam); } else { py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam); } PyTuple_SetItem(result, 1, py_sam); py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*r->out.num_entries); PyTuple_SetItem(result, 2, py_num_entries); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_GetAliasMembership_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_GetAliasMembership_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetAliasMembership_in_get_sids(PyObject *obj, void *closure) { struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(obj); PyObject *py_sids; if (object->in.sids == NULL) { Py_RETURN_NONE; } py_sids = pytalloc_reference_ex(lsa_SidArray_Type, object->in.sids, object->in.sids); return py_sids; } static int py_samr_GetAliasMembership_in_set_sids(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids"); return -1; } object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids); if (object->in.sids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_SidArray_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.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetAliasMembership_out_get_rids(PyObject *obj, void *closure) { struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(obj); PyObject *py_rids; if (object->out.rids == NULL) { Py_RETURN_NONE; } py_rids = pytalloc_reference_ex(&samr_Ids_Type, object->out.rids, object->out.rids); return py_rids; } static int py_samr_GetAliasMembership_out_set_rids(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids"); return -1; } object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids); if (object->out.rids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&samr_Ids_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.rids = (struct samr_Ids *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetAliasMembership_get_result(PyObject *obj, void *closure) { struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_GetAliasMembership_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_GetAliasMembership_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_GetAliasMembership_in_get_domain_handle, .set = py_samr_GetAliasMembership_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_sids"), .get = py_samr_GetAliasMembership_in_get_sids, .set = py_samr_GetAliasMembership_in_set_sids, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray") }, { .name = discard_const_p(char, "out_rids"), .get = py_samr_GetAliasMembership_out_get_rids, .set = py_samr_GetAliasMembership_out_set_rids, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Ids") }, { .name = discard_const_p(char, "result"), .get = py_samr_GetAliasMembership_get_result, .set = py_samr_GetAliasMembership_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_GetAliasMembership_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_GetAliasMembership, type); struct samr_GetAliasMembership *_self = (struct samr_GetAliasMembership *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray); _self->out.rids = talloc_zero(mem_ctx, struct samr_Ids); return self; } static PyObject *py_samr_GetAliasMembership_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(16); } static PyObject *py_samr_GetAliasMembership_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 17) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetAliasMembership_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[16]; 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_samr_GetAliasMembership_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_samr_GetAliasMembership_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_GetAliasMembership_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_samr_GetAliasMembership_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_GetAliasMembership_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 samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 17) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetAliasMembership_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[16]; 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_samr_GetAliasMembership_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_samr_GetAliasMembership_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetAliasMembership_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_samr_GetAliasMembership_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetAliasMembership_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 17) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetAliasMembership_ndr_print"); return NULL; } call = &ndr_table_samr.calls[16]; 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_samr_GetAliasMembership_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetAliasMembership_ndr_print(py_obj, "samr_GetAliasMembership_in", NDR_IN); } static PyObject *py_samr_GetAliasMembership_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetAliasMembership_ndr_print(py_obj, "samr_GetAliasMembership_out", NDR_OUT); } static PyMethodDef py_samr_GetAliasMembership_methods[] = { { "opnum", (PyCFunction)py_samr_GetAliasMembership_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.GetAliasMembership.opnum() -> 16 (0x10) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetAliasMembership_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_samr_GetAliasMembership_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_samr_GetAliasMembership_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_samr_GetAliasMembership_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_samr_GetAliasMembership_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_GetAliasMembership_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_GetAliasMembership_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.GetAliasMembership", .tp_getset = py_samr_GetAliasMembership_getsetters, .tp_methods = py_samr_GetAliasMembership_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_GetAliasMembership_new, }; static bool pack_py_samr_GetAliasMembership_args_in(PyObject *args, PyObject *kwargs, struct samr_GetAliasMembership *r) { PyObject *py_domain_handle; PyObject *py_sids; const char *kwnames[] = { "domain_handle", "sids", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_GetAliasMembership", discard_const_p(char *, kwnames), &py_domain_handle, &py_sids)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); if (py_sids == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids"); return false; } r->in.sids = talloc_ptrtype(r, r->in.sids); if (r->in.sids == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_SidArray_Type, py_sids, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) { PyErr_NoMemory(); return false; } r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids); return true; } static PyObject *unpack_py_samr_GetAliasMembership_args_out(struct samr_GetAliasMembership *r) { PyObject *result; PyObject *py_rids; py_rids = pytalloc_reference_ex(&samr_Ids_Type, r->out.rids, r->out.rids); result = py_rids; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_LookupNames_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_LookupNames_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_LookupNames_in_get_num_names(PyObject *obj, void *closure) { struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(obj); PyObject *py_num_names; py_num_names = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_names); return py_num_names; } static int py_samr_LookupNames_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_names"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names)); 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.num_names = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_LookupNames_in_get_names(PyObject *obj, void *closure) { struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(obj); PyObject *py_names; py_names = PyList_New(object->in.num_names); if (py_names == NULL) { return NULL; } { int names_cntr_0; for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) { PyObject *py_names_0; py_names_0 = pytalloc_reference_ex(lsa_String_Type, object->in.names, &object->in.names[names_cntr_0]); PyList_SetItem(py_names, names_cntr_0, py_names_0); } } return py_names; } static int py_samr_LookupNames_in_set_names(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int names_cntr_0; object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value)); if (!object->in.names) { return -1;; } talloc_set_name_const(object->in.names, "ARRAY: object->in.names"); for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) { if (PyList_GET_ITEM(value, names_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names[names_cntr_0]"); return -1; } PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;); if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) { PyErr_NoMemory(); return -1; } object->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0)); } } return 0; } static PyObject *py_samr_LookupNames_out_get_rids(PyObject *obj, void *closure) { struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(obj); PyObject *py_rids; if (object->out.rids == NULL) { Py_RETURN_NONE; } py_rids = pytalloc_reference_ex(&samr_Ids_Type, object->out.rids, object->out.rids); return py_rids; } static int py_samr_LookupNames_out_set_rids(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids"); return -1; } object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids); if (object->out.rids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&samr_Ids_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.rids = (struct samr_Ids *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_LookupNames_out_get_types(PyObject *obj, void *closure) { struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(obj); PyObject *py_types; if (object->out.types == NULL) { Py_RETURN_NONE; } py_types = pytalloc_reference_ex(&samr_Ids_Type, object->out.types, object->out.types); return py_types; } static int py_samr_LookupNames_out_set_types(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.types)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.types"); return -1; } object->out.types = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.types); if (object->out.types == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&samr_Ids_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.types = (struct samr_Ids *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_LookupNames_get_result(PyObject *obj, void *closure) { struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_LookupNames_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_LookupNames_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_LookupNames_in_get_domain_handle, .set = py_samr_LookupNames_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_num_names"), .get = py_samr_LookupNames_in_get_num_names, .set = py_samr_LookupNames_in_set_num_names, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_names"), .get = py_samr_LookupNames_in_get_names, .set = py_samr_LookupNames_in_set_names, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "out_rids"), .get = py_samr_LookupNames_out_get_rids, .set = py_samr_LookupNames_out_set_rids, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Ids") }, { .name = discard_const_p(char, "out_types"), .get = py_samr_LookupNames_out_get_types, .set = py_samr_LookupNames_out_set_types, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Ids") }, { .name = discard_const_p(char, "result"), .get = py_samr_LookupNames_get_result, .set = py_samr_LookupNames_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_LookupNames_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_LookupNames, type); struct samr_LookupNames *_self = (struct samr_LookupNames *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.rids = talloc_zero(mem_ctx, struct samr_Ids); _self->out.types = talloc_zero(mem_ctx, struct samr_Ids); return self; } static PyObject *py_samr_LookupNames_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(17); } static PyObject *py_samr_LookupNames_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 18) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupNames_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[17]; 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_samr_LookupNames_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_samr_LookupNames_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_LookupNames_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_samr_LookupNames_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_LookupNames_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 samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 18) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupNames_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[17]; 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_samr_LookupNames_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_samr_LookupNames_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_LookupNames_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_samr_LookupNames_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_LookupNames_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 18) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupNames_ndr_print"); return NULL; } call = &ndr_table_samr.calls[17]; 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_samr_LookupNames_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_LookupNames_ndr_print(py_obj, "samr_LookupNames_in", NDR_IN); } static PyObject *py_samr_LookupNames_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_LookupNames_ndr_print(py_obj, "samr_LookupNames_out", NDR_OUT); } static PyMethodDef py_samr_LookupNames_methods[] = { { "opnum", (PyCFunction)py_samr_LookupNames_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.LookupNames.opnum() -> 17 (0x11) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupNames_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_samr_LookupNames_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_samr_LookupNames_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_samr_LookupNames_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_samr_LookupNames_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_LookupNames_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_LookupNames_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.LookupNames", .tp_getset = py_samr_LookupNames_getsetters, .tp_methods = py_samr_LookupNames_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_LookupNames_new, }; static bool pack_py_samr_LookupNames_args_in(PyObject *args, PyObject *kwargs, struct samr_LookupNames *r) { PyObject *py_domain_handle; PyObject *py_names; const char *kwnames[] = { "domain_handle", "names", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_LookupNames", discard_const_p(char *, kwnames), &py_domain_handle, &py_names)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); PY_CHECK_TYPE(&PyList_Type, py_names, return false;); r->in.num_names = PyList_GET_SIZE(py_names); if (py_names == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names"); return false; } PY_CHECK_TYPE(&PyList_Type, py_names, return false;); { int names_cntr_0; r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names)); if (!r->in.names) { return false;; } talloc_set_name_const(r->in.names, "ARRAY: r->in.names"); for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) { if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names[names_cntr_0]"); return false; } PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;); if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) { PyErr_NoMemory(); return false; } r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0)); } } return true; } static PyObject *unpack_py_samr_LookupNames_args_out(struct samr_LookupNames *r) { PyObject *result; PyObject *py_rids; PyObject *py_types; result = PyTuple_New(2); py_rids = pytalloc_reference_ex(&samr_Ids_Type, r->out.rids, r->out.rids); PyTuple_SetItem(result, 0, py_rids); py_types = pytalloc_reference_ex(&samr_Ids_Type, r->out.types, r->out.types); PyTuple_SetItem(result, 1, py_types); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_LookupRids_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_LookupRids_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_LookupRids_in_get_num_rids(PyObject *obj, void *closure) { struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(obj); PyObject *py_num_rids; py_num_rids = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_rids); return py_num_rids; } static int py_samr_LookupRids_in_set_num_rids(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_rids"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_rids)); 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.num_rids = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_LookupRids_in_get_rids(PyObject *obj, void *closure) { struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(obj); PyObject *py_rids; py_rids = PyList_New(object->in.num_rids); if (py_rids == NULL) { return NULL; } { int rids_cntr_0; for (rids_cntr_0 = 0; rids_cntr_0 < (object->in.num_rids); rids_cntr_0++) { PyObject *py_rids_0; py_rids_0 = PyLong_FromUnsignedLongLong((uint32_t)object->in.rids[rids_cntr_0]); PyList_SetItem(py_rids, rids_cntr_0, py_rids_0); } } return py_rids; } static int py_samr_LookupRids_in_set_rids(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rids"); return -1; } PY_CHECK_TYPE(&PyList_Type, value, return -1;); { int rids_cntr_0; object->in.rids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.rids, PyList_GET_SIZE(value)); if (!object->in.rids) { return -1;; } talloc_set_name_const(object->in.rids, "ARRAY: object->in.rids"); for (rids_cntr_0 = 0; rids_cntr_0 < PyList_GET_SIZE(value); rids_cntr_0++) { if (PyList_GET_ITEM(value, rids_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rids[rids_cntr_0]"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rids[rids_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(value, rids_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, rids_cntr_0)); 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.rids[rids_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } } } return 0; } static PyObject *py_samr_LookupRids_out_get_names(PyObject *obj, void *closure) { struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(obj); PyObject *py_names; if (object->out.names == NULL) { Py_RETURN_NONE; } py_names = pytalloc_reference_ex(lsa_Strings_Type, object->out.names, object->out.names); return py_names; } static int py_samr_LookupRids_out_set_names(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.names"); return -1; } object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names); if (object->out.names == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_Strings_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.names = (struct lsa_Strings *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_LookupRids_out_get_types(PyObject *obj, void *closure) { struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(obj); PyObject *py_types; if (object->out.types == NULL) { Py_RETURN_NONE; } py_types = pytalloc_reference_ex(&samr_Ids_Type, object->out.types, object->out.types); return py_types; } static int py_samr_LookupRids_out_set_types(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.types)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.types"); return -1; } object->out.types = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.types); if (object->out.types == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&samr_Ids_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.types = (struct samr_Ids *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_LookupRids_get_result(PyObject *obj, void *closure) { struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_LookupRids_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_LookupRids_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_LookupRids_in_get_domain_handle, .set = py_samr_LookupRids_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_num_rids"), .get = py_samr_LookupRids_in_get_num_rids, .set = py_samr_LookupRids_in_set_num_rids, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_rids"), .get = py_samr_LookupRids_in_get_rids, .set = py_samr_LookupRids_in_set_rids, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_names"), .get = py_samr_LookupRids_out_get_names, .set = py_samr_LookupRids_out_set_names, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_Strings") }, { .name = discard_const_p(char, "out_types"), .get = py_samr_LookupRids_out_get_types, .set = py_samr_LookupRids_out_set_types, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Ids") }, { .name = discard_const_p(char, "result"), .get = py_samr_LookupRids_get_result, .set = py_samr_LookupRids_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_LookupRids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_LookupRids, type); struct samr_LookupRids *_self = (struct samr_LookupRids *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.names = talloc_zero(mem_ctx, struct lsa_Strings); _self->out.types = talloc_zero(mem_ctx, struct samr_Ids); return self; } static PyObject *py_samr_LookupRids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(18); } static PyObject *py_samr_LookupRids_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 19) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupRids_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[18]; 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_samr_LookupRids_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_samr_LookupRids_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_LookupRids_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_samr_LookupRids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_LookupRids_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 samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 19) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupRids_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[18]; 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_samr_LookupRids_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_samr_LookupRids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_LookupRids_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_samr_LookupRids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_LookupRids_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 19) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupRids_ndr_print"); return NULL; } call = &ndr_table_samr.calls[18]; 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_samr_LookupRids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_LookupRids_ndr_print(py_obj, "samr_LookupRids_in", NDR_IN); } static PyObject *py_samr_LookupRids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_LookupRids_ndr_print(py_obj, "samr_LookupRids_out", NDR_OUT); } static PyMethodDef py_samr_LookupRids_methods[] = { { "opnum", (PyCFunction)py_samr_LookupRids_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.LookupRids.opnum() -> 18 (0x12) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupRids_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_samr_LookupRids_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_samr_LookupRids_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_samr_LookupRids_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_samr_LookupRids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_LookupRids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_LookupRids_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.LookupRids", .tp_getset = py_samr_LookupRids_getsetters, .tp_methods = py_samr_LookupRids_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_LookupRids_new, }; static bool pack_py_samr_LookupRids_args_in(PyObject *args, PyObject *kwargs, struct samr_LookupRids *r) { PyObject *py_domain_handle; PyObject *py_rids; const char *kwnames[] = { "domain_handle", "rids", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_LookupRids", discard_const_p(char *, kwnames), &py_domain_handle, &py_rids)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); PY_CHECK_TYPE(&PyList_Type, py_rids, return false;); r->in.num_rids = PyList_GET_SIZE(py_rids); if (py_rids == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rids"); return false; } PY_CHECK_TYPE(&PyList_Type, py_rids, return false;); { int rids_cntr_0; r->in.rids = talloc_array_ptrtype(r, r->in.rids, PyList_GET_SIZE(py_rids)); if (!r->in.rids) { return false;; } talloc_set_name_const(r->in.rids, "ARRAY: r->in.rids"); for (rids_cntr_0 = 0; rids_cntr_0 < PyList_GET_SIZE(py_rids); rids_cntr_0++) { if (PyList_GET_ITEM(py_rids, rids_cntr_0) == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rids[rids_cntr_0]"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rids[rids_cntr_0])); if (PyLong_Check(PyList_GET_ITEM(py_rids, rids_cntr_0))) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_rids, rids_cntr_0)); 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.rids[rids_cntr_0] = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } } } return true; } static PyObject *unpack_py_samr_LookupRids_args_out(struct samr_LookupRids *r) { PyObject *result; PyObject *py_names; PyObject *py_types; result = PyTuple_New(2); py_names = pytalloc_reference_ex(lsa_Strings_Type, r->out.names, r->out.names); PyTuple_SetItem(result, 0, py_names); py_types = pytalloc_reference_ex(&samr_Ids_Type, r->out.types, r->out.types); PyTuple_SetItem(result, 1, py_types); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_OpenGroup_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_OpenGroup_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_OpenGroup_in_get_access_mask(PyObject *obj, void *closure) { struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(obj); PyObject *py_access_mask; py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask); return py_access_mask; } static int py_samr_OpenGroup_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask)); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_OpenGroup_in_get_rid(PyObject *obj, void *closure) { struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->in.rid); return py_rid; } static int py_samr_OpenGroup_in_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rid)); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_OpenGroup_out_get_group_handle(PyObject *obj, void *closure) { struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(obj); PyObject *py_group_handle; if (object->out.group_handle == NULL) { Py_RETURN_NONE; } py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->out.group_handle, object->out.group_handle); return py_group_handle; } static int py_samr_OpenGroup_out_set_group_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.group_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.group_handle"); return -1; } object->out.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.group_handle); if (object->out.group_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.group_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_OpenGroup_get_result(PyObject *obj, void *closure) { struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_OpenGroup_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_OpenGroup_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_OpenGroup_in_get_domain_handle, .set = py_samr_OpenGroup_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_access_mask"), .get = py_samr_OpenGroup_in_get_access_mask, .set = py_samr_OpenGroup_in_set_access_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_GroupAccessMask") }, { .name = discard_const_p(char, "in_rid"), .get = py_samr_OpenGroup_in_get_rid, .set = py_samr_OpenGroup_in_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_group_handle"), .get = py_samr_OpenGroup_out_get_group_handle, .set = py_samr_OpenGroup_out_set_group_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_OpenGroup_get_result, .set = py_samr_OpenGroup_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_OpenGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_OpenGroup, type); struct samr_OpenGroup *_self = (struct samr_OpenGroup *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.group_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_OpenGroup_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(19); } static PyObject *py_samr_OpenGroup_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 20) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenGroup_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[19]; 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_samr_OpenGroup_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_samr_OpenGroup_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_OpenGroup_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_samr_OpenGroup_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_OpenGroup_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 samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 20) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenGroup_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[19]; 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_samr_OpenGroup_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_samr_OpenGroup_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_OpenGroup_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_samr_OpenGroup_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_OpenGroup_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 20) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenGroup_ndr_print"); return NULL; } call = &ndr_table_samr.calls[19]; 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_samr_OpenGroup_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_OpenGroup_ndr_print(py_obj, "samr_OpenGroup_in", NDR_IN); } static PyObject *py_samr_OpenGroup_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_OpenGroup_ndr_print(py_obj, "samr_OpenGroup_out", NDR_OUT); } static PyMethodDef py_samr_OpenGroup_methods[] = { { "opnum", (PyCFunction)py_samr_OpenGroup_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.OpenGroup.opnum() -> 19 (0x13) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenGroup_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_samr_OpenGroup_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_samr_OpenGroup_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_samr_OpenGroup_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_samr_OpenGroup_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_OpenGroup_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_OpenGroup_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.OpenGroup", .tp_getset = py_samr_OpenGroup_getsetters, .tp_methods = py_samr_OpenGroup_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_OpenGroup_new, }; static bool pack_py_samr_OpenGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenGroup *r) { PyObject *py_domain_handle; PyObject *py_access_mask; PyObject *py_rid; const char *kwnames[] = { "domain_handle", "access_mask", "rid", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenGroup", discard_const_p(char *, kwnames), &py_domain_handle, &py_access_mask, &py_rid)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); if (py_access_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask)); if (PyLong_Check(py_access_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_access_mask); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_rid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rid"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rid)); if (PyLong_Check(py_rid)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_rid); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_OpenGroup_args_out(struct samr_OpenGroup *r) { PyObject *result; PyObject *py_group_handle; py_group_handle = pytalloc_reference_ex(policy_handle_Type, r->out.group_handle, r->out.group_handle); result = py_group_handle; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_QueryGroupInfo_in_get_group_handle(PyObject *obj, void *closure) { struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(obj); PyObject *py_group_handle; if (object->in.group_handle == NULL) { Py_RETURN_NONE; } py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle); return py_group_handle; } static int py_samr_QueryGroupInfo_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle"); return -1; } object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle); if (object->in.group_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.group_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_QueryGroupInfo_in_get_level(PyObject *obj, void *closure) { struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_QueryGroupInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)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_samr_QueryGroupInfo_out_get_info(PyObject *obj, void *closure) { struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } if (*object->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pyrpc_import_union(&samr_GroupInfo_Type, *object->out.info, object->in.level, *object->out.info, "union samr_GroupInfo"); if (py_info == NULL) { return NULL; } } return py_info; } static int py_samr_QueryGroupInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info"); return -1; } object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info); if (object->out.info == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.info = NULL; } else { *object->out.info = NULL; { union samr_GroupInfo *info_switch_2; info_switch_2 = (union samr_GroupInfo *)pyrpc_export_union(&samr_GroupInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_GroupInfo"); if (info_switch_2 == NULL) { return -1; } *object->out.info = info_switch_2; } } return 0; } static PyObject *py_samr_QueryGroupInfo_get_result(PyObject *obj, void *closure) { struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_QueryGroupInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_QueryGroupInfo_getsetters[] = { { .name = discard_const_p(char, "in_group_handle"), .get = py_samr_QueryGroupInfo_in_get_group_handle, .set = py_samr_QueryGroupInfo_in_set_group_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_QueryGroupInfo_in_get_level, .set = py_samr_QueryGroupInfo_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type samr_GroupInfoEnum") }, { .name = discard_const_p(char, "out_info"), .get = py_samr_QueryGroupInfo_out_get_info, .set = py_samr_QueryGroupInfo_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_GroupInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_QueryGroupInfo_get_result, .set = py_samr_QueryGroupInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_QueryGroupInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_QueryGroupInfo, type); struct samr_QueryGroupInfo *_self = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle); /* a pointer to a NULL pointer */ _self->out.info = talloc_zero(mem_ctx, union samr_GroupInfo *); return self; } static PyObject *py_samr_QueryGroupInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(20); } static PyObject *py_samr_QueryGroupInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 21) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryGroupInfo_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[20]; 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_samr_QueryGroupInfo_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_samr_QueryGroupInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_QueryGroupInfo_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_samr_QueryGroupInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_QueryGroupInfo_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 samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 21) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryGroupInfo_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[20]; 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_samr_QueryGroupInfo_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_samr_QueryGroupInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryGroupInfo_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_samr_QueryGroupInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryGroupInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 21) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryGroupInfo_ndr_print"); return NULL; } call = &ndr_table_samr.calls[20]; 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_samr_QueryGroupInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryGroupInfo_ndr_print(py_obj, "samr_QueryGroupInfo_in", NDR_IN); } static PyObject *py_samr_QueryGroupInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryGroupInfo_ndr_print(py_obj, "samr_QueryGroupInfo_out", NDR_OUT); } static PyMethodDef py_samr_QueryGroupInfo_methods[] = { { "opnum", (PyCFunction)py_samr_QueryGroupInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.QueryGroupInfo.opnum() -> 20 (0x14) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryGroupInfo_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_samr_QueryGroupInfo_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_samr_QueryGroupInfo_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_samr_QueryGroupInfo_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_samr_QueryGroupInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_QueryGroupInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_QueryGroupInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.QueryGroupInfo", .tp_getset = py_samr_QueryGroupInfo_getsetters, .tp_methods = py_samr_QueryGroupInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_QueryGroupInfo_new, }; static bool pack_py_samr_QueryGroupInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryGroupInfo *r) { PyObject *py_group_handle; PyObject *py_level; const char *kwnames[] = { "group_handle", "level", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryGroupInfo", discard_const_p(char *, kwnames), &py_group_handle, &py_level)) { return false; } if (py_group_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle"); return false; } r->in.group_handle = talloc_ptrtype(r, r->in.group_handle); if (r->in.group_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle); 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_samr_QueryGroupInfo_args_out(struct samr_QueryGroupInfo *r) { PyObject *result; PyObject *py_info; if (*r->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pyrpc_import_union(&samr_GroupInfo_Type, *r->out.info, r->in.level, *r->out.info, "union samr_GroupInfo"); if (py_info == NULL) { return NULL; } } result = py_info; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_SetGroupInfo_in_get_group_handle(PyObject *obj, void *closure) { struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(obj); PyObject *py_group_handle; if (object->in.group_handle == NULL) { Py_RETURN_NONE; } py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle); return py_group_handle; } static int py_samr_SetGroupInfo_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle"); return -1; } object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle); if (object->in.group_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.group_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_SetGroupInfo_in_get_level(PyObject *obj, void *closure) { struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_SetGroupInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)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_samr_SetGroupInfo_in_get_info(PyObject *obj, void *closure) { struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->in.info == NULL) { Py_RETURN_NONE; } py_info = pyrpc_import_union(&samr_GroupInfo_Type, object->in.info, object->in.level, object->in.info, "union samr_GroupInfo"); if (py_info == NULL) { return NULL; } return py_info; } static int py_samr_SetGroupInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info"); return -1; } object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info); if (object->in.info == NULL) { PyErr_NoMemory(); return -1; } { union samr_GroupInfo *info_switch_1; info_switch_1 = (union samr_GroupInfo *)pyrpc_export_union(&samr_GroupInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_GroupInfo"); if (info_switch_1 == NULL) { return -1; } object->in.info = info_switch_1; } return 0; } static PyObject *py_samr_SetGroupInfo_get_result(PyObject *obj, void *closure) { struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_SetGroupInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_SetGroupInfo_getsetters[] = { { .name = discard_const_p(char, "in_group_handle"), .get = py_samr_SetGroupInfo_in_get_group_handle, .set = py_samr_SetGroupInfo_in_set_group_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_SetGroupInfo_in_get_level, .set = py_samr_SetGroupInfo_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type samr_GroupInfoEnum") }, { .name = discard_const_p(char, "in_info"), .get = py_samr_SetGroupInfo_in_get_info, .set = py_samr_SetGroupInfo_in_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_GroupInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_SetGroupInfo_get_result, .set = py_samr_SetGroupInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_SetGroupInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_SetGroupInfo, type); struct samr_SetGroupInfo *_self = (struct samr_SetGroupInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.info = talloc_zero(mem_ctx, union samr_GroupInfo); return self; } static PyObject *py_samr_SetGroupInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(21); } static PyObject *py_samr_SetGroupInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 22) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetGroupInfo_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[21]; 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_samr_SetGroupInfo_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_samr_SetGroupInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_SetGroupInfo_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_samr_SetGroupInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_SetGroupInfo_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 samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 22) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetGroupInfo_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[21]; 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_samr_SetGroupInfo_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_samr_SetGroupInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetGroupInfo_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_samr_SetGroupInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetGroupInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 22) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetGroupInfo_ndr_print"); return NULL; } call = &ndr_table_samr.calls[21]; 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_samr_SetGroupInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetGroupInfo_ndr_print(py_obj, "samr_SetGroupInfo_in", NDR_IN); } static PyObject *py_samr_SetGroupInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetGroupInfo_ndr_print(py_obj, "samr_SetGroupInfo_out", NDR_OUT); } static PyMethodDef py_samr_SetGroupInfo_methods[] = { { "opnum", (PyCFunction)py_samr_SetGroupInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.SetGroupInfo.opnum() -> 21 (0x15) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetGroupInfo_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_samr_SetGroupInfo_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_samr_SetGroupInfo_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_samr_SetGroupInfo_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_samr_SetGroupInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_SetGroupInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_SetGroupInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.SetGroupInfo", .tp_getset = py_samr_SetGroupInfo_getsetters, .tp_methods = py_samr_SetGroupInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_SetGroupInfo_new, }; static bool pack_py_samr_SetGroupInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetGroupInfo *r) { PyObject *py_group_handle; PyObject *py_level; PyObject *py_info; const char *kwnames[] = { "group_handle", "level", "info", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetGroupInfo", discard_const_p(char *, kwnames), &py_group_handle, &py_level, &py_info)) { return false; } if (py_group_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle"); return false; } r->in.group_handle = talloc_ptrtype(r, r->in.group_handle); if (r->in.group_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle); 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; } } if (py_info == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info"); return false; } r->in.info = talloc_ptrtype(r, r->in.info); if (r->in.info == NULL) { PyErr_NoMemory(); return false; } { union samr_GroupInfo *info_switch_1; info_switch_1 = (union samr_GroupInfo *)pyrpc_export_union(&samr_GroupInfo_Type, r, r->in.level, py_info, "union samr_GroupInfo"); if (info_switch_1 == NULL) { return false; } r->in.info = info_switch_1; } return true; } static PyObject *unpack_py_samr_SetGroupInfo_args_out(struct samr_SetGroupInfo *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_AddGroupMember_in_get_group_handle(PyObject *obj, void *closure) { struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(obj); PyObject *py_group_handle; if (object->in.group_handle == NULL) { Py_RETURN_NONE; } py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle); return py_group_handle; } static int py_samr_AddGroupMember_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle"); return -1; } object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle); if (object->in.group_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.group_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_AddGroupMember_in_get_rid(PyObject *obj, void *closure) { struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->in.rid); return py_rid; } static int py_samr_AddGroupMember_in_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rid)); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_AddGroupMember_in_get_flags(PyObject *obj, void *closure) { struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(obj); PyObject *py_flags; py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags); return py_flags; } static int py_samr_AddGroupMember_in_set_flags(PyObject *py_obj, PyObject *value, void *closure) { struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags)); 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.flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_AddGroupMember_get_result(PyObject *obj, void *closure) { struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_AddGroupMember_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_AddGroupMember_getsetters[] = { { .name = discard_const_p(char, "in_group_handle"), .get = py_samr_AddGroupMember_in_get_group_handle, .set = py_samr_AddGroupMember_in_set_group_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_rid"), .get = py_samr_AddGroupMember_in_get_rid, .set = py_samr_AddGroupMember_in_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_flags"), .get = py_samr_AddGroupMember_in_get_flags, .set = py_samr_AddGroupMember_in_set_flags, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_AddGroupMember_get_result, .set = py_samr_AddGroupMember_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_AddGroupMember_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_AddGroupMember, type); struct samr_AddGroupMember *_self = (struct samr_AddGroupMember *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_AddGroupMember_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(22); } static PyObject *py_samr_AddGroupMember_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 23) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddGroupMember_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[22]; 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_samr_AddGroupMember_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_samr_AddGroupMember_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_AddGroupMember_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_samr_AddGroupMember_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_AddGroupMember_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 samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 23) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddGroupMember_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[22]; 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_samr_AddGroupMember_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_samr_AddGroupMember_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_AddGroupMember_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_samr_AddGroupMember_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_AddGroupMember_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 23) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddGroupMember_ndr_print"); return NULL; } call = &ndr_table_samr.calls[22]; 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_samr_AddGroupMember_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_AddGroupMember_ndr_print(py_obj, "samr_AddGroupMember_in", NDR_IN); } static PyObject *py_samr_AddGroupMember_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_AddGroupMember_ndr_print(py_obj, "samr_AddGroupMember_out", NDR_OUT); } static PyMethodDef py_samr_AddGroupMember_methods[] = { { "opnum", (PyCFunction)py_samr_AddGroupMember_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.AddGroupMember.opnum() -> 22 (0x16) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddGroupMember_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_samr_AddGroupMember_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_samr_AddGroupMember_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_samr_AddGroupMember_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_samr_AddGroupMember_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_AddGroupMember_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_AddGroupMember_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.AddGroupMember", .tp_getset = py_samr_AddGroupMember_getsetters, .tp_methods = py_samr_AddGroupMember_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_AddGroupMember_new, }; static bool pack_py_samr_AddGroupMember_args_in(PyObject *args, PyObject *kwargs, struct samr_AddGroupMember *r) { PyObject *py_group_handle; PyObject *py_rid; PyObject *py_flags; const char *kwnames[] = { "group_handle", "rid", "flags", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_AddGroupMember", discard_const_p(char *, kwnames), &py_group_handle, &py_rid, &py_flags)) { return false; } if (py_group_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle"); return false; } r->in.group_handle = talloc_ptrtype(r, r->in.group_handle); if (r->in.group_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle); if (py_rid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rid"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rid)); if (PyLong_Check(py_rid)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_rid); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_flags == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags)); if (PyLong_Check(py_flags)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_flags); 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.flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_AddGroupMember_args_out(struct samr_AddGroupMember *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_DeleteDomainGroup_in_get_group_handle(PyObject *obj, void *closure) { struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(obj); PyObject *py_group_handle; if (object->in.group_handle == NULL) { Py_RETURN_NONE; } py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle); return py_group_handle; } static int py_samr_DeleteDomainGroup_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle"); return -1; } object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle); if (object->in.group_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.group_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DeleteDomainGroup_out_get_group_handle(PyObject *obj, void *closure) { struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(obj); PyObject *py_group_handle; if (object->out.group_handle == NULL) { Py_RETURN_NONE; } py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->out.group_handle, object->out.group_handle); return py_group_handle; } static int py_samr_DeleteDomainGroup_out_set_group_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.group_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.group_handle"); return -1; } object->out.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.group_handle); if (object->out.group_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.group_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DeleteDomainGroup_get_result(PyObject *obj, void *closure) { struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_DeleteDomainGroup_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_DeleteDomainGroup_getsetters[] = { { .name = discard_const_p(char, "in_group_handle"), .get = py_samr_DeleteDomainGroup_in_get_group_handle, .set = py_samr_DeleteDomainGroup_in_set_group_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "out_group_handle"), .get = py_samr_DeleteDomainGroup_out_get_group_handle, .set = py_samr_DeleteDomainGroup_out_set_group_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_DeleteDomainGroup_get_result, .set = py_samr_DeleteDomainGroup_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_DeleteDomainGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_DeleteDomainGroup, type); struct samr_DeleteDomainGroup *_self = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.group_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_DeleteDomainGroup_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(23); } static PyObject *py_samr_DeleteDomainGroup_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 24) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteDomainGroup_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[23]; 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_samr_DeleteDomainGroup_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_samr_DeleteDomainGroup_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_DeleteDomainGroup_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_samr_DeleteDomainGroup_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_DeleteDomainGroup_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 samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 24) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteDomainGroup_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[23]; 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_samr_DeleteDomainGroup_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_samr_DeleteDomainGroup_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_DeleteDomainGroup_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_samr_DeleteDomainGroup_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_DeleteDomainGroup_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 24) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteDomainGroup_ndr_print"); return NULL; } call = &ndr_table_samr.calls[23]; 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_samr_DeleteDomainGroup_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_DeleteDomainGroup_ndr_print(py_obj, "samr_DeleteDomainGroup_in", NDR_IN); } static PyObject *py_samr_DeleteDomainGroup_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_DeleteDomainGroup_ndr_print(py_obj, "samr_DeleteDomainGroup_out", NDR_OUT); } static PyMethodDef py_samr_DeleteDomainGroup_methods[] = { { "opnum", (PyCFunction)py_samr_DeleteDomainGroup_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.DeleteDomainGroup.opnum() -> 23 (0x17) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteDomainGroup_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_samr_DeleteDomainGroup_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_samr_DeleteDomainGroup_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_samr_DeleteDomainGroup_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_samr_DeleteDomainGroup_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_DeleteDomainGroup_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_DeleteDomainGroup_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DeleteDomainGroup", .tp_getset = py_samr_DeleteDomainGroup_getsetters, .tp_methods = py_samr_DeleteDomainGroup_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DeleteDomainGroup_new, }; static bool pack_py_samr_DeleteDomainGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteDomainGroup *r) { PyObject *py_group_handle; const char *kwnames[] = { "group_handle", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_DeleteDomainGroup", discard_const_p(char *, kwnames), &py_group_handle)) { return false; } if (py_group_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle"); return false; } r->in.group_handle = talloc_ptrtype(r, r->in.group_handle); if (r->in.group_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle); return true; } static PyObject *unpack_py_samr_DeleteDomainGroup_args_out(struct samr_DeleteDomainGroup *r) { PyObject *result; PyObject *py_group_handle; py_group_handle = pytalloc_reference_ex(policy_handle_Type, r->out.group_handle, r->out.group_handle); result = py_group_handle; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_DeleteGroupMember_in_get_group_handle(PyObject *obj, void *closure) { struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(obj); PyObject *py_group_handle; if (object->in.group_handle == NULL) { Py_RETURN_NONE; } py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle); return py_group_handle; } static int py_samr_DeleteGroupMember_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle"); return -1; } object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle); if (object->in.group_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.group_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DeleteGroupMember_in_get_rid(PyObject *obj, void *closure) { struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->in.rid); return py_rid; } static int py_samr_DeleteGroupMember_in_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rid)); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_DeleteGroupMember_get_result(PyObject *obj, void *closure) { struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_DeleteGroupMember_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_DeleteGroupMember_getsetters[] = { { .name = discard_const_p(char, "in_group_handle"), .get = py_samr_DeleteGroupMember_in_get_group_handle, .set = py_samr_DeleteGroupMember_in_set_group_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_rid"), .get = py_samr_DeleteGroupMember_in_get_rid, .set = py_samr_DeleteGroupMember_in_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_DeleteGroupMember_get_result, .set = py_samr_DeleteGroupMember_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_DeleteGroupMember_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_DeleteGroupMember, type); struct samr_DeleteGroupMember *_self = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_DeleteGroupMember_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(24); } static PyObject *py_samr_DeleteGroupMember_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 25) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteGroupMember_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[24]; 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_samr_DeleteGroupMember_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_samr_DeleteGroupMember_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_DeleteGroupMember_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_samr_DeleteGroupMember_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_DeleteGroupMember_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 samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 25) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteGroupMember_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[24]; 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_samr_DeleteGroupMember_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_samr_DeleteGroupMember_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_DeleteGroupMember_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_samr_DeleteGroupMember_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_DeleteGroupMember_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 25) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteGroupMember_ndr_print"); return NULL; } call = &ndr_table_samr.calls[24]; 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_samr_DeleteGroupMember_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_DeleteGroupMember_ndr_print(py_obj, "samr_DeleteGroupMember_in", NDR_IN); } static PyObject *py_samr_DeleteGroupMember_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_DeleteGroupMember_ndr_print(py_obj, "samr_DeleteGroupMember_out", NDR_OUT); } static PyMethodDef py_samr_DeleteGroupMember_methods[] = { { "opnum", (PyCFunction)py_samr_DeleteGroupMember_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.DeleteGroupMember.opnum() -> 24 (0x18) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteGroupMember_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_samr_DeleteGroupMember_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_samr_DeleteGroupMember_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_samr_DeleteGroupMember_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_samr_DeleteGroupMember_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_DeleteGroupMember_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_DeleteGroupMember_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DeleteGroupMember", .tp_getset = py_samr_DeleteGroupMember_getsetters, .tp_methods = py_samr_DeleteGroupMember_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DeleteGroupMember_new, }; static bool pack_py_samr_DeleteGroupMember_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteGroupMember *r) { PyObject *py_group_handle; PyObject *py_rid; const char *kwnames[] = { "group_handle", "rid", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_DeleteGroupMember", discard_const_p(char *, kwnames), &py_group_handle, &py_rid)) { return false; } if (py_group_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle"); return false; } r->in.group_handle = talloc_ptrtype(r, r->in.group_handle); if (r->in.group_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle); if (py_rid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rid"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rid)); if (PyLong_Check(py_rid)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_rid); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_DeleteGroupMember_args_out(struct samr_DeleteGroupMember *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_QueryGroupMember_in_get_group_handle(PyObject *obj, void *closure) { struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(obj); PyObject *py_group_handle; if (object->in.group_handle == NULL) { Py_RETURN_NONE; } py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle); return py_group_handle; } static int py_samr_QueryGroupMember_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle"); return -1; } object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle); if (object->in.group_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.group_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_QueryGroupMember_out_get_rids(PyObject *obj, void *closure) { struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(obj); PyObject *py_rids; if (object->out.rids == NULL) { Py_RETURN_NONE; } if (*object->out.rids == NULL) { py_rids = Py_None; Py_INCREF(py_rids); } else { py_rids = pytalloc_reference_ex(&samr_RidAttrArray_Type, *object->out.rids, *object->out.rids); } return py_rids; } static int py_samr_QueryGroupMember_out_set_rids(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids"); return -1; } object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids); if (object->out.rids == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.rids = NULL; } else { *object->out.rids = NULL; PY_CHECK_TYPE(&samr_RidAttrArray_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.rids = (struct samr_RidAttrArray *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_QueryGroupMember_get_result(PyObject *obj, void *closure) { struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_QueryGroupMember_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_QueryGroupMember_getsetters[] = { { .name = discard_const_p(char, "in_group_handle"), .get = py_samr_QueryGroupMember_in_get_group_handle, .set = py_samr_QueryGroupMember_in_set_group_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "out_rids"), .get = py_samr_QueryGroupMember_out_get_rids, .set = py_samr_QueryGroupMember_out_set_rids, .doc = discard_const_p(char, "PIDL-generated element of base type samr_RidAttrArray") }, { .name = discard_const_p(char, "result"), .get = py_samr_QueryGroupMember_get_result, .set = py_samr_QueryGroupMember_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_QueryGroupMember_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_QueryGroupMember, type); struct samr_QueryGroupMember *_self = (struct samr_QueryGroupMember *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle); /* a pointer to a NULL pointer */ _self->out.rids = talloc_zero(mem_ctx, struct samr_RidAttrArray *); return self; } static PyObject *py_samr_QueryGroupMember_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(25); } static PyObject *py_samr_QueryGroupMember_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 26) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryGroupMember_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[25]; 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_samr_QueryGroupMember_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_samr_QueryGroupMember_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_QueryGroupMember_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_samr_QueryGroupMember_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_QueryGroupMember_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 samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 26) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryGroupMember_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[25]; 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_samr_QueryGroupMember_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_samr_QueryGroupMember_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryGroupMember_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_samr_QueryGroupMember_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryGroupMember_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 26) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryGroupMember_ndr_print"); return NULL; } call = &ndr_table_samr.calls[25]; 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_samr_QueryGroupMember_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryGroupMember_ndr_print(py_obj, "samr_QueryGroupMember_in", NDR_IN); } static PyObject *py_samr_QueryGroupMember_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryGroupMember_ndr_print(py_obj, "samr_QueryGroupMember_out", NDR_OUT); } static PyMethodDef py_samr_QueryGroupMember_methods[] = { { "opnum", (PyCFunction)py_samr_QueryGroupMember_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.QueryGroupMember.opnum() -> 25 (0x19) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryGroupMember_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_samr_QueryGroupMember_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_samr_QueryGroupMember_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_samr_QueryGroupMember_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_samr_QueryGroupMember_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_QueryGroupMember_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_QueryGroupMember_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.QueryGroupMember", .tp_getset = py_samr_QueryGroupMember_getsetters, .tp_methods = py_samr_QueryGroupMember_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_QueryGroupMember_new, }; static bool pack_py_samr_QueryGroupMember_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryGroupMember *r) { PyObject *py_group_handle; const char *kwnames[] = { "group_handle", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_QueryGroupMember", discard_const_p(char *, kwnames), &py_group_handle)) { return false; } if (py_group_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle"); return false; } r->in.group_handle = talloc_ptrtype(r, r->in.group_handle); if (r->in.group_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle); return true; } static PyObject *unpack_py_samr_QueryGroupMember_args_out(struct samr_QueryGroupMember *r) { PyObject *result; PyObject *py_rids; if (*r->out.rids == NULL) { py_rids = Py_None; Py_INCREF(py_rids); } else { py_rids = pytalloc_reference_ex(&samr_RidAttrArray_Type, *r->out.rids, *r->out.rids); } result = py_rids; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_SetMemberAttributesOfGroup_in_get_group_handle(PyObject *obj, void *closure) { struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(obj); PyObject *py_group_handle; if (object->in.group_handle == NULL) { Py_RETURN_NONE; } py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle); return py_group_handle; } static int py_samr_SetMemberAttributesOfGroup_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle"); return -1; } object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle); if (object->in.group_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.group_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_SetMemberAttributesOfGroup_in_get_unknown1(PyObject *obj, void *closure) { struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(obj); PyObject *py_unknown1; py_unknown1 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown1); return py_unknown1; } static int py_samr_SetMemberAttributesOfGroup_in_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown1"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown1)); 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.unknown1 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_SetMemberAttributesOfGroup_in_get_unknown2(PyObject *obj, void *closure) { struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown2); return py_unknown2; } static int py_samr_SetMemberAttributesOfGroup_in_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown2"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown2)); 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.unknown2 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_SetMemberAttributesOfGroup_get_result(PyObject *obj, void *closure) { struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_SetMemberAttributesOfGroup_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_SetMemberAttributesOfGroup_getsetters[] = { { .name = discard_const_p(char, "in_group_handle"), .get = py_samr_SetMemberAttributesOfGroup_in_get_group_handle, .set = py_samr_SetMemberAttributesOfGroup_in_set_group_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_unknown1"), .get = py_samr_SetMemberAttributesOfGroup_in_get_unknown1, .set = py_samr_SetMemberAttributesOfGroup_in_set_unknown1, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_unknown2"), .get = py_samr_SetMemberAttributesOfGroup_in_get_unknown2, .set = py_samr_SetMemberAttributesOfGroup_in_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_SetMemberAttributesOfGroup_get_result, .set = py_samr_SetMemberAttributesOfGroup_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_SetMemberAttributesOfGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_SetMemberAttributesOfGroup, type); struct samr_SetMemberAttributesOfGroup *_self = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(26); } static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 27) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetMemberAttributesOfGroup_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[26]; 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_samr_SetMemberAttributesOfGroup_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_samr_SetMemberAttributesOfGroup_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_SetMemberAttributesOfGroup_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_samr_SetMemberAttributesOfGroup_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_SetMemberAttributesOfGroup_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 samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 27) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetMemberAttributesOfGroup_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[26]; 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_samr_SetMemberAttributesOfGroup_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_samr_SetMemberAttributesOfGroup_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetMemberAttributesOfGroup_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_samr_SetMemberAttributesOfGroup_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 27) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetMemberAttributesOfGroup_ndr_print"); return NULL; } call = &ndr_table_samr.calls[26]; 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_samr_SetMemberAttributesOfGroup_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetMemberAttributesOfGroup_ndr_print(py_obj, "samr_SetMemberAttributesOfGroup_in", NDR_IN); } static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetMemberAttributesOfGroup_ndr_print(py_obj, "samr_SetMemberAttributesOfGroup_out", NDR_OUT); } static PyMethodDef py_samr_SetMemberAttributesOfGroup_methods[] = { { "opnum", (PyCFunction)py_samr_SetMemberAttributesOfGroup_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.SetMemberAttributesOfGroup.opnum() -> 26 (0x1a) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetMemberAttributesOfGroup_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_samr_SetMemberAttributesOfGroup_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_samr_SetMemberAttributesOfGroup_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_samr_SetMemberAttributesOfGroup_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_samr_SetMemberAttributesOfGroup_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_SetMemberAttributesOfGroup_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_SetMemberAttributesOfGroup_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.SetMemberAttributesOfGroup", .tp_getset = py_samr_SetMemberAttributesOfGroup_getsetters, .tp_methods = py_samr_SetMemberAttributesOfGroup_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_SetMemberAttributesOfGroup_new, }; static bool pack_py_samr_SetMemberAttributesOfGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_SetMemberAttributesOfGroup *r) { PyObject *py_group_handle; PyObject *py_unknown1; PyObject *py_unknown2; const char *kwnames[] = { "group_handle", "unknown1", "unknown2", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetMemberAttributesOfGroup", discard_const_p(char *, kwnames), &py_group_handle, &py_unknown1, &py_unknown2)) { return false; } if (py_group_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle"); return false; } r->in.group_handle = talloc_ptrtype(r, r->in.group_handle); if (r->in.group_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle); if (py_unknown1 == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown1"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown1)); if (PyLong_Check(py_unknown1)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_unknown1); 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.unknown1 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_unknown2 == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown2"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown2)); if (PyLong_Check(py_unknown2)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_unknown2); 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.unknown2 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_SetMemberAttributesOfGroup_args_out(struct samr_SetMemberAttributesOfGroup *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_OpenAlias_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_OpenAlias_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_OpenAlias_in_get_access_mask(PyObject *obj, void *closure) { struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(obj); PyObject *py_access_mask; py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask); return py_access_mask; } static int py_samr_OpenAlias_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask)); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_OpenAlias_in_get_rid(PyObject *obj, void *closure) { struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->in.rid); return py_rid; } static int py_samr_OpenAlias_in_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rid)); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_OpenAlias_out_get_alias_handle(PyObject *obj, void *closure) { struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(obj); PyObject *py_alias_handle; if (object->out.alias_handle == NULL) { Py_RETURN_NONE; } py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->out.alias_handle, object->out.alias_handle); return py_alias_handle; } static int py_samr_OpenAlias_out_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.alias_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.alias_handle"); return -1; } object->out.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.alias_handle); if (object->out.alias_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_OpenAlias_get_result(PyObject *obj, void *closure) { struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_OpenAlias_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_OpenAlias_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_OpenAlias_in_get_domain_handle, .set = py_samr_OpenAlias_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_access_mask"), .get = py_samr_OpenAlias_in_get_access_mask, .set = py_samr_OpenAlias_in_set_access_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AliasAccessMask") }, { .name = discard_const_p(char, "in_rid"), .get = py_samr_OpenAlias_in_get_rid, .set = py_samr_OpenAlias_in_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_alias_handle"), .get = py_samr_OpenAlias_out_get_alias_handle, .set = py_samr_OpenAlias_out_set_alias_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_OpenAlias_get_result, .set = py_samr_OpenAlias_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_OpenAlias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_OpenAlias, type); struct samr_OpenAlias *_self = (struct samr_OpenAlias *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.alias_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_OpenAlias_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(27); } static PyObject *py_samr_OpenAlias_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 28) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenAlias_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[27]; 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_samr_OpenAlias_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_samr_OpenAlias_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_OpenAlias_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_samr_OpenAlias_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_OpenAlias_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 samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 28) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenAlias_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[27]; 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_samr_OpenAlias_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_samr_OpenAlias_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_OpenAlias_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_samr_OpenAlias_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_OpenAlias_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 28) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenAlias_ndr_print"); return NULL; } call = &ndr_table_samr.calls[27]; 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_samr_OpenAlias_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_OpenAlias_ndr_print(py_obj, "samr_OpenAlias_in", NDR_IN); } static PyObject *py_samr_OpenAlias_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_OpenAlias_ndr_print(py_obj, "samr_OpenAlias_out", NDR_OUT); } static PyMethodDef py_samr_OpenAlias_methods[] = { { "opnum", (PyCFunction)py_samr_OpenAlias_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.OpenAlias.opnum() -> 27 (0x1b) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenAlias_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_samr_OpenAlias_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_samr_OpenAlias_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_samr_OpenAlias_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_samr_OpenAlias_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_OpenAlias_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_OpenAlias_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.OpenAlias", .tp_getset = py_samr_OpenAlias_getsetters, .tp_methods = py_samr_OpenAlias_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_OpenAlias_new, }; static bool pack_py_samr_OpenAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenAlias *r) { PyObject *py_domain_handle; PyObject *py_access_mask; PyObject *py_rid; const char *kwnames[] = { "domain_handle", "access_mask", "rid", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenAlias", discard_const_p(char *, kwnames), &py_domain_handle, &py_access_mask, &py_rid)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); if (py_access_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask)); if (PyLong_Check(py_access_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_access_mask); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_rid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rid"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rid)); if (PyLong_Check(py_rid)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_rid); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_OpenAlias_args_out(struct samr_OpenAlias *r) { PyObject *result; PyObject *py_alias_handle; py_alias_handle = pytalloc_reference_ex(policy_handle_Type, r->out.alias_handle, r->out.alias_handle); result = py_alias_handle; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_QueryAliasInfo_in_get_alias_handle(PyObject *obj, void *closure) { struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(obj); PyObject *py_alias_handle; if (object->in.alias_handle == NULL) { Py_RETURN_NONE; } py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle); return py_alias_handle; } static int py_samr_QueryAliasInfo_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle"); return -1; } object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle); if (object->in.alias_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_QueryAliasInfo_in_get_level(PyObject *obj, void *closure) { struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_QueryAliasInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)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_samr_QueryAliasInfo_out_get_info(PyObject *obj, void *closure) { struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } if (*object->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pyrpc_import_union(&samr_AliasInfo_Type, *object->out.info, object->in.level, *object->out.info, "union samr_AliasInfo"); if (py_info == NULL) { return NULL; } } return py_info; } static int py_samr_QueryAliasInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info"); return -1; } object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info); if (object->out.info == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.info = NULL; } else { *object->out.info = NULL; { union samr_AliasInfo *info_switch_2; info_switch_2 = (union samr_AliasInfo *)pyrpc_export_union(&samr_AliasInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_AliasInfo"); if (info_switch_2 == NULL) { return -1; } *object->out.info = info_switch_2; } } return 0; } static PyObject *py_samr_QueryAliasInfo_get_result(PyObject *obj, void *closure) { struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_QueryAliasInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_QueryAliasInfo_getsetters[] = { { .name = discard_const_p(char, "in_alias_handle"), .get = py_samr_QueryAliasInfo_in_get_alias_handle, .set = py_samr_QueryAliasInfo_in_set_alias_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_QueryAliasInfo_in_get_level, .set = py_samr_QueryAliasInfo_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AliasInfoEnum") }, { .name = discard_const_p(char, "out_info"), .get = py_samr_QueryAliasInfo_out_get_info, .set = py_samr_QueryAliasInfo_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AliasInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_QueryAliasInfo_get_result, .set = py_samr_QueryAliasInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_QueryAliasInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_QueryAliasInfo, type); struct samr_QueryAliasInfo *_self = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle); /* a pointer to a NULL pointer */ _self->out.info = talloc_zero(mem_ctx, union samr_AliasInfo *); return self; } static PyObject *py_samr_QueryAliasInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(28); } static PyObject *py_samr_QueryAliasInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 29) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryAliasInfo_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[28]; 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_samr_QueryAliasInfo_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_samr_QueryAliasInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_QueryAliasInfo_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_samr_QueryAliasInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_QueryAliasInfo_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 samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 29) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryAliasInfo_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[28]; 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_samr_QueryAliasInfo_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_samr_QueryAliasInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryAliasInfo_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_samr_QueryAliasInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryAliasInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 29) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryAliasInfo_ndr_print"); return NULL; } call = &ndr_table_samr.calls[28]; 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_samr_QueryAliasInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryAliasInfo_ndr_print(py_obj, "samr_QueryAliasInfo_in", NDR_IN); } static PyObject *py_samr_QueryAliasInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryAliasInfo_ndr_print(py_obj, "samr_QueryAliasInfo_out", NDR_OUT); } static PyMethodDef py_samr_QueryAliasInfo_methods[] = { { "opnum", (PyCFunction)py_samr_QueryAliasInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.QueryAliasInfo.opnum() -> 28 (0x1c) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryAliasInfo_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_samr_QueryAliasInfo_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_samr_QueryAliasInfo_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_samr_QueryAliasInfo_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_samr_QueryAliasInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_QueryAliasInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_QueryAliasInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.QueryAliasInfo", .tp_getset = py_samr_QueryAliasInfo_getsetters, .tp_methods = py_samr_QueryAliasInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_QueryAliasInfo_new, }; static bool pack_py_samr_QueryAliasInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryAliasInfo *r) { PyObject *py_alias_handle; PyObject *py_level; const char *kwnames[] = { "alias_handle", "level", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryAliasInfo", discard_const_p(char *, kwnames), &py_alias_handle, &py_level)) { return false; } if (py_alias_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle"); return false; } r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle); if (r->in.alias_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle); 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_samr_QueryAliasInfo_args_out(struct samr_QueryAliasInfo *r) { PyObject *result; PyObject *py_info; if (*r->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pyrpc_import_union(&samr_AliasInfo_Type, *r->out.info, r->in.level, *r->out.info, "union samr_AliasInfo"); if (py_info == NULL) { return NULL; } } result = py_info; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_SetAliasInfo_in_get_alias_handle(PyObject *obj, void *closure) { struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(obj); PyObject *py_alias_handle; if (object->in.alias_handle == NULL) { Py_RETURN_NONE; } py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle); return py_alias_handle; } static int py_samr_SetAliasInfo_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle"); return -1; } object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle); if (object->in.alias_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_SetAliasInfo_in_get_level(PyObject *obj, void *closure) { struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_SetAliasInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)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_samr_SetAliasInfo_in_get_info(PyObject *obj, void *closure) { struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->in.info == NULL) { Py_RETURN_NONE; } py_info = pyrpc_import_union(&samr_AliasInfo_Type, object->in.info, object->in.level, object->in.info, "union samr_AliasInfo"); if (py_info == NULL) { return NULL; } return py_info; } static int py_samr_SetAliasInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info"); return -1; } object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info); if (object->in.info == NULL) { PyErr_NoMemory(); return -1; } { union samr_AliasInfo *info_switch_1; info_switch_1 = (union samr_AliasInfo *)pyrpc_export_union(&samr_AliasInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_AliasInfo"); if (info_switch_1 == NULL) { return -1; } object->in.info = info_switch_1; } return 0; } static PyObject *py_samr_SetAliasInfo_get_result(PyObject *obj, void *closure) { struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_SetAliasInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_SetAliasInfo_getsetters[] = { { .name = discard_const_p(char, "in_alias_handle"), .get = py_samr_SetAliasInfo_in_get_alias_handle, .set = py_samr_SetAliasInfo_in_set_alias_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_SetAliasInfo_in_get_level, .set = py_samr_SetAliasInfo_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AliasInfoEnum") }, { .name = discard_const_p(char, "in_info"), .get = py_samr_SetAliasInfo_in_get_info, .set = py_samr_SetAliasInfo_in_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AliasInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_SetAliasInfo_get_result, .set = py_samr_SetAliasInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_SetAliasInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_SetAliasInfo, type); struct samr_SetAliasInfo *_self = (struct samr_SetAliasInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.info = talloc_zero(mem_ctx, union samr_AliasInfo); return self; } static PyObject *py_samr_SetAliasInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(29); } static PyObject *py_samr_SetAliasInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 30) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetAliasInfo_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[29]; 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_samr_SetAliasInfo_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_samr_SetAliasInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_SetAliasInfo_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_samr_SetAliasInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_SetAliasInfo_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 samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 30) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetAliasInfo_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[29]; 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_samr_SetAliasInfo_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_samr_SetAliasInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetAliasInfo_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_samr_SetAliasInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetAliasInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 30) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetAliasInfo_ndr_print"); return NULL; } call = &ndr_table_samr.calls[29]; 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_samr_SetAliasInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetAliasInfo_ndr_print(py_obj, "samr_SetAliasInfo_in", NDR_IN); } static PyObject *py_samr_SetAliasInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetAliasInfo_ndr_print(py_obj, "samr_SetAliasInfo_out", NDR_OUT); } static PyMethodDef py_samr_SetAliasInfo_methods[] = { { "opnum", (PyCFunction)py_samr_SetAliasInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.SetAliasInfo.opnum() -> 29 (0x1d) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetAliasInfo_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_samr_SetAliasInfo_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_samr_SetAliasInfo_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_samr_SetAliasInfo_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_samr_SetAliasInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_SetAliasInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_SetAliasInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.SetAliasInfo", .tp_getset = py_samr_SetAliasInfo_getsetters, .tp_methods = py_samr_SetAliasInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_SetAliasInfo_new, }; static bool pack_py_samr_SetAliasInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetAliasInfo *r) { PyObject *py_alias_handle; PyObject *py_level; PyObject *py_info; const char *kwnames[] = { "alias_handle", "level", "info", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetAliasInfo", discard_const_p(char *, kwnames), &py_alias_handle, &py_level, &py_info)) { return false; } if (py_alias_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle"); return false; } r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle); if (r->in.alias_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle); 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; } } if (py_info == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info"); return false; } r->in.info = talloc_ptrtype(r, r->in.info); if (r->in.info == NULL) { PyErr_NoMemory(); return false; } { union samr_AliasInfo *info_switch_1; info_switch_1 = (union samr_AliasInfo *)pyrpc_export_union(&samr_AliasInfo_Type, r, r->in.level, py_info, "union samr_AliasInfo"); if (info_switch_1 == NULL) { return false; } r->in.info = info_switch_1; } return true; } static PyObject *unpack_py_samr_SetAliasInfo_args_out(struct samr_SetAliasInfo *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_DeleteDomAlias_in_get_alias_handle(PyObject *obj, void *closure) { struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(obj); PyObject *py_alias_handle; if (object->in.alias_handle == NULL) { Py_RETURN_NONE; } py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle); return py_alias_handle; } static int py_samr_DeleteDomAlias_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle"); return -1; } object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle); if (object->in.alias_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DeleteDomAlias_out_get_alias_handle(PyObject *obj, void *closure) { struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(obj); PyObject *py_alias_handle; if (object->out.alias_handle == NULL) { Py_RETURN_NONE; } py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->out.alias_handle, object->out.alias_handle); return py_alias_handle; } static int py_samr_DeleteDomAlias_out_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.alias_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.alias_handle"); return -1; } object->out.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.alias_handle); if (object->out.alias_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DeleteDomAlias_get_result(PyObject *obj, void *closure) { struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_DeleteDomAlias_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_DeleteDomAlias_getsetters[] = { { .name = discard_const_p(char, "in_alias_handle"), .get = py_samr_DeleteDomAlias_in_get_alias_handle, .set = py_samr_DeleteDomAlias_in_set_alias_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "out_alias_handle"), .get = py_samr_DeleteDomAlias_out_get_alias_handle, .set = py_samr_DeleteDomAlias_out_set_alias_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_DeleteDomAlias_get_result, .set = py_samr_DeleteDomAlias_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_DeleteDomAlias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_DeleteDomAlias, type); struct samr_DeleteDomAlias *_self = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.alias_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_DeleteDomAlias_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(30); } static PyObject *py_samr_DeleteDomAlias_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 31) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteDomAlias_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[30]; 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_samr_DeleteDomAlias_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_samr_DeleteDomAlias_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_DeleteDomAlias_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_samr_DeleteDomAlias_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_DeleteDomAlias_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 samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 31) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteDomAlias_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[30]; 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_samr_DeleteDomAlias_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_samr_DeleteDomAlias_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_DeleteDomAlias_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_samr_DeleteDomAlias_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_DeleteDomAlias_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 31) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteDomAlias_ndr_print"); return NULL; } call = &ndr_table_samr.calls[30]; 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_samr_DeleteDomAlias_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_DeleteDomAlias_ndr_print(py_obj, "samr_DeleteDomAlias_in", NDR_IN); } static PyObject *py_samr_DeleteDomAlias_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_DeleteDomAlias_ndr_print(py_obj, "samr_DeleteDomAlias_out", NDR_OUT); } static PyMethodDef py_samr_DeleteDomAlias_methods[] = { { "opnum", (PyCFunction)py_samr_DeleteDomAlias_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.DeleteDomAlias.opnum() -> 30 (0x1e) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteDomAlias_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_samr_DeleteDomAlias_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_samr_DeleteDomAlias_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_samr_DeleteDomAlias_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_samr_DeleteDomAlias_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_DeleteDomAlias_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_DeleteDomAlias_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DeleteDomAlias", .tp_getset = py_samr_DeleteDomAlias_getsetters, .tp_methods = py_samr_DeleteDomAlias_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DeleteDomAlias_new, }; static bool pack_py_samr_DeleteDomAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteDomAlias *r) { PyObject *py_alias_handle; const char *kwnames[] = { "alias_handle", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_DeleteDomAlias", discard_const_p(char *, kwnames), &py_alias_handle)) { return false; } if (py_alias_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle"); return false; } r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle); if (r->in.alias_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle); return true; } static PyObject *unpack_py_samr_DeleteDomAlias_args_out(struct samr_DeleteDomAlias *r) { PyObject *result; PyObject *py_alias_handle; py_alias_handle = pytalloc_reference_ex(policy_handle_Type, r->out.alias_handle, r->out.alias_handle); result = py_alias_handle; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_AddAliasMember_in_get_alias_handle(PyObject *obj, void *closure) { struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(obj); PyObject *py_alias_handle; if (object->in.alias_handle == NULL) { Py_RETURN_NONE; } py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle); return py_alias_handle; } static int py_samr_AddAliasMember_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle"); return -1; } object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle); if (object->in.alias_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_AddAliasMember_in_get_sid(PyObject *obj, void *closure) { struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(obj); PyObject *py_sid; if (object->in.sid == NULL) { Py_RETURN_NONE; } py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid); return py_sid; } static int py_samr_AddAliasMember_in_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid"); return -1; } object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid); if (object->in.sid == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(dom_sid_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.sid = (struct dom_sid *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_AddAliasMember_get_result(PyObject *obj, void *closure) { struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_AddAliasMember_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_AddAliasMember_getsetters[] = { { .name = discard_const_p(char, "in_alias_handle"), .get = py_samr_AddAliasMember_in_get_alias_handle, .set = py_samr_AddAliasMember_in_set_alias_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_sid"), .get = py_samr_AddAliasMember_in_get_sid, .set = py_samr_AddAliasMember_in_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2") }, { .name = discard_const_p(char, "result"), .get = py_samr_AddAliasMember_get_result, .set = py_samr_AddAliasMember_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_AddAliasMember_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_AddAliasMember, type); struct samr_AddAliasMember *_self = (struct samr_AddAliasMember *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2); return self; } static PyObject *py_samr_AddAliasMember_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(31); } static PyObject *py_samr_AddAliasMember_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 32) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddAliasMember_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[31]; 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_samr_AddAliasMember_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_samr_AddAliasMember_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_AddAliasMember_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_samr_AddAliasMember_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_AddAliasMember_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 samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 32) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddAliasMember_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[31]; 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_samr_AddAliasMember_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_samr_AddAliasMember_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_AddAliasMember_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_samr_AddAliasMember_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_AddAliasMember_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 32) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddAliasMember_ndr_print"); return NULL; } call = &ndr_table_samr.calls[31]; 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_samr_AddAliasMember_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_AddAliasMember_ndr_print(py_obj, "samr_AddAliasMember_in", NDR_IN); } static PyObject *py_samr_AddAliasMember_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_AddAliasMember_ndr_print(py_obj, "samr_AddAliasMember_out", NDR_OUT); } static PyMethodDef py_samr_AddAliasMember_methods[] = { { "opnum", (PyCFunction)py_samr_AddAliasMember_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.AddAliasMember.opnum() -> 31 (0x1f) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddAliasMember_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_samr_AddAliasMember_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_samr_AddAliasMember_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_samr_AddAliasMember_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_samr_AddAliasMember_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_AddAliasMember_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_AddAliasMember_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.AddAliasMember", .tp_getset = py_samr_AddAliasMember_getsetters, .tp_methods = py_samr_AddAliasMember_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_AddAliasMember_new, }; static bool pack_py_samr_AddAliasMember_args_in(PyObject *args, PyObject *kwargs, struct samr_AddAliasMember *r) { PyObject *py_alias_handle; PyObject *py_sid; const char *kwnames[] = { "alias_handle", "sid", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_AddAliasMember", discard_const_p(char *, kwnames), &py_alias_handle, &py_sid)) { return false; } if (py_alias_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle"); return false; } r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle); if (r->in.alias_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle); if (py_sid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid"); return false; } r->in.sid = talloc_ptrtype(r, r->in.sid); if (r->in.sid == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) { PyErr_NoMemory(); return false; } r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid); return true; } static PyObject *unpack_py_samr_AddAliasMember_args_out(struct samr_AddAliasMember *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_DeleteAliasMember_in_get_alias_handle(PyObject *obj, void *closure) { struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(obj); PyObject *py_alias_handle; if (object->in.alias_handle == NULL) { Py_RETURN_NONE; } py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle); return py_alias_handle; } static int py_samr_DeleteAliasMember_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle"); return -1; } object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle); if (object->in.alias_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DeleteAliasMember_in_get_sid(PyObject *obj, void *closure) { struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(obj); PyObject *py_sid; if (object->in.sid == NULL) { Py_RETURN_NONE; } py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid); return py_sid; } static int py_samr_DeleteAliasMember_in_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid"); return -1; } object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid); if (object->in.sid == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(dom_sid_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.sid = (struct dom_sid *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DeleteAliasMember_get_result(PyObject *obj, void *closure) { struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_DeleteAliasMember_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_DeleteAliasMember_getsetters[] = { { .name = discard_const_p(char, "in_alias_handle"), .get = py_samr_DeleteAliasMember_in_get_alias_handle, .set = py_samr_DeleteAliasMember_in_set_alias_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_sid"), .get = py_samr_DeleteAliasMember_in_get_sid, .set = py_samr_DeleteAliasMember_in_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2") }, { .name = discard_const_p(char, "result"), .get = py_samr_DeleteAliasMember_get_result, .set = py_samr_DeleteAliasMember_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_DeleteAliasMember_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_DeleteAliasMember, type); struct samr_DeleteAliasMember *_self = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2); return self; } static PyObject *py_samr_DeleteAliasMember_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(32); } static PyObject *py_samr_DeleteAliasMember_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 33) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteAliasMember_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[32]; 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_samr_DeleteAliasMember_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_samr_DeleteAliasMember_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_DeleteAliasMember_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_samr_DeleteAliasMember_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_DeleteAliasMember_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 samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 33) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteAliasMember_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[32]; 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_samr_DeleteAliasMember_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_samr_DeleteAliasMember_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_DeleteAliasMember_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_samr_DeleteAliasMember_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_DeleteAliasMember_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 33) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteAliasMember_ndr_print"); return NULL; } call = &ndr_table_samr.calls[32]; 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_samr_DeleteAliasMember_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_DeleteAliasMember_ndr_print(py_obj, "samr_DeleteAliasMember_in", NDR_IN); } static PyObject *py_samr_DeleteAliasMember_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_DeleteAliasMember_ndr_print(py_obj, "samr_DeleteAliasMember_out", NDR_OUT); } static PyMethodDef py_samr_DeleteAliasMember_methods[] = { { "opnum", (PyCFunction)py_samr_DeleteAliasMember_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.DeleteAliasMember.opnum() -> 32 (0x20) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteAliasMember_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_samr_DeleteAliasMember_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_samr_DeleteAliasMember_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_samr_DeleteAliasMember_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_samr_DeleteAliasMember_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_DeleteAliasMember_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_DeleteAliasMember_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DeleteAliasMember", .tp_getset = py_samr_DeleteAliasMember_getsetters, .tp_methods = py_samr_DeleteAliasMember_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DeleteAliasMember_new, }; static bool pack_py_samr_DeleteAliasMember_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteAliasMember *r) { PyObject *py_alias_handle; PyObject *py_sid; const char *kwnames[] = { "alias_handle", "sid", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_DeleteAliasMember", discard_const_p(char *, kwnames), &py_alias_handle, &py_sid)) { return false; } if (py_alias_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle"); return false; } r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle); if (r->in.alias_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle); if (py_sid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid"); return false; } r->in.sid = talloc_ptrtype(r, r->in.sid); if (r->in.sid == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) { PyErr_NoMemory(); return false; } r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid); return true; } static PyObject *unpack_py_samr_DeleteAliasMember_args_out(struct samr_DeleteAliasMember *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_GetMembersInAlias_in_get_alias_handle(PyObject *obj, void *closure) { struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(obj); PyObject *py_alias_handle; if (object->in.alias_handle == NULL) { Py_RETURN_NONE; } py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle); return py_alias_handle; } static int py_samr_GetMembersInAlias_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle"); return -1; } object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle); if (object->in.alias_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetMembersInAlias_out_get_sids(PyObject *obj, void *closure) { struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(obj); PyObject *py_sids; if (object->out.sids == NULL) { Py_RETURN_NONE; } py_sids = pytalloc_reference_ex(lsa_SidArray_Type, object->out.sids, object->out.sids); return py_sids; } static int py_samr_GetMembersInAlias_out_set_sids(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids"); return -1; } object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids); if (object->out.sids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_SidArray_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.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetMembersInAlias_get_result(PyObject *obj, void *closure) { struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_GetMembersInAlias_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_GetMembersInAlias_getsetters[] = { { .name = discard_const_p(char, "in_alias_handle"), .get = py_samr_GetMembersInAlias_in_get_alias_handle, .set = py_samr_GetMembersInAlias_in_set_alias_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "out_sids"), .get = py_samr_GetMembersInAlias_out_get_sids, .set = py_samr_GetMembersInAlias_out_set_sids, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray") }, { .name = discard_const_p(char, "result"), .get = py_samr_GetMembersInAlias_get_result, .set = py_samr_GetMembersInAlias_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_GetMembersInAlias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_GetMembersInAlias, type); struct samr_GetMembersInAlias *_self = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.sids = talloc_zero(mem_ctx, struct lsa_SidArray); return self; } static PyObject *py_samr_GetMembersInAlias_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(33); } static PyObject *py_samr_GetMembersInAlias_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 34) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetMembersInAlias_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[33]; 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_samr_GetMembersInAlias_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_samr_GetMembersInAlias_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_GetMembersInAlias_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_samr_GetMembersInAlias_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_GetMembersInAlias_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 samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 34) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetMembersInAlias_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[33]; 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_samr_GetMembersInAlias_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_samr_GetMembersInAlias_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetMembersInAlias_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_samr_GetMembersInAlias_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetMembersInAlias_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 34) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetMembersInAlias_ndr_print"); return NULL; } call = &ndr_table_samr.calls[33]; 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_samr_GetMembersInAlias_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetMembersInAlias_ndr_print(py_obj, "samr_GetMembersInAlias_in", NDR_IN); } static PyObject *py_samr_GetMembersInAlias_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetMembersInAlias_ndr_print(py_obj, "samr_GetMembersInAlias_out", NDR_OUT); } static PyMethodDef py_samr_GetMembersInAlias_methods[] = { { "opnum", (PyCFunction)py_samr_GetMembersInAlias_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.GetMembersInAlias.opnum() -> 33 (0x21) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetMembersInAlias_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_samr_GetMembersInAlias_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_samr_GetMembersInAlias_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_samr_GetMembersInAlias_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_samr_GetMembersInAlias_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_GetMembersInAlias_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_GetMembersInAlias_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.GetMembersInAlias", .tp_getset = py_samr_GetMembersInAlias_getsetters, .tp_methods = py_samr_GetMembersInAlias_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_GetMembersInAlias_new, }; static bool pack_py_samr_GetMembersInAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_GetMembersInAlias *r) { PyObject *py_alias_handle; const char *kwnames[] = { "alias_handle", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetMembersInAlias", discard_const_p(char *, kwnames), &py_alias_handle)) { return false; } if (py_alias_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle"); return false; } r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle); if (r->in.alias_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle); return true; } static PyObject *unpack_py_samr_GetMembersInAlias_args_out(struct samr_GetMembersInAlias *r) { PyObject *result; PyObject *py_sids; py_sids = pytalloc_reference_ex(lsa_SidArray_Type, r->out.sids, r->out.sids); result = py_sids; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_OpenUser_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_OpenUser_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_OpenUser_in_get_access_mask(PyObject *obj, void *closure) { struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(obj); PyObject *py_access_mask; py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask); return py_access_mask; } static int py_samr_OpenUser_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask)); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_OpenUser_in_get_rid(PyObject *obj, void *closure) { struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->in.rid); return py_rid; } static int py_samr_OpenUser_in_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rid)); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_OpenUser_out_get_user_handle(PyObject *obj, void *closure) { struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(obj); PyObject *py_user_handle; if (object->out.user_handle == NULL) { Py_RETURN_NONE; } py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->out.user_handle, object->out.user_handle); return py_user_handle; } static int py_samr_OpenUser_out_set_user_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.user_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.user_handle"); return -1; } object->out.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.user_handle); if (object->out.user_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.user_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_OpenUser_get_result(PyObject *obj, void *closure) { struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_OpenUser_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_OpenUser_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_OpenUser_in_get_domain_handle, .set = py_samr_OpenUser_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_access_mask"), .get = py_samr_OpenUser_in_get_access_mask, .set = py_samr_OpenUser_in_set_access_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserAccessMask") }, { .name = discard_const_p(char, "in_rid"), .get = py_samr_OpenUser_in_get_rid, .set = py_samr_OpenUser_in_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_user_handle"), .get = py_samr_OpenUser_out_get_user_handle, .set = py_samr_OpenUser_out_set_user_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_OpenUser_get_result, .set = py_samr_OpenUser_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_OpenUser_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_OpenUser, type); struct samr_OpenUser *_self = (struct samr_OpenUser *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.user_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_OpenUser_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(34); } static PyObject *py_samr_OpenUser_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 35) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenUser_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[34]; 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_samr_OpenUser_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_samr_OpenUser_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_OpenUser_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_samr_OpenUser_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_OpenUser_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 samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 35) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenUser_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[34]; 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_samr_OpenUser_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_samr_OpenUser_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_OpenUser_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_samr_OpenUser_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_OpenUser_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 35) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenUser_ndr_print"); return NULL; } call = &ndr_table_samr.calls[34]; 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_samr_OpenUser_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_OpenUser_ndr_print(py_obj, "samr_OpenUser_in", NDR_IN); } static PyObject *py_samr_OpenUser_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_OpenUser_ndr_print(py_obj, "samr_OpenUser_out", NDR_OUT); } static PyMethodDef py_samr_OpenUser_methods[] = { { "opnum", (PyCFunction)py_samr_OpenUser_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.OpenUser.opnum() -> 34 (0x22) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenUser_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_samr_OpenUser_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_samr_OpenUser_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_samr_OpenUser_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_samr_OpenUser_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_OpenUser_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_OpenUser_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.OpenUser", .tp_getset = py_samr_OpenUser_getsetters, .tp_methods = py_samr_OpenUser_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_OpenUser_new, }; static bool pack_py_samr_OpenUser_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenUser *r) { PyObject *py_domain_handle; PyObject *py_access_mask; PyObject *py_rid; const char *kwnames[] = { "domain_handle", "access_mask", "rid", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenUser", discard_const_p(char *, kwnames), &py_domain_handle, &py_access_mask, &py_rid)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); if (py_access_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask)); if (PyLong_Check(py_access_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_access_mask); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_rid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rid"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rid)); if (PyLong_Check(py_rid)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_rid); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_OpenUser_args_out(struct samr_OpenUser *r) { PyObject *result; PyObject *py_user_handle; py_user_handle = pytalloc_reference_ex(policy_handle_Type, r->out.user_handle, r->out.user_handle); result = py_user_handle; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_DeleteUser_in_get_user_handle(PyObject *obj, void *closure) { struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(obj); PyObject *py_user_handle; if (object->in.user_handle == NULL) { Py_RETURN_NONE; } py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle); return py_user_handle; } static int py_samr_DeleteUser_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle"); return -1; } object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle); if (object->in.user_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.user_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DeleteUser_out_get_user_handle(PyObject *obj, void *closure) { struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(obj); PyObject *py_user_handle; if (object->out.user_handle == NULL) { Py_RETURN_NONE; } py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->out.user_handle, object->out.user_handle); return py_user_handle; } static int py_samr_DeleteUser_out_set_user_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.user_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.user_handle"); return -1; } object->out.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.user_handle); if (object->out.user_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.user_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_DeleteUser_get_result(PyObject *obj, void *closure) { struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_DeleteUser_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_DeleteUser_getsetters[] = { { .name = discard_const_p(char, "in_user_handle"), .get = py_samr_DeleteUser_in_get_user_handle, .set = py_samr_DeleteUser_in_set_user_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "out_user_handle"), .get = py_samr_DeleteUser_out_get_user_handle, .set = py_samr_DeleteUser_out_set_user_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_DeleteUser_get_result, .set = py_samr_DeleteUser_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_DeleteUser_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_DeleteUser, type); struct samr_DeleteUser *_self = (struct samr_DeleteUser *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.user_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_DeleteUser_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(35); } static PyObject *py_samr_DeleteUser_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 36) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteUser_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[35]; 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_samr_DeleteUser_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_samr_DeleteUser_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_DeleteUser_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_samr_DeleteUser_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_DeleteUser_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 samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 36) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteUser_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[35]; 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_samr_DeleteUser_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_samr_DeleteUser_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_DeleteUser_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_samr_DeleteUser_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_DeleteUser_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 36) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteUser_ndr_print"); return NULL; } call = &ndr_table_samr.calls[35]; 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_samr_DeleteUser_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_DeleteUser_ndr_print(py_obj, "samr_DeleteUser_in", NDR_IN); } static PyObject *py_samr_DeleteUser_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_DeleteUser_ndr_print(py_obj, "samr_DeleteUser_out", NDR_OUT); } static PyMethodDef py_samr_DeleteUser_methods[] = { { "opnum", (PyCFunction)py_samr_DeleteUser_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.DeleteUser.opnum() -> 35 (0x23) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteUser_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_samr_DeleteUser_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_samr_DeleteUser_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_samr_DeleteUser_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_samr_DeleteUser_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_DeleteUser_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_DeleteUser_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.DeleteUser", .tp_getset = py_samr_DeleteUser_getsetters, .tp_methods = py_samr_DeleteUser_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_DeleteUser_new, }; static bool pack_py_samr_DeleteUser_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteUser *r) { PyObject *py_user_handle; const char *kwnames[] = { "user_handle", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_DeleteUser", discard_const_p(char *, kwnames), &py_user_handle)) { return false; } if (py_user_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle"); return false; } r->in.user_handle = talloc_ptrtype(r, r->in.user_handle); if (r->in.user_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle); return true; } static PyObject *unpack_py_samr_DeleteUser_args_out(struct samr_DeleteUser *r) { PyObject *result; PyObject *py_user_handle; py_user_handle = pytalloc_reference_ex(policy_handle_Type, r->out.user_handle, r->out.user_handle); result = py_user_handle; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_QueryUserInfo_in_get_user_handle(PyObject *obj, void *closure) { struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(obj); PyObject *py_user_handle; if (object->in.user_handle == NULL) { Py_RETURN_NONE; } py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle); return py_user_handle; } static int py_samr_QueryUserInfo_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle"); return -1; } object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle); if (object->in.user_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.user_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_QueryUserInfo_in_get_level(PyObject *obj, void *closure) { struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_QueryUserInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)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_samr_QueryUserInfo_out_get_info(PyObject *obj, void *closure) { struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } if (*object->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pyrpc_import_union(&samr_UserInfo_Type, *object->out.info, object->in.level, *object->out.info, "union samr_UserInfo"); if (py_info == NULL) { return NULL; } } return py_info; } static int py_samr_QueryUserInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info"); return -1; } object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info); if (object->out.info == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.info = NULL; } else { *object->out.info = NULL; { union samr_UserInfo *info_switch_2; info_switch_2 = (union samr_UserInfo *)pyrpc_export_union(&samr_UserInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_UserInfo"); if (info_switch_2 == NULL) { return -1; } *object->out.info = info_switch_2; } } return 0; } static PyObject *py_samr_QueryUserInfo_get_result(PyObject *obj, void *closure) { struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_QueryUserInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_QueryUserInfo_getsetters[] = { { .name = discard_const_p(char, "in_user_handle"), .get = py_samr_QueryUserInfo_in_get_user_handle, .set = py_samr_QueryUserInfo_in_set_user_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_QueryUserInfo_in_get_level, .set = py_samr_QueryUserInfo_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfoLevel") }, { .name = discard_const_p(char, "out_info"), .get = py_samr_QueryUserInfo_out_get_info, .set = py_samr_QueryUserInfo_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_QueryUserInfo_get_result, .set = py_samr_QueryUserInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_QueryUserInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_QueryUserInfo, type); struct samr_QueryUserInfo *_self = (struct samr_QueryUserInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle); /* a pointer to a NULL pointer */ _self->out.info = talloc_zero(mem_ctx, union samr_UserInfo *); return self; } static PyObject *py_samr_QueryUserInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(36); } static PyObject *py_samr_QueryUserInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 37) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryUserInfo_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[36]; 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_samr_QueryUserInfo_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_samr_QueryUserInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_QueryUserInfo_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_samr_QueryUserInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_QueryUserInfo_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 samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 37) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryUserInfo_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[36]; 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_samr_QueryUserInfo_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_samr_QueryUserInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryUserInfo_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_samr_QueryUserInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryUserInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 37) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryUserInfo_ndr_print"); return NULL; } call = &ndr_table_samr.calls[36]; 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_samr_QueryUserInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryUserInfo_ndr_print(py_obj, "samr_QueryUserInfo_in", NDR_IN); } static PyObject *py_samr_QueryUserInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryUserInfo_ndr_print(py_obj, "samr_QueryUserInfo_out", NDR_OUT); } static PyMethodDef py_samr_QueryUserInfo_methods[] = { { "opnum", (PyCFunction)py_samr_QueryUserInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.QueryUserInfo.opnum() -> 36 (0x24) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryUserInfo_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_samr_QueryUserInfo_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_samr_QueryUserInfo_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_samr_QueryUserInfo_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_samr_QueryUserInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_QueryUserInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_QueryUserInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.QueryUserInfo", .tp_getset = py_samr_QueryUserInfo_getsetters, .tp_methods = py_samr_QueryUserInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_QueryUserInfo_new, }; static bool pack_py_samr_QueryUserInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryUserInfo *r) { PyObject *py_user_handle; PyObject *py_level; const char *kwnames[] = { "user_handle", "level", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryUserInfo", discard_const_p(char *, kwnames), &py_user_handle, &py_level)) { return false; } if (py_user_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle"); return false; } r->in.user_handle = talloc_ptrtype(r, r->in.user_handle); if (r->in.user_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle); 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_samr_QueryUserInfo_args_out(struct samr_QueryUserInfo *r) { PyObject *result; PyObject *py_info; if (*r->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pyrpc_import_union(&samr_UserInfo_Type, *r->out.info, r->in.level, *r->out.info, "union samr_UserInfo"); if (py_info == NULL) { return NULL; } } result = py_info; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_SetUserInfo_in_get_user_handle(PyObject *obj, void *closure) { struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(obj); PyObject *py_user_handle; if (object->in.user_handle == NULL) { Py_RETURN_NONE; } py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle); return py_user_handle; } static int py_samr_SetUserInfo_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle"); return -1; } object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle); if (object->in.user_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.user_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_SetUserInfo_in_get_level(PyObject *obj, void *closure) { struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_SetUserInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)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_samr_SetUserInfo_in_get_info(PyObject *obj, void *closure) { struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->in.info == NULL) { Py_RETURN_NONE; } py_info = pyrpc_import_union(&samr_UserInfo_Type, object->in.info, object->in.level, object->in.info, "union samr_UserInfo"); if (py_info == NULL) { return NULL; } return py_info; } static int py_samr_SetUserInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info"); return -1; } object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info); if (object->in.info == NULL) { PyErr_NoMemory(); return -1; } { union samr_UserInfo *info_switch_1; info_switch_1 = (union samr_UserInfo *)pyrpc_export_union(&samr_UserInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_UserInfo"); if (info_switch_1 == NULL) { return -1; } object->in.info = info_switch_1; } return 0; } static PyObject *py_samr_SetUserInfo_get_result(PyObject *obj, void *closure) { struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_SetUserInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_SetUserInfo_getsetters[] = { { .name = discard_const_p(char, "in_user_handle"), .get = py_samr_SetUserInfo_in_get_user_handle, .set = py_samr_SetUserInfo_in_set_user_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_SetUserInfo_in_get_level, .set = py_samr_SetUserInfo_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfoLevel") }, { .name = discard_const_p(char, "in_info"), .get = py_samr_SetUserInfo_in_get_info, .set = py_samr_SetUserInfo_in_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_SetUserInfo_get_result, .set = py_samr_SetUserInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_SetUserInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_SetUserInfo, type); struct samr_SetUserInfo *_self = (struct samr_SetUserInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.info = talloc_zero(mem_ctx, union samr_UserInfo); return self; } static PyObject *py_samr_SetUserInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(37); } static PyObject *py_samr_SetUserInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 38) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetUserInfo_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[37]; 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_samr_SetUserInfo_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_samr_SetUserInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_SetUserInfo_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_samr_SetUserInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_SetUserInfo_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 samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 38) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetUserInfo_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[37]; 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_samr_SetUserInfo_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_samr_SetUserInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetUserInfo_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_samr_SetUserInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetUserInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 38) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetUserInfo_ndr_print"); return NULL; } call = &ndr_table_samr.calls[37]; 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_samr_SetUserInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetUserInfo_ndr_print(py_obj, "samr_SetUserInfo_in", NDR_IN); } static PyObject *py_samr_SetUserInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetUserInfo_ndr_print(py_obj, "samr_SetUserInfo_out", NDR_OUT); } static PyMethodDef py_samr_SetUserInfo_methods[] = { { "opnum", (PyCFunction)py_samr_SetUserInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.SetUserInfo.opnum() -> 37 (0x25) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetUserInfo_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_samr_SetUserInfo_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_samr_SetUserInfo_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_samr_SetUserInfo_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_samr_SetUserInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_SetUserInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_SetUserInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.SetUserInfo", .tp_getset = py_samr_SetUserInfo_getsetters, .tp_methods = py_samr_SetUserInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_SetUserInfo_new, }; static bool pack_py_samr_SetUserInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetUserInfo *r) { PyObject *py_user_handle; PyObject *py_level; PyObject *py_info; const char *kwnames[] = { "user_handle", "level", "info", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetUserInfo", discard_const_p(char *, kwnames), &py_user_handle, &py_level, &py_info)) { return false; } if (py_user_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle"); return false; } r->in.user_handle = talloc_ptrtype(r, r->in.user_handle); if (r->in.user_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle); 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; } } if (py_info == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info"); return false; } r->in.info = talloc_ptrtype(r, r->in.info); if (r->in.info == NULL) { PyErr_NoMemory(); return false; } { union samr_UserInfo *info_switch_1; info_switch_1 = (union samr_UserInfo *)pyrpc_export_union(&samr_UserInfo_Type, r, r->in.level, py_info, "union samr_UserInfo"); if (info_switch_1 == NULL) { return false; } r->in.info = info_switch_1; } return true; } static PyObject *unpack_py_samr_SetUserInfo_args_out(struct samr_SetUserInfo *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_ChangePasswordUser_in_get_user_handle(PyObject *obj, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj); PyObject *py_user_handle; if (object->in.user_handle == NULL) { Py_RETURN_NONE; } py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle); return py_user_handle; } static int py_samr_ChangePasswordUser_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle"); return -1; } object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle); if (object->in.user_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.user_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_ChangePasswordUser_in_get_lm_present(PyObject *obj, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj); PyObject *py_lm_present; py_lm_present = PyLong_FromLong((uint16_t)object->in.lm_present); return py_lm_present; } static int py_samr_ChangePasswordUser_in_set_lm_present(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_present"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lm_present)); 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.lm_present = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ChangePasswordUser_in_get_old_lm_crypted(PyObject *obj, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj); PyObject *py_old_lm_crypted; if (object->in.old_lm_crypted == NULL) { Py_RETURN_NONE; } if (object->in.old_lm_crypted == NULL) { py_old_lm_crypted = Py_None; Py_INCREF(py_old_lm_crypted); } else { py_old_lm_crypted = pytalloc_reference_ex(&samr_Password_Type, object->in.old_lm_crypted, object->in.old_lm_crypted); } return py_old_lm_crypted; } static int py_samr_ChangePasswordUser_in_set_old_lm_crypted(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.old_lm_crypted)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.old_lm_crypted"); return -1; } if (value == Py_None) { object->in.old_lm_crypted = NULL; } else { object->in.old_lm_crypted = NULL; PY_CHECK_TYPE(&samr_Password_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.old_lm_crypted = (struct samr_Password *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser_in_get_new_lm_crypted(PyObject *obj, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj); PyObject *py_new_lm_crypted; if (object->in.new_lm_crypted == NULL) { Py_RETURN_NONE; } if (object->in.new_lm_crypted == NULL) { py_new_lm_crypted = Py_None; Py_INCREF(py_new_lm_crypted); } else { py_new_lm_crypted = pytalloc_reference_ex(&samr_Password_Type, object->in.new_lm_crypted, object->in.new_lm_crypted); } return py_new_lm_crypted; } static int py_samr_ChangePasswordUser_in_set_new_lm_crypted(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_lm_crypted)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_lm_crypted"); return -1; } if (value == Py_None) { object->in.new_lm_crypted = NULL; } else { object->in.new_lm_crypted = NULL; PY_CHECK_TYPE(&samr_Password_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.new_lm_crypted = (struct samr_Password *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser_in_get_nt_present(PyObject *obj, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj); PyObject *py_nt_present; py_nt_present = PyLong_FromLong((uint16_t)object->in.nt_present); return py_nt_present; } static int py_samr_ChangePasswordUser_in_set_nt_present(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.nt_present"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.nt_present)); 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.nt_present = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ChangePasswordUser_in_get_old_nt_crypted(PyObject *obj, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj); PyObject *py_old_nt_crypted; if (object->in.old_nt_crypted == NULL) { Py_RETURN_NONE; } if (object->in.old_nt_crypted == NULL) { py_old_nt_crypted = Py_None; Py_INCREF(py_old_nt_crypted); } else { py_old_nt_crypted = pytalloc_reference_ex(&samr_Password_Type, object->in.old_nt_crypted, object->in.old_nt_crypted); } return py_old_nt_crypted; } static int py_samr_ChangePasswordUser_in_set_old_nt_crypted(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.old_nt_crypted)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.old_nt_crypted"); return -1; } if (value == Py_None) { object->in.old_nt_crypted = NULL; } else { object->in.old_nt_crypted = NULL; PY_CHECK_TYPE(&samr_Password_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.old_nt_crypted = (struct samr_Password *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser_in_get_new_nt_crypted(PyObject *obj, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj); PyObject *py_new_nt_crypted; if (object->in.new_nt_crypted == NULL) { Py_RETURN_NONE; } if (object->in.new_nt_crypted == NULL) { py_new_nt_crypted = Py_None; Py_INCREF(py_new_nt_crypted); } else { py_new_nt_crypted = pytalloc_reference_ex(&samr_Password_Type, object->in.new_nt_crypted, object->in.new_nt_crypted); } return py_new_nt_crypted; } static int py_samr_ChangePasswordUser_in_set_new_nt_crypted(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_nt_crypted)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_nt_crypted"); return -1; } if (value == Py_None) { object->in.new_nt_crypted = NULL; } else { object->in.new_nt_crypted = NULL; PY_CHECK_TYPE(&samr_Password_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.new_nt_crypted = (struct samr_Password *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser_in_get_cross1_present(PyObject *obj, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj); PyObject *py_cross1_present; py_cross1_present = PyLong_FromLong((uint16_t)object->in.cross1_present); return py_cross1_present; } static int py_samr_ChangePasswordUser_in_set_cross1_present(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.cross1_present"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.cross1_present)); 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.cross1_present = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ChangePasswordUser_in_get_nt_cross(PyObject *obj, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj); PyObject *py_nt_cross; if (object->in.nt_cross == NULL) { Py_RETURN_NONE; } if (object->in.nt_cross == NULL) { py_nt_cross = Py_None; Py_INCREF(py_nt_cross); } else { py_nt_cross = pytalloc_reference_ex(&samr_Password_Type, object->in.nt_cross, object->in.nt_cross); } return py_nt_cross; } static int py_samr_ChangePasswordUser_in_set_nt_cross(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.nt_cross)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.nt_cross"); return -1; } if (value == Py_None) { object->in.nt_cross = NULL; } else { object->in.nt_cross = NULL; PY_CHECK_TYPE(&samr_Password_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.nt_cross = (struct samr_Password *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser_in_get_cross2_present(PyObject *obj, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj); PyObject *py_cross2_present; py_cross2_present = PyLong_FromLong((uint16_t)object->in.cross2_present); return py_cross2_present; } static int py_samr_ChangePasswordUser_in_set_cross2_present(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.cross2_present"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.cross2_present)); 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.cross2_present = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ChangePasswordUser_in_get_lm_cross(PyObject *obj, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj); PyObject *py_lm_cross; if (object->in.lm_cross == NULL) { Py_RETURN_NONE; } if (object->in.lm_cross == NULL) { py_lm_cross = Py_None; Py_INCREF(py_lm_cross); } else { py_lm_cross = pytalloc_reference_ex(&samr_Password_Type, object->in.lm_cross, object->in.lm_cross); } return py_lm_cross; } static int py_samr_ChangePasswordUser_in_set_lm_cross(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lm_cross)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_cross"); return -1; } if (value == Py_None) { object->in.lm_cross = NULL; } else { object->in.lm_cross = NULL; PY_CHECK_TYPE(&samr_Password_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.lm_cross = (struct samr_Password *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser_get_result(PyObject *obj, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_ChangePasswordUser_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_ChangePasswordUser_getsetters[] = { { .name = discard_const_p(char, "in_user_handle"), .get = py_samr_ChangePasswordUser_in_get_user_handle, .set = py_samr_ChangePasswordUser_in_set_user_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_lm_present"), .get = py_samr_ChangePasswordUser_in_get_lm_present, .set = py_samr_ChangePasswordUser_in_set_lm_present, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_old_lm_crypted"), .get = py_samr_ChangePasswordUser_in_get_old_lm_crypted, .set = py_samr_ChangePasswordUser_in_set_old_lm_crypted, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "in_new_lm_crypted"), .get = py_samr_ChangePasswordUser_in_get_new_lm_crypted, .set = py_samr_ChangePasswordUser_in_set_new_lm_crypted, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "in_nt_present"), .get = py_samr_ChangePasswordUser_in_get_nt_present, .set = py_samr_ChangePasswordUser_in_set_nt_present, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_old_nt_crypted"), .get = py_samr_ChangePasswordUser_in_get_old_nt_crypted, .set = py_samr_ChangePasswordUser_in_set_old_nt_crypted, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "in_new_nt_crypted"), .get = py_samr_ChangePasswordUser_in_get_new_nt_crypted, .set = py_samr_ChangePasswordUser_in_set_new_nt_crypted, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "in_cross1_present"), .get = py_samr_ChangePasswordUser_in_get_cross1_present, .set = py_samr_ChangePasswordUser_in_set_cross1_present, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_nt_cross"), .get = py_samr_ChangePasswordUser_in_get_nt_cross, .set = py_samr_ChangePasswordUser_in_set_nt_cross, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "in_cross2_present"), .get = py_samr_ChangePasswordUser_in_get_cross2_present, .set = py_samr_ChangePasswordUser_in_set_cross2_present, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_lm_cross"), .get = py_samr_ChangePasswordUser_in_get_lm_cross, .set = py_samr_ChangePasswordUser_in_set_lm_cross, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "result"), .get = py_samr_ChangePasswordUser_get_result, .set = py_samr_ChangePasswordUser_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_ChangePasswordUser_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_ChangePasswordUser, type); struct samr_ChangePasswordUser *_self = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_ChangePasswordUser_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(38); } static PyObject *py_samr_ChangePasswordUser_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 39) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[38]; 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_samr_ChangePasswordUser_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_samr_ChangePasswordUser_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_ChangePasswordUser_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_samr_ChangePasswordUser_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_ChangePasswordUser_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 samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 39) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[38]; 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_samr_ChangePasswordUser_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_samr_ChangePasswordUser_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_ChangePasswordUser_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_samr_ChangePasswordUser_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_ChangePasswordUser_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 39) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser_ndr_print"); return NULL; } call = &ndr_table_samr.calls[38]; 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_samr_ChangePasswordUser_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_ChangePasswordUser_ndr_print(py_obj, "samr_ChangePasswordUser_in", NDR_IN); } static PyObject *py_samr_ChangePasswordUser_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_ChangePasswordUser_ndr_print(py_obj, "samr_ChangePasswordUser_out", NDR_OUT); } static PyMethodDef py_samr_ChangePasswordUser_methods[] = { { "opnum", (PyCFunction)py_samr_ChangePasswordUser_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.ChangePasswordUser.opnum() -> 38 (0x26) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser_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_samr_ChangePasswordUser_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_samr_ChangePasswordUser_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_samr_ChangePasswordUser_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_samr_ChangePasswordUser_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_ChangePasswordUser_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_ChangePasswordUser_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ChangePasswordUser", .tp_getset = py_samr_ChangePasswordUser_getsetters, .tp_methods = py_samr_ChangePasswordUser_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ChangePasswordUser_new, }; static bool pack_py_samr_ChangePasswordUser_args_in(PyObject *args, PyObject *kwargs, struct samr_ChangePasswordUser *r) { PyObject *py_user_handle; PyObject *py_lm_present; PyObject *py_old_lm_crypted; PyObject *py_new_lm_crypted; PyObject *py_nt_present; PyObject *py_old_nt_crypted; PyObject *py_new_nt_crypted; PyObject *py_cross1_present; PyObject *py_nt_cross; PyObject *py_cross2_present; PyObject *py_lm_cross; const char *kwnames[] = { "user_handle", "lm_present", "old_lm_crypted", "new_lm_crypted", "nt_present", "old_nt_crypted", "new_nt_crypted", "cross1_present", "nt_cross", "cross2_present", "lm_cross", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOOOOO:samr_ChangePasswordUser", discard_const_p(char *, kwnames), &py_user_handle, &py_lm_present, &py_old_lm_crypted, &py_new_lm_crypted, &py_nt_present, &py_old_nt_crypted, &py_new_nt_crypted, &py_cross1_present, &py_nt_cross, &py_cross2_present, &py_lm_cross)) { return false; } if (py_user_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle"); return false; } r->in.user_handle = talloc_ptrtype(r, r->in.user_handle); if (r->in.user_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle); if (py_lm_present == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_present"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lm_present)); if (PyLong_Check(py_lm_present)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_lm_present); 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.lm_present = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_old_lm_crypted == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.old_lm_crypted"); return false; } if (py_old_lm_crypted == Py_None) { r->in.old_lm_crypted = NULL; } else { r->in.old_lm_crypted = NULL; PY_CHECK_TYPE(&samr_Password_Type, py_old_lm_crypted, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_lm_crypted)) == NULL) { PyErr_NoMemory(); return false; } r->in.old_lm_crypted = (struct samr_Password *)pytalloc_get_ptr(py_old_lm_crypted); } if (py_new_lm_crypted == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_lm_crypted"); return false; } if (py_new_lm_crypted == Py_None) { r->in.new_lm_crypted = NULL; } else { r->in.new_lm_crypted = NULL; PY_CHECK_TYPE(&samr_Password_Type, py_new_lm_crypted, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_lm_crypted)) == NULL) { PyErr_NoMemory(); return false; } r->in.new_lm_crypted = (struct samr_Password *)pytalloc_get_ptr(py_new_lm_crypted); } if (py_nt_present == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.nt_present"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.nt_present)); if (PyLong_Check(py_nt_present)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_nt_present); 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.nt_present = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_old_nt_crypted == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.old_nt_crypted"); return false; } if (py_old_nt_crypted == Py_None) { r->in.old_nt_crypted = NULL; } else { r->in.old_nt_crypted = NULL; PY_CHECK_TYPE(&samr_Password_Type, py_old_nt_crypted, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_nt_crypted)) == NULL) { PyErr_NoMemory(); return false; } r->in.old_nt_crypted = (struct samr_Password *)pytalloc_get_ptr(py_old_nt_crypted); } if (py_new_nt_crypted == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_nt_crypted"); return false; } if (py_new_nt_crypted == Py_None) { r->in.new_nt_crypted = NULL; } else { r->in.new_nt_crypted = NULL; PY_CHECK_TYPE(&samr_Password_Type, py_new_nt_crypted, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_nt_crypted)) == NULL) { PyErr_NoMemory(); return false; } r->in.new_nt_crypted = (struct samr_Password *)pytalloc_get_ptr(py_new_nt_crypted); } if (py_cross1_present == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.cross1_present"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.cross1_present)); if (PyLong_Check(py_cross1_present)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_cross1_present); 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.cross1_present = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_nt_cross == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.nt_cross"); return false; } if (py_nt_cross == Py_None) { r->in.nt_cross = NULL; } else { r->in.nt_cross = NULL; PY_CHECK_TYPE(&samr_Password_Type, py_nt_cross, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_cross)) == NULL) { PyErr_NoMemory(); return false; } r->in.nt_cross = (struct samr_Password *)pytalloc_get_ptr(py_nt_cross); } if (py_cross2_present == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.cross2_present"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.cross2_present)); if (PyLong_Check(py_cross2_present)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_cross2_present); 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.cross2_present = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_lm_cross == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_cross"); return false; } if (py_lm_cross == Py_None) { r->in.lm_cross = NULL; } else { r->in.lm_cross = NULL; PY_CHECK_TYPE(&samr_Password_Type, py_lm_cross, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_cross)) == NULL) { PyErr_NoMemory(); return false; } r->in.lm_cross = (struct samr_Password *)pytalloc_get_ptr(py_lm_cross); } return true; } static PyObject *unpack_py_samr_ChangePasswordUser_args_out(struct samr_ChangePasswordUser *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_GetGroupsForUser_in_get_user_handle(PyObject *obj, void *closure) { struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(obj); PyObject *py_user_handle; if (object->in.user_handle == NULL) { Py_RETURN_NONE; } py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle); return py_user_handle; } static int py_samr_GetGroupsForUser_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle"); return -1; } object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle); if (object->in.user_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.user_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetGroupsForUser_out_get_rids(PyObject *obj, void *closure) { struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(obj); PyObject *py_rids; if (object->out.rids == NULL) { Py_RETURN_NONE; } if (*object->out.rids == NULL) { py_rids = Py_None; Py_INCREF(py_rids); } else { py_rids = pytalloc_reference_ex(&samr_RidWithAttributeArray_Type, *object->out.rids, *object->out.rids); } return py_rids; } static int py_samr_GetGroupsForUser_out_set_rids(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids"); return -1; } object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids); if (object->out.rids == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.rids = NULL; } else { *object->out.rids = NULL; PY_CHECK_TYPE(&samr_RidWithAttributeArray_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.rids = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_GetGroupsForUser_get_result(PyObject *obj, void *closure) { struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_GetGroupsForUser_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_GetGroupsForUser_getsetters[] = { { .name = discard_const_p(char, "in_user_handle"), .get = py_samr_GetGroupsForUser_in_get_user_handle, .set = py_samr_GetGroupsForUser_in_set_user_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "out_rids"), .get = py_samr_GetGroupsForUser_out_get_rids, .set = py_samr_GetGroupsForUser_out_set_rids, .doc = discard_const_p(char, "PIDL-generated element of base type samr_RidWithAttributeArray") }, { .name = discard_const_p(char, "result"), .get = py_samr_GetGroupsForUser_get_result, .set = py_samr_GetGroupsForUser_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_GetGroupsForUser_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_GetGroupsForUser, type); struct samr_GetGroupsForUser *_self = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle); /* a pointer to a NULL pointer */ _self->out.rids = talloc_zero(mem_ctx, struct samr_RidWithAttributeArray *); return self; } static PyObject *py_samr_GetGroupsForUser_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(39); } static PyObject *py_samr_GetGroupsForUser_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 40) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetGroupsForUser_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[39]; 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_samr_GetGroupsForUser_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_samr_GetGroupsForUser_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_GetGroupsForUser_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_samr_GetGroupsForUser_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_GetGroupsForUser_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 samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 40) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetGroupsForUser_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[39]; 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_samr_GetGroupsForUser_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_samr_GetGroupsForUser_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetGroupsForUser_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_samr_GetGroupsForUser_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetGroupsForUser_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 40) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetGroupsForUser_ndr_print"); return NULL; } call = &ndr_table_samr.calls[39]; 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_samr_GetGroupsForUser_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetGroupsForUser_ndr_print(py_obj, "samr_GetGroupsForUser_in", NDR_IN); } static PyObject *py_samr_GetGroupsForUser_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetGroupsForUser_ndr_print(py_obj, "samr_GetGroupsForUser_out", NDR_OUT); } static PyMethodDef py_samr_GetGroupsForUser_methods[] = { { "opnum", (PyCFunction)py_samr_GetGroupsForUser_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.GetGroupsForUser.opnum() -> 39 (0x27) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetGroupsForUser_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_samr_GetGroupsForUser_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_samr_GetGroupsForUser_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_samr_GetGroupsForUser_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_samr_GetGroupsForUser_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_GetGroupsForUser_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_GetGroupsForUser_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.GetGroupsForUser", .tp_getset = py_samr_GetGroupsForUser_getsetters, .tp_methods = py_samr_GetGroupsForUser_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_GetGroupsForUser_new, }; static bool pack_py_samr_GetGroupsForUser_args_in(PyObject *args, PyObject *kwargs, struct samr_GetGroupsForUser *r) { PyObject *py_user_handle; const char *kwnames[] = { "user_handle", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetGroupsForUser", discard_const_p(char *, kwnames), &py_user_handle)) { return false; } if (py_user_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle"); return false; } r->in.user_handle = talloc_ptrtype(r, r->in.user_handle); if (r->in.user_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle); return true; } static PyObject *unpack_py_samr_GetGroupsForUser_args_out(struct samr_GetGroupsForUser *r) { PyObject *result; PyObject *py_rids; if (*r->out.rids == NULL) { py_rids = Py_None; Py_INCREF(py_rids); } else { py_rids = pytalloc_reference_ex(&samr_RidWithAttributeArray_Type, *r->out.rids, *r->out.rids); } result = py_rids; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_QueryDisplayInfo_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_QueryDisplayInfo_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_QueryDisplayInfo_in_get_level(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_QueryDisplayInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)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_samr_QueryDisplayInfo_in_get_start_idx(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj); PyObject *py_start_idx; py_start_idx = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_idx); return py_start_idx; } static int py_samr_QueryDisplayInfo_in_set_start_idx(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_idx"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_idx)); 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.start_idx = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo_in_get_max_entries(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj); PyObject *py_max_entries; py_max_entries = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_entries); return py_max_entries; } static int py_samr_QueryDisplayInfo_in_set_max_entries(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_entries"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_entries)); 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.max_entries = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo_in_get_buf_size(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj); PyObject *py_buf_size; py_buf_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.buf_size); return py_buf_size; } static int py_samr_QueryDisplayInfo_in_set_buf_size(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buf_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buf_size)); 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.buf_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo_out_get_total_size(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj); PyObject *py_total_size; if (object->out.total_size == NULL) { Py_RETURN_NONE; } py_total_size = PyLong_FromUnsignedLongLong((uint32_t)*object->out.total_size); return py_total_size; } static int py_samr_QueryDisplayInfo_out_set_total_size(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.total_size)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.total_size"); return -1; } object->out.total_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.total_size); if (object->out.total_size == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.total_size)); 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.total_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo_out_get_returned_size(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj); PyObject *py_returned_size; if (object->out.returned_size == NULL) { Py_RETURN_NONE; } py_returned_size = PyLong_FromUnsignedLongLong((uint32_t)*object->out.returned_size); return py_returned_size; } static int py_samr_QueryDisplayInfo_out_set_returned_size(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.returned_size)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.returned_size"); return -1; } object->out.returned_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.returned_size); if (object->out.returned_size == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.returned_size)); 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.returned_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo_out_get_info(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } py_info = pyrpc_import_union(&samr_DispInfo_Type, object->out.info, object->in.level, object->out.info, "union samr_DispInfo"); if (py_info == NULL) { return NULL; } return py_info; } static int py_samr_QueryDisplayInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info"); return -1; } object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info); if (object->out.info == NULL) { PyErr_NoMemory(); return -1; } { union samr_DispInfo *info_switch_1; info_switch_1 = (union samr_DispInfo *)pyrpc_export_union(&samr_DispInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_DispInfo"); if (info_switch_1 == NULL) { return -1; } object->out.info = info_switch_1; } return 0; } static PyObject *py_samr_QueryDisplayInfo_get_result(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_QueryDisplayInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_QueryDisplayInfo_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_QueryDisplayInfo_in_get_domain_handle, .set = py_samr_QueryDisplayInfo_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_QueryDisplayInfo_in_get_level, .set = py_samr_QueryDisplayInfo_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_start_idx"), .get = py_samr_QueryDisplayInfo_in_get_start_idx, .set = py_samr_QueryDisplayInfo_in_set_start_idx, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_max_entries"), .get = py_samr_QueryDisplayInfo_in_get_max_entries, .set = py_samr_QueryDisplayInfo_in_set_max_entries, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_buf_size"), .get = py_samr_QueryDisplayInfo_in_get_buf_size, .set = py_samr_QueryDisplayInfo_in_set_buf_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_total_size"), .get = py_samr_QueryDisplayInfo_out_get_total_size, .set = py_samr_QueryDisplayInfo_out_set_total_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_returned_size"), .get = py_samr_QueryDisplayInfo_out_get_returned_size, .set = py_samr_QueryDisplayInfo_out_set_returned_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_info"), .get = py_samr_QueryDisplayInfo_out_get_info, .set = py_samr_QueryDisplayInfo_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_QueryDisplayInfo_get_result, .set = py_samr_QueryDisplayInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_QueryDisplayInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_QueryDisplayInfo, type); struct samr_QueryDisplayInfo *_self = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.total_size = talloc_zero(mem_ctx, uint32_t); _self->out.returned_size = talloc_zero(mem_ctx, uint32_t); _self->out.info = talloc_zero(mem_ctx, union samr_DispInfo); return self; } static PyObject *py_samr_QueryDisplayInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(40); } static PyObject *py_samr_QueryDisplayInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 41) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[40]; 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_samr_QueryDisplayInfo_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_samr_QueryDisplayInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_QueryDisplayInfo_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_samr_QueryDisplayInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_QueryDisplayInfo_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 samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 41) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[40]; 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_samr_QueryDisplayInfo_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_samr_QueryDisplayInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryDisplayInfo_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_samr_QueryDisplayInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryDisplayInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 41) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo_ndr_print"); return NULL; } call = &ndr_table_samr.calls[40]; 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_samr_QueryDisplayInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryDisplayInfo_ndr_print(py_obj, "samr_QueryDisplayInfo_in", NDR_IN); } static PyObject *py_samr_QueryDisplayInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryDisplayInfo_ndr_print(py_obj, "samr_QueryDisplayInfo_out", NDR_OUT); } static PyMethodDef py_samr_QueryDisplayInfo_methods[] = { { "opnum", (PyCFunction)py_samr_QueryDisplayInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.QueryDisplayInfo.opnum() -> 40 (0x28) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo_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_samr_QueryDisplayInfo_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_samr_QueryDisplayInfo_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_samr_QueryDisplayInfo_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_samr_QueryDisplayInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_QueryDisplayInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_QueryDisplayInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.QueryDisplayInfo", .tp_getset = py_samr_QueryDisplayInfo_getsetters, .tp_methods = py_samr_QueryDisplayInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_QueryDisplayInfo_new, }; static bool pack_py_samr_QueryDisplayInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDisplayInfo *r) { PyObject *py_domain_handle; PyObject *py_level; PyObject *py_start_idx; PyObject *py_max_entries; PyObject *py_buf_size; const char *kwnames[] = { "domain_handle", "level", "start_idx", "max_entries", "buf_size", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:samr_QueryDisplayInfo", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_start_idx, &py_max_entries, &py_buf_size)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); 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; } } if (py_start_idx == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_idx"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_idx)); if (PyLong_Check(py_start_idx)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_start_idx); 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.start_idx = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_max_entries == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_entries"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_entries)); if (PyLong_Check(py_max_entries)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_max_entries); 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.max_entries = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_buf_size == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buf_size"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buf_size)); if (PyLong_Check(py_buf_size)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_buf_size); 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.buf_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_QueryDisplayInfo_args_out(struct samr_QueryDisplayInfo *r) { PyObject *result; PyObject *py_total_size; PyObject *py_returned_size; PyObject *py_info; result = PyTuple_New(3); py_total_size = PyLong_FromUnsignedLongLong((uint32_t)*r->out.total_size); PyTuple_SetItem(result, 0, py_total_size); py_returned_size = PyLong_FromUnsignedLongLong((uint32_t)*r->out.returned_size); PyTuple_SetItem(result, 1, py_returned_size); py_info = pyrpc_import_union(&samr_DispInfo_Type, r->out.info, r->in.level, r->out.info, "union samr_DispInfo"); if (py_info == NULL) { return NULL; } PyTuple_SetItem(result, 2, py_info); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_GetDisplayEnumerationIndex_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_GetDisplayEnumerationIndex_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetDisplayEnumerationIndex_in_get_level(PyObject *obj, void *closure) { struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_GetDisplayEnumerationIndex_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)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_samr_GetDisplayEnumerationIndex_in_get_name(PyObject *obj, void *closure) { struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(obj); PyObject *py_name; if (object->in.name == NULL) { Py_RETURN_NONE; } py_name = pytalloc_reference_ex(lsa_String_Type, object->in.name, object->in.name); return py_name; } static int py_samr_GetDisplayEnumerationIndex_in_set_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name"); return -1; } object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name); if (object->in.name == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_String_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.name = (struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetDisplayEnumerationIndex_out_get_idx(PyObject *obj, void *closure) { struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(obj); PyObject *py_idx; if (object->out.idx == NULL) { Py_RETURN_NONE; } py_idx = PyLong_FromUnsignedLongLong((uint32_t)*object->out.idx); return py_idx; } static int py_samr_GetDisplayEnumerationIndex_out_set_idx(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.idx)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.idx"); return -1; } object->out.idx = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.idx); if (object->out.idx == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.idx)); 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.idx = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_GetDisplayEnumerationIndex_get_result(PyObject *obj, void *closure) { struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_GetDisplayEnumerationIndex_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_GetDisplayEnumerationIndex_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_GetDisplayEnumerationIndex_in_get_domain_handle, .set = py_samr_GetDisplayEnumerationIndex_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_GetDisplayEnumerationIndex_in_get_level, .set = py_samr_GetDisplayEnumerationIndex_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_name"), .get = py_samr_GetDisplayEnumerationIndex_in_get_name, .set = py_samr_GetDisplayEnumerationIndex_in_set_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "out_idx"), .get = py_samr_GetDisplayEnumerationIndex_out_get_idx, .set = py_samr_GetDisplayEnumerationIndex_out_set_idx, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_GetDisplayEnumerationIndex_get_result, .set = py_samr_GetDisplayEnumerationIndex_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_GetDisplayEnumerationIndex_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_GetDisplayEnumerationIndex, type); struct samr_GetDisplayEnumerationIndex *_self = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.name = talloc_zero(mem_ctx, struct lsa_String); _self->out.idx = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(41); } static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 42) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDisplayEnumerationIndex_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[41]; 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_samr_GetDisplayEnumerationIndex_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_samr_GetDisplayEnumerationIndex_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_GetDisplayEnumerationIndex_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_samr_GetDisplayEnumerationIndex_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_GetDisplayEnumerationIndex_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 samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 42) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDisplayEnumerationIndex_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[41]; 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_samr_GetDisplayEnumerationIndex_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_samr_GetDisplayEnumerationIndex_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetDisplayEnumerationIndex_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_samr_GetDisplayEnumerationIndex_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 42) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDisplayEnumerationIndex_ndr_print"); return NULL; } call = &ndr_table_samr.calls[41]; 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_samr_GetDisplayEnumerationIndex_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetDisplayEnumerationIndex_ndr_print(py_obj, "samr_GetDisplayEnumerationIndex_in", NDR_IN); } static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetDisplayEnumerationIndex_ndr_print(py_obj, "samr_GetDisplayEnumerationIndex_out", NDR_OUT); } static PyMethodDef py_samr_GetDisplayEnumerationIndex_methods[] = { { "opnum", (PyCFunction)py_samr_GetDisplayEnumerationIndex_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.GetDisplayEnumerationIndex.opnum() -> 41 (0x29) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDisplayEnumerationIndex_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_samr_GetDisplayEnumerationIndex_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_samr_GetDisplayEnumerationIndex_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_samr_GetDisplayEnumerationIndex_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_samr_GetDisplayEnumerationIndex_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_GetDisplayEnumerationIndex_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_GetDisplayEnumerationIndex_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.GetDisplayEnumerationIndex", .tp_getset = py_samr_GetDisplayEnumerationIndex_getsetters, .tp_methods = py_samr_GetDisplayEnumerationIndex_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_GetDisplayEnumerationIndex_new, }; static bool pack_py_samr_GetDisplayEnumerationIndex_args_in(PyObject *args, PyObject *kwargs, struct samr_GetDisplayEnumerationIndex *r) { PyObject *py_domain_handle; PyObject *py_level; PyObject *py_name; const char *kwnames[] = { "domain_handle", "level", "name", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_GetDisplayEnumerationIndex", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_name)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); 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; } } if (py_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name"); return false; } r->in.name = talloc_ptrtype(r, r->in.name); if (r->in.name == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_String_Type, py_name, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) { PyErr_NoMemory(); return false; } r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name); return true; } static PyObject *unpack_py_samr_GetDisplayEnumerationIndex_args_out(struct samr_GetDisplayEnumerationIndex *r) { PyObject *result; PyObject *py_idx; py_idx = PyLong_FromUnsignedLongLong((uint32_t)*r->out.idx); result = py_idx; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_TestPrivateFunctionsDomain_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_TestPrivateFunctionsDomain_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_TestPrivateFunctionsDomain_get_result(PyObject *obj, void *closure) { struct samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_TestPrivateFunctionsDomain_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_TestPrivateFunctionsDomain_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_TestPrivateFunctionsDomain_in_get_domain_handle, .set = py_samr_TestPrivateFunctionsDomain_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_TestPrivateFunctionsDomain_get_result, .set = py_samr_TestPrivateFunctionsDomain_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_TestPrivateFunctionsDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_TestPrivateFunctionsDomain, type); struct samr_TestPrivateFunctionsDomain *_self = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(42); } static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 43) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_TestPrivateFunctionsDomain_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[42]; 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_samr_TestPrivateFunctionsDomain_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_samr_TestPrivateFunctionsDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_TestPrivateFunctionsDomain_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_samr_TestPrivateFunctionsDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_TestPrivateFunctionsDomain_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 samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 43) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_TestPrivateFunctionsDomain_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[42]; 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_samr_TestPrivateFunctionsDomain_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_samr_TestPrivateFunctionsDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_TestPrivateFunctionsDomain_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_samr_TestPrivateFunctionsDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 43) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_TestPrivateFunctionsDomain_ndr_print"); return NULL; } call = &ndr_table_samr.calls[42]; 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_samr_TestPrivateFunctionsDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_TestPrivateFunctionsDomain_ndr_print(py_obj, "samr_TestPrivateFunctionsDomain_in", NDR_IN); } static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_TestPrivateFunctionsDomain_ndr_print(py_obj, "samr_TestPrivateFunctionsDomain_out", NDR_OUT); } static PyMethodDef py_samr_TestPrivateFunctionsDomain_methods[] = { { "opnum", (PyCFunction)py_samr_TestPrivateFunctionsDomain_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.TestPrivateFunctionsDomain.opnum() -> 42 (0x2a) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_TestPrivateFunctionsDomain_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_samr_TestPrivateFunctionsDomain_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_samr_TestPrivateFunctionsDomain_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_samr_TestPrivateFunctionsDomain_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_samr_TestPrivateFunctionsDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_TestPrivateFunctionsDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_TestPrivateFunctionsDomain_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.TestPrivateFunctionsDomain", .tp_getset = py_samr_TestPrivateFunctionsDomain_getsetters, .tp_methods = py_samr_TestPrivateFunctionsDomain_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_TestPrivateFunctionsDomain_new, }; static bool pack_py_samr_TestPrivateFunctionsDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_TestPrivateFunctionsDomain *r) { PyObject *py_domain_handle; const char *kwnames[] = { "domain_handle", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_TestPrivateFunctionsDomain", discard_const_p(char *, kwnames), &py_domain_handle)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); return true; } static PyObject *unpack_py_samr_TestPrivateFunctionsDomain_args_out(struct samr_TestPrivateFunctionsDomain *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_TestPrivateFunctionsUser_in_get_user_handle(PyObject *obj, void *closure) { struct samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(obj); PyObject *py_user_handle; if (object->in.user_handle == NULL) { Py_RETURN_NONE; } py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle); return py_user_handle; } static int py_samr_TestPrivateFunctionsUser_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle"); return -1; } object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle); if (object->in.user_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.user_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_TestPrivateFunctionsUser_get_result(PyObject *obj, void *closure) { struct samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_TestPrivateFunctionsUser_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_TestPrivateFunctionsUser_getsetters[] = { { .name = discard_const_p(char, "in_user_handle"), .get = py_samr_TestPrivateFunctionsUser_in_get_user_handle, .set = py_samr_TestPrivateFunctionsUser_in_set_user_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_TestPrivateFunctionsUser_get_result, .set = py_samr_TestPrivateFunctionsUser_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_TestPrivateFunctionsUser_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_TestPrivateFunctionsUser, type); struct samr_TestPrivateFunctionsUser *_self = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_TestPrivateFunctionsUser_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(43); } static PyObject *py_samr_TestPrivateFunctionsUser_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 44) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_TestPrivateFunctionsUser_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[43]; 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_samr_TestPrivateFunctionsUser_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_samr_TestPrivateFunctionsUser_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_TestPrivateFunctionsUser_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_samr_TestPrivateFunctionsUser_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_TestPrivateFunctionsUser_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 samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 44) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_TestPrivateFunctionsUser_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[43]; 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_samr_TestPrivateFunctionsUser_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_samr_TestPrivateFunctionsUser_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_TestPrivateFunctionsUser_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_samr_TestPrivateFunctionsUser_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_TestPrivateFunctionsUser_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 44) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_TestPrivateFunctionsUser_ndr_print"); return NULL; } call = &ndr_table_samr.calls[43]; 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_samr_TestPrivateFunctionsUser_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_TestPrivateFunctionsUser_ndr_print(py_obj, "samr_TestPrivateFunctionsUser_in", NDR_IN); } static PyObject *py_samr_TestPrivateFunctionsUser_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_TestPrivateFunctionsUser_ndr_print(py_obj, "samr_TestPrivateFunctionsUser_out", NDR_OUT); } static PyMethodDef py_samr_TestPrivateFunctionsUser_methods[] = { { "opnum", (PyCFunction)py_samr_TestPrivateFunctionsUser_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.TestPrivateFunctionsUser.opnum() -> 43 (0x2b) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_TestPrivateFunctionsUser_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_samr_TestPrivateFunctionsUser_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_samr_TestPrivateFunctionsUser_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_samr_TestPrivateFunctionsUser_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_samr_TestPrivateFunctionsUser_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_TestPrivateFunctionsUser_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_TestPrivateFunctionsUser_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.TestPrivateFunctionsUser", .tp_getset = py_samr_TestPrivateFunctionsUser_getsetters, .tp_methods = py_samr_TestPrivateFunctionsUser_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_TestPrivateFunctionsUser_new, }; static bool pack_py_samr_TestPrivateFunctionsUser_args_in(PyObject *args, PyObject *kwargs, struct samr_TestPrivateFunctionsUser *r) { PyObject *py_user_handle; const char *kwnames[] = { "user_handle", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_TestPrivateFunctionsUser", discard_const_p(char *, kwnames), &py_user_handle)) { return false; } if (py_user_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle"); return false; } r->in.user_handle = talloc_ptrtype(r, r->in.user_handle); if (r->in.user_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle); return true; } static PyObject *unpack_py_samr_TestPrivateFunctionsUser_args_out(struct samr_TestPrivateFunctionsUser *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_GetUserPwInfo_in_get_user_handle(PyObject *obj, void *closure) { struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(obj); PyObject *py_user_handle; if (object->in.user_handle == NULL) { Py_RETURN_NONE; } py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle); return py_user_handle; } static int py_samr_GetUserPwInfo_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle"); return -1; } object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle); if (object->in.user_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.user_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetUserPwInfo_out_get_info(PyObject *obj, void *closure) { struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } py_info = pytalloc_reference_ex(&samr_PwInfo_Type, object->out.info, object->out.info); return py_info; } static int py_samr_GetUserPwInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info"); return -1; } object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info); if (object->out.info == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&samr_PwInfo_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.info = (struct samr_PwInfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetUserPwInfo_get_result(PyObject *obj, void *closure) { struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_GetUserPwInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_GetUserPwInfo_getsetters[] = { { .name = discard_const_p(char, "in_user_handle"), .get = py_samr_GetUserPwInfo_in_get_user_handle, .set = py_samr_GetUserPwInfo_in_set_user_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "out_info"), .get = py_samr_GetUserPwInfo_out_get_info, .set = py_samr_GetUserPwInfo_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_PwInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_GetUserPwInfo_get_result, .set = py_samr_GetUserPwInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_GetUserPwInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_GetUserPwInfo, type); struct samr_GetUserPwInfo *_self = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.info = talloc_zero(mem_ctx, struct samr_PwInfo); return self; } static PyObject *py_samr_GetUserPwInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(44); } static PyObject *py_samr_GetUserPwInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 45) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetUserPwInfo_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[44]; 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_samr_GetUserPwInfo_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_samr_GetUserPwInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_GetUserPwInfo_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_samr_GetUserPwInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_GetUserPwInfo_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 samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 45) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetUserPwInfo_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[44]; 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_samr_GetUserPwInfo_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_samr_GetUserPwInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetUserPwInfo_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_samr_GetUserPwInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetUserPwInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 45) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetUserPwInfo_ndr_print"); return NULL; } call = &ndr_table_samr.calls[44]; 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_samr_GetUserPwInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetUserPwInfo_ndr_print(py_obj, "samr_GetUserPwInfo_in", NDR_IN); } static PyObject *py_samr_GetUserPwInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetUserPwInfo_ndr_print(py_obj, "samr_GetUserPwInfo_out", NDR_OUT); } static PyMethodDef py_samr_GetUserPwInfo_methods[] = { { "opnum", (PyCFunction)py_samr_GetUserPwInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.GetUserPwInfo.opnum() -> 44 (0x2c) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetUserPwInfo_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_samr_GetUserPwInfo_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_samr_GetUserPwInfo_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_samr_GetUserPwInfo_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_samr_GetUserPwInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_GetUserPwInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_GetUserPwInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.GetUserPwInfo", .tp_getset = py_samr_GetUserPwInfo_getsetters, .tp_methods = py_samr_GetUserPwInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_GetUserPwInfo_new, }; static bool pack_py_samr_GetUserPwInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_GetUserPwInfo *r) { PyObject *py_user_handle; const char *kwnames[] = { "user_handle", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetUserPwInfo", discard_const_p(char *, kwnames), &py_user_handle)) { return false; } if (py_user_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle"); return false; } r->in.user_handle = talloc_ptrtype(r, r->in.user_handle); if (r->in.user_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle); return true; } static PyObject *unpack_py_samr_GetUserPwInfo_args_out(struct samr_GetUserPwInfo *r) { PyObject *result; PyObject *py_info; py_info = pytalloc_reference_ex(&samr_PwInfo_Type, r->out.info, r->out.info); result = py_info; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_RemoveMemberFromForeignDomain_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_RemoveMemberFromForeignDomain_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_RemoveMemberFromForeignDomain_in_get_sid(PyObject *obj, void *closure) { struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(obj); PyObject *py_sid; if (object->in.sid == NULL) { Py_RETURN_NONE; } py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid); return py_sid; } static int py_samr_RemoveMemberFromForeignDomain_in_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid"); return -1; } object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid); if (object->in.sid == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(dom_sid_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.sid = (struct dom_sid *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_RemoveMemberFromForeignDomain_get_result(PyObject *obj, void *closure) { struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_RemoveMemberFromForeignDomain_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_RemoveMemberFromForeignDomain_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_RemoveMemberFromForeignDomain_in_get_domain_handle, .set = py_samr_RemoveMemberFromForeignDomain_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_sid"), .get = py_samr_RemoveMemberFromForeignDomain_in_get_sid, .set = py_samr_RemoveMemberFromForeignDomain_in_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2") }, { .name = discard_const_p(char, "result"), .get = py_samr_RemoveMemberFromForeignDomain_get_result, .set = py_samr_RemoveMemberFromForeignDomain_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_RemoveMemberFromForeignDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_RemoveMemberFromForeignDomain, type); struct samr_RemoveMemberFromForeignDomain *_self = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2); return self; } static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(45); } static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 46) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RemoveMemberFromForeignDomain_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[45]; 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_samr_RemoveMemberFromForeignDomain_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_samr_RemoveMemberFromForeignDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_RemoveMemberFromForeignDomain_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_samr_RemoveMemberFromForeignDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_RemoveMemberFromForeignDomain_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 samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 46) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RemoveMemberFromForeignDomain_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[45]; 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_samr_RemoveMemberFromForeignDomain_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_samr_RemoveMemberFromForeignDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_RemoveMemberFromForeignDomain_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_samr_RemoveMemberFromForeignDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 46) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RemoveMemberFromForeignDomain_ndr_print"); return NULL; } call = &ndr_table_samr.calls[45]; 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_samr_RemoveMemberFromForeignDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_RemoveMemberFromForeignDomain_ndr_print(py_obj, "samr_RemoveMemberFromForeignDomain_in", NDR_IN); } static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_RemoveMemberFromForeignDomain_ndr_print(py_obj, "samr_RemoveMemberFromForeignDomain_out", NDR_OUT); } static PyMethodDef py_samr_RemoveMemberFromForeignDomain_methods[] = { { "opnum", (PyCFunction)py_samr_RemoveMemberFromForeignDomain_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.RemoveMemberFromForeignDomain.opnum() -> 45 (0x2d) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RemoveMemberFromForeignDomain_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_samr_RemoveMemberFromForeignDomain_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_samr_RemoveMemberFromForeignDomain_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_samr_RemoveMemberFromForeignDomain_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_samr_RemoveMemberFromForeignDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_RemoveMemberFromForeignDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_RemoveMemberFromForeignDomain_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.RemoveMemberFromForeignDomain", .tp_getset = py_samr_RemoveMemberFromForeignDomain_getsetters, .tp_methods = py_samr_RemoveMemberFromForeignDomain_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_RemoveMemberFromForeignDomain_new, }; static bool pack_py_samr_RemoveMemberFromForeignDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_RemoveMemberFromForeignDomain *r) { PyObject *py_domain_handle; PyObject *py_sid; const char *kwnames[] = { "domain_handle", "sid", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_RemoveMemberFromForeignDomain", discard_const_p(char *, kwnames), &py_domain_handle, &py_sid)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); if (py_sid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid"); return false; } r->in.sid = talloc_ptrtype(r, r->in.sid); if (r->in.sid == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) { PyErr_NoMemory(); return false; } r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid); return true; } static PyObject *unpack_py_samr_RemoveMemberFromForeignDomain_args_out(struct samr_RemoveMemberFromForeignDomain *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_QueryDomainInfo2_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_QueryDomainInfo2_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_QueryDomainInfo2_in_get_level(PyObject *obj, void *closure) { struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_QueryDomainInfo2_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)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_samr_QueryDomainInfo2_out_get_info(PyObject *obj, void *closure) { struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } if (*object->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pyrpc_import_union(&samr_DomainInfo_Type, *object->out.info, object->in.level, *object->out.info, "union samr_DomainInfo"); if (py_info == NULL) { return NULL; } } return py_info; } static int py_samr_QueryDomainInfo2_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info"); return -1; } object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info); if (object->out.info == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.info = NULL; } else { *object->out.info = NULL; { union samr_DomainInfo *info_switch_2; info_switch_2 = (union samr_DomainInfo *)pyrpc_export_union(&samr_DomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_DomainInfo"); if (info_switch_2 == NULL) { return -1; } *object->out.info = info_switch_2; } } return 0; } static PyObject *py_samr_QueryDomainInfo2_get_result(PyObject *obj, void *closure) { struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_QueryDomainInfo2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_QueryDomainInfo2_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_QueryDomainInfo2_in_get_domain_handle, .set = py_samr_QueryDomainInfo2_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_QueryDomainInfo2_in_get_level, .set = py_samr_QueryDomainInfo2_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainInfoClass") }, { .name = discard_const_p(char, "out_info"), .get = py_samr_QueryDomainInfo2_out_get_info, .set = py_samr_QueryDomainInfo2_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_QueryDomainInfo2_get_result, .set = py_samr_QueryDomainInfo2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_QueryDomainInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_QueryDomainInfo2, type); struct samr_QueryDomainInfo2 *_self = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); /* a pointer to a NULL pointer */ _self->out.info = talloc_zero(mem_ctx, union samr_DomainInfo *); return self; } static PyObject *py_samr_QueryDomainInfo2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(46); } static PyObject *py_samr_QueryDomainInfo2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 47) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDomainInfo2_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[46]; 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_samr_QueryDomainInfo2_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_samr_QueryDomainInfo2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_QueryDomainInfo2_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_samr_QueryDomainInfo2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_QueryDomainInfo2_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 samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 47) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDomainInfo2_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[46]; 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_samr_QueryDomainInfo2_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_samr_QueryDomainInfo2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryDomainInfo2_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_samr_QueryDomainInfo2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryDomainInfo2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 47) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDomainInfo2_ndr_print"); return NULL; } call = &ndr_table_samr.calls[46]; 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_samr_QueryDomainInfo2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryDomainInfo2_ndr_print(py_obj, "samr_QueryDomainInfo2_in", NDR_IN); } static PyObject *py_samr_QueryDomainInfo2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryDomainInfo2_ndr_print(py_obj, "samr_QueryDomainInfo2_out", NDR_OUT); } static PyMethodDef py_samr_QueryDomainInfo2_methods[] = { { "opnum", (PyCFunction)py_samr_QueryDomainInfo2_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.QueryDomainInfo2.opnum() -> 46 (0x2e) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDomainInfo2_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_samr_QueryDomainInfo2_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_samr_QueryDomainInfo2_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_samr_QueryDomainInfo2_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_samr_QueryDomainInfo2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_QueryDomainInfo2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_QueryDomainInfo2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.QueryDomainInfo2", .tp_getset = py_samr_QueryDomainInfo2_getsetters, .tp_methods = py_samr_QueryDomainInfo2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_QueryDomainInfo2_new, }; static bool pack_py_samr_QueryDomainInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDomainInfo2 *r) { PyObject *py_domain_handle; PyObject *py_level; const char *kwnames[] = { "domain_handle", "level", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryDomainInfo2", discard_const_p(char *, kwnames), &py_domain_handle, &py_level)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); 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_samr_QueryDomainInfo2_args_out(struct samr_QueryDomainInfo2 *r) { PyObject *result; PyObject *py_info; if (*r->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pyrpc_import_union(&samr_DomainInfo_Type, *r->out.info, r->in.level, *r->out.info, "union samr_DomainInfo"); if (py_info == NULL) { return NULL; } } result = py_info; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_QueryUserInfo2_in_get_user_handle(PyObject *obj, void *closure) { struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(obj); PyObject *py_user_handle; if (object->in.user_handle == NULL) { Py_RETURN_NONE; } py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle); return py_user_handle; } static int py_samr_QueryUserInfo2_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle"); return -1; } object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle); if (object->in.user_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.user_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_QueryUserInfo2_in_get_level(PyObject *obj, void *closure) { struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_QueryUserInfo2_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)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_samr_QueryUserInfo2_out_get_info(PyObject *obj, void *closure) { struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } if (*object->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pyrpc_import_union(&samr_UserInfo_Type, *object->out.info, object->in.level, *object->out.info, "union samr_UserInfo"); if (py_info == NULL) { return NULL; } } return py_info; } static int py_samr_QueryUserInfo2_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info"); return -1; } object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info); if (object->out.info == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.info = NULL; } else { *object->out.info = NULL; { union samr_UserInfo *info_switch_2; info_switch_2 = (union samr_UserInfo *)pyrpc_export_union(&samr_UserInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_UserInfo"); if (info_switch_2 == NULL) { return -1; } *object->out.info = info_switch_2; } } return 0; } static PyObject *py_samr_QueryUserInfo2_get_result(PyObject *obj, void *closure) { struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_QueryUserInfo2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_QueryUserInfo2_getsetters[] = { { .name = discard_const_p(char, "in_user_handle"), .get = py_samr_QueryUserInfo2_in_get_user_handle, .set = py_samr_QueryUserInfo2_in_set_user_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_QueryUserInfo2_in_get_level, .set = py_samr_QueryUserInfo2_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfoLevel") }, { .name = discard_const_p(char, "out_info"), .get = py_samr_QueryUserInfo2_out_get_info, .set = py_samr_QueryUserInfo2_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_QueryUserInfo2_get_result, .set = py_samr_QueryUserInfo2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_QueryUserInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_QueryUserInfo2, type); struct samr_QueryUserInfo2 *_self = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle); /* a pointer to a NULL pointer */ _self->out.info = talloc_zero(mem_ctx, union samr_UserInfo *); return self; } static PyObject *py_samr_QueryUserInfo2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(47); } static PyObject *py_samr_QueryUserInfo2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 48) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryUserInfo2_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[47]; 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_samr_QueryUserInfo2_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_samr_QueryUserInfo2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_QueryUserInfo2_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_samr_QueryUserInfo2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_QueryUserInfo2_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 samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 48) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryUserInfo2_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[47]; 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_samr_QueryUserInfo2_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_samr_QueryUserInfo2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryUserInfo2_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_samr_QueryUserInfo2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryUserInfo2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 48) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryUserInfo2_ndr_print"); return NULL; } call = &ndr_table_samr.calls[47]; 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_samr_QueryUserInfo2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryUserInfo2_ndr_print(py_obj, "samr_QueryUserInfo2_in", NDR_IN); } static PyObject *py_samr_QueryUserInfo2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryUserInfo2_ndr_print(py_obj, "samr_QueryUserInfo2_out", NDR_OUT); } static PyMethodDef py_samr_QueryUserInfo2_methods[] = { { "opnum", (PyCFunction)py_samr_QueryUserInfo2_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.QueryUserInfo2.opnum() -> 47 (0x2f) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryUserInfo2_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_samr_QueryUserInfo2_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_samr_QueryUserInfo2_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_samr_QueryUserInfo2_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_samr_QueryUserInfo2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_QueryUserInfo2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_QueryUserInfo2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.QueryUserInfo2", .tp_getset = py_samr_QueryUserInfo2_getsetters, .tp_methods = py_samr_QueryUserInfo2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_QueryUserInfo2_new, }; static bool pack_py_samr_QueryUserInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryUserInfo2 *r) { PyObject *py_user_handle; PyObject *py_level; const char *kwnames[] = { "user_handle", "level", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryUserInfo2", discard_const_p(char *, kwnames), &py_user_handle, &py_level)) { return false; } if (py_user_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle"); return false; } r->in.user_handle = talloc_ptrtype(r, r->in.user_handle); if (r->in.user_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle); 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_samr_QueryUserInfo2_args_out(struct samr_QueryUserInfo2 *r) { PyObject *result; PyObject *py_info; if (*r->out.info == NULL) { py_info = Py_None; Py_INCREF(py_info); } else { py_info = pyrpc_import_union(&samr_UserInfo_Type, *r->out.info, r->in.level, *r->out.info, "union samr_UserInfo"); if (py_info == NULL) { return NULL; } } result = py_info; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_QueryDisplayInfo2_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_QueryDisplayInfo2_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_QueryDisplayInfo2_in_get_level(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_QueryDisplayInfo2_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)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_samr_QueryDisplayInfo2_in_get_start_idx(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj); PyObject *py_start_idx; py_start_idx = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_idx); return py_start_idx; } static int py_samr_QueryDisplayInfo2_in_set_start_idx(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_idx"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_idx)); 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.start_idx = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo2_in_get_max_entries(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj); PyObject *py_max_entries; py_max_entries = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_entries); return py_max_entries; } static int py_samr_QueryDisplayInfo2_in_set_max_entries(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_entries"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_entries)); 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.max_entries = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo2_in_get_buf_size(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj); PyObject *py_buf_size; py_buf_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.buf_size); return py_buf_size; } static int py_samr_QueryDisplayInfo2_in_set_buf_size(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buf_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buf_size)); 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.buf_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo2_out_get_total_size(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj); PyObject *py_total_size; if (object->out.total_size == NULL) { Py_RETURN_NONE; } py_total_size = PyLong_FromUnsignedLongLong((uint32_t)*object->out.total_size); return py_total_size; } static int py_samr_QueryDisplayInfo2_out_set_total_size(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.total_size)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.total_size"); return -1; } object->out.total_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.total_size); if (object->out.total_size == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.total_size)); 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.total_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo2_out_get_returned_size(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj); PyObject *py_returned_size; if (object->out.returned_size == NULL) { Py_RETURN_NONE; } py_returned_size = PyLong_FromUnsignedLongLong((uint32_t)*object->out.returned_size); return py_returned_size; } static int py_samr_QueryDisplayInfo2_out_set_returned_size(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.returned_size)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.returned_size"); return -1; } object->out.returned_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.returned_size); if (object->out.returned_size == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.returned_size)); 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.returned_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo2_out_get_info(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } py_info = pyrpc_import_union(&samr_DispInfo_Type, object->out.info, object->in.level, object->out.info, "union samr_DispInfo"); if (py_info == NULL) { return NULL; } return py_info; } static int py_samr_QueryDisplayInfo2_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info"); return -1; } object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info); if (object->out.info == NULL) { PyErr_NoMemory(); return -1; } { union samr_DispInfo *info_switch_1; info_switch_1 = (union samr_DispInfo *)pyrpc_export_union(&samr_DispInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_DispInfo"); if (info_switch_1 == NULL) { return -1; } object->out.info = info_switch_1; } return 0; } static PyObject *py_samr_QueryDisplayInfo2_get_result(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_QueryDisplayInfo2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_QueryDisplayInfo2_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_QueryDisplayInfo2_in_get_domain_handle, .set = py_samr_QueryDisplayInfo2_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_QueryDisplayInfo2_in_get_level, .set = py_samr_QueryDisplayInfo2_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_start_idx"), .get = py_samr_QueryDisplayInfo2_in_get_start_idx, .set = py_samr_QueryDisplayInfo2_in_set_start_idx, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_max_entries"), .get = py_samr_QueryDisplayInfo2_in_get_max_entries, .set = py_samr_QueryDisplayInfo2_in_set_max_entries, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_buf_size"), .get = py_samr_QueryDisplayInfo2_in_get_buf_size, .set = py_samr_QueryDisplayInfo2_in_set_buf_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_total_size"), .get = py_samr_QueryDisplayInfo2_out_get_total_size, .set = py_samr_QueryDisplayInfo2_out_set_total_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_returned_size"), .get = py_samr_QueryDisplayInfo2_out_get_returned_size, .set = py_samr_QueryDisplayInfo2_out_set_returned_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_info"), .get = py_samr_QueryDisplayInfo2_out_get_info, .set = py_samr_QueryDisplayInfo2_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_QueryDisplayInfo2_get_result, .set = py_samr_QueryDisplayInfo2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_QueryDisplayInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_QueryDisplayInfo2, type); struct samr_QueryDisplayInfo2 *_self = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.total_size = talloc_zero(mem_ctx, uint32_t); _self->out.returned_size = talloc_zero(mem_ctx, uint32_t); _self->out.info = talloc_zero(mem_ctx, union samr_DispInfo); return self; } static PyObject *py_samr_QueryDisplayInfo2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(48); } static PyObject *py_samr_QueryDisplayInfo2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 49) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo2_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[48]; 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_samr_QueryDisplayInfo2_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_samr_QueryDisplayInfo2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_QueryDisplayInfo2_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_samr_QueryDisplayInfo2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_QueryDisplayInfo2_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 samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 49) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo2_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[48]; 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_samr_QueryDisplayInfo2_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_samr_QueryDisplayInfo2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryDisplayInfo2_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_samr_QueryDisplayInfo2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryDisplayInfo2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 49) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo2_ndr_print"); return NULL; } call = &ndr_table_samr.calls[48]; 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_samr_QueryDisplayInfo2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryDisplayInfo2_ndr_print(py_obj, "samr_QueryDisplayInfo2_in", NDR_IN); } static PyObject *py_samr_QueryDisplayInfo2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryDisplayInfo2_ndr_print(py_obj, "samr_QueryDisplayInfo2_out", NDR_OUT); } static PyMethodDef py_samr_QueryDisplayInfo2_methods[] = { { "opnum", (PyCFunction)py_samr_QueryDisplayInfo2_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.QueryDisplayInfo2.opnum() -> 48 (0x30) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo2_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_samr_QueryDisplayInfo2_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_samr_QueryDisplayInfo2_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_samr_QueryDisplayInfo2_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_samr_QueryDisplayInfo2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_QueryDisplayInfo2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_QueryDisplayInfo2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.QueryDisplayInfo2", .tp_getset = py_samr_QueryDisplayInfo2_getsetters, .tp_methods = py_samr_QueryDisplayInfo2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_QueryDisplayInfo2_new, }; static bool pack_py_samr_QueryDisplayInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDisplayInfo2 *r) { PyObject *py_domain_handle; PyObject *py_level; PyObject *py_start_idx; PyObject *py_max_entries; PyObject *py_buf_size; const char *kwnames[] = { "domain_handle", "level", "start_idx", "max_entries", "buf_size", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:samr_QueryDisplayInfo2", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_start_idx, &py_max_entries, &py_buf_size)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); 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; } } if (py_start_idx == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_idx"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_idx)); if (PyLong_Check(py_start_idx)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_start_idx); 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.start_idx = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_max_entries == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_entries"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_entries)); if (PyLong_Check(py_max_entries)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_max_entries); 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.max_entries = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_buf_size == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buf_size"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buf_size)); if (PyLong_Check(py_buf_size)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_buf_size); 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.buf_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_QueryDisplayInfo2_args_out(struct samr_QueryDisplayInfo2 *r) { PyObject *result; PyObject *py_total_size; PyObject *py_returned_size; PyObject *py_info; result = PyTuple_New(3); py_total_size = PyLong_FromUnsignedLongLong((uint32_t)*r->out.total_size); PyTuple_SetItem(result, 0, py_total_size); py_returned_size = PyLong_FromUnsignedLongLong((uint32_t)*r->out.returned_size); PyTuple_SetItem(result, 1, py_returned_size); py_info = pyrpc_import_union(&samr_DispInfo_Type, r->out.info, r->in.level, r->out.info, "union samr_DispInfo"); if (py_info == NULL) { return NULL; } PyTuple_SetItem(result, 2, py_info); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_GetDisplayEnumerationIndex2_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_GetDisplayEnumerationIndex2_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetDisplayEnumerationIndex2_in_get_level(PyObject *obj, void *closure) { struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_GetDisplayEnumerationIndex2_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)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_samr_GetDisplayEnumerationIndex2_in_get_name(PyObject *obj, void *closure) { struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(obj); PyObject *py_name; if (object->in.name == NULL) { Py_RETURN_NONE; } py_name = pytalloc_reference_ex(lsa_String_Type, object->in.name, object->in.name); return py_name; } static int py_samr_GetDisplayEnumerationIndex2_in_set_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name"); return -1; } object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name); if (object->in.name == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_String_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.name = (struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetDisplayEnumerationIndex2_out_get_idx(PyObject *obj, void *closure) { struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(obj); PyObject *py_idx; if (object->out.idx == NULL) { Py_RETURN_NONE; } py_idx = PyLong_FromUnsignedLongLong((uint32_t)*object->out.idx); return py_idx; } static int py_samr_GetDisplayEnumerationIndex2_out_set_idx(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.idx)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.idx"); return -1; } object->out.idx = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.idx); if (object->out.idx == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.idx)); 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.idx = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_GetDisplayEnumerationIndex2_get_result(PyObject *obj, void *closure) { struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_GetDisplayEnumerationIndex2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_GetDisplayEnumerationIndex2_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_GetDisplayEnumerationIndex2_in_get_domain_handle, .set = py_samr_GetDisplayEnumerationIndex2_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_GetDisplayEnumerationIndex2_in_get_level, .set = py_samr_GetDisplayEnumerationIndex2_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_name"), .get = py_samr_GetDisplayEnumerationIndex2_in_get_name, .set = py_samr_GetDisplayEnumerationIndex2_in_set_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "out_idx"), .get = py_samr_GetDisplayEnumerationIndex2_out_get_idx, .set = py_samr_GetDisplayEnumerationIndex2_out_set_idx, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_GetDisplayEnumerationIndex2_get_result, .set = py_samr_GetDisplayEnumerationIndex2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_GetDisplayEnumerationIndex2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_GetDisplayEnumerationIndex2, type); struct samr_GetDisplayEnumerationIndex2 *_self = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.name = talloc_zero(mem_ctx, struct lsa_String); _self->out.idx = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(49); } static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 50) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDisplayEnumerationIndex2_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[49]; 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_samr_GetDisplayEnumerationIndex2_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_samr_GetDisplayEnumerationIndex2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_GetDisplayEnumerationIndex2_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_samr_GetDisplayEnumerationIndex2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_GetDisplayEnumerationIndex2_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 samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 50) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDisplayEnumerationIndex2_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[49]; 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_samr_GetDisplayEnumerationIndex2_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_samr_GetDisplayEnumerationIndex2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetDisplayEnumerationIndex2_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_samr_GetDisplayEnumerationIndex2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 50) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDisplayEnumerationIndex2_ndr_print"); return NULL; } call = &ndr_table_samr.calls[49]; 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_samr_GetDisplayEnumerationIndex2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetDisplayEnumerationIndex2_ndr_print(py_obj, "samr_GetDisplayEnumerationIndex2_in", NDR_IN); } static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetDisplayEnumerationIndex2_ndr_print(py_obj, "samr_GetDisplayEnumerationIndex2_out", NDR_OUT); } static PyMethodDef py_samr_GetDisplayEnumerationIndex2_methods[] = { { "opnum", (PyCFunction)py_samr_GetDisplayEnumerationIndex2_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.GetDisplayEnumerationIndex2.opnum() -> 49 (0x31) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDisplayEnumerationIndex2_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_samr_GetDisplayEnumerationIndex2_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_samr_GetDisplayEnumerationIndex2_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_samr_GetDisplayEnumerationIndex2_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_samr_GetDisplayEnumerationIndex2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_GetDisplayEnumerationIndex2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_GetDisplayEnumerationIndex2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.GetDisplayEnumerationIndex2", .tp_getset = py_samr_GetDisplayEnumerationIndex2_getsetters, .tp_methods = py_samr_GetDisplayEnumerationIndex2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_GetDisplayEnumerationIndex2_new, }; static bool pack_py_samr_GetDisplayEnumerationIndex2_args_in(PyObject *args, PyObject *kwargs, struct samr_GetDisplayEnumerationIndex2 *r) { PyObject *py_domain_handle; PyObject *py_level; PyObject *py_name; const char *kwnames[] = { "domain_handle", "level", "name", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_GetDisplayEnumerationIndex2", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_name)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); 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; } } if (py_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name"); return false; } r->in.name = talloc_ptrtype(r, r->in.name); if (r->in.name == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_String_Type, py_name, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) { PyErr_NoMemory(); return false; } r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name); return true; } static PyObject *unpack_py_samr_GetDisplayEnumerationIndex2_args_out(struct samr_GetDisplayEnumerationIndex2 *r) { PyObject *result; PyObject *py_idx; py_idx = PyLong_FromUnsignedLongLong((uint32_t)*r->out.idx); result = py_idx; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_CreateUser2_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_CreateUser2_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_CreateUser2_in_get_account_name(PyObject *obj, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj); PyObject *py_account_name; if (object->in.account_name == NULL) { Py_RETURN_NONE; } py_account_name = pytalloc_reference_ex(lsa_String_Type, object->in.account_name, object->in.account_name); return py_account_name; } static int py_samr_CreateUser2_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account_name)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name"); return -1; } object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name); if (object->in.account_name == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_String_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.account_name = (struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_CreateUser2_in_get_acct_flags(PyObject *obj, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj); PyObject *py_acct_flags; py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.acct_flags); return py_acct_flags; } static int py_samr_CreateUser2_in_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.acct_flags"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.acct_flags)); 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.acct_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_CreateUser2_in_get_access_mask(PyObject *obj, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj); PyObject *py_access_mask; py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask); return py_access_mask; } static int py_samr_CreateUser2_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask)); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_CreateUser2_out_get_user_handle(PyObject *obj, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj); PyObject *py_user_handle; if (object->out.user_handle == NULL) { Py_RETURN_NONE; } py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->out.user_handle, object->out.user_handle); return py_user_handle; } static int py_samr_CreateUser2_out_set_user_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.user_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.user_handle"); return -1; } object->out.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.user_handle); if (object->out.user_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.user_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_CreateUser2_out_get_access_granted(PyObject *obj, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj); PyObject *py_access_granted; if (object->out.access_granted == NULL) { Py_RETURN_NONE; } py_access_granted = PyLong_FromUnsignedLongLong((uint32_t)*object->out.access_granted); return py_access_granted; } static int py_samr_CreateUser2_out_set_access_granted(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.access_granted)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.access_granted"); return -1; } object->out.access_granted = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.access_granted); if (object->out.access_granted == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.access_granted)); 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.access_granted = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_CreateUser2_out_get_rid(PyObject *obj, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj); PyObject *py_rid; if (object->out.rid == NULL) { Py_RETURN_NONE; } py_rid = PyLong_FromUnsignedLongLong((uint32_t)*object->out.rid); return py_rid; } static int py_samr_CreateUser2_out_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rid"); return -1; } object->out.rid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rid); if (object->out.rid == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.rid)); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_CreateUser2_get_result(PyObject *obj, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_CreateUser2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_CreateUser2_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_CreateUser2_in_get_domain_handle, .set = py_samr_CreateUser2_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_account_name"), .get = py_samr_CreateUser2_in_get_account_name, .set = py_samr_CreateUser2_in_set_account_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "in_acct_flags"), .get = py_samr_CreateUser2_in_get_acct_flags, .set = py_samr_CreateUser2_in_set_acct_flags, .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags") }, { .name = discard_const_p(char, "in_access_mask"), .get = py_samr_CreateUser2_in_get_access_mask, .set = py_samr_CreateUser2_in_set_access_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserAccessMask") }, { .name = discard_const_p(char, "out_user_handle"), .get = py_samr_CreateUser2_out_get_user_handle, .set = py_samr_CreateUser2_out_set_user_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "out_access_granted"), .get = py_samr_CreateUser2_out_get_access_granted, .set = py_samr_CreateUser2_out_set_access_granted, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_rid"), .get = py_samr_CreateUser2_out_get_rid, .set = py_samr_CreateUser2_out_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_CreateUser2_get_result, .set = py_samr_CreateUser2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_CreateUser2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_CreateUser2, type); struct samr_CreateUser2 *_self = (struct samr_CreateUser2 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.account_name = talloc_zero(mem_ctx, struct lsa_String); _self->out.user_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.access_granted = talloc_zero(mem_ctx, uint32_t); _self->out.rid = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_samr_CreateUser2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(50); } static PyObject *py_samr_CreateUser2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 51) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateUser2_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[50]; 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_samr_CreateUser2_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_samr_CreateUser2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_CreateUser2_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_samr_CreateUser2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_CreateUser2_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 samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 51) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateUser2_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[50]; 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_samr_CreateUser2_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_samr_CreateUser2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_CreateUser2_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_samr_CreateUser2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_CreateUser2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 51) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateUser2_ndr_print"); return NULL; } call = &ndr_table_samr.calls[50]; 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_samr_CreateUser2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_CreateUser2_ndr_print(py_obj, "samr_CreateUser2_in", NDR_IN); } static PyObject *py_samr_CreateUser2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_CreateUser2_ndr_print(py_obj, "samr_CreateUser2_out", NDR_OUT); } static PyMethodDef py_samr_CreateUser2_methods[] = { { "opnum", (PyCFunction)py_samr_CreateUser2_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.CreateUser2.opnum() -> 50 (0x32) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateUser2_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_samr_CreateUser2_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_samr_CreateUser2_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_samr_CreateUser2_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_samr_CreateUser2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_CreateUser2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_CreateUser2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.CreateUser2", .tp_getset = py_samr_CreateUser2_getsetters, .tp_methods = py_samr_CreateUser2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_CreateUser2_new, }; static bool pack_py_samr_CreateUser2_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateUser2 *r) { PyObject *py_domain_handle; PyObject *py_account_name; PyObject *py_acct_flags; PyObject *py_access_mask; const char *kwnames[] = { "domain_handle", "account_name", "acct_flags", "access_mask", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_CreateUser2", discard_const_p(char *, kwnames), &py_domain_handle, &py_account_name, &py_acct_flags, &py_access_mask)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); if (py_account_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name"); return false; } r->in.account_name = talloc_ptrtype(r, r->in.account_name); if (r->in.account_name == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_String_Type, py_account_name, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_account_name)) == NULL) { PyErr_NoMemory(); return false; } r->in.account_name = (struct lsa_String *)pytalloc_get_ptr(py_account_name); if (py_acct_flags == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.acct_flags"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.acct_flags)); if (PyLong_Check(py_acct_flags)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_acct_flags); 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.acct_flags = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_access_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask)); if (PyLong_Check(py_access_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_access_mask); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_CreateUser2_args_out(struct samr_CreateUser2 *r) { PyObject *result; PyObject *py_user_handle; PyObject *py_access_granted; PyObject *py_rid; result = PyTuple_New(3); py_user_handle = pytalloc_reference_ex(policy_handle_Type, r->out.user_handle, r->out.user_handle); PyTuple_SetItem(result, 0, py_user_handle); py_access_granted = PyLong_FromUnsignedLongLong((uint32_t)*r->out.access_granted); PyTuple_SetItem(result, 1, py_access_granted); py_rid = PyLong_FromUnsignedLongLong((uint32_t)*r->out.rid); PyTuple_SetItem(result, 2, py_rid); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_QueryDisplayInfo3_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_QueryDisplayInfo3_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_QueryDisplayInfo3_in_get_level(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_QueryDisplayInfo3_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)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_samr_QueryDisplayInfo3_in_get_start_idx(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj); PyObject *py_start_idx; py_start_idx = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_idx); return py_start_idx; } static int py_samr_QueryDisplayInfo3_in_set_start_idx(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_idx"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_idx)); 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.start_idx = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo3_in_get_max_entries(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj); PyObject *py_max_entries; py_max_entries = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_entries); return py_max_entries; } static int py_samr_QueryDisplayInfo3_in_set_max_entries(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_entries"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_entries)); 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.max_entries = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo3_in_get_buf_size(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj); PyObject *py_buf_size; py_buf_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.buf_size); return py_buf_size; } static int py_samr_QueryDisplayInfo3_in_set_buf_size(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buf_size"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buf_size)); 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.buf_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo3_out_get_total_size(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj); PyObject *py_total_size; if (object->out.total_size == NULL) { Py_RETURN_NONE; } py_total_size = PyLong_FromUnsignedLongLong((uint32_t)*object->out.total_size); return py_total_size; } static int py_samr_QueryDisplayInfo3_out_set_total_size(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.total_size)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.total_size"); return -1; } object->out.total_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.total_size); if (object->out.total_size == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.total_size)); 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.total_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo3_out_get_returned_size(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj); PyObject *py_returned_size; if (object->out.returned_size == NULL) { Py_RETURN_NONE; } py_returned_size = PyLong_FromUnsignedLongLong((uint32_t)*object->out.returned_size); return py_returned_size; } static int py_samr_QueryDisplayInfo3_out_set_returned_size(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.returned_size)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.returned_size"); return -1; } object->out.returned_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.returned_size); if (object->out.returned_size == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.returned_size)); 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.returned_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_QueryDisplayInfo3_out_get_info(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } py_info = pyrpc_import_union(&samr_DispInfo_Type, object->out.info, object->in.level, object->out.info, "union samr_DispInfo"); if (py_info == NULL) { return NULL; } return py_info; } static int py_samr_QueryDisplayInfo3_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info"); return -1; } object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info); if (object->out.info == NULL) { PyErr_NoMemory(); return -1; } { union samr_DispInfo *info_switch_1; info_switch_1 = (union samr_DispInfo *)pyrpc_export_union(&samr_DispInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_DispInfo"); if (info_switch_1 == NULL) { return -1; } object->out.info = info_switch_1; } return 0; } static PyObject *py_samr_QueryDisplayInfo3_get_result(PyObject *obj, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_QueryDisplayInfo3_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_QueryDisplayInfo3_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_QueryDisplayInfo3_in_get_domain_handle, .set = py_samr_QueryDisplayInfo3_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_QueryDisplayInfo3_in_get_level, .set = py_samr_QueryDisplayInfo3_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_start_idx"), .get = py_samr_QueryDisplayInfo3_in_get_start_idx, .set = py_samr_QueryDisplayInfo3_in_set_start_idx, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_max_entries"), .get = py_samr_QueryDisplayInfo3_in_get_max_entries, .set = py_samr_QueryDisplayInfo3_in_set_max_entries, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_buf_size"), .get = py_samr_QueryDisplayInfo3_in_get_buf_size, .set = py_samr_QueryDisplayInfo3_in_set_buf_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_total_size"), .get = py_samr_QueryDisplayInfo3_out_get_total_size, .set = py_samr_QueryDisplayInfo3_out_set_total_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_returned_size"), .get = py_samr_QueryDisplayInfo3_out_get_returned_size, .set = py_samr_QueryDisplayInfo3_out_set_returned_size, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_info"), .get = py_samr_QueryDisplayInfo3_out_get_info, .set = py_samr_QueryDisplayInfo3_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_QueryDisplayInfo3_get_result, .set = py_samr_QueryDisplayInfo3_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_QueryDisplayInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_QueryDisplayInfo3, type); struct samr_QueryDisplayInfo3 *_self = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.total_size = talloc_zero(mem_ctx, uint32_t); _self->out.returned_size = talloc_zero(mem_ctx, uint32_t); _self->out.info = talloc_zero(mem_ctx, union samr_DispInfo); return self; } static PyObject *py_samr_QueryDisplayInfo3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(51); } static PyObject *py_samr_QueryDisplayInfo3_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 52) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo3_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[51]; 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_samr_QueryDisplayInfo3_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_samr_QueryDisplayInfo3_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_QueryDisplayInfo3_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_samr_QueryDisplayInfo3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_QueryDisplayInfo3_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 samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 52) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo3_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[51]; 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_samr_QueryDisplayInfo3_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_samr_QueryDisplayInfo3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryDisplayInfo3_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_samr_QueryDisplayInfo3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_QueryDisplayInfo3_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 52) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo3_ndr_print"); return NULL; } call = &ndr_table_samr.calls[51]; 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_samr_QueryDisplayInfo3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryDisplayInfo3_ndr_print(py_obj, "samr_QueryDisplayInfo3_in", NDR_IN); } static PyObject *py_samr_QueryDisplayInfo3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_QueryDisplayInfo3_ndr_print(py_obj, "samr_QueryDisplayInfo3_out", NDR_OUT); } static PyMethodDef py_samr_QueryDisplayInfo3_methods[] = { { "opnum", (PyCFunction)py_samr_QueryDisplayInfo3_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.QueryDisplayInfo3.opnum() -> 51 (0x33) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo3_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_samr_QueryDisplayInfo3_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_samr_QueryDisplayInfo3_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_samr_QueryDisplayInfo3_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_samr_QueryDisplayInfo3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_QueryDisplayInfo3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_QueryDisplayInfo3_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.QueryDisplayInfo3", .tp_getset = py_samr_QueryDisplayInfo3_getsetters, .tp_methods = py_samr_QueryDisplayInfo3_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_QueryDisplayInfo3_new, }; static bool pack_py_samr_QueryDisplayInfo3_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDisplayInfo3 *r) { PyObject *py_domain_handle; PyObject *py_level; PyObject *py_start_idx; PyObject *py_max_entries; PyObject *py_buf_size; const char *kwnames[] = { "domain_handle", "level", "start_idx", "max_entries", "buf_size", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:samr_QueryDisplayInfo3", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_start_idx, &py_max_entries, &py_buf_size)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); 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; } } if (py_start_idx == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_idx"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_idx)); if (PyLong_Check(py_start_idx)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_start_idx); 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.start_idx = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_max_entries == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_entries"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_entries)); if (PyLong_Check(py_max_entries)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_max_entries); 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.max_entries = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_buf_size == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buf_size"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buf_size)); if (PyLong_Check(py_buf_size)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_buf_size); 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.buf_size = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_QueryDisplayInfo3_args_out(struct samr_QueryDisplayInfo3 *r) { PyObject *result; PyObject *py_total_size; PyObject *py_returned_size; PyObject *py_info; result = PyTuple_New(3); py_total_size = PyLong_FromUnsignedLongLong((uint32_t)*r->out.total_size); PyTuple_SetItem(result, 0, py_total_size); py_returned_size = PyLong_FromUnsignedLongLong((uint32_t)*r->out.returned_size); PyTuple_SetItem(result, 1, py_returned_size); py_info = pyrpc_import_union(&samr_DispInfo_Type, r->out.info, r->in.level, r->out.info, "union samr_DispInfo"); if (py_info == NULL) { return NULL; } PyTuple_SetItem(result, 2, py_info); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_AddMultipleMembersToAlias_in_get_alias_handle(PyObject *obj, void *closure) { struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(obj); PyObject *py_alias_handle; if (object->in.alias_handle == NULL) { Py_RETURN_NONE; } py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle); return py_alias_handle; } static int py_samr_AddMultipleMembersToAlias_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle"); return -1; } object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle); if (object->in.alias_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_AddMultipleMembersToAlias_in_get_sids(PyObject *obj, void *closure) { struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(obj); PyObject *py_sids; if (object->in.sids == NULL) { Py_RETURN_NONE; } py_sids = pytalloc_reference_ex(lsa_SidArray_Type, object->in.sids, object->in.sids); return py_sids; } static int py_samr_AddMultipleMembersToAlias_in_set_sids(PyObject *py_obj, PyObject *value, void *closure) { struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids"); return -1; } object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids); if (object->in.sids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_SidArray_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.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_AddMultipleMembersToAlias_get_result(PyObject *obj, void *closure) { struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_AddMultipleMembersToAlias_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_AddMultipleMembersToAlias_getsetters[] = { { .name = discard_const_p(char, "in_alias_handle"), .get = py_samr_AddMultipleMembersToAlias_in_get_alias_handle, .set = py_samr_AddMultipleMembersToAlias_in_set_alias_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_sids"), .get = py_samr_AddMultipleMembersToAlias_in_get_sids, .set = py_samr_AddMultipleMembersToAlias_in_set_sids, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray") }, { .name = discard_const_p(char, "result"), .get = py_samr_AddMultipleMembersToAlias_get_result, .set = py_samr_AddMultipleMembersToAlias_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_AddMultipleMembersToAlias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_AddMultipleMembersToAlias, type); struct samr_AddMultipleMembersToAlias *_self = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray); return self; } static PyObject *py_samr_AddMultipleMembersToAlias_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(52); } static PyObject *py_samr_AddMultipleMembersToAlias_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 53) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddMultipleMembersToAlias_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[52]; 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_samr_AddMultipleMembersToAlias_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_samr_AddMultipleMembersToAlias_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_AddMultipleMembersToAlias_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_samr_AddMultipleMembersToAlias_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_AddMultipleMembersToAlias_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 samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 53) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddMultipleMembersToAlias_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[52]; 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_samr_AddMultipleMembersToAlias_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_samr_AddMultipleMembersToAlias_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_AddMultipleMembersToAlias_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_samr_AddMultipleMembersToAlias_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_AddMultipleMembersToAlias_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 53) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddMultipleMembersToAlias_ndr_print"); return NULL; } call = &ndr_table_samr.calls[52]; 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_samr_AddMultipleMembersToAlias_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_AddMultipleMembersToAlias_ndr_print(py_obj, "samr_AddMultipleMembersToAlias_in", NDR_IN); } static PyObject *py_samr_AddMultipleMembersToAlias_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_AddMultipleMembersToAlias_ndr_print(py_obj, "samr_AddMultipleMembersToAlias_out", NDR_OUT); } static PyMethodDef py_samr_AddMultipleMembersToAlias_methods[] = { { "opnum", (PyCFunction)py_samr_AddMultipleMembersToAlias_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.AddMultipleMembersToAlias.opnum() -> 52 (0x34) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddMultipleMembersToAlias_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_samr_AddMultipleMembersToAlias_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_samr_AddMultipleMembersToAlias_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_samr_AddMultipleMembersToAlias_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_samr_AddMultipleMembersToAlias_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_AddMultipleMembersToAlias_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_AddMultipleMembersToAlias_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.AddMultipleMembersToAlias", .tp_getset = py_samr_AddMultipleMembersToAlias_getsetters, .tp_methods = py_samr_AddMultipleMembersToAlias_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_AddMultipleMembersToAlias_new, }; static bool pack_py_samr_AddMultipleMembersToAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_AddMultipleMembersToAlias *r) { PyObject *py_alias_handle; PyObject *py_sids; const char *kwnames[] = { "alias_handle", "sids", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_AddMultipleMembersToAlias", discard_const_p(char *, kwnames), &py_alias_handle, &py_sids)) { return false; } if (py_alias_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle"); return false; } r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle); if (r->in.alias_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle); if (py_sids == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids"); return false; } r->in.sids = talloc_ptrtype(r, r->in.sids); if (r->in.sids == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_SidArray_Type, py_sids, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) { PyErr_NoMemory(); return false; } r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids); return true; } static PyObject *unpack_py_samr_AddMultipleMembersToAlias_args_out(struct samr_AddMultipleMembersToAlias *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_RemoveMultipleMembersFromAlias_in_get_alias_handle(PyObject *obj, void *closure) { struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(obj); PyObject *py_alias_handle; if (object->in.alias_handle == NULL) { Py_RETURN_NONE; } py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle); return py_alias_handle; } static int py_samr_RemoveMultipleMembersFromAlias_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle"); return -1; } object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle); if (object->in.alias_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_RemoveMultipleMembersFromAlias_in_get_sids(PyObject *obj, void *closure) { struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(obj); PyObject *py_sids; if (object->in.sids == NULL) { Py_RETURN_NONE; } py_sids = pytalloc_reference_ex(lsa_SidArray_Type, object->in.sids, object->in.sids); return py_sids; } static int py_samr_RemoveMultipleMembersFromAlias_in_set_sids(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids"); return -1; } object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids); if (object->in.sids == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_SidArray_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.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_RemoveMultipleMembersFromAlias_get_result(PyObject *obj, void *closure) { struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_RemoveMultipleMembersFromAlias_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_RemoveMultipleMembersFromAlias_getsetters[] = { { .name = discard_const_p(char, "in_alias_handle"), .get = py_samr_RemoveMultipleMembersFromAlias_in_get_alias_handle, .set = py_samr_RemoveMultipleMembersFromAlias_in_set_alias_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_sids"), .get = py_samr_RemoveMultipleMembersFromAlias_in_get_sids, .set = py_samr_RemoveMultipleMembersFromAlias_in_set_sids, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray") }, { .name = discard_const_p(char, "result"), .get = py_samr_RemoveMultipleMembersFromAlias_get_result, .set = py_samr_RemoveMultipleMembersFromAlias_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_RemoveMultipleMembersFromAlias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_RemoveMultipleMembersFromAlias, type); struct samr_RemoveMultipleMembersFromAlias *_self = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray); return self; } static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(53); } static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 54) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RemoveMultipleMembersFromAlias_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[53]; 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_samr_RemoveMultipleMembersFromAlias_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_samr_RemoveMultipleMembersFromAlias_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_RemoveMultipleMembersFromAlias_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_samr_RemoveMultipleMembersFromAlias_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_RemoveMultipleMembersFromAlias_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 samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 54) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RemoveMultipleMembersFromAlias_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[53]; 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_samr_RemoveMultipleMembersFromAlias_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_samr_RemoveMultipleMembersFromAlias_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_RemoveMultipleMembersFromAlias_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_samr_RemoveMultipleMembersFromAlias_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 54) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RemoveMultipleMembersFromAlias_ndr_print"); return NULL; } call = &ndr_table_samr.calls[53]; 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_samr_RemoveMultipleMembersFromAlias_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_RemoveMultipleMembersFromAlias_ndr_print(py_obj, "samr_RemoveMultipleMembersFromAlias_in", NDR_IN); } static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_RemoveMultipleMembersFromAlias_ndr_print(py_obj, "samr_RemoveMultipleMembersFromAlias_out", NDR_OUT); } static PyMethodDef py_samr_RemoveMultipleMembersFromAlias_methods[] = { { "opnum", (PyCFunction)py_samr_RemoveMultipleMembersFromAlias_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.RemoveMultipleMembersFromAlias.opnum() -> 53 (0x35) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RemoveMultipleMembersFromAlias_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_samr_RemoveMultipleMembersFromAlias_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_samr_RemoveMultipleMembersFromAlias_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_samr_RemoveMultipleMembersFromAlias_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_samr_RemoveMultipleMembersFromAlias_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_RemoveMultipleMembersFromAlias_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_RemoveMultipleMembersFromAlias_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.RemoveMultipleMembersFromAlias", .tp_getset = py_samr_RemoveMultipleMembersFromAlias_getsetters, .tp_methods = py_samr_RemoveMultipleMembersFromAlias_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_RemoveMultipleMembersFromAlias_new, }; static bool pack_py_samr_RemoveMultipleMembersFromAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_RemoveMultipleMembersFromAlias *r) { PyObject *py_alias_handle; PyObject *py_sids; const char *kwnames[] = { "alias_handle", "sids", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_RemoveMultipleMembersFromAlias", discard_const_p(char *, kwnames), &py_alias_handle, &py_sids)) { return false; } if (py_alias_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle"); return false; } r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle); if (r->in.alias_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle); if (py_sids == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids"); return false; } r->in.sids = talloc_ptrtype(r, r->in.sids); if (r->in.sids == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_SidArray_Type, py_sids, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) { PyErr_NoMemory(); return false; } r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids); return true; } static PyObject *unpack_py_samr_RemoveMultipleMembersFromAlias_args_out(struct samr_RemoveMultipleMembersFromAlias *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_OemChangePasswordUser2_in_get_server(PyObject *obj, void *closure) { struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(obj); PyObject *py_server; if (object->in.server == NULL) { Py_RETURN_NONE; } if (object->in.server == NULL) { py_server = Py_None; Py_INCREF(py_server); } else { py_server = pytalloc_reference_ex(lsa_AsciiString_Type, object->in.server, object->in.server); } return py_server; } static int py_samr_OemChangePasswordUser2_in_set_server(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.server)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server"); return -1; } if (value == Py_None) { object->in.server = NULL; } else { object->in.server = NULL; PY_CHECK_TYPE(lsa_AsciiString_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.server = (struct lsa_AsciiString *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_OemChangePasswordUser2_in_get_account(PyObject *obj, void *closure) { struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(obj); PyObject *py_account; if (object->in.account == NULL) { Py_RETURN_NONE; } py_account = pytalloc_reference_ex(lsa_AsciiString_Type, object->in.account, object->in.account); return py_account; } static int py_samr_OemChangePasswordUser2_in_set_account(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account"); return -1; } object->in.account = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account); if (object->in.account == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_AsciiString_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.account = (struct lsa_AsciiString *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_OemChangePasswordUser2_in_get_password(PyObject *obj, void *closure) { struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(obj); PyObject *py_password; if (object->in.password == NULL) { Py_RETURN_NONE; } if (object->in.password == NULL) { py_password = Py_None; Py_INCREF(py_password); } else { py_password = pytalloc_reference_ex(&samr_CryptPassword_Type, object->in.password, object->in.password); } return py_password; } static int py_samr_OemChangePasswordUser2_in_set_password(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.password)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password"); return -1; } if (value == Py_None) { object->in.password = NULL; } else { object->in.password = NULL; PY_CHECK_TYPE(&samr_CryptPassword_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.password = (struct samr_CryptPassword *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_OemChangePasswordUser2_in_get_hash(PyObject *obj, void *closure) { struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(obj); PyObject *py_hash; if (object->in.hash == NULL) { Py_RETURN_NONE; } if (object->in.hash == NULL) { py_hash = Py_None; Py_INCREF(py_hash); } else { py_hash = pytalloc_reference_ex(&samr_Password_Type, object->in.hash, object->in.hash); } return py_hash; } static int py_samr_OemChangePasswordUser2_in_set_hash(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.hash)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.hash"); return -1; } if (value == Py_None) { object->in.hash = NULL; } else { object->in.hash = NULL; PY_CHECK_TYPE(&samr_Password_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.hash = (struct samr_Password *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_OemChangePasswordUser2_get_result(PyObject *obj, void *closure) { struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_OemChangePasswordUser2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_OemChangePasswordUser2_getsetters[] = { { .name = discard_const_p(char, "in_server"), .get = py_samr_OemChangePasswordUser2_in_get_server, .set = py_samr_OemChangePasswordUser2_in_set_server, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AsciiString") }, { .name = discard_const_p(char, "in_account"), .get = py_samr_OemChangePasswordUser2_in_get_account, .set = py_samr_OemChangePasswordUser2_in_set_account, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AsciiString") }, { .name = discard_const_p(char, "in_password"), .get = py_samr_OemChangePasswordUser2_in_get_password, .set = py_samr_OemChangePasswordUser2_in_set_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword") }, { .name = discard_const_p(char, "in_hash"), .get = py_samr_OemChangePasswordUser2_in_get_hash, .set = py_samr_OemChangePasswordUser2_in_set_hash, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "result"), .get = py_samr_OemChangePasswordUser2_get_result, .set = py_samr_OemChangePasswordUser2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_OemChangePasswordUser2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_OemChangePasswordUser2, type); struct samr_OemChangePasswordUser2 *_self = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.account = talloc_zero(mem_ctx, struct lsa_AsciiString); return self; } static PyObject *py_samr_OemChangePasswordUser2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(54); } static PyObject *py_samr_OemChangePasswordUser2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 55) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OemChangePasswordUser2_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[54]; 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_samr_OemChangePasswordUser2_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_samr_OemChangePasswordUser2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_OemChangePasswordUser2_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_samr_OemChangePasswordUser2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_OemChangePasswordUser2_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 samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 55) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OemChangePasswordUser2_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[54]; 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_samr_OemChangePasswordUser2_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_samr_OemChangePasswordUser2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_OemChangePasswordUser2_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_samr_OemChangePasswordUser2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_OemChangePasswordUser2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 55) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OemChangePasswordUser2_ndr_print"); return NULL; } call = &ndr_table_samr.calls[54]; 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_samr_OemChangePasswordUser2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_OemChangePasswordUser2_ndr_print(py_obj, "samr_OemChangePasswordUser2_in", NDR_IN); } static PyObject *py_samr_OemChangePasswordUser2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_OemChangePasswordUser2_ndr_print(py_obj, "samr_OemChangePasswordUser2_out", NDR_OUT); } static PyMethodDef py_samr_OemChangePasswordUser2_methods[] = { { "opnum", (PyCFunction)py_samr_OemChangePasswordUser2_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.OemChangePasswordUser2.opnum() -> 54 (0x36) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OemChangePasswordUser2_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_samr_OemChangePasswordUser2_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_samr_OemChangePasswordUser2_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_samr_OemChangePasswordUser2_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_samr_OemChangePasswordUser2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_OemChangePasswordUser2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_OemChangePasswordUser2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.OemChangePasswordUser2", .tp_getset = py_samr_OemChangePasswordUser2_getsetters, .tp_methods = py_samr_OemChangePasswordUser2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_OemChangePasswordUser2_new, }; static bool pack_py_samr_OemChangePasswordUser2_args_in(PyObject *args, PyObject *kwargs, struct samr_OemChangePasswordUser2 *r) { PyObject *py_server; PyObject *py_account; PyObject *py_password; PyObject *py_hash; const char *kwnames[] = { "server", "account", "password", "hash", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_OemChangePasswordUser2", discard_const_p(char *, kwnames), &py_server, &py_account, &py_password, &py_hash)) { return false; } if (py_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server"); return false; } if (py_server == Py_None) { r->in.server = NULL; } else { r->in.server = NULL; PY_CHECK_TYPE(lsa_AsciiString_Type, py_server, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_server)) == NULL) { PyErr_NoMemory(); return false; } r->in.server = (struct lsa_AsciiString *)pytalloc_get_ptr(py_server); } if (py_account == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account"); return false; } r->in.account = talloc_ptrtype(r, r->in.account); if (r->in.account == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_AsciiString_Type, py_account, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_account)) == NULL) { PyErr_NoMemory(); return false; } r->in.account = (struct lsa_AsciiString *)pytalloc_get_ptr(py_account); if (py_password == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password"); return false; } if (py_password == Py_None) { r->in.password = NULL; } else { r->in.password = NULL; PY_CHECK_TYPE(&samr_CryptPassword_Type, py_password, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_password)) == NULL) { PyErr_NoMemory(); return false; } r->in.password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_password); } if (py_hash == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.hash"); return false; } if (py_hash == Py_None) { r->in.hash = NULL; } else { r->in.hash = NULL; PY_CHECK_TYPE(&samr_Password_Type, py_hash, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_hash)) == NULL) { PyErr_NoMemory(); return false; } r->in.hash = (struct samr_Password *)pytalloc_get_ptr(py_hash); } return true; } static PyObject *unpack_py_samr_OemChangePasswordUser2_args_out(struct samr_OemChangePasswordUser2 *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_ChangePasswordUser2_in_get_server(PyObject *obj, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj); PyObject *py_server; if (object->in.server == NULL) { Py_RETURN_NONE; } if (object->in.server == NULL) { py_server = Py_None; Py_INCREF(py_server); } else { py_server = pytalloc_reference_ex(lsa_String_Type, object->in.server, object->in.server); } return py_server; } static int py_samr_ChangePasswordUser2_in_set_server(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.server)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server"); return -1; } if (value == Py_None) { object->in.server = NULL; } else { object->in.server = NULL; PY_CHECK_TYPE(lsa_String_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.server = (struct lsa_String *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser2_in_get_account(PyObject *obj, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj); PyObject *py_account; if (object->in.account == NULL) { Py_RETURN_NONE; } py_account = pytalloc_reference_ex(lsa_String_Type, object->in.account, object->in.account); return py_account; } static int py_samr_ChangePasswordUser2_in_set_account(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account"); return -1; } object->in.account = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account); if (object->in.account == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_String_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.account = (struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_ChangePasswordUser2_in_get_nt_password(PyObject *obj, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj); PyObject *py_nt_password; if (object->in.nt_password == NULL) { Py_RETURN_NONE; } if (object->in.nt_password == NULL) { py_nt_password = Py_None; Py_INCREF(py_nt_password); } else { py_nt_password = pytalloc_reference_ex(&samr_CryptPassword_Type, object->in.nt_password, object->in.nt_password); } return py_nt_password; } static int py_samr_ChangePasswordUser2_in_set_nt_password(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.nt_password)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.nt_password"); return -1; } if (value == Py_None) { object->in.nt_password = NULL; } else { object->in.nt_password = NULL; PY_CHECK_TYPE(&samr_CryptPassword_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.nt_password = (struct samr_CryptPassword *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser2_in_get_nt_verifier(PyObject *obj, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj); PyObject *py_nt_verifier; if (object->in.nt_verifier == NULL) { Py_RETURN_NONE; } if (object->in.nt_verifier == NULL) { py_nt_verifier = Py_None; Py_INCREF(py_nt_verifier); } else { py_nt_verifier = pytalloc_reference_ex(&samr_Password_Type, object->in.nt_verifier, object->in.nt_verifier); } return py_nt_verifier; } static int py_samr_ChangePasswordUser2_in_set_nt_verifier(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.nt_verifier)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.nt_verifier"); return -1; } if (value == Py_None) { object->in.nt_verifier = NULL; } else { object->in.nt_verifier = NULL; PY_CHECK_TYPE(&samr_Password_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.nt_verifier = (struct samr_Password *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser2_in_get_lm_change(PyObject *obj, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj); PyObject *py_lm_change; py_lm_change = PyLong_FromLong((uint16_t)object->in.lm_change); return py_lm_change; } static int py_samr_ChangePasswordUser2_in_set_lm_change(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lm_change)); 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.lm_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ChangePasswordUser2_in_get_lm_password(PyObject *obj, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj); PyObject *py_lm_password; if (object->in.lm_password == NULL) { Py_RETURN_NONE; } if (object->in.lm_password == NULL) { py_lm_password = Py_None; Py_INCREF(py_lm_password); } else { py_lm_password = pytalloc_reference_ex(&samr_CryptPassword_Type, object->in.lm_password, object->in.lm_password); } return py_lm_password; } static int py_samr_ChangePasswordUser2_in_set_lm_password(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lm_password)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_password"); return -1; } if (value == Py_None) { object->in.lm_password = NULL; } else { object->in.lm_password = NULL; PY_CHECK_TYPE(&samr_CryptPassword_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.lm_password = (struct samr_CryptPassword *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser2_in_get_lm_verifier(PyObject *obj, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj); PyObject *py_lm_verifier; if (object->in.lm_verifier == NULL) { Py_RETURN_NONE; } if (object->in.lm_verifier == NULL) { py_lm_verifier = Py_None; Py_INCREF(py_lm_verifier); } else { py_lm_verifier = pytalloc_reference_ex(&samr_Password_Type, object->in.lm_verifier, object->in.lm_verifier); } return py_lm_verifier; } static int py_samr_ChangePasswordUser2_in_set_lm_verifier(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lm_verifier)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_verifier"); return -1; } if (value == Py_None) { object->in.lm_verifier = NULL; } else { object->in.lm_verifier = NULL; PY_CHECK_TYPE(&samr_Password_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.lm_verifier = (struct samr_Password *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser2_get_result(PyObject *obj, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_ChangePasswordUser2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_ChangePasswordUser2_getsetters[] = { { .name = discard_const_p(char, "in_server"), .get = py_samr_ChangePasswordUser2_in_get_server, .set = py_samr_ChangePasswordUser2_in_set_server, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "in_account"), .get = py_samr_ChangePasswordUser2_in_get_account, .set = py_samr_ChangePasswordUser2_in_set_account, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "in_nt_password"), .get = py_samr_ChangePasswordUser2_in_get_nt_password, .set = py_samr_ChangePasswordUser2_in_set_nt_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword") }, { .name = discard_const_p(char, "in_nt_verifier"), .get = py_samr_ChangePasswordUser2_in_get_nt_verifier, .set = py_samr_ChangePasswordUser2_in_set_nt_verifier, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "in_lm_change"), .get = py_samr_ChangePasswordUser2_in_get_lm_change, .set = py_samr_ChangePasswordUser2_in_set_lm_change, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_lm_password"), .get = py_samr_ChangePasswordUser2_in_get_lm_password, .set = py_samr_ChangePasswordUser2_in_set_lm_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword") }, { .name = discard_const_p(char, "in_lm_verifier"), .get = py_samr_ChangePasswordUser2_in_get_lm_verifier, .set = py_samr_ChangePasswordUser2_in_set_lm_verifier, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "result"), .get = py_samr_ChangePasswordUser2_get_result, .set = py_samr_ChangePasswordUser2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_ChangePasswordUser2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_ChangePasswordUser2, type); struct samr_ChangePasswordUser2 *_self = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.account = talloc_zero(mem_ctx, struct lsa_String); return self; } static PyObject *py_samr_ChangePasswordUser2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(55); } static PyObject *py_samr_ChangePasswordUser2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 56) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser2_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[55]; 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_samr_ChangePasswordUser2_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_samr_ChangePasswordUser2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_ChangePasswordUser2_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_samr_ChangePasswordUser2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_ChangePasswordUser2_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 samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 56) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser2_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[55]; 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_samr_ChangePasswordUser2_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_samr_ChangePasswordUser2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_ChangePasswordUser2_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_samr_ChangePasswordUser2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_ChangePasswordUser2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 56) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser2_ndr_print"); return NULL; } call = &ndr_table_samr.calls[55]; 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_samr_ChangePasswordUser2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_ChangePasswordUser2_ndr_print(py_obj, "samr_ChangePasswordUser2_in", NDR_IN); } static PyObject *py_samr_ChangePasswordUser2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_ChangePasswordUser2_ndr_print(py_obj, "samr_ChangePasswordUser2_out", NDR_OUT); } static PyMethodDef py_samr_ChangePasswordUser2_methods[] = { { "opnum", (PyCFunction)py_samr_ChangePasswordUser2_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.ChangePasswordUser2.opnum() -> 55 (0x37) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser2_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_samr_ChangePasswordUser2_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_samr_ChangePasswordUser2_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_samr_ChangePasswordUser2_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_samr_ChangePasswordUser2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_ChangePasswordUser2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_ChangePasswordUser2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ChangePasswordUser2", .tp_getset = py_samr_ChangePasswordUser2_getsetters, .tp_methods = py_samr_ChangePasswordUser2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ChangePasswordUser2_new, }; static bool pack_py_samr_ChangePasswordUser2_args_in(PyObject *args, PyObject *kwargs, struct samr_ChangePasswordUser2 *r) { PyObject *py_server; PyObject *py_account; PyObject *py_nt_password; PyObject *py_nt_verifier; PyObject *py_lm_change; PyObject *py_lm_password; PyObject *py_lm_verifier; const char *kwnames[] = { "server", "account", "nt_password", "nt_verifier", "lm_change", "lm_password", "lm_verifier", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:samr_ChangePasswordUser2", discard_const_p(char *, kwnames), &py_server, &py_account, &py_nt_password, &py_nt_verifier, &py_lm_change, &py_lm_password, &py_lm_verifier)) { return false; } if (py_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server"); return false; } if (py_server == Py_None) { r->in.server = NULL; } else { r->in.server = NULL; PY_CHECK_TYPE(lsa_String_Type, py_server, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_server)) == NULL) { PyErr_NoMemory(); return false; } r->in.server = (struct lsa_String *)pytalloc_get_ptr(py_server); } if (py_account == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account"); return false; } r->in.account = talloc_ptrtype(r, r->in.account); if (r->in.account == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_String_Type, py_account, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_account)) == NULL) { PyErr_NoMemory(); return false; } r->in.account = (struct lsa_String *)pytalloc_get_ptr(py_account); if (py_nt_password == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.nt_password"); return false; } if (py_nt_password == Py_None) { r->in.nt_password = NULL; } else { r->in.nt_password = NULL; PY_CHECK_TYPE(&samr_CryptPassword_Type, py_nt_password, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_password)) == NULL) { PyErr_NoMemory(); return false; } r->in.nt_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_nt_password); } if (py_nt_verifier == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.nt_verifier"); return false; } if (py_nt_verifier == Py_None) { r->in.nt_verifier = NULL; } else { r->in.nt_verifier = NULL; PY_CHECK_TYPE(&samr_Password_Type, py_nt_verifier, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_verifier)) == NULL) { PyErr_NoMemory(); return false; } r->in.nt_verifier = (struct samr_Password *)pytalloc_get_ptr(py_nt_verifier); } if (py_lm_change == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_change"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lm_change)); if (PyLong_Check(py_lm_change)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_lm_change); 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.lm_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_lm_password == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_password"); return false; } if (py_lm_password == Py_None) { r->in.lm_password = NULL; } else { r->in.lm_password = NULL; PY_CHECK_TYPE(&samr_CryptPassword_Type, py_lm_password, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_password)) == NULL) { PyErr_NoMemory(); return false; } r->in.lm_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_lm_password); } if (py_lm_verifier == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_verifier"); return false; } if (py_lm_verifier == Py_None) { r->in.lm_verifier = NULL; } else { r->in.lm_verifier = NULL; PY_CHECK_TYPE(&samr_Password_Type, py_lm_verifier, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_verifier)) == NULL) { PyErr_NoMemory(); return false; } r->in.lm_verifier = (struct samr_Password *)pytalloc_get_ptr(py_lm_verifier); } return true; } static PyObject *unpack_py_samr_ChangePasswordUser2_args_out(struct samr_ChangePasswordUser2 *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_GetDomPwInfo_in_get_domain_name(PyObject *obj, void *closure) { struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(obj); PyObject *py_domain_name; if (object->in.domain_name == NULL) { Py_RETURN_NONE; } if (object->in.domain_name == NULL) { py_domain_name = Py_None; Py_INCREF(py_domain_name); } else { py_domain_name = pytalloc_reference_ex(lsa_String_Type, object->in.domain_name, object->in.domain_name); } return py_domain_name; } static int py_samr_GetDomPwInfo_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_name)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name"); return -1; } if (value == Py_None) { object->in.domain_name = NULL; } else { object->in.domain_name = NULL; PY_CHECK_TYPE(lsa_String_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.domain_name = (struct lsa_String *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_GetDomPwInfo_out_get_info(PyObject *obj, void *closure) { struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->out.info == NULL) { Py_RETURN_NONE; } py_info = pytalloc_reference_ex(&samr_PwInfo_Type, object->out.info, object->out.info); return py_info; } static int py_samr_GetDomPwInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info"); return -1; } object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info); if (object->out.info == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(&samr_PwInfo_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.info = (struct samr_PwInfo *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetDomPwInfo_get_result(PyObject *obj, void *closure) { struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_GetDomPwInfo_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_GetDomPwInfo_getsetters[] = { { .name = discard_const_p(char, "in_domain_name"), .get = py_samr_GetDomPwInfo_in_get_domain_name, .set = py_samr_GetDomPwInfo_in_set_domain_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "out_info"), .get = py_samr_GetDomPwInfo_out_get_info, .set = py_samr_GetDomPwInfo_out_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_PwInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_GetDomPwInfo_get_result, .set = py_samr_GetDomPwInfo_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_GetDomPwInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_GetDomPwInfo, type); struct samr_GetDomPwInfo *_self = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.info = talloc_zero(mem_ctx, struct samr_PwInfo); return self; } static PyObject *py_samr_GetDomPwInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(56); } static PyObject *py_samr_GetDomPwInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 57) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDomPwInfo_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[56]; 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_samr_GetDomPwInfo_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_samr_GetDomPwInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_GetDomPwInfo_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_samr_GetDomPwInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_GetDomPwInfo_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 samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 57) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDomPwInfo_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[56]; 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_samr_GetDomPwInfo_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_samr_GetDomPwInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetDomPwInfo_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_samr_GetDomPwInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetDomPwInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 57) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDomPwInfo_ndr_print"); return NULL; } call = &ndr_table_samr.calls[56]; 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_samr_GetDomPwInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetDomPwInfo_ndr_print(py_obj, "samr_GetDomPwInfo_in", NDR_IN); } static PyObject *py_samr_GetDomPwInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetDomPwInfo_ndr_print(py_obj, "samr_GetDomPwInfo_out", NDR_OUT); } static PyMethodDef py_samr_GetDomPwInfo_methods[] = { { "opnum", (PyCFunction)py_samr_GetDomPwInfo_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.GetDomPwInfo.opnum() -> 56 (0x38) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDomPwInfo_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_samr_GetDomPwInfo_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_samr_GetDomPwInfo_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_samr_GetDomPwInfo_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_samr_GetDomPwInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_GetDomPwInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_GetDomPwInfo_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.GetDomPwInfo", .tp_getset = py_samr_GetDomPwInfo_getsetters, .tp_methods = py_samr_GetDomPwInfo_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_GetDomPwInfo_new, }; static bool pack_py_samr_GetDomPwInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_GetDomPwInfo *r) { PyObject *py_domain_name; const char *kwnames[] = { "domain_name", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetDomPwInfo", discard_const_p(char *, kwnames), &py_domain_name)) { return false; } if (py_domain_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name"); return false; } if (py_domain_name == Py_None) { r->in.domain_name = NULL; } else { r->in.domain_name = NULL; PY_CHECK_TYPE(lsa_String_Type, py_domain_name, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_name)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_name = (struct lsa_String *)pytalloc_get_ptr(py_domain_name); } return true; } static PyObject *unpack_py_samr_GetDomPwInfo_args_out(struct samr_GetDomPwInfo *r) { PyObject *result; PyObject *py_info; py_info = pytalloc_reference_ex(&samr_PwInfo_Type, r->out.info, r->out.info); result = py_info; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_Connect2_in_get_system_name(PyObject *obj, void *closure) { struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(obj); PyObject *py_system_name; if (object->in.system_name == NULL) { Py_RETURN_NONE; } if (object->in.system_name == NULL) { py_system_name = Py_None; Py_INCREF(py_system_name); } else { if (object->in.system_name == NULL) { py_system_name = Py_None; Py_INCREF(py_system_name); } else { py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore"); } } return py_system_name; } static int py_samr_Connect2_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name"); return -1; } if (value == Py_None) { object->in.system_name = NULL; } else { object->in.system_name = 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->in.system_name = talloc_str; } } return 0; } static PyObject *py_samr_Connect2_in_get_access_mask(PyObject *obj, void *closure) { struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(obj); PyObject *py_access_mask; py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask); return py_access_mask; } static int py_samr_Connect2_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask)); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_Connect2_out_get_connect_handle(PyObject *obj, void *closure) { struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(obj); PyObject *py_connect_handle; if (object->out.connect_handle == NULL) { Py_RETURN_NONE; } py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->out.connect_handle, object->out.connect_handle); return py_connect_handle; } static int py_samr_Connect2_out_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.connect_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.connect_handle"); return -1; } object->out.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.connect_handle); if (object->out.connect_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_Connect2_get_result(PyObject *obj, void *closure) { struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_Connect2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_Connect2_getsetters[] = { { .name = discard_const_p(char, "in_system_name"), .get = py_samr_Connect2_in_get_system_name, .set = py_samr_Connect2_in_set_system_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_access_mask"), .get = py_samr_Connect2_in_get_access_mask, .set = py_samr_Connect2_in_set_access_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectAccessMask") }, { .name = discard_const_p(char, "out_connect_handle"), .get = py_samr_Connect2_out_get_connect_handle, .set = py_samr_Connect2_out_set_connect_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_Connect2_get_result, .set = py_samr_Connect2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_Connect2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_Connect2, type); struct samr_Connect2 *_self = (struct samr_Connect2 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_Connect2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(57); } static PyObject *py_samr_Connect2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 58) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect2_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[57]; 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_samr_Connect2_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_samr_Connect2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_Connect2_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_samr_Connect2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_Connect2_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 samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 58) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect2_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[57]; 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_samr_Connect2_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_samr_Connect2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Connect2_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_samr_Connect2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Connect2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 58) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect2_ndr_print"); return NULL; } call = &ndr_table_samr.calls[57]; 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_samr_Connect2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Connect2_ndr_print(py_obj, "samr_Connect2_in", NDR_IN); } static PyObject *py_samr_Connect2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Connect2_ndr_print(py_obj, "samr_Connect2_out", NDR_OUT); } static PyMethodDef py_samr_Connect2_methods[] = { { "opnum", (PyCFunction)py_samr_Connect2_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.Connect2.opnum() -> 57 (0x39) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect2_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_samr_Connect2_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_samr_Connect2_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_samr_Connect2_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_samr_Connect2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_Connect2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_Connect2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.Connect2", .tp_getset = py_samr_Connect2_getsetters, .tp_methods = py_samr_Connect2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_Connect2_new, }; static bool pack_py_samr_Connect2_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect2 *r) { PyObject *py_system_name; PyObject *py_access_mask; const char *kwnames[] = { "system_name", "access_mask", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_Connect2", discard_const_p(char *, kwnames), &py_system_name, &py_access_mask)) { return false; } if (py_system_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name"); return false; } if (py_system_name == Py_None) { r->in.system_name = NULL; } else { r->in.system_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_system_name)) { unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_system_name)) { test_str = PyBytes_AS_STRING(py_system_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->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.system_name = talloc_str; } } if (py_access_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask)); if (PyLong_Check(py_access_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_access_mask); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_Connect2_args_out(struct samr_Connect2 *r) { PyObject *result; PyObject *py_connect_handle; py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle); result = py_connect_handle; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_SetUserInfo2_in_get_user_handle(PyObject *obj, void *closure) { struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(obj); PyObject *py_user_handle; if (object->in.user_handle == NULL) { Py_RETURN_NONE; } py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle); return py_user_handle; } static int py_samr_SetUserInfo2_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle"); return -1; } object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle); if (object->in.user_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.user_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_SetUserInfo2_in_get_level(PyObject *obj, void *closure) { struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_SetUserInfo2_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)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_samr_SetUserInfo2_in_get_info(PyObject *obj, void *closure) { struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(obj); PyObject *py_info; if (object->in.info == NULL) { Py_RETURN_NONE; } py_info = pyrpc_import_union(&samr_UserInfo_Type, object->in.info, object->in.level, object->in.info, "union samr_UserInfo"); if (py_info == NULL) { return NULL; } return py_info; } static int py_samr_SetUserInfo2_in_set_info(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info"); return -1; } object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info); if (object->in.info == NULL) { PyErr_NoMemory(); return -1; } { union samr_UserInfo *info_switch_1; info_switch_1 = (union samr_UserInfo *)pyrpc_export_union(&samr_UserInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_UserInfo"); if (info_switch_1 == NULL) { return -1; } object->in.info = info_switch_1; } return 0; } static PyObject *py_samr_SetUserInfo2_get_result(PyObject *obj, void *closure) { struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_SetUserInfo2_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_SetUserInfo2_getsetters[] = { { .name = discard_const_p(char, "in_user_handle"), .get = py_samr_SetUserInfo2_in_get_user_handle, .set = py_samr_SetUserInfo2_in_set_user_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_level"), .get = py_samr_SetUserInfo2_in_get_level, .set = py_samr_SetUserInfo2_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfoLevel") }, { .name = discard_const_p(char, "in_info"), .get = py_samr_SetUserInfo2_in_get_info, .set = py_samr_SetUserInfo2_in_set_info, .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfo") }, { .name = discard_const_p(char, "result"), .get = py_samr_SetUserInfo2_get_result, .set = py_samr_SetUserInfo2_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_SetUserInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_SetUserInfo2, type); struct samr_SetUserInfo2 *_self = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle); _self->in.info = talloc_zero(mem_ctx, union samr_UserInfo); return self; } static PyObject *py_samr_SetUserInfo2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(58); } static PyObject *py_samr_SetUserInfo2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 59) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetUserInfo2_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[58]; 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_samr_SetUserInfo2_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_samr_SetUserInfo2_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_SetUserInfo2_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_samr_SetUserInfo2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_SetUserInfo2_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 samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 59) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetUserInfo2_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[58]; 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_samr_SetUserInfo2_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_samr_SetUserInfo2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetUserInfo2_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_samr_SetUserInfo2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetUserInfo2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 59) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetUserInfo2_ndr_print"); return NULL; } call = &ndr_table_samr.calls[58]; 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_samr_SetUserInfo2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetUserInfo2_ndr_print(py_obj, "samr_SetUserInfo2_in", NDR_IN); } static PyObject *py_samr_SetUserInfo2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetUserInfo2_ndr_print(py_obj, "samr_SetUserInfo2_out", NDR_OUT); } static PyMethodDef py_samr_SetUserInfo2_methods[] = { { "opnum", (PyCFunction)py_samr_SetUserInfo2_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.SetUserInfo2.opnum() -> 58 (0x3a) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetUserInfo2_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_samr_SetUserInfo2_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_samr_SetUserInfo2_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_samr_SetUserInfo2_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_samr_SetUserInfo2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_SetUserInfo2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_SetUserInfo2_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.SetUserInfo2", .tp_getset = py_samr_SetUserInfo2_getsetters, .tp_methods = py_samr_SetUserInfo2_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_SetUserInfo2_new, }; static bool pack_py_samr_SetUserInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_SetUserInfo2 *r) { PyObject *py_user_handle; PyObject *py_level; PyObject *py_info; const char *kwnames[] = { "user_handle", "level", "info", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetUserInfo2", discard_const_p(char *, kwnames), &py_user_handle, &py_level, &py_info)) { return false; } if (py_user_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle"); return false; } r->in.user_handle = talloc_ptrtype(r, r->in.user_handle); if (r->in.user_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle); 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; } } if (py_info == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info"); return false; } r->in.info = talloc_ptrtype(r, r->in.info); if (r->in.info == NULL) { PyErr_NoMemory(); return false; } { union samr_UserInfo *info_switch_1; info_switch_1 = (union samr_UserInfo *)pyrpc_export_union(&samr_UserInfo_Type, r, r->in.level, py_info, "union samr_UserInfo"); if (info_switch_1 == NULL) { return false; } r->in.info = info_switch_1; } return true; } static PyObject *unpack_py_samr_SetUserInfo2_args_out(struct samr_SetUserInfo2 *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_SetBootKeyInformation_in_get_connect_handle(PyObject *obj, void *closure) { struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(obj); PyObject *py_connect_handle; if (object->in.connect_handle == NULL) { Py_RETURN_NONE; } py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->in.connect_handle, object->in.connect_handle); return py_connect_handle; } static int py_samr_SetBootKeyInformation_in_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.connect_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.connect_handle"); return -1; } object->in.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.connect_handle); if (object->in.connect_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_SetBootKeyInformation_in_get_unknown1(PyObject *obj, void *closure) { struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(obj); PyObject *py_unknown1; py_unknown1 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown1); return py_unknown1; } static int py_samr_SetBootKeyInformation_in_set_unknown1(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown1"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown1)); 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.unknown1 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_SetBootKeyInformation_in_get_unknown2(PyObject *obj, void *closure) { struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(obj); PyObject *py_unknown2; py_unknown2 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown2); return py_unknown2; } static int py_samr_SetBootKeyInformation_in_set_unknown2(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown2"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown2)); 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.unknown2 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_SetBootKeyInformation_in_get_unknown3(PyObject *obj, void *closure) { struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(obj); PyObject *py_unknown3; py_unknown3 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown3); return py_unknown3; } static int py_samr_SetBootKeyInformation_in_set_unknown3(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown3"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown3)); 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.unknown3 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_SetBootKeyInformation_get_result(PyObject *obj, void *closure) { struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_SetBootKeyInformation_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_SetBootKeyInformation_getsetters[] = { { .name = discard_const_p(char, "in_connect_handle"), .get = py_samr_SetBootKeyInformation_in_get_connect_handle, .set = py_samr_SetBootKeyInformation_in_set_connect_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_unknown1"), .get = py_samr_SetBootKeyInformation_in_get_unknown1, .set = py_samr_SetBootKeyInformation_in_set_unknown1, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_unknown2"), .get = py_samr_SetBootKeyInformation_in_get_unknown2, .set = py_samr_SetBootKeyInformation_in_set_unknown2, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_unknown3"), .get = py_samr_SetBootKeyInformation_in_get_unknown3, .set = py_samr_SetBootKeyInformation_in_set_unknown3, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_SetBootKeyInformation_get_result, .set = py_samr_SetBootKeyInformation_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_SetBootKeyInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_SetBootKeyInformation, type); struct samr_SetBootKeyInformation *_self = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.connect_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_SetBootKeyInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(59); } static PyObject *py_samr_SetBootKeyInformation_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 60) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetBootKeyInformation_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[59]; 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_samr_SetBootKeyInformation_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_samr_SetBootKeyInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_SetBootKeyInformation_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_samr_SetBootKeyInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_SetBootKeyInformation_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 samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 60) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetBootKeyInformation_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[59]; 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_samr_SetBootKeyInformation_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_samr_SetBootKeyInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetBootKeyInformation_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_samr_SetBootKeyInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetBootKeyInformation_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 60) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetBootKeyInformation_ndr_print"); return NULL; } call = &ndr_table_samr.calls[59]; 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_samr_SetBootKeyInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetBootKeyInformation_ndr_print(py_obj, "samr_SetBootKeyInformation_in", NDR_IN); } static PyObject *py_samr_SetBootKeyInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetBootKeyInformation_ndr_print(py_obj, "samr_SetBootKeyInformation_out", NDR_OUT); } static PyMethodDef py_samr_SetBootKeyInformation_methods[] = { { "opnum", (PyCFunction)py_samr_SetBootKeyInformation_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.SetBootKeyInformation.opnum() -> 59 (0x3b) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetBootKeyInformation_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_samr_SetBootKeyInformation_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_samr_SetBootKeyInformation_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_samr_SetBootKeyInformation_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_samr_SetBootKeyInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_SetBootKeyInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_SetBootKeyInformation_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.SetBootKeyInformation", .tp_getset = py_samr_SetBootKeyInformation_getsetters, .tp_methods = py_samr_SetBootKeyInformation_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_SetBootKeyInformation_new, }; static bool pack_py_samr_SetBootKeyInformation_args_in(PyObject *args, PyObject *kwargs, struct samr_SetBootKeyInformation *r) { PyObject *py_connect_handle; PyObject *py_unknown1; PyObject *py_unknown2; PyObject *py_unknown3; const char *kwnames[] = { "connect_handle", "unknown1", "unknown2", "unknown3", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_SetBootKeyInformation", discard_const_p(char *, kwnames), &py_connect_handle, &py_unknown1, &py_unknown2, &py_unknown3)) { return false; } if (py_connect_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.connect_handle"); return false; } r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle); if (r->in.connect_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle); if (py_unknown1 == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown1"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown1)); if (PyLong_Check(py_unknown1)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_unknown1); 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.unknown1 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_unknown2 == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown2"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown2)); if (PyLong_Check(py_unknown2)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_unknown2); 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.unknown2 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_unknown3 == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown3"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown3)); if (PyLong_Check(py_unknown3)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_unknown3); 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.unknown3 = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_SetBootKeyInformation_args_out(struct samr_SetBootKeyInformation *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_GetBootKeyInformation_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_GetBootKeyInformation_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_GetBootKeyInformation_out_get_unknown(PyObject *obj, void *closure) { struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(obj); PyObject *py_unknown; if (object->out.unknown == NULL) { Py_RETURN_NONE; } py_unknown = PyLong_FromUnsignedLongLong((uint32_t)*object->out.unknown); return py_unknown; } static int py_samr_GetBootKeyInformation_out_set_unknown(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.unknown)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.unknown"); return -1; } object->out.unknown = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.unknown); if (object->out.unknown == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.unknown)); 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.unknown = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_GetBootKeyInformation_get_result(PyObject *obj, void *closure) { struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_GetBootKeyInformation_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_GetBootKeyInformation_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_GetBootKeyInformation_in_get_domain_handle, .set = py_samr_GetBootKeyInformation_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "out_unknown"), .get = py_samr_GetBootKeyInformation_out_get_unknown, .set = py_samr_GetBootKeyInformation_out_set_unknown, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "result"), .get = py_samr_GetBootKeyInformation_get_result, .set = py_samr_GetBootKeyInformation_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_GetBootKeyInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_GetBootKeyInformation, type); struct samr_GetBootKeyInformation *_self = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); _self->out.unknown = talloc_zero(mem_ctx, uint32_t); return self; } static PyObject *py_samr_GetBootKeyInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(60); } static PyObject *py_samr_GetBootKeyInformation_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 61) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetBootKeyInformation_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[60]; 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_samr_GetBootKeyInformation_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_samr_GetBootKeyInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_GetBootKeyInformation_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_samr_GetBootKeyInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_GetBootKeyInformation_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 samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 61) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetBootKeyInformation_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[60]; 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_samr_GetBootKeyInformation_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_samr_GetBootKeyInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetBootKeyInformation_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_samr_GetBootKeyInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_GetBootKeyInformation_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 61) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetBootKeyInformation_ndr_print"); return NULL; } call = &ndr_table_samr.calls[60]; 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_samr_GetBootKeyInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetBootKeyInformation_ndr_print(py_obj, "samr_GetBootKeyInformation_in", NDR_IN); } static PyObject *py_samr_GetBootKeyInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_GetBootKeyInformation_ndr_print(py_obj, "samr_GetBootKeyInformation_out", NDR_OUT); } static PyMethodDef py_samr_GetBootKeyInformation_methods[] = { { "opnum", (PyCFunction)py_samr_GetBootKeyInformation_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.GetBootKeyInformation.opnum() -> 60 (0x3c) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetBootKeyInformation_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_samr_GetBootKeyInformation_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_samr_GetBootKeyInformation_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_samr_GetBootKeyInformation_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_samr_GetBootKeyInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_GetBootKeyInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_GetBootKeyInformation_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.GetBootKeyInformation", .tp_getset = py_samr_GetBootKeyInformation_getsetters, .tp_methods = py_samr_GetBootKeyInformation_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_GetBootKeyInformation_new, }; static bool pack_py_samr_GetBootKeyInformation_args_in(PyObject *args, PyObject *kwargs, struct samr_GetBootKeyInformation *r) { PyObject *py_domain_handle; const char *kwnames[] = { "domain_handle", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetBootKeyInformation", discard_const_p(char *, kwnames), &py_domain_handle)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); return true; } static PyObject *unpack_py_samr_GetBootKeyInformation_args_out(struct samr_GetBootKeyInformation *r) { PyObject *result; PyObject *py_unknown; py_unknown = PyLong_FromUnsignedLongLong((uint32_t)*r->out.unknown); result = py_unknown; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_Connect3_in_get_system_name(PyObject *obj, void *closure) { struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(obj); PyObject *py_system_name; if (object->in.system_name == NULL) { Py_RETURN_NONE; } if (object->in.system_name == NULL) { py_system_name = Py_None; Py_INCREF(py_system_name); } else { if (object->in.system_name == NULL) { py_system_name = Py_None; Py_INCREF(py_system_name); } else { py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore"); } } return py_system_name; } static int py_samr_Connect3_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name"); return -1; } if (value == Py_None) { object->in.system_name = NULL; } else { object->in.system_name = 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->in.system_name = talloc_str; } } return 0; } static PyObject *py_samr_Connect3_in_get_unknown(PyObject *obj, void *closure) { struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(obj); PyObject *py_unknown; py_unknown = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown); return py_unknown; } static int py_samr_Connect3_in_set_unknown(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown)); 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.unknown = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_Connect3_in_get_access_mask(PyObject *obj, void *closure) { struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(obj); PyObject *py_access_mask; py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask); return py_access_mask; } static int py_samr_Connect3_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask)); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_Connect3_out_get_connect_handle(PyObject *obj, void *closure) { struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(obj); PyObject *py_connect_handle; if (object->out.connect_handle == NULL) { Py_RETURN_NONE; } py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->out.connect_handle, object->out.connect_handle); return py_connect_handle; } static int py_samr_Connect3_out_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.connect_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.connect_handle"); return -1; } object->out.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.connect_handle); if (object->out.connect_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_Connect3_get_result(PyObject *obj, void *closure) { struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_Connect3_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_Connect3_getsetters[] = { { .name = discard_const_p(char, "in_system_name"), .get = py_samr_Connect3_in_get_system_name, .set = py_samr_Connect3_in_set_system_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_unknown"), .get = py_samr_Connect3_in_get_unknown, .set = py_samr_Connect3_in_set_unknown, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_access_mask"), .get = py_samr_Connect3_in_get_access_mask, .set = py_samr_Connect3_in_set_access_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectAccessMask") }, { .name = discard_const_p(char, "out_connect_handle"), .get = py_samr_Connect3_out_get_connect_handle, .set = py_samr_Connect3_out_set_connect_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_Connect3_get_result, .set = py_samr_Connect3_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_Connect3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_Connect3, type); struct samr_Connect3 *_self = (struct samr_Connect3 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_Connect3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(61); } static PyObject *py_samr_Connect3_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 62) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect3_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[61]; 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_samr_Connect3_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_samr_Connect3_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_Connect3_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_samr_Connect3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_Connect3_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 samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 62) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect3_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[61]; 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_samr_Connect3_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_samr_Connect3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Connect3_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_samr_Connect3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Connect3_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 62) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect3_ndr_print"); return NULL; } call = &ndr_table_samr.calls[61]; 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_samr_Connect3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Connect3_ndr_print(py_obj, "samr_Connect3_in", NDR_IN); } static PyObject *py_samr_Connect3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Connect3_ndr_print(py_obj, "samr_Connect3_out", NDR_OUT); } static PyMethodDef py_samr_Connect3_methods[] = { { "opnum", (PyCFunction)py_samr_Connect3_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.Connect3.opnum() -> 61 (0x3d) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect3_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_samr_Connect3_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_samr_Connect3_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_samr_Connect3_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_samr_Connect3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_Connect3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_Connect3_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.Connect3", .tp_getset = py_samr_Connect3_getsetters, .tp_methods = py_samr_Connect3_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_Connect3_new, }; static bool pack_py_samr_Connect3_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect3 *r) { PyObject *py_system_name; PyObject *py_unknown; PyObject *py_access_mask; const char *kwnames[] = { "system_name", "unknown", "access_mask", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_Connect3", discard_const_p(char *, kwnames), &py_system_name, &py_unknown, &py_access_mask)) { return false; } if (py_system_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name"); return false; } if (py_system_name == Py_None) { r->in.system_name = NULL; } else { r->in.system_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_system_name)) { unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_system_name)) { test_str = PyBytes_AS_STRING(py_system_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->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.system_name = talloc_str; } } if (py_unknown == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown)); if (PyLong_Check(py_unknown)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_unknown); 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.unknown = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_access_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask)); if (PyLong_Check(py_access_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_access_mask); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_Connect3_args_out(struct samr_Connect3 *r) { PyObject *result; PyObject *py_connect_handle; py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle); result = py_connect_handle; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_Connect4_in_get_system_name(PyObject *obj, void *closure) { struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(obj); PyObject *py_system_name; if (object->in.system_name == NULL) { Py_RETURN_NONE; } if (object->in.system_name == NULL) { py_system_name = Py_None; Py_INCREF(py_system_name); } else { if (object->in.system_name == NULL) { py_system_name = Py_None; Py_INCREF(py_system_name); } else { py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore"); } } return py_system_name; } static int py_samr_Connect4_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name"); return -1; } if (value == Py_None) { object->in.system_name = NULL; } else { object->in.system_name = 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->in.system_name = talloc_str; } } return 0; } static PyObject *py_samr_Connect4_in_get_client_version(PyObject *obj, void *closure) { struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(obj); PyObject *py_client_version; py_client_version = PyLong_FromUnsignedLongLong((uint32_t)object->in.client_version); return py_client_version; } static int py_samr_Connect4_in_set_client_version(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_version"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_version)); 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.client_version = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_Connect4_in_get_access_mask(PyObject *obj, void *closure) { struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(obj); PyObject *py_access_mask; py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask); return py_access_mask; } static int py_samr_Connect4_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask)); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_Connect4_out_get_connect_handle(PyObject *obj, void *closure) { struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(obj); PyObject *py_connect_handle; if (object->out.connect_handle == NULL) { Py_RETURN_NONE; } py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->out.connect_handle, object->out.connect_handle); return py_connect_handle; } static int py_samr_Connect4_out_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.connect_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.connect_handle"); return -1; } object->out.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.connect_handle); if (object->out.connect_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_Connect4_get_result(PyObject *obj, void *closure) { struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_Connect4_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_Connect4_getsetters[] = { { .name = discard_const_p(char, "in_system_name"), .get = py_samr_Connect4_in_get_system_name, .set = py_samr_Connect4_in_set_system_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_client_version"), .get = py_samr_Connect4_in_get_client_version, .set = py_samr_Connect4_in_set_client_version, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectVersion") }, { .name = discard_const_p(char, "in_access_mask"), .get = py_samr_Connect4_in_get_access_mask, .set = py_samr_Connect4_in_set_access_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectAccessMask") }, { .name = discard_const_p(char, "out_connect_handle"), .get = py_samr_Connect4_out_get_connect_handle, .set = py_samr_Connect4_out_set_connect_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_Connect4_get_result, .set = py_samr_Connect4_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_Connect4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_Connect4, type); struct samr_Connect4 *_self = (struct samr_Connect4 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_Connect4_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(62); } static PyObject *py_samr_Connect4_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 63) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect4_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[62]; 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_samr_Connect4_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_samr_Connect4_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_Connect4_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_samr_Connect4_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_Connect4_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 samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 63) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect4_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[62]; 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_samr_Connect4_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_samr_Connect4_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Connect4_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_samr_Connect4_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Connect4_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 63) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect4_ndr_print"); return NULL; } call = &ndr_table_samr.calls[62]; 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_samr_Connect4_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Connect4_ndr_print(py_obj, "samr_Connect4_in", NDR_IN); } static PyObject *py_samr_Connect4_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Connect4_ndr_print(py_obj, "samr_Connect4_out", NDR_OUT); } static PyMethodDef py_samr_Connect4_methods[] = { { "opnum", (PyCFunction)py_samr_Connect4_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.Connect4.opnum() -> 62 (0x3e) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect4_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_samr_Connect4_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_samr_Connect4_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_samr_Connect4_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_samr_Connect4_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_Connect4_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_Connect4_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.Connect4", .tp_getset = py_samr_Connect4_getsetters, .tp_methods = py_samr_Connect4_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_Connect4_new, }; static bool pack_py_samr_Connect4_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect4 *r) { PyObject *py_system_name; PyObject *py_client_version; PyObject *py_access_mask; const char *kwnames[] = { "system_name", "client_version", "access_mask", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_Connect4", discard_const_p(char *, kwnames), &py_system_name, &py_client_version, &py_access_mask)) { return false; } if (py_system_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name"); return false; } if (py_system_name == Py_None) { r->in.system_name = NULL; } else { r->in.system_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_system_name)) { unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_system_name)) { test_str = PyBytes_AS_STRING(py_system_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->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.system_name = talloc_str; } } if (py_client_version == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_version"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_version)); if (PyLong_Check(py_client_version)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_client_version); 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.client_version = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_access_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask)); if (PyLong_Check(py_access_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_access_mask); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_Connect4_args_out(struct samr_Connect4 *r) { PyObject *result; PyObject *py_connect_handle; py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle); result = py_connect_handle; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_ChangePasswordUser3_in_get_server(PyObject *obj, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj); PyObject *py_server; if (object->in.server == NULL) { Py_RETURN_NONE; } if (object->in.server == NULL) { py_server = Py_None; Py_INCREF(py_server); } else { py_server = pytalloc_reference_ex(lsa_String_Type, object->in.server, object->in.server); } return py_server; } static int py_samr_ChangePasswordUser3_in_set_server(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.server)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server"); return -1; } if (value == Py_None) { object->in.server = NULL; } else { object->in.server = NULL; PY_CHECK_TYPE(lsa_String_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.server = (struct lsa_String *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser3_in_get_account(PyObject *obj, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj); PyObject *py_account; if (object->in.account == NULL) { Py_RETURN_NONE; } py_account = pytalloc_reference_ex(lsa_String_Type, object->in.account, object->in.account); return py_account; } static int py_samr_ChangePasswordUser3_in_set_account(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account"); return -1; } object->in.account = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account); if (object->in.account == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(lsa_String_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.account = (struct lsa_String *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_ChangePasswordUser3_in_get_nt_password(PyObject *obj, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj); PyObject *py_nt_password; if (object->in.nt_password == NULL) { Py_RETURN_NONE; } if (object->in.nt_password == NULL) { py_nt_password = Py_None; Py_INCREF(py_nt_password); } else { py_nt_password = pytalloc_reference_ex(&samr_CryptPassword_Type, object->in.nt_password, object->in.nt_password); } return py_nt_password; } static int py_samr_ChangePasswordUser3_in_set_nt_password(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.nt_password)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.nt_password"); return -1; } if (value == Py_None) { object->in.nt_password = NULL; } else { object->in.nt_password = NULL; PY_CHECK_TYPE(&samr_CryptPassword_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.nt_password = (struct samr_CryptPassword *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser3_in_get_nt_verifier(PyObject *obj, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj); PyObject *py_nt_verifier; if (object->in.nt_verifier == NULL) { Py_RETURN_NONE; } if (object->in.nt_verifier == NULL) { py_nt_verifier = Py_None; Py_INCREF(py_nt_verifier); } else { py_nt_verifier = pytalloc_reference_ex(&samr_Password_Type, object->in.nt_verifier, object->in.nt_verifier); } return py_nt_verifier; } static int py_samr_ChangePasswordUser3_in_set_nt_verifier(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.nt_verifier)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.nt_verifier"); return -1; } if (value == Py_None) { object->in.nt_verifier = NULL; } else { object->in.nt_verifier = NULL; PY_CHECK_TYPE(&samr_Password_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.nt_verifier = (struct samr_Password *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser3_in_get_lm_change(PyObject *obj, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj); PyObject *py_lm_change; py_lm_change = PyLong_FromLong((uint16_t)object->in.lm_change); return py_lm_change; } static int py_samr_ChangePasswordUser3_in_set_lm_change(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_change"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lm_change)); 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.lm_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_ChangePasswordUser3_in_get_lm_password(PyObject *obj, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj); PyObject *py_lm_password; if (object->in.lm_password == NULL) { Py_RETURN_NONE; } if (object->in.lm_password == NULL) { py_lm_password = Py_None; Py_INCREF(py_lm_password); } else { py_lm_password = pytalloc_reference_ex(&samr_CryptPassword_Type, object->in.lm_password, object->in.lm_password); } return py_lm_password; } static int py_samr_ChangePasswordUser3_in_set_lm_password(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lm_password)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_password"); return -1; } if (value == Py_None) { object->in.lm_password = NULL; } else { object->in.lm_password = NULL; PY_CHECK_TYPE(&samr_CryptPassword_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.lm_password = (struct samr_CryptPassword *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser3_in_get_lm_verifier(PyObject *obj, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj); PyObject *py_lm_verifier; if (object->in.lm_verifier == NULL) { Py_RETURN_NONE; } if (object->in.lm_verifier == NULL) { py_lm_verifier = Py_None; Py_INCREF(py_lm_verifier); } else { py_lm_verifier = pytalloc_reference_ex(&samr_Password_Type, object->in.lm_verifier, object->in.lm_verifier); } return py_lm_verifier; } static int py_samr_ChangePasswordUser3_in_set_lm_verifier(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lm_verifier)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_verifier"); return -1; } if (value == Py_None) { object->in.lm_verifier = NULL; } else { object->in.lm_verifier = NULL; PY_CHECK_TYPE(&samr_Password_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.lm_verifier = (struct samr_Password *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser3_in_get_password3(PyObject *obj, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj); PyObject *py_password3; if (object->in.password3 == NULL) { Py_RETURN_NONE; } if (object->in.password3 == NULL) { py_password3 = Py_None; Py_INCREF(py_password3); } else { py_password3 = pytalloc_reference_ex(&samr_CryptPassword_Type, object->in.password3, object->in.password3); } return py_password3; } static int py_samr_ChangePasswordUser3_in_set_password3(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.password3)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password3"); return -1; } if (value == Py_None) { object->in.password3 = NULL; } else { object->in.password3 = NULL; PY_CHECK_TYPE(&samr_CryptPassword_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.password3 = (struct samr_CryptPassword *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser3_out_get_dominfo(PyObject *obj, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj); PyObject *py_dominfo; if (object->out.dominfo == NULL) { Py_RETURN_NONE; } if (*object->out.dominfo == NULL) { py_dominfo = Py_None; Py_INCREF(py_dominfo); } else { py_dominfo = pytalloc_reference_ex(&samr_DomInfo1_Type, *object->out.dominfo, *object->out.dominfo); } return py_dominfo; } static int py_samr_ChangePasswordUser3_out_set_dominfo(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dominfo)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dominfo"); return -1; } object->out.dominfo = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dominfo); if (object->out.dominfo == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.dominfo = NULL; } else { *object->out.dominfo = NULL; PY_CHECK_TYPE(&samr_DomInfo1_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.dominfo = (struct samr_DomInfo1 *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser3_out_get_reject(PyObject *obj, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj); PyObject *py_reject; if (object->out.reject == NULL) { Py_RETURN_NONE; } if (*object->out.reject == NULL) { py_reject = Py_None; Py_INCREF(py_reject); } else { py_reject = pytalloc_reference_ex(&userPwdChangeFailureInformation_Type, *object->out.reject, *object->out.reject); } return py_reject; } static int py_samr_ChangePasswordUser3_out_set_reject(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.reject)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.reject"); return -1; } object->out.reject = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.reject); if (object->out.reject == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.reject = NULL; } else { *object->out.reject = NULL; PY_CHECK_TYPE(&userPwdChangeFailureInformation_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.reject = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_ChangePasswordUser3_get_result(PyObject *obj, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_ChangePasswordUser3_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_ChangePasswordUser3_getsetters[] = { { .name = discard_const_p(char, "in_server"), .get = py_samr_ChangePasswordUser3_in_get_server, .set = py_samr_ChangePasswordUser3_in_set_server, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "in_account"), .get = py_samr_ChangePasswordUser3_in_get_account, .set = py_samr_ChangePasswordUser3_in_set_account, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "in_nt_password"), .get = py_samr_ChangePasswordUser3_in_get_nt_password, .set = py_samr_ChangePasswordUser3_in_set_nt_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword") }, { .name = discard_const_p(char, "in_nt_verifier"), .get = py_samr_ChangePasswordUser3_in_get_nt_verifier, .set = py_samr_ChangePasswordUser3_in_set_nt_verifier, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "in_lm_change"), .get = py_samr_ChangePasswordUser3_in_get_lm_change, .set = py_samr_ChangePasswordUser3_in_set_lm_change, .doc = discard_const_p(char, "PIDL-generated element of base type uint8") }, { .name = discard_const_p(char, "in_lm_password"), .get = py_samr_ChangePasswordUser3_in_get_lm_password, .set = py_samr_ChangePasswordUser3_in_set_lm_password, .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword") }, { .name = discard_const_p(char, "in_lm_verifier"), .get = py_samr_ChangePasswordUser3_in_get_lm_verifier, .set = py_samr_ChangePasswordUser3_in_set_lm_verifier, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "in_password3"), .get = py_samr_ChangePasswordUser3_in_get_password3, .set = py_samr_ChangePasswordUser3_in_set_password3, .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword") }, { .name = discard_const_p(char, "out_dominfo"), .get = py_samr_ChangePasswordUser3_out_get_dominfo, .set = py_samr_ChangePasswordUser3_out_set_dominfo, .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomInfo1") }, { .name = discard_const_p(char, "out_reject"), .get = py_samr_ChangePasswordUser3_out_get_reject, .set = py_samr_ChangePasswordUser3_out_set_reject, .doc = discard_const_p(char, "PIDL-generated element of base type userPwdChangeFailureInformation") }, { .name = discard_const_p(char, "result"), .get = py_samr_ChangePasswordUser3_get_result, .set = py_samr_ChangePasswordUser3_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_ChangePasswordUser3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_ChangePasswordUser3, type); struct samr_ChangePasswordUser3 *_self = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.account = talloc_zero(mem_ctx, struct lsa_String); /* a pointer to a NULL pointer */ _self->out.dominfo = talloc_zero(mem_ctx, struct samr_DomInfo1 *); /* a pointer to a NULL pointer */ _self->out.reject = talloc_zero(mem_ctx, struct userPwdChangeFailureInformation *); return self; } static PyObject *py_samr_ChangePasswordUser3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(63); } static PyObject *py_samr_ChangePasswordUser3_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 64) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser3_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[63]; 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_samr_ChangePasswordUser3_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_samr_ChangePasswordUser3_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_ChangePasswordUser3_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_samr_ChangePasswordUser3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_ChangePasswordUser3_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 samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 64) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser3_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[63]; 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_samr_ChangePasswordUser3_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_samr_ChangePasswordUser3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_ChangePasswordUser3_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_samr_ChangePasswordUser3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_ChangePasswordUser3_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 64) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser3_ndr_print"); return NULL; } call = &ndr_table_samr.calls[63]; 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_samr_ChangePasswordUser3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_ChangePasswordUser3_ndr_print(py_obj, "samr_ChangePasswordUser3_in", NDR_IN); } static PyObject *py_samr_ChangePasswordUser3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_ChangePasswordUser3_ndr_print(py_obj, "samr_ChangePasswordUser3_out", NDR_OUT); } static PyMethodDef py_samr_ChangePasswordUser3_methods[] = { { "opnum", (PyCFunction)py_samr_ChangePasswordUser3_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.ChangePasswordUser3.opnum() -> 63 (0x3f) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser3_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_samr_ChangePasswordUser3_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_samr_ChangePasswordUser3_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_samr_ChangePasswordUser3_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_samr_ChangePasswordUser3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_ChangePasswordUser3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_ChangePasswordUser3_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ChangePasswordUser3", .tp_getset = py_samr_ChangePasswordUser3_getsetters, .tp_methods = py_samr_ChangePasswordUser3_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ChangePasswordUser3_new, }; static bool pack_py_samr_ChangePasswordUser3_args_in(PyObject *args, PyObject *kwargs, struct samr_ChangePasswordUser3 *r) { PyObject *py_server; PyObject *py_account; PyObject *py_nt_password; PyObject *py_nt_verifier; PyObject *py_lm_change; PyObject *py_lm_password; PyObject *py_lm_verifier; PyObject *py_password3; const char *kwnames[] = { "server", "account", "nt_password", "nt_verifier", "lm_change", "lm_password", "lm_verifier", "password3", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOO:samr_ChangePasswordUser3", discard_const_p(char *, kwnames), &py_server, &py_account, &py_nt_password, &py_nt_verifier, &py_lm_change, &py_lm_password, &py_lm_verifier, &py_password3)) { return false; } if (py_server == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server"); return false; } if (py_server == Py_None) { r->in.server = NULL; } else { r->in.server = NULL; PY_CHECK_TYPE(lsa_String_Type, py_server, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_server)) == NULL) { PyErr_NoMemory(); return false; } r->in.server = (struct lsa_String *)pytalloc_get_ptr(py_server); } if (py_account == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account"); return false; } r->in.account = talloc_ptrtype(r, r->in.account); if (r->in.account == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(lsa_String_Type, py_account, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_account)) == NULL) { PyErr_NoMemory(); return false; } r->in.account = (struct lsa_String *)pytalloc_get_ptr(py_account); if (py_nt_password == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.nt_password"); return false; } if (py_nt_password == Py_None) { r->in.nt_password = NULL; } else { r->in.nt_password = NULL; PY_CHECK_TYPE(&samr_CryptPassword_Type, py_nt_password, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_password)) == NULL) { PyErr_NoMemory(); return false; } r->in.nt_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_nt_password); } if (py_nt_verifier == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.nt_verifier"); return false; } if (py_nt_verifier == Py_None) { r->in.nt_verifier = NULL; } else { r->in.nt_verifier = NULL; PY_CHECK_TYPE(&samr_Password_Type, py_nt_verifier, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_verifier)) == NULL) { PyErr_NoMemory(); return false; } r->in.nt_verifier = (struct samr_Password *)pytalloc_get_ptr(py_nt_verifier); } if (py_lm_change == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_change"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lm_change)); if (PyLong_Check(py_lm_change)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_lm_change); 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.lm_change = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_lm_password == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_password"); return false; } if (py_lm_password == Py_None) { r->in.lm_password = NULL; } else { r->in.lm_password = NULL; PY_CHECK_TYPE(&samr_CryptPassword_Type, py_lm_password, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_password)) == NULL) { PyErr_NoMemory(); return false; } r->in.lm_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_lm_password); } if (py_lm_verifier == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_verifier"); return false; } if (py_lm_verifier == Py_None) { r->in.lm_verifier = NULL; } else { r->in.lm_verifier = NULL; PY_CHECK_TYPE(&samr_Password_Type, py_lm_verifier, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_verifier)) == NULL) { PyErr_NoMemory(); return false; } r->in.lm_verifier = (struct samr_Password *)pytalloc_get_ptr(py_lm_verifier); } if (py_password3 == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password3"); return false; } if (py_password3 == Py_None) { r->in.password3 = NULL; } else { r->in.password3 = NULL; PY_CHECK_TYPE(&samr_CryptPassword_Type, py_password3, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_password3)) == NULL) { PyErr_NoMemory(); return false; } r->in.password3 = (struct samr_CryptPassword *)pytalloc_get_ptr(py_password3); } return true; } static PyObject *unpack_py_samr_ChangePasswordUser3_args_out(struct samr_ChangePasswordUser3 *r) { PyObject *result; PyObject *py_dominfo; PyObject *py_reject; result = PyTuple_New(2); if (*r->out.dominfo == NULL) { py_dominfo = Py_None; Py_INCREF(py_dominfo); } else { py_dominfo = pytalloc_reference_ex(&samr_DomInfo1_Type, *r->out.dominfo, *r->out.dominfo); } PyTuple_SetItem(result, 0, py_dominfo); if (*r->out.reject == NULL) { py_reject = Py_None; Py_INCREF(py_reject); } else { py_reject = pytalloc_reference_ex(&userPwdChangeFailureInformation_Type, *r->out.reject, *r->out.reject); } PyTuple_SetItem(result, 1, py_reject); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_Connect5_in_get_system_name(PyObject *obj, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj); PyObject *py_system_name; if (object->in.system_name == NULL) { Py_RETURN_NONE; } if (object->in.system_name == NULL) { py_system_name = Py_None; Py_INCREF(py_system_name); } else { if (object->in.system_name == NULL) { py_system_name = Py_None; Py_INCREF(py_system_name); } else { py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore"); } } return py_system_name; } static int py_samr_Connect5_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name"); return -1; } if (value == Py_None) { object->in.system_name = NULL; } else { object->in.system_name = 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->in.system_name = talloc_str; } } return 0; } static PyObject *py_samr_Connect5_in_get_access_mask(PyObject *obj, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj); PyObject *py_access_mask; py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask); return py_access_mask; } static int py_samr_Connect5_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask)); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_Connect5_in_get_level_in(PyObject *obj, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj); PyObject *py_level_in; py_level_in = PyLong_FromUnsignedLongLong((uint32_t)object->in.level_in); return py_level_in; } static int py_samr_Connect5_in_set_level_in(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level_in"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level_in)); 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_in = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_Connect5_in_get_info_in(PyObject *obj, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj); PyObject *py_info_in; if (object->in.info_in == NULL) { Py_RETURN_NONE; } py_info_in = pyrpc_import_union(&samr_ConnectInfo_Type, object->in.info_in, object->in.level_in, object->in.info_in, "union samr_ConnectInfo"); if (py_info_in == NULL) { return NULL; } return py_info_in; } static int py_samr_Connect5_in_set_info_in(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info_in)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_in"); return -1; } object->in.info_in = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info_in); if (object->in.info_in == NULL) { PyErr_NoMemory(); return -1; } { union samr_ConnectInfo *info_in_switch_1; info_in_switch_1 = (union samr_ConnectInfo *)pyrpc_export_union(&samr_ConnectInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level_in, value, "union samr_ConnectInfo"); if (info_in_switch_1 == NULL) { return -1; } object->in.info_in = info_in_switch_1; } return 0; } static PyObject *py_samr_Connect5_out_get_level_out(PyObject *obj, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj); PyObject *py_level_out; if (object->out.level_out == NULL) { Py_RETURN_NONE; } py_level_out = PyLong_FromUnsignedLongLong((uint32_t)*object->out.level_out); return py_level_out; } static int py_samr_Connect5_out_set_level_out(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.level_out)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.level_out"); return -1; } object->out.level_out = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.level_out); if (object->out.level_out == NULL) { PyErr_NoMemory(); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.level_out)); 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.level_out = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_Connect5_out_get_info_out(PyObject *obj, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj); PyObject *py_info_out; if (object->out.info_out == NULL) { Py_RETURN_NONE; } py_info_out = pyrpc_import_union(&samr_ConnectInfo_Type, object->out.info_out, *object->out.level_out, object->out.info_out, "union samr_ConnectInfo"); if (py_info_out == NULL) { return NULL; } return py_info_out; } static int py_samr_Connect5_out_set_info_out(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info_out)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info_out"); return -1; } object->out.info_out = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info_out); if (object->out.info_out == NULL) { PyErr_NoMemory(); return -1; } { union samr_ConnectInfo *info_out_switch_1; info_out_switch_1 = (union samr_ConnectInfo *)pyrpc_export_union(&samr_ConnectInfo_Type, pytalloc_get_mem_ctx(py_obj), *object->out.level_out, value, "union samr_ConnectInfo"); if (info_out_switch_1 == NULL) { return -1; } object->out.info_out = info_out_switch_1; } return 0; } static PyObject *py_samr_Connect5_out_get_connect_handle(PyObject *obj, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj); PyObject *py_connect_handle; if (object->out.connect_handle == NULL) { Py_RETURN_NONE; } py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->out.connect_handle, object->out.connect_handle); return py_connect_handle; } static int py_samr_Connect5_out_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.connect_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.connect_handle"); return -1; } object->out.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.connect_handle); if (object->out.connect_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_Connect5_get_result(PyObject *obj, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_Connect5_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_Connect5_getsetters[] = { { .name = discard_const_p(char, "in_system_name"), .get = py_samr_Connect5_in_get_system_name, .set = py_samr_Connect5_in_set_system_name, .doc = discard_const_p(char, "PIDL-generated element of base type uint16") }, { .name = discard_const_p(char, "in_access_mask"), .get = py_samr_Connect5_in_get_access_mask, .set = py_samr_Connect5_in_set_access_mask, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectAccessMask") }, { .name = discard_const_p(char, "in_level_in"), .get = py_samr_Connect5_in_get_level_in, .set = py_samr_Connect5_in_set_level_in, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_info_in"), .get = py_samr_Connect5_in_get_info_in, .set = py_samr_Connect5_in_set_info_in, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectInfo") }, { .name = discard_const_p(char, "out_level_out"), .get = py_samr_Connect5_out_get_level_out, .set = py_samr_Connect5_out_set_level_out, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_info_out"), .get = py_samr_Connect5_out_get_info_out, .set = py_samr_Connect5_out_set_info_out, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectInfo") }, { .name = discard_const_p(char, "out_connect_handle"), .get = py_samr_Connect5_out_get_connect_handle, .set = py_samr_Connect5_out_set_connect_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "result"), .get = py_samr_Connect5_get_result, .set = py_samr_Connect5_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_Connect5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_Connect5, type); struct samr_Connect5 *_self = (struct samr_Connect5 *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.info_in = talloc_zero(mem_ctx, union samr_ConnectInfo); _self->out.level_out = talloc_zero(mem_ctx, uint32_t); _self->out.info_out = talloc_zero(mem_ctx, union samr_ConnectInfo); _self->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle); return self; } static PyObject *py_samr_Connect5_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(64); } static PyObject *py_samr_Connect5_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 65) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect5_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[64]; 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_samr_Connect5_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_samr_Connect5_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_Connect5_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_samr_Connect5_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_Connect5_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 samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 65) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect5_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[64]; 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_samr_Connect5_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_samr_Connect5_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Connect5_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_samr_Connect5_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_Connect5_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 65) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect5_ndr_print"); return NULL; } call = &ndr_table_samr.calls[64]; 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_samr_Connect5_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Connect5_ndr_print(py_obj, "samr_Connect5_in", NDR_IN); } static PyObject *py_samr_Connect5_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_Connect5_ndr_print(py_obj, "samr_Connect5_out", NDR_OUT); } static PyMethodDef py_samr_Connect5_methods[] = { { "opnum", (PyCFunction)py_samr_Connect5_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.Connect5.opnum() -> 64 (0x40) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect5_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_samr_Connect5_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_samr_Connect5_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_samr_Connect5_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_samr_Connect5_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_Connect5_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_Connect5_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.Connect5", .tp_getset = py_samr_Connect5_getsetters, .tp_methods = py_samr_Connect5_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_Connect5_new, }; static bool pack_py_samr_Connect5_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect5 *r) { PyObject *py_system_name; PyObject *py_access_mask; PyObject *py_level_in; PyObject *py_info_in; const char *kwnames[] = { "system_name", "access_mask", "level_in", "info_in", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_Connect5", discard_const_p(char *, kwnames), &py_system_name, &py_access_mask, &py_level_in, &py_info_in)) { return false; } if (py_system_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name"); return false; } if (py_system_name == Py_None) { r->in.system_name = NULL; } else { r->in.system_name = NULL; { const char *test_str; const char *talloc_str; PyObject *unicode = NULL; if (PyUnicode_Check(py_system_name)) { unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore"); if (unicode == NULL) { PyErr_NoMemory(); return false; } test_str = PyBytes_AS_STRING(unicode); } else if (PyBytes_Check(py_system_name)) { test_str = PyBytes_AS_STRING(py_system_name); } else { PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->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.system_name = talloc_str; } } if (py_access_mask == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask)); if (PyLong_Check(py_access_mask)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_access_mask); 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.access_mask = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_level_in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level_in"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level_in)); if (PyLong_Check(py_level_in)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_level_in); 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_in = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_info_in == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_in"); return false; } r->in.info_in = talloc_ptrtype(r, r->in.info_in); if (r->in.info_in == NULL) { PyErr_NoMemory(); return false; } { union samr_ConnectInfo *info_in_switch_1; info_in_switch_1 = (union samr_ConnectInfo *)pyrpc_export_union(&samr_ConnectInfo_Type, r, r->in.level_in, py_info_in, "union samr_ConnectInfo"); if (info_in_switch_1 == NULL) { return false; } r->in.info_in = info_in_switch_1; } return true; } static PyObject *unpack_py_samr_Connect5_args_out(struct samr_Connect5 *r) { PyObject *result; PyObject *py_level_out; PyObject *py_info_out; PyObject *py_connect_handle; result = PyTuple_New(3); py_level_out = PyLong_FromUnsignedLongLong((uint32_t)*r->out.level_out); PyTuple_SetItem(result, 0, py_level_out); py_info_out = pyrpc_import_union(&samr_ConnectInfo_Type, r->out.info_out, *r->out.level_out, r->out.info_out, "union samr_ConnectInfo"); if (py_info_out == NULL) { return NULL; } PyTuple_SetItem(result, 1, py_info_out); py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle); PyTuple_SetItem(result, 2, py_connect_handle); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_RidToSid_in_get_domain_handle(PyObject *obj, void *closure) { struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(obj); PyObject *py_domain_handle; if (object->in.domain_handle == NULL) { Py_RETURN_NONE; } py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle); return py_domain_handle; } static int py_samr_RidToSid_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle"); return -1; } object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle); if (object->in.domain_handle == NULL) { PyErr_NoMemory(); return -1; } PY_CHECK_TYPE(policy_handle_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.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value); return 0; } static PyObject *py_samr_RidToSid_in_get_rid(PyObject *obj, void *closure) { struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(obj); PyObject *py_rid; py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->in.rid); return py_rid; } static int py_samr_RidToSid_in_set_rid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rid"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rid)); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_RidToSid_out_get_sid(PyObject *obj, void *closure) { struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(obj); PyObject *py_sid; if (object->out.sid == NULL) { Py_RETURN_NONE; } if (*object->out.sid == NULL) { py_sid = Py_None; Py_INCREF(py_sid); } else { py_sid = pytalloc_reference_ex(dom_sid_Type, *object->out.sid, *object->out.sid); } return py_sid; } static int py_samr_RidToSid_out_set_sid(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sid)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sid"); return -1; } object->out.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sid); if (object->out.sid == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.sid = NULL; } else { *object->out.sid = NULL; PY_CHECK_TYPE(dom_sid_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.sid = (struct dom_sid *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_RidToSid_get_result(PyObject *obj, void *closure) { struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_RidToSid_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_RidToSid_getsetters[] = { { .name = discard_const_p(char, "in_domain_handle"), .get = py_samr_RidToSid_in_get_domain_handle, .set = py_samr_RidToSid_in_set_domain_handle, .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle") }, { .name = discard_const_p(char, "in_rid"), .get = py_samr_RidToSid_in_get_rid, .set = py_samr_RidToSid_in_set_rid, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "out_sid"), .get = py_samr_RidToSid_out_get_sid, .set = py_samr_RidToSid_out_set_sid, .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2") }, { .name = discard_const_p(char, "result"), .get = py_samr_RidToSid_get_result, .set = py_samr_RidToSid_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_RidToSid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_RidToSid, type); struct samr_RidToSid *_self = (struct samr_RidToSid *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle); /* a pointer to a NULL pointer */ _self->out.sid = talloc_zero(mem_ctx, struct dom_sid2 *); return self; } static PyObject *py_samr_RidToSid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(65); } static PyObject *py_samr_RidToSid_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 66) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RidToSid_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[65]; 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_samr_RidToSid_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_samr_RidToSid_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_RidToSid_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_samr_RidToSid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_RidToSid_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 samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 66) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RidToSid_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[65]; 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_samr_RidToSid_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_samr_RidToSid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_RidToSid_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_samr_RidToSid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_RidToSid_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 66) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RidToSid_ndr_print"); return NULL; } call = &ndr_table_samr.calls[65]; 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_samr_RidToSid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_RidToSid_ndr_print(py_obj, "samr_RidToSid_in", NDR_IN); } static PyObject *py_samr_RidToSid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_RidToSid_ndr_print(py_obj, "samr_RidToSid_out", NDR_OUT); } static PyMethodDef py_samr_RidToSid_methods[] = { { "opnum", (PyCFunction)py_samr_RidToSid_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.RidToSid.opnum() -> 65 (0x41) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RidToSid_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_samr_RidToSid_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_samr_RidToSid_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_samr_RidToSid_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_samr_RidToSid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_RidToSid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_RidToSid_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.RidToSid", .tp_getset = py_samr_RidToSid_getsetters, .tp_methods = py_samr_RidToSid_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_RidToSid_new, }; static bool pack_py_samr_RidToSid_args_in(PyObject *args, PyObject *kwargs, struct samr_RidToSid *r) { PyObject *py_domain_handle; PyObject *py_rid; const char *kwnames[] = { "domain_handle", "rid", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_RidToSid", discard_const_p(char *, kwnames), &py_domain_handle, &py_rid)) { return false; } if (py_domain_handle == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle"); return false; } r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle); if (r->in.domain_handle == NULL) { PyErr_NoMemory(); return false; } PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) { PyErr_NoMemory(); return false; } r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle); if (py_rid == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rid"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rid)); if (PyLong_Check(py_rid)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_rid); 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.rid = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } return true; } static PyObject *unpack_py_samr_RidToSid_args_out(struct samr_RidToSid *r) { PyObject *result; PyObject *py_sid; if (*r->out.sid == NULL) { py_sid = Py_None; Py_INCREF(py_sid); } else { py_sid = pytalloc_reference_ex(dom_sid_Type, *r->out.sid, *r->out.sid); } result = py_sid; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_SetDsrmPassword_in_get_name(PyObject *obj, void *closure) { struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(obj); PyObject *py_name; if (object->in.name == NULL) { Py_RETURN_NONE; } if (object->in.name == NULL) { py_name = Py_None; Py_INCREF(py_name); } else { py_name = pytalloc_reference_ex(lsa_String_Type, object->in.name, object->in.name); } return py_name; } static int py_samr_SetDsrmPassword_in_set_name(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name"); return -1; } if (value == Py_None) { object->in.name = NULL; } else { object->in.name = NULL; PY_CHECK_TYPE(lsa_String_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.name = (struct lsa_String *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_SetDsrmPassword_in_get_unknown(PyObject *obj, void *closure) { struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(obj); PyObject *py_unknown; py_unknown = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown); return py_unknown; } static int py_samr_SetDsrmPassword_in_set_unknown(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown"); return -1; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown)); 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.unknown = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return -1; } } return 0; } static PyObject *py_samr_SetDsrmPassword_in_get_hash(PyObject *obj, void *closure) { struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(obj); PyObject *py_hash; if (object->in.hash == NULL) { Py_RETURN_NONE; } if (object->in.hash == NULL) { py_hash = Py_None; Py_INCREF(py_hash); } else { py_hash = pytalloc_reference_ex(&samr_Password_Type, object->in.hash, object->in.hash); } return py_hash; } static int py_samr_SetDsrmPassword_in_set_hash(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.hash)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.hash"); return -1; } if (value == Py_None) { object->in.hash = NULL; } else { object->in.hash = NULL; PY_CHECK_TYPE(&samr_Password_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.hash = (struct samr_Password *)pytalloc_get_ptr(value); } return 0; } static PyObject *py_samr_SetDsrmPassword_get_result(PyObject *obj, void *closure) { struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_SetDsrmPassword_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_SetDsrmPassword_getsetters[] = { { .name = discard_const_p(char, "in_name"), .get = py_samr_SetDsrmPassword_in_get_name, .set = py_samr_SetDsrmPassword_in_set_name, .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String") }, { .name = discard_const_p(char, "in_unknown"), .get = py_samr_SetDsrmPassword_in_get_unknown, .set = py_samr_SetDsrmPassword_in_set_unknown, .doc = discard_const_p(char, "PIDL-generated element of base type uint32") }, { .name = discard_const_p(char, "in_hash"), .get = py_samr_SetDsrmPassword_in_get_hash, .set = py_samr_SetDsrmPassword_in_set_hash, .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password") }, { .name = discard_const_p(char, "result"), .get = py_samr_SetDsrmPassword_get_result, .set = py_samr_SetDsrmPassword_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_SetDsrmPassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_SetDsrmPassword, type); return self; } static PyObject *py_samr_SetDsrmPassword_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(66); } static PyObject *py_samr_SetDsrmPassword_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 67) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetDsrmPassword_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[66]; 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_samr_SetDsrmPassword_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_samr_SetDsrmPassword_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_SetDsrmPassword_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_samr_SetDsrmPassword_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_SetDsrmPassword_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 samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 67) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetDsrmPassword_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[66]; 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_samr_SetDsrmPassword_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_samr_SetDsrmPassword_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetDsrmPassword_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_samr_SetDsrmPassword_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_SetDsrmPassword_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 67) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetDsrmPassword_ndr_print"); return NULL; } call = &ndr_table_samr.calls[66]; 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_samr_SetDsrmPassword_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetDsrmPassword_ndr_print(py_obj, "samr_SetDsrmPassword_in", NDR_IN); } static PyObject *py_samr_SetDsrmPassword_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_SetDsrmPassword_ndr_print(py_obj, "samr_SetDsrmPassword_out", NDR_OUT); } static PyMethodDef py_samr_SetDsrmPassword_methods[] = { { "opnum", (PyCFunction)py_samr_SetDsrmPassword_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.SetDsrmPassword.opnum() -> 66 (0x42) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetDsrmPassword_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_samr_SetDsrmPassword_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_samr_SetDsrmPassword_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_samr_SetDsrmPassword_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_samr_SetDsrmPassword_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_SetDsrmPassword_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_SetDsrmPassword_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.SetDsrmPassword", .tp_getset = py_samr_SetDsrmPassword_getsetters, .tp_methods = py_samr_SetDsrmPassword_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_SetDsrmPassword_new, }; static bool pack_py_samr_SetDsrmPassword_args_in(PyObject *args, PyObject *kwargs, struct samr_SetDsrmPassword *r) { PyObject *py_name; PyObject *py_unknown; PyObject *py_hash; const char *kwnames[] = { "name", "unknown", "hash", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetDsrmPassword", discard_const_p(char *, kwnames), &py_name, &py_unknown, &py_hash)) { return false; } if (py_name == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name"); return false; } if (py_name == Py_None) { r->in.name = NULL; } else { r->in.name = NULL; PY_CHECK_TYPE(lsa_String_Type, py_name, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) { PyErr_NoMemory(); return false; } r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name); } if (py_unknown == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown"); return false; } { const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown)); if (PyLong_Check(py_unknown)) { unsigned long long test_var; test_var = PyLong_AsUnsignedLongLong(py_unknown); 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.unknown = test_var; } else { PyErr_Format(PyExc_TypeError, "Expected type %s",\ PyLong_Type.tp_name); return false; } } if (py_hash == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.hash"); return false; } if (py_hash == Py_None) { r->in.hash = NULL; } else { r->in.hash = NULL; PY_CHECK_TYPE(&samr_Password_Type, py_hash, return false;); if (talloc_reference(r, pytalloc_get_mem_ctx(py_hash)) == NULL) { PyErr_NoMemory(); return false; } r->in.hash = (struct samr_Password *)pytalloc_get_ptr(py_hash); } return true; } static PyObject *unpack_py_samr_SetDsrmPassword_args_out(struct samr_SetDsrmPassword *r) { PyObject *result; result = Py_None; Py_INCREF(result); if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } static PyObject *py_samr_ValidatePassword_in_get_level(PyObject *obj, void *closure) { struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(obj); PyObject *py_level; py_level = PyLong_FromLong((uint16_t)object->in.level); return py_level; } static int py_samr_ValidatePassword_in_set_level(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)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_samr_ValidatePassword_in_get_req(PyObject *obj, void *closure) { struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(obj); PyObject *py_req; if (object->in.req == NULL) { Py_RETURN_NONE; } py_req = pyrpc_import_union(&samr_ValidatePasswordReq_Type, object->in.req, object->in.level, object->in.req, "union samr_ValidatePasswordReq"); if (py_req == NULL) { return NULL; } return py_req; } static int py_samr_ValidatePassword_in_set_req(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.req)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.req"); return -1; } object->in.req = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.req); if (object->in.req == NULL) { PyErr_NoMemory(); return -1; } { union samr_ValidatePasswordReq *req_switch_1; req_switch_1 = (union samr_ValidatePasswordReq *)pyrpc_export_union(&samr_ValidatePasswordReq_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_ValidatePasswordReq"); if (req_switch_1 == NULL) { return -1; } object->in.req = req_switch_1; } return 0; } static PyObject *py_samr_ValidatePassword_out_get_rep(PyObject *obj, void *closure) { struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(obj); PyObject *py_rep; if (object->out.rep == NULL) { Py_RETURN_NONE; } if (*object->out.rep == NULL) { py_rep = Py_None; Py_INCREF(py_rep); } else { py_rep = pyrpc_import_union(&samr_ValidatePasswordRep_Type, *object->out.rep, object->in.level, *object->out.rep, "union samr_ValidatePasswordRep"); if (py_rep == NULL) { return NULL; } } return py_rep; } static int py_samr_ValidatePassword_out_set_rep(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(py_obj); talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rep)); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rep"); return -1; } object->out.rep = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rep); if (object->out.rep == NULL) { PyErr_NoMemory(); return -1; } if (value == Py_None) { *object->out.rep = NULL; } else { *object->out.rep = NULL; { union samr_ValidatePasswordRep *rep_switch_2; rep_switch_2 = (union samr_ValidatePasswordRep *)pyrpc_export_union(&samr_ValidatePasswordRep_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_ValidatePasswordRep"); if (rep_switch_2 == NULL) { return -1; } *object->out.rep = rep_switch_2; } } return 0; } static PyObject *py_samr_ValidatePassword_get_result(PyObject *obj, void *closure) { struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(obj); PyObject *py_result; py_result = PyErr_FromNTSTATUS(object->out.result); return py_result; } static int py_samr_ValidatePassword_set_result(PyObject *py_obj, PyObject *value, void *closure) { struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(py_obj); if (value == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result"); return -1; } object->out.result = NT_STATUS(PyLong_AsLong(value)); return 0; } static PyGetSetDef py_samr_ValidatePassword_getsetters[] = { { .name = discard_const_p(char, "in_level"), .get = py_samr_ValidatePassword_in_get_level, .set = py_samr_ValidatePassword_in_set_level, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordLevel") }, { .name = discard_const_p(char, "in_req"), .get = py_samr_ValidatePassword_in_get_req, .set = py_samr_ValidatePassword_in_set_req, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordReq") }, { .name = discard_const_p(char, "out_rep"), .get = py_samr_ValidatePassword_out_get_rep, .set = py_samr_ValidatePassword_out_set_rep, .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordRep") }, { .name = discard_const_p(char, "result"), .get = py_samr_ValidatePassword_get_result, .set = py_samr_ValidatePassword_set_result, .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS") }, { .name = NULL } }; static PyObject *py_samr_ValidatePassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *self = pytalloc_new(struct samr_ValidatePassword, type); struct samr_ValidatePassword *_self = (struct samr_ValidatePassword *)pytalloc_get_ptr(self); TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self); _self->in.req = talloc_zero(mem_ctx, union samr_ValidatePasswordReq); /* a pointer to a NULL pointer */ _self->out.rep = talloc_zero(mem_ctx, union samr_ValidatePasswordRep *); return self; } static PyObject *py_samr_ValidatePassword_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored)) { return PyLong_FromLong(67); } static PyObject *py_samr_ValidatePassword_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags) { const struct ndr_interface_call *call = NULL; struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(py_obj); PyObject *ret = NULL; struct ndr_push *push = NULL; DATA_BLOB blob; enum ndr_err_code err; if (ndr_table_samr.num_calls < 68) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ValidatePassword_ndr_pack"); return NULL; } call = &ndr_table_samr.calls[67]; 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_samr_ValidatePassword_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_samr_ValidatePassword_ndr_pack(py_obj, NDR_IN, ndr_push_flags); } static PyObject *py_samr_ValidatePassword_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_samr_ValidatePassword_ndr_pack(py_obj, NDR_OUT, ndr_push_flags); } static PyObject *py_samr_ValidatePassword_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 samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(py_obj); struct ndr_pull *pull = NULL; enum ndr_err_code err; if (ndr_table_samr.num_calls < 68) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ValidatePassword_ndr_unpack"); return NULL; } call = &ndr_table_samr.calls[67]; 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_samr_ValidatePassword_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_samr_ValidatePassword_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_ValidatePassword_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_samr_ValidatePassword_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining); } static PyObject *py_samr_ValidatePassword_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags) { const struct ndr_interface_call *call = NULL; struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(py_obj); PyObject *ret; char *retstr; if (ndr_table_samr.num_calls < 68) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ValidatePassword_ndr_print"); return NULL; } call = &ndr_table_samr.calls[67]; 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_samr_ValidatePassword_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_ValidatePassword_ndr_print(py_obj, "samr_ValidatePassword_in", NDR_IN); } static PyObject *py_samr_ValidatePassword_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored)) { return py_samr_ValidatePassword_ndr_print(py_obj, "samr_ValidatePassword_out", NDR_OUT); } static PyMethodDef py_samr_ValidatePassword_methods[] = { { "opnum", (PyCFunction)py_samr_ValidatePassword_ndr_opnum, METH_NOARGS|METH_CLASS, "samr.ValidatePassword.opnum() -> 67 (0x43) " }, { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ValidatePassword_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_samr_ValidatePassword_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_samr_ValidatePassword_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_samr_ValidatePassword_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_samr_ValidatePassword_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" }, { "__ndr_print_out__", (PyCFunction)py_samr_ValidatePassword_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" }, { NULL, NULL, 0, NULL } }; static PyTypeObject samr_ValidatePassword_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.ValidatePassword", .tp_getset = py_samr_ValidatePassword_getsetters, .tp_methods = py_samr_ValidatePassword_methods, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = py_samr_ValidatePassword_new, }; static bool pack_py_samr_ValidatePassword_args_in(PyObject *args, PyObject *kwargs, struct samr_ValidatePassword *r) { PyObject *py_level; PyObject *py_req; const char *kwnames[] = { "level", "req", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_ValidatePassword", discard_const_p(char *, kwnames), &py_level, &py_req)) { return false; } 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; } } if (py_req == NULL) { PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.req"); return false; } r->in.req = talloc_ptrtype(r, r->in.req); if (r->in.req == NULL) { PyErr_NoMemory(); return false; } { union samr_ValidatePasswordReq *req_switch_1; req_switch_1 = (union samr_ValidatePasswordReq *)pyrpc_export_union(&samr_ValidatePasswordReq_Type, r, r->in.level, py_req, "union samr_ValidatePasswordReq"); if (req_switch_1 == NULL) { return false; } r->in.req = req_switch_1; } return true; } static PyObject *unpack_py_samr_ValidatePassword_args_out(struct samr_ValidatePassword *r) { PyObject *result; PyObject *py_rep; if (*r->out.rep == NULL) { py_rep = Py_None; Py_INCREF(py_rep); } else { py_rep = pyrpc_import_union(&samr_ValidatePasswordRep_Type, *r->out.rep, r->in.level, *r->out.rep, "union samr_ValidatePasswordRep"); if (py_rep == NULL) { return NULL; } } result = py_rep; if (NT_STATUS_IS_ERR(r->out.result)) { PyErr_SetNTSTATUS(r->out.result); return NULL; } return result; } const struct PyNdrRpcMethodDef py_ndr_samr_methods[] = { { "Connect", "S.Connect(system_name, access_mask) -> connect_handle", (py_dcerpc_call_fn)dcerpc_samr_Connect_r, (py_data_pack_fn)pack_py_samr_Connect_args_in, (py_data_unpack_fn)unpack_py_samr_Connect_args_out, 0, &ndr_table_samr }, { "Close", "S.Close(handle) -> handle", (py_dcerpc_call_fn)dcerpc_samr_Close_r, (py_data_pack_fn)pack_py_samr_Close_args_in, (py_data_unpack_fn)unpack_py_samr_Close_args_out, 1, &ndr_table_samr }, { "SetSecurity", "S.SetSecurity(handle, sec_info, sdbuf) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetSecurity_r, (py_data_pack_fn)pack_py_samr_SetSecurity_args_in, (py_data_unpack_fn)unpack_py_samr_SetSecurity_args_out, 2, &ndr_table_samr }, { "QuerySecurity", "S.QuerySecurity(handle, sec_info) -> sdbuf", (py_dcerpc_call_fn)dcerpc_samr_QuerySecurity_r, (py_data_pack_fn)pack_py_samr_QuerySecurity_args_in, (py_data_unpack_fn)unpack_py_samr_QuerySecurity_args_out, 3, &ndr_table_samr }, { "Shutdown", "S.Shutdown(connect_handle) -> None", (py_dcerpc_call_fn)dcerpc_samr_Shutdown_r, (py_data_pack_fn)pack_py_samr_Shutdown_args_in, (py_data_unpack_fn)unpack_py_samr_Shutdown_args_out, 4, &ndr_table_samr }, { "LookupDomain", "S.LookupDomain(connect_handle, domain_name) -> sid", (py_dcerpc_call_fn)dcerpc_samr_LookupDomain_r, (py_data_pack_fn)pack_py_samr_LookupDomain_args_in, (py_data_unpack_fn)unpack_py_samr_LookupDomain_args_out, 5, &ndr_table_samr }, { "EnumDomains", "S.EnumDomains(connect_handle, resume_handle, buf_size) -> (resume_handle, sam, num_entries)", (py_dcerpc_call_fn)dcerpc_samr_EnumDomains_r, (py_data_pack_fn)pack_py_samr_EnumDomains_args_in, (py_data_unpack_fn)unpack_py_samr_EnumDomains_args_out, 6, &ndr_table_samr }, { "OpenDomain", "S.OpenDomain(connect_handle, access_mask, sid) -> domain_handle", (py_dcerpc_call_fn)dcerpc_samr_OpenDomain_r, (py_data_pack_fn)pack_py_samr_OpenDomain_args_in, (py_data_unpack_fn)unpack_py_samr_OpenDomain_args_out, 7, &ndr_table_samr }, { "QueryDomainInfo", "S.QueryDomainInfo(domain_handle, level) -> info", (py_dcerpc_call_fn)dcerpc_samr_QueryDomainInfo_r, (py_data_pack_fn)pack_py_samr_QueryDomainInfo_args_in, (py_data_unpack_fn)unpack_py_samr_QueryDomainInfo_args_out, 8, &ndr_table_samr }, { "SetDomainInfo", "S.SetDomainInfo(domain_handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetDomainInfo_r, (py_data_pack_fn)pack_py_samr_SetDomainInfo_args_in, (py_data_unpack_fn)unpack_py_samr_SetDomainInfo_args_out, 9, &ndr_table_samr }, { "CreateDomainGroup", "S.CreateDomainGroup(domain_handle, name, access_mask) -> (group_handle, rid)", (py_dcerpc_call_fn)dcerpc_samr_CreateDomainGroup_r, (py_data_pack_fn)pack_py_samr_CreateDomainGroup_args_in, (py_data_unpack_fn)unpack_py_samr_CreateDomainGroup_args_out, 10, &ndr_table_samr }, { "EnumDomainGroups", "S.EnumDomainGroups(domain_handle, resume_handle, max_size) -> (resume_handle, sam, num_entries)", (py_dcerpc_call_fn)dcerpc_samr_EnumDomainGroups_r, (py_data_pack_fn)pack_py_samr_EnumDomainGroups_args_in, (py_data_unpack_fn)unpack_py_samr_EnumDomainGroups_args_out, 11, &ndr_table_samr }, { "CreateUser", "S.CreateUser(domain_handle, account_name, access_mask) -> (user_handle, rid)", (py_dcerpc_call_fn)dcerpc_samr_CreateUser_r, (py_data_pack_fn)pack_py_samr_CreateUser_args_in, (py_data_unpack_fn)unpack_py_samr_CreateUser_args_out, 12, &ndr_table_samr }, { "EnumDomainUsers", "S.EnumDomainUsers(domain_handle, resume_handle, acct_flags, max_size) -> (resume_handle, sam, num_entries)", (py_dcerpc_call_fn)dcerpc_samr_EnumDomainUsers_r, (py_data_pack_fn)pack_py_samr_EnumDomainUsers_args_in, (py_data_unpack_fn)unpack_py_samr_EnumDomainUsers_args_out, 13, &ndr_table_samr }, { "CreateDomAlias", "S.CreateDomAlias(domain_handle, alias_name, access_mask) -> (alias_handle, rid)", (py_dcerpc_call_fn)dcerpc_samr_CreateDomAlias_r, (py_data_pack_fn)pack_py_samr_CreateDomAlias_args_in, (py_data_unpack_fn)unpack_py_samr_CreateDomAlias_args_out, 14, &ndr_table_samr }, { "EnumDomainAliases", "S.EnumDomainAliases(domain_handle, resume_handle, max_size) -> (resume_handle, sam, num_entries)", (py_dcerpc_call_fn)dcerpc_samr_EnumDomainAliases_r, (py_data_pack_fn)pack_py_samr_EnumDomainAliases_args_in, (py_data_unpack_fn)unpack_py_samr_EnumDomainAliases_args_out, 15, &ndr_table_samr }, { "GetAliasMembership", "S.GetAliasMembership(domain_handle, sids) -> rids", (py_dcerpc_call_fn)dcerpc_samr_GetAliasMembership_r, (py_data_pack_fn)pack_py_samr_GetAliasMembership_args_in, (py_data_unpack_fn)unpack_py_samr_GetAliasMembership_args_out, 16, &ndr_table_samr }, { "LookupNames", "S.LookupNames(domain_handle, names) -> (rids, types)", (py_dcerpc_call_fn)dcerpc_samr_LookupNames_r, (py_data_pack_fn)pack_py_samr_LookupNames_args_in, (py_data_unpack_fn)unpack_py_samr_LookupNames_args_out, 17, &ndr_table_samr }, { "LookupRids", "S.LookupRids(domain_handle, rids) -> (names, types)", (py_dcerpc_call_fn)dcerpc_samr_LookupRids_r, (py_data_pack_fn)pack_py_samr_LookupRids_args_in, (py_data_unpack_fn)unpack_py_samr_LookupRids_args_out, 18, &ndr_table_samr }, { "OpenGroup", "S.OpenGroup(domain_handle, access_mask, rid) -> group_handle", (py_dcerpc_call_fn)dcerpc_samr_OpenGroup_r, (py_data_pack_fn)pack_py_samr_OpenGroup_args_in, (py_data_unpack_fn)unpack_py_samr_OpenGroup_args_out, 19, &ndr_table_samr }, { "QueryGroupInfo", "S.QueryGroupInfo(group_handle, level) -> info", (py_dcerpc_call_fn)dcerpc_samr_QueryGroupInfo_r, (py_data_pack_fn)pack_py_samr_QueryGroupInfo_args_in, (py_data_unpack_fn)unpack_py_samr_QueryGroupInfo_args_out, 20, &ndr_table_samr }, { "SetGroupInfo", "S.SetGroupInfo(group_handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetGroupInfo_r, (py_data_pack_fn)pack_py_samr_SetGroupInfo_args_in, (py_data_unpack_fn)unpack_py_samr_SetGroupInfo_args_out, 21, &ndr_table_samr }, { "AddGroupMember", "S.AddGroupMember(group_handle, rid, flags) -> None", (py_dcerpc_call_fn)dcerpc_samr_AddGroupMember_r, (py_data_pack_fn)pack_py_samr_AddGroupMember_args_in, (py_data_unpack_fn)unpack_py_samr_AddGroupMember_args_out, 22, &ndr_table_samr }, { "DeleteDomainGroup", "S.DeleteDomainGroup(group_handle) -> group_handle", (py_dcerpc_call_fn)dcerpc_samr_DeleteDomainGroup_r, (py_data_pack_fn)pack_py_samr_DeleteDomainGroup_args_in, (py_data_unpack_fn)unpack_py_samr_DeleteDomainGroup_args_out, 23, &ndr_table_samr }, { "DeleteGroupMember", "S.DeleteGroupMember(group_handle, rid) -> None", (py_dcerpc_call_fn)dcerpc_samr_DeleteGroupMember_r, (py_data_pack_fn)pack_py_samr_DeleteGroupMember_args_in, (py_data_unpack_fn)unpack_py_samr_DeleteGroupMember_args_out, 24, &ndr_table_samr }, { "QueryGroupMember", "S.QueryGroupMember(group_handle) -> rids", (py_dcerpc_call_fn)dcerpc_samr_QueryGroupMember_r, (py_data_pack_fn)pack_py_samr_QueryGroupMember_args_in, (py_data_unpack_fn)unpack_py_samr_QueryGroupMember_args_out, 25, &ndr_table_samr }, { "SetMemberAttributesOfGroup", "S.SetMemberAttributesOfGroup(group_handle, unknown1, unknown2) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetMemberAttributesOfGroup_r, (py_data_pack_fn)pack_py_samr_SetMemberAttributesOfGroup_args_in, (py_data_unpack_fn)unpack_py_samr_SetMemberAttributesOfGroup_args_out, 26, &ndr_table_samr }, { "OpenAlias", "S.OpenAlias(domain_handle, access_mask, rid) -> alias_handle", (py_dcerpc_call_fn)dcerpc_samr_OpenAlias_r, (py_data_pack_fn)pack_py_samr_OpenAlias_args_in, (py_data_unpack_fn)unpack_py_samr_OpenAlias_args_out, 27, &ndr_table_samr }, { "QueryAliasInfo", "S.QueryAliasInfo(alias_handle, level) -> info", (py_dcerpc_call_fn)dcerpc_samr_QueryAliasInfo_r, (py_data_pack_fn)pack_py_samr_QueryAliasInfo_args_in, (py_data_unpack_fn)unpack_py_samr_QueryAliasInfo_args_out, 28, &ndr_table_samr }, { "SetAliasInfo", "S.SetAliasInfo(alias_handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetAliasInfo_r, (py_data_pack_fn)pack_py_samr_SetAliasInfo_args_in, (py_data_unpack_fn)unpack_py_samr_SetAliasInfo_args_out, 29, &ndr_table_samr }, { "DeleteDomAlias", "S.DeleteDomAlias(alias_handle) -> alias_handle", (py_dcerpc_call_fn)dcerpc_samr_DeleteDomAlias_r, (py_data_pack_fn)pack_py_samr_DeleteDomAlias_args_in, (py_data_unpack_fn)unpack_py_samr_DeleteDomAlias_args_out, 30, &ndr_table_samr }, { "AddAliasMember", "S.AddAliasMember(alias_handle, sid) -> None", (py_dcerpc_call_fn)dcerpc_samr_AddAliasMember_r, (py_data_pack_fn)pack_py_samr_AddAliasMember_args_in, (py_data_unpack_fn)unpack_py_samr_AddAliasMember_args_out, 31, &ndr_table_samr }, { "DeleteAliasMember", "S.DeleteAliasMember(alias_handle, sid) -> None", (py_dcerpc_call_fn)dcerpc_samr_DeleteAliasMember_r, (py_data_pack_fn)pack_py_samr_DeleteAliasMember_args_in, (py_data_unpack_fn)unpack_py_samr_DeleteAliasMember_args_out, 32, &ndr_table_samr }, { "GetMembersInAlias", "S.GetMembersInAlias(alias_handle) -> sids", (py_dcerpc_call_fn)dcerpc_samr_GetMembersInAlias_r, (py_data_pack_fn)pack_py_samr_GetMembersInAlias_args_in, (py_data_unpack_fn)unpack_py_samr_GetMembersInAlias_args_out, 33, &ndr_table_samr }, { "OpenUser", "S.OpenUser(domain_handle, access_mask, rid) -> user_handle", (py_dcerpc_call_fn)dcerpc_samr_OpenUser_r, (py_data_pack_fn)pack_py_samr_OpenUser_args_in, (py_data_unpack_fn)unpack_py_samr_OpenUser_args_out, 34, &ndr_table_samr }, { "DeleteUser", "S.DeleteUser(user_handle) -> user_handle", (py_dcerpc_call_fn)dcerpc_samr_DeleteUser_r, (py_data_pack_fn)pack_py_samr_DeleteUser_args_in, (py_data_unpack_fn)unpack_py_samr_DeleteUser_args_out, 35, &ndr_table_samr }, { "QueryUserInfo", "S.QueryUserInfo(user_handle, level) -> info", (py_dcerpc_call_fn)dcerpc_samr_QueryUserInfo_r, (py_data_pack_fn)pack_py_samr_QueryUserInfo_args_in, (py_data_unpack_fn)unpack_py_samr_QueryUserInfo_args_out, 36, &ndr_table_samr }, { "SetUserInfo", "S.SetUserInfo(user_handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetUserInfo_r, (py_data_pack_fn)pack_py_samr_SetUserInfo_args_in, (py_data_unpack_fn)unpack_py_samr_SetUserInfo_args_out, 37, &ndr_table_samr }, { "ChangePasswordUser", "S.ChangePasswordUser(user_handle, lm_present, old_lm_crypted, new_lm_crypted, nt_present, old_nt_crypted, new_nt_crypted, cross1_present, nt_cross, cross2_present, lm_cross) -> None", (py_dcerpc_call_fn)dcerpc_samr_ChangePasswordUser_r, (py_data_pack_fn)pack_py_samr_ChangePasswordUser_args_in, (py_data_unpack_fn)unpack_py_samr_ChangePasswordUser_args_out, 38, &ndr_table_samr }, { "GetGroupsForUser", "S.GetGroupsForUser(user_handle) -> rids", (py_dcerpc_call_fn)dcerpc_samr_GetGroupsForUser_r, (py_data_pack_fn)pack_py_samr_GetGroupsForUser_args_in, (py_data_unpack_fn)unpack_py_samr_GetGroupsForUser_args_out, 39, &ndr_table_samr }, { "QueryDisplayInfo", "S.QueryDisplayInfo(domain_handle, level, start_idx, max_entries, buf_size) -> (total_size, returned_size, info)", (py_dcerpc_call_fn)dcerpc_samr_QueryDisplayInfo_r, (py_data_pack_fn)pack_py_samr_QueryDisplayInfo_args_in, (py_data_unpack_fn)unpack_py_samr_QueryDisplayInfo_args_out, 40, &ndr_table_samr }, { "GetDisplayEnumerationIndex", "S.GetDisplayEnumerationIndex(domain_handle, level, name) -> idx", (py_dcerpc_call_fn)dcerpc_samr_GetDisplayEnumerationIndex_r, (py_data_pack_fn)pack_py_samr_GetDisplayEnumerationIndex_args_in, (py_data_unpack_fn)unpack_py_samr_GetDisplayEnumerationIndex_args_out, 41, &ndr_table_samr }, { "TestPrivateFunctionsDomain", "S.TestPrivateFunctionsDomain(domain_handle) -> None", (py_dcerpc_call_fn)dcerpc_samr_TestPrivateFunctionsDomain_r, (py_data_pack_fn)pack_py_samr_TestPrivateFunctionsDomain_args_in, (py_data_unpack_fn)unpack_py_samr_TestPrivateFunctionsDomain_args_out, 42, &ndr_table_samr }, { "TestPrivateFunctionsUser", "S.TestPrivateFunctionsUser(user_handle) -> None", (py_dcerpc_call_fn)dcerpc_samr_TestPrivateFunctionsUser_r, (py_data_pack_fn)pack_py_samr_TestPrivateFunctionsUser_args_in, (py_data_unpack_fn)unpack_py_samr_TestPrivateFunctionsUser_args_out, 43, &ndr_table_samr }, { "GetUserPwInfo", "S.GetUserPwInfo(user_handle) -> info", (py_dcerpc_call_fn)dcerpc_samr_GetUserPwInfo_r, (py_data_pack_fn)pack_py_samr_GetUserPwInfo_args_in, (py_data_unpack_fn)unpack_py_samr_GetUserPwInfo_args_out, 44, &ndr_table_samr }, { "RemoveMemberFromForeignDomain", "S.RemoveMemberFromForeignDomain(domain_handle, sid) -> None", (py_dcerpc_call_fn)dcerpc_samr_RemoveMemberFromForeignDomain_r, (py_data_pack_fn)pack_py_samr_RemoveMemberFromForeignDomain_args_in, (py_data_unpack_fn)unpack_py_samr_RemoveMemberFromForeignDomain_args_out, 45, &ndr_table_samr }, { "QueryDomainInfo2", "S.QueryDomainInfo2(domain_handle, level) -> info", (py_dcerpc_call_fn)dcerpc_samr_QueryDomainInfo2_r, (py_data_pack_fn)pack_py_samr_QueryDomainInfo2_args_in, (py_data_unpack_fn)unpack_py_samr_QueryDomainInfo2_args_out, 46, &ndr_table_samr }, { "QueryUserInfo2", "S.QueryUserInfo2(user_handle, level) -> info", (py_dcerpc_call_fn)dcerpc_samr_QueryUserInfo2_r, (py_data_pack_fn)pack_py_samr_QueryUserInfo2_args_in, (py_data_unpack_fn)unpack_py_samr_QueryUserInfo2_args_out, 47, &ndr_table_samr }, { "QueryDisplayInfo2", "S.QueryDisplayInfo2(domain_handle, level, start_idx, max_entries, buf_size) -> (total_size, returned_size, info)", (py_dcerpc_call_fn)dcerpc_samr_QueryDisplayInfo2_r, (py_data_pack_fn)pack_py_samr_QueryDisplayInfo2_args_in, (py_data_unpack_fn)unpack_py_samr_QueryDisplayInfo2_args_out, 48, &ndr_table_samr }, { "GetDisplayEnumerationIndex2", "S.GetDisplayEnumerationIndex2(domain_handle, level, name) -> idx", (py_dcerpc_call_fn)dcerpc_samr_GetDisplayEnumerationIndex2_r, (py_data_pack_fn)pack_py_samr_GetDisplayEnumerationIndex2_args_in, (py_data_unpack_fn)unpack_py_samr_GetDisplayEnumerationIndex2_args_out, 49, &ndr_table_samr }, { "CreateUser2", "S.CreateUser2(domain_handle, account_name, acct_flags, access_mask) -> (user_handle, access_granted, rid)", (py_dcerpc_call_fn)dcerpc_samr_CreateUser2_r, (py_data_pack_fn)pack_py_samr_CreateUser2_args_in, (py_data_unpack_fn)unpack_py_samr_CreateUser2_args_out, 50, &ndr_table_samr }, { "QueryDisplayInfo3", "S.QueryDisplayInfo3(domain_handle, level, start_idx, max_entries, buf_size) -> (total_size, returned_size, info)", (py_dcerpc_call_fn)dcerpc_samr_QueryDisplayInfo3_r, (py_data_pack_fn)pack_py_samr_QueryDisplayInfo3_args_in, (py_data_unpack_fn)unpack_py_samr_QueryDisplayInfo3_args_out, 51, &ndr_table_samr }, { "AddMultipleMembersToAlias", "S.AddMultipleMembersToAlias(alias_handle, sids) -> None", (py_dcerpc_call_fn)dcerpc_samr_AddMultipleMembersToAlias_r, (py_data_pack_fn)pack_py_samr_AddMultipleMembersToAlias_args_in, (py_data_unpack_fn)unpack_py_samr_AddMultipleMembersToAlias_args_out, 52, &ndr_table_samr }, { "RemoveMultipleMembersFromAlias", "S.RemoveMultipleMembersFromAlias(alias_handle, sids) -> None", (py_dcerpc_call_fn)dcerpc_samr_RemoveMultipleMembersFromAlias_r, (py_data_pack_fn)pack_py_samr_RemoveMultipleMembersFromAlias_args_in, (py_data_unpack_fn)unpack_py_samr_RemoveMultipleMembersFromAlias_args_out, 53, &ndr_table_samr }, { "OemChangePasswordUser2", "S.OemChangePasswordUser2(server, account, password, hash) -> None", (py_dcerpc_call_fn)dcerpc_samr_OemChangePasswordUser2_r, (py_data_pack_fn)pack_py_samr_OemChangePasswordUser2_args_in, (py_data_unpack_fn)unpack_py_samr_OemChangePasswordUser2_args_out, 54, &ndr_table_samr }, { "ChangePasswordUser2", "S.ChangePasswordUser2(server, account, nt_password, nt_verifier, lm_change, lm_password, lm_verifier) -> None", (py_dcerpc_call_fn)dcerpc_samr_ChangePasswordUser2_r, (py_data_pack_fn)pack_py_samr_ChangePasswordUser2_args_in, (py_data_unpack_fn)unpack_py_samr_ChangePasswordUser2_args_out, 55, &ndr_table_samr }, { "GetDomPwInfo", "S.GetDomPwInfo(domain_name) -> info", (py_dcerpc_call_fn)dcerpc_samr_GetDomPwInfo_r, (py_data_pack_fn)pack_py_samr_GetDomPwInfo_args_in, (py_data_unpack_fn)unpack_py_samr_GetDomPwInfo_args_out, 56, &ndr_table_samr }, { "Connect2", "S.Connect2(system_name, access_mask) -> connect_handle", (py_dcerpc_call_fn)dcerpc_samr_Connect2_r, (py_data_pack_fn)pack_py_samr_Connect2_args_in, (py_data_unpack_fn)unpack_py_samr_Connect2_args_out, 57, &ndr_table_samr }, { "SetUserInfo2", "S.SetUserInfo2(user_handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetUserInfo2_r, (py_data_pack_fn)pack_py_samr_SetUserInfo2_args_in, (py_data_unpack_fn)unpack_py_samr_SetUserInfo2_args_out, 58, &ndr_table_samr }, { "SetBootKeyInformation", "S.SetBootKeyInformation(connect_handle, unknown1, unknown2, unknown3) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetBootKeyInformation_r, (py_data_pack_fn)pack_py_samr_SetBootKeyInformation_args_in, (py_data_unpack_fn)unpack_py_samr_SetBootKeyInformation_args_out, 59, &ndr_table_samr }, { "GetBootKeyInformation", "S.GetBootKeyInformation(domain_handle) -> unknown", (py_dcerpc_call_fn)dcerpc_samr_GetBootKeyInformation_r, (py_data_pack_fn)pack_py_samr_GetBootKeyInformation_args_in, (py_data_unpack_fn)unpack_py_samr_GetBootKeyInformation_args_out, 60, &ndr_table_samr }, { "Connect3", "S.Connect3(system_name, unknown, access_mask) -> connect_handle", (py_dcerpc_call_fn)dcerpc_samr_Connect3_r, (py_data_pack_fn)pack_py_samr_Connect3_args_in, (py_data_unpack_fn)unpack_py_samr_Connect3_args_out, 61, &ndr_table_samr }, { "Connect4", "S.Connect4(system_name, client_version, access_mask) -> connect_handle", (py_dcerpc_call_fn)dcerpc_samr_Connect4_r, (py_data_pack_fn)pack_py_samr_Connect4_args_in, (py_data_unpack_fn)unpack_py_samr_Connect4_args_out, 62, &ndr_table_samr }, { "ChangePasswordUser3", "S.ChangePasswordUser3(server, account, nt_password, nt_verifier, lm_change, lm_password, lm_verifier, password3) -> (dominfo, reject)", (py_dcerpc_call_fn)dcerpc_samr_ChangePasswordUser3_r, (py_data_pack_fn)pack_py_samr_ChangePasswordUser3_args_in, (py_data_unpack_fn)unpack_py_samr_ChangePasswordUser3_args_out, 63, &ndr_table_samr }, { "Connect5", "S.Connect5(system_name, access_mask, level_in, info_in) -> (level_out, info_out, connect_handle)", (py_dcerpc_call_fn)dcerpc_samr_Connect5_r, (py_data_pack_fn)pack_py_samr_Connect5_args_in, (py_data_unpack_fn)unpack_py_samr_Connect5_args_out, 64, &ndr_table_samr }, { "RidToSid", "S.RidToSid(domain_handle, rid) -> sid", (py_dcerpc_call_fn)dcerpc_samr_RidToSid_r, (py_data_pack_fn)pack_py_samr_RidToSid_args_in, (py_data_unpack_fn)unpack_py_samr_RidToSid_args_out, 65, &ndr_table_samr }, { "SetDsrmPassword", "S.SetDsrmPassword(name, unknown, hash) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetDsrmPassword_r, (py_data_pack_fn)pack_py_samr_SetDsrmPassword_args_in, (py_data_unpack_fn)unpack_py_samr_SetDsrmPassword_args_out, 66, &ndr_table_samr }, { "ValidatePassword", "S.ValidatePassword(level, req) -> rep", (py_dcerpc_call_fn)dcerpc_samr_ValidatePassword_r, (py_data_pack_fn)pack_py_samr_ValidatePassword_args_in, (py_data_unpack_fn)unpack_py_samr_ValidatePassword_args_out, 67, &ndr_table_samr }, {0} }; static PyObject *interface_samr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_samr); } static PyTypeObject samr_InterfaceType = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.samr", .tp_basicsize = sizeof(dcerpc_InterfaceObject), .tp_doc = "samr(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", .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = interface_samr_new, }; static PyObject *syntax_samr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_samr.syntax_id); } static PyTypeObject samr_SyntaxType = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "samr.samr_abstract_syntax", .tp_doc = "samr_abstract_syntax()\n", .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = syntax_samr_new, }; static PyMethodDef samr_methods[] = { { NULL, NULL, 0, NULL } }; static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, .m_name = "samr", .m_doc = "samr DCE/RPC", .m_size = -1, .m_methods = samr_methods, }; MODULE_INIT_FUNC(samr) { PyObject *m = NULL; PyObject *dep_samba_dcerpc_misc = NULL; PyObject *dep_samba_dcerpc_lsa = NULL; PyObject *dep_samba_dcerpc_security = 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_samba_dcerpc_lsa = PyImport_ImportModule("samba.dcerpc.lsa"); if (dep_samba_dcerpc_lsa == NULL) goto out; dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security"); if (dep_samba_dcerpc_security == 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; lsa_String_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "String"); if (lsa_String_Type == NULL) goto out; BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject"); if (BaseObject_Type == NULL) goto out; lsa_BinaryString_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "BinaryString"); if (lsa_BinaryString_Type == NULL) goto out; lsa_AsciiStringLarge_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "AsciiStringLarge"); if (lsa_AsciiStringLarge_Type == NULL) goto out; lsa_StringLarge_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "StringLarge"); if (lsa_StringLarge_Type == NULL) goto out; policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle"); if (policy_handle_Type == NULL) goto out; sec_desc_buf_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "sec_desc_buf"); if (sec_desc_buf_Type == NULL) goto out; dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid"); if (dom_sid_Type == NULL) goto out; lsa_SidArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "SidArray"); if (lsa_SidArray_Type == NULL) goto out; lsa_Strings_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "Strings"); if (lsa_Strings_Type == NULL) goto out; lsa_AsciiString_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "AsciiString"); if (lsa_AsciiString_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; samr_SamEntry_Type.tp_base = BaseObject_Type; samr_SamEntry_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_SamArray_Type.tp_base = BaseObject_Type; samr_SamArray_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DomInfo1_Type.tp_base = BaseObject_Type; samr_DomInfo1_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DomGeneralInformation_Type.tp_base = BaseObject_Type; samr_DomGeneralInformation_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DomInfo3_Type.tp_base = BaseObject_Type; samr_DomInfo3_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DomOEMInformation_Type.tp_base = BaseObject_Type; samr_DomOEMInformation_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DomInfo5_Type.tp_base = BaseObject_Type; samr_DomInfo5_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DomInfo6_Type.tp_base = BaseObject_Type; samr_DomInfo6_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DomInfo7_Type.tp_base = BaseObject_Type; samr_DomInfo7_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DomInfo8_Type.tp_base = BaseObject_Type; samr_DomInfo8_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DomInfo9_Type.tp_base = BaseObject_Type; samr_DomInfo9_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DomGeneralInformation2_Type.tp_base = BaseObject_Type; samr_DomGeneralInformation2_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DomInfo12_Type.tp_base = BaseObject_Type; samr_DomInfo12_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DomInfo13_Type.tp_base = BaseObject_Type; samr_DomInfo13_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DomainInfo_Type.tp_base = BaseObject_Type; samr_DomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_Ids_Type.tp_base = BaseObject_Type; samr_Ids_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_GroupInfoAll_Type.tp_base = BaseObject_Type; samr_GroupInfoAll_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_GroupInfoAttributes_Type.tp_base = BaseObject_Type; samr_GroupInfoAttributes_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_GroupInfoDescription_Type.tp_base = BaseObject_Type; samr_GroupInfoDescription_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_GroupInfo_Type.tp_base = BaseObject_Type; samr_GroupInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_RidAttrArray_Type.tp_base = BaseObject_Type; samr_RidAttrArray_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_AliasInfoAll_Type.tp_base = BaseObject_Type; samr_AliasInfoAll_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_AliasInfo_Type.tp_base = BaseObject_Type; samr_AliasInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo1_Type.tp_base = BaseObject_Type; samr_UserInfo1_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo2_Type.tp_base = BaseObject_Type; samr_UserInfo2_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_LogonHours_Type.tp_base = BaseObject_Type; samr_LogonHours_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo3_Type.tp_base = BaseObject_Type; samr_UserInfo3_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo4_Type.tp_base = BaseObject_Type; samr_UserInfo4_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo5_Type.tp_base = BaseObject_Type; samr_UserInfo5_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo6_Type.tp_base = BaseObject_Type; samr_UserInfo6_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo7_Type.tp_base = BaseObject_Type; samr_UserInfo7_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo8_Type.tp_base = BaseObject_Type; samr_UserInfo8_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo9_Type.tp_base = BaseObject_Type; samr_UserInfo9_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo10_Type.tp_base = BaseObject_Type; samr_UserInfo10_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo11_Type.tp_base = BaseObject_Type; samr_UserInfo11_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo12_Type.tp_base = BaseObject_Type; samr_UserInfo12_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo13_Type.tp_base = BaseObject_Type; samr_UserInfo13_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo14_Type.tp_base = BaseObject_Type; samr_UserInfo14_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo16_Type.tp_base = BaseObject_Type; samr_UserInfo16_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo17_Type.tp_base = BaseObject_Type; samr_UserInfo17_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_Password_Type.tp_base = BaseObject_Type; samr_Password_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo18_Type.tp_base = BaseObject_Type; samr_UserInfo18_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo20_Type.tp_base = BaseObject_Type; samr_UserInfo20_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo21_Type.tp_base = BaseObject_Type; samr_UserInfo21_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_CryptPassword_Type.tp_base = BaseObject_Type; samr_CryptPassword_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo23_Type.tp_base = BaseObject_Type; samr_UserInfo23_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo24_Type.tp_base = BaseObject_Type; samr_UserInfo24_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_CryptPasswordEx_Type.tp_base = BaseObject_Type; samr_CryptPasswordEx_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo25_Type.tp_base = BaseObject_Type; samr_UserInfo25_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo26_Type.tp_base = BaseObject_Type; samr_UserInfo26_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_UserInfo_Type.tp_base = BaseObject_Type; samr_UserInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_RidWithAttribute_Type.tp_base = BaseObject_Type; samr_RidWithAttribute_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_RidWithAttributeArray_Type.tp_base = BaseObject_Type; samr_RidWithAttributeArray_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DispEntryGeneral_Type.tp_base = BaseObject_Type; samr_DispEntryGeneral_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DispInfoGeneral_Type.tp_base = BaseObject_Type; samr_DispInfoGeneral_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DispEntryFull_Type.tp_base = BaseObject_Type; samr_DispEntryFull_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DispInfoFull_Type.tp_base = BaseObject_Type; samr_DispInfoFull_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DispEntryFullGroup_Type.tp_base = BaseObject_Type; samr_DispEntryFullGroup_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DispInfoFullGroups_Type.tp_base = BaseObject_Type; samr_DispInfoFullGroups_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DispEntryAscii_Type.tp_base = BaseObject_Type; samr_DispEntryAscii_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DispInfoAscii_Type.tp_base = BaseObject_Type; samr_DispInfoAscii_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DispInfo_Type.tp_base = BaseObject_Type; samr_DispInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_PwInfo_Type.tp_base = BaseObject_Type; samr_PwInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); userPwdChangeFailureInformation_Type.tp_base = BaseObject_Type; userPwdChangeFailureInformation_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ConnectInfo1_Type.tp_base = BaseObject_Type; samr_ConnectInfo1_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ConnectInfo_Type.tp_base = BaseObject_Type; samr_ConnectInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ValidationBlob_Type.tp_base = BaseObject_Type; samr_ValidationBlob_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ValidatePasswordInfo_Type.tp_base = BaseObject_Type; samr_ValidatePasswordInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ValidatePasswordRepCtr_Type.tp_base = BaseObject_Type; samr_ValidatePasswordRepCtr_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ValidatePasswordRep_Type.tp_base = BaseObject_Type; samr_ValidatePasswordRep_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ValidatePasswordReq3_Type.tp_base = BaseObject_Type; samr_ValidatePasswordReq3_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ValidatePasswordReq2_Type.tp_base = BaseObject_Type; samr_ValidatePasswordReq2_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ValidatePasswordReq1_Type.tp_base = BaseObject_Type; samr_ValidatePasswordReq1_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ValidatePasswordReq_Type.tp_base = BaseObject_Type; samr_ValidatePasswordReq_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_Connect_Type.tp_base = BaseObject_Type; samr_Connect_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_Close_Type.tp_base = BaseObject_Type; samr_Close_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_SetSecurity_Type.tp_base = BaseObject_Type; samr_SetSecurity_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_QuerySecurity_Type.tp_base = BaseObject_Type; samr_QuerySecurity_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_Shutdown_Type.tp_base = BaseObject_Type; samr_Shutdown_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_LookupDomain_Type.tp_base = BaseObject_Type; samr_LookupDomain_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_EnumDomains_Type.tp_base = BaseObject_Type; samr_EnumDomains_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_OpenDomain_Type.tp_base = BaseObject_Type; samr_OpenDomain_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_QueryDomainInfo_Type.tp_base = BaseObject_Type; samr_QueryDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_SetDomainInfo_Type.tp_base = BaseObject_Type; samr_SetDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_CreateDomainGroup_Type.tp_base = BaseObject_Type; samr_CreateDomainGroup_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_EnumDomainGroups_Type.tp_base = BaseObject_Type; samr_EnumDomainGroups_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_CreateUser_Type.tp_base = BaseObject_Type; samr_CreateUser_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_EnumDomainUsers_Type.tp_base = BaseObject_Type; samr_EnumDomainUsers_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_CreateDomAlias_Type.tp_base = BaseObject_Type; samr_CreateDomAlias_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_EnumDomainAliases_Type.tp_base = BaseObject_Type; samr_EnumDomainAliases_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_GetAliasMembership_Type.tp_base = BaseObject_Type; samr_GetAliasMembership_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_LookupNames_Type.tp_base = BaseObject_Type; samr_LookupNames_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_LookupRids_Type.tp_base = BaseObject_Type; samr_LookupRids_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_OpenGroup_Type.tp_base = BaseObject_Type; samr_OpenGroup_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_QueryGroupInfo_Type.tp_base = BaseObject_Type; samr_QueryGroupInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_SetGroupInfo_Type.tp_base = BaseObject_Type; samr_SetGroupInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_AddGroupMember_Type.tp_base = BaseObject_Type; samr_AddGroupMember_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DeleteDomainGroup_Type.tp_base = BaseObject_Type; samr_DeleteDomainGroup_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DeleteGroupMember_Type.tp_base = BaseObject_Type; samr_DeleteGroupMember_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_QueryGroupMember_Type.tp_base = BaseObject_Type; samr_QueryGroupMember_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_SetMemberAttributesOfGroup_Type.tp_base = BaseObject_Type; samr_SetMemberAttributesOfGroup_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_OpenAlias_Type.tp_base = BaseObject_Type; samr_OpenAlias_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_QueryAliasInfo_Type.tp_base = BaseObject_Type; samr_QueryAliasInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_SetAliasInfo_Type.tp_base = BaseObject_Type; samr_SetAliasInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DeleteDomAlias_Type.tp_base = BaseObject_Type; samr_DeleteDomAlias_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_AddAliasMember_Type.tp_base = BaseObject_Type; samr_AddAliasMember_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DeleteAliasMember_Type.tp_base = BaseObject_Type; samr_DeleteAliasMember_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_GetMembersInAlias_Type.tp_base = BaseObject_Type; samr_GetMembersInAlias_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_OpenUser_Type.tp_base = BaseObject_Type; samr_OpenUser_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_DeleteUser_Type.tp_base = BaseObject_Type; samr_DeleteUser_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_QueryUserInfo_Type.tp_base = BaseObject_Type; samr_QueryUserInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_SetUserInfo_Type.tp_base = BaseObject_Type; samr_SetUserInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ChangePasswordUser_Type.tp_base = BaseObject_Type; samr_ChangePasswordUser_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_GetGroupsForUser_Type.tp_base = BaseObject_Type; samr_GetGroupsForUser_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_QueryDisplayInfo_Type.tp_base = BaseObject_Type; samr_QueryDisplayInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_GetDisplayEnumerationIndex_Type.tp_base = BaseObject_Type; samr_GetDisplayEnumerationIndex_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_TestPrivateFunctionsDomain_Type.tp_base = BaseObject_Type; samr_TestPrivateFunctionsDomain_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_TestPrivateFunctionsUser_Type.tp_base = BaseObject_Type; samr_TestPrivateFunctionsUser_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_GetUserPwInfo_Type.tp_base = BaseObject_Type; samr_GetUserPwInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_RemoveMemberFromForeignDomain_Type.tp_base = BaseObject_Type; samr_RemoveMemberFromForeignDomain_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_QueryDomainInfo2_Type.tp_base = BaseObject_Type; samr_QueryDomainInfo2_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_QueryUserInfo2_Type.tp_base = BaseObject_Type; samr_QueryUserInfo2_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_QueryDisplayInfo2_Type.tp_base = BaseObject_Type; samr_QueryDisplayInfo2_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_GetDisplayEnumerationIndex2_Type.tp_base = BaseObject_Type; samr_GetDisplayEnumerationIndex2_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_CreateUser2_Type.tp_base = BaseObject_Type; samr_CreateUser2_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_QueryDisplayInfo3_Type.tp_base = BaseObject_Type; samr_QueryDisplayInfo3_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_AddMultipleMembersToAlias_Type.tp_base = BaseObject_Type; samr_AddMultipleMembersToAlias_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_RemoveMultipleMembersFromAlias_Type.tp_base = BaseObject_Type; samr_RemoveMultipleMembersFromAlias_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_OemChangePasswordUser2_Type.tp_base = BaseObject_Type; samr_OemChangePasswordUser2_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ChangePasswordUser2_Type.tp_base = BaseObject_Type; samr_ChangePasswordUser2_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_GetDomPwInfo_Type.tp_base = BaseObject_Type; samr_GetDomPwInfo_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_Connect2_Type.tp_base = BaseObject_Type; samr_Connect2_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_SetUserInfo2_Type.tp_base = BaseObject_Type; samr_SetUserInfo2_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_SetBootKeyInformation_Type.tp_base = BaseObject_Type; samr_SetBootKeyInformation_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_GetBootKeyInformation_Type.tp_base = BaseObject_Type; samr_GetBootKeyInformation_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_Connect3_Type.tp_base = BaseObject_Type; samr_Connect3_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_Connect4_Type.tp_base = BaseObject_Type; samr_Connect4_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ChangePasswordUser3_Type.tp_base = BaseObject_Type; samr_ChangePasswordUser3_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_Connect5_Type.tp_base = BaseObject_Type; samr_Connect5_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_RidToSid_Type.tp_base = BaseObject_Type; samr_RidToSid_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_SetDsrmPassword_Type.tp_base = BaseObject_Type; samr_SetDsrmPassword_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_ValidatePassword_Type.tp_base = BaseObject_Type; samr_ValidatePassword_Type.tp_basicsize = pytalloc_BaseObject_size(); samr_InterfaceType.tp_base = ClientConnection_Type; samr_SyntaxType.tp_base = ndr_syntax_id_Type; samr_SyntaxType.tp_basicsize = pytalloc_BaseObject_size(); if (PyType_Ready(&samr_SamEntry_Type) < 0) goto out; if (PyType_Ready(&samr_SamArray_Type) < 0) goto out; if (PyType_Ready(&samr_DomInfo1_Type) < 0) goto out; if (PyType_Ready(&samr_DomGeneralInformation_Type) < 0) goto out; if (PyType_Ready(&samr_DomInfo3_Type) < 0) goto out; if (PyType_Ready(&samr_DomOEMInformation_Type) < 0) goto out; if (PyType_Ready(&samr_DomInfo5_Type) < 0) goto out; if (PyType_Ready(&samr_DomInfo6_Type) < 0) goto out; if (PyType_Ready(&samr_DomInfo7_Type) < 0) goto out; if (PyType_Ready(&samr_DomInfo8_Type) < 0) goto out; if (PyType_Ready(&samr_DomInfo9_Type) < 0) goto out; if (PyType_Ready(&samr_DomGeneralInformation2_Type) < 0) goto out; if (PyType_Ready(&samr_DomInfo12_Type) < 0) goto out; if (PyType_Ready(&samr_DomInfo13_Type) < 0) goto out; if (PyType_Ready(&samr_DomainInfo_Type) < 0) goto out; if (PyType_Ready(&samr_Ids_Type) < 0) goto out; if (PyType_Ready(&samr_GroupInfoAll_Type) < 0) goto out; if (PyType_Ready(&samr_GroupInfoAttributes_Type) < 0) goto out; if (PyType_Ready(&samr_GroupInfoDescription_Type) < 0) goto out; if (PyType_Ready(&samr_GroupInfo_Type) < 0) goto out; if (PyType_Ready(&samr_RidAttrArray_Type) < 0) goto out; if (PyType_Ready(&samr_AliasInfoAll_Type) < 0) goto out; if (PyType_Ready(&samr_AliasInfo_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo1_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo2_Type) < 0) goto out; if (PyType_Ready(&samr_LogonHours_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo3_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo4_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo5_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo6_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo7_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo8_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo9_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo10_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo11_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo12_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo13_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo14_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo16_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo17_Type) < 0) goto out; if (PyType_Ready(&samr_Password_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo18_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo20_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo21_Type) < 0) goto out; if (PyType_Ready(&samr_CryptPassword_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo23_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo24_Type) < 0) goto out; if (PyType_Ready(&samr_CryptPasswordEx_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo25_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo26_Type) < 0) goto out; if (PyType_Ready(&samr_UserInfo_Type) < 0) goto out; if (PyType_Ready(&samr_RidWithAttribute_Type) < 0) goto out; if (PyType_Ready(&samr_RidWithAttributeArray_Type) < 0) goto out; if (PyType_Ready(&samr_DispEntryGeneral_Type) < 0) goto out; if (PyType_Ready(&samr_DispInfoGeneral_Type) < 0) goto out; if (PyType_Ready(&samr_DispEntryFull_Type) < 0) goto out; if (PyType_Ready(&samr_DispInfoFull_Type) < 0) goto out; if (PyType_Ready(&samr_DispEntryFullGroup_Type) < 0) goto out; if (PyType_Ready(&samr_DispInfoFullGroups_Type) < 0) goto out; if (PyType_Ready(&samr_DispEntryAscii_Type) < 0) goto out; if (PyType_Ready(&samr_DispInfoAscii_Type) < 0) goto out; if (PyType_Ready(&samr_DispInfo_Type) < 0) goto out; if (PyType_Ready(&samr_PwInfo_Type) < 0) goto out; if (PyType_Ready(&userPwdChangeFailureInformation_Type) < 0) goto out; if (PyType_Ready(&samr_ConnectInfo1_Type) < 0) goto out; if (PyType_Ready(&samr_ConnectInfo_Type) < 0) goto out; if (PyType_Ready(&samr_ValidationBlob_Type) < 0) goto out; if (PyType_Ready(&samr_ValidatePasswordInfo_Type) < 0) goto out; if (PyType_Ready(&samr_ValidatePasswordRepCtr_Type) < 0) goto out; if (PyType_Ready(&samr_ValidatePasswordRep_Type) < 0) goto out; if (PyType_Ready(&samr_ValidatePasswordReq3_Type) < 0) goto out; if (PyType_Ready(&samr_ValidatePasswordReq2_Type) < 0) goto out; if (PyType_Ready(&samr_ValidatePasswordReq1_Type) < 0) goto out; if (PyType_Ready(&samr_ValidatePasswordReq_Type) < 0) goto out; if (PyType_Ready(&samr_Connect_Type) < 0) goto out; if (PyType_Ready(&samr_Close_Type) < 0) goto out; if (PyType_Ready(&samr_SetSecurity_Type) < 0) goto out; if (PyType_Ready(&samr_QuerySecurity_Type) < 0) goto out; if (PyType_Ready(&samr_Shutdown_Type) < 0) goto out; if (PyType_Ready(&samr_LookupDomain_Type) < 0) goto out; if (PyType_Ready(&samr_EnumDomains_Type) < 0) goto out; if (PyType_Ready(&samr_OpenDomain_Type) < 0) goto out; if (PyType_Ready(&samr_QueryDomainInfo_Type) < 0) goto out; if (PyType_Ready(&samr_SetDomainInfo_Type) < 0) goto out; if (PyType_Ready(&samr_CreateDomainGroup_Type) < 0) goto out; if (PyType_Ready(&samr_EnumDomainGroups_Type) < 0) goto out; if (PyType_Ready(&samr_CreateUser_Type) < 0) goto out; if (PyType_Ready(&samr_EnumDomainUsers_Type) < 0) goto out; if (PyType_Ready(&samr_CreateDomAlias_Type) < 0) goto out; if (PyType_Ready(&samr_EnumDomainAliases_Type) < 0) goto out; if (PyType_Ready(&samr_GetAliasMembership_Type) < 0) goto out; if (PyType_Ready(&samr_LookupNames_Type) < 0) goto out; if (PyType_Ready(&samr_LookupRids_Type) < 0) goto out; if (PyType_Ready(&samr_OpenGroup_Type) < 0) goto out; if (PyType_Ready(&samr_QueryGroupInfo_Type) < 0) goto out; if (PyType_Ready(&samr_SetGroupInfo_Type) < 0) goto out; if (PyType_Ready(&samr_AddGroupMember_Type) < 0) goto out; if (PyType_Ready(&samr_DeleteDomainGroup_Type) < 0) goto out; if (PyType_Ready(&samr_DeleteGroupMember_Type) < 0) goto out; if (PyType_Ready(&samr_QueryGroupMember_Type) < 0) goto out; if (PyType_Ready(&samr_SetMemberAttributesOfGroup_Type) < 0) goto out; if (PyType_Ready(&samr_OpenAlias_Type) < 0) goto out; if (PyType_Ready(&samr_QueryAliasInfo_Type) < 0) goto out; if (PyType_Ready(&samr_SetAliasInfo_Type) < 0) goto out; if (PyType_Ready(&samr_DeleteDomAlias_Type) < 0) goto out; if (PyType_Ready(&samr_AddAliasMember_Type) < 0) goto out; if (PyType_Ready(&samr_DeleteAliasMember_Type) < 0) goto out; if (PyType_Ready(&samr_GetMembersInAlias_Type) < 0) goto out; if (PyType_Ready(&samr_OpenUser_Type) < 0) goto out; if (PyType_Ready(&samr_DeleteUser_Type) < 0) goto out; if (PyType_Ready(&samr_QueryUserInfo_Type) < 0) goto out; if (PyType_Ready(&samr_SetUserInfo_Type) < 0) goto out; if (PyType_Ready(&samr_ChangePasswordUser_Type) < 0) goto out; if (PyType_Ready(&samr_GetGroupsForUser_Type) < 0) goto out; if (PyType_Ready(&samr_QueryDisplayInfo_Type) < 0) goto out; if (PyType_Ready(&samr_GetDisplayEnumerationIndex_Type) < 0) goto out; if (PyType_Ready(&samr_TestPrivateFunctionsDomain_Type) < 0) goto out; if (PyType_Ready(&samr_TestPrivateFunctionsUser_Type) < 0) goto out; if (PyType_Ready(&samr_GetUserPwInfo_Type) < 0) goto out; if (PyType_Ready(&samr_RemoveMemberFromForeignDomain_Type) < 0) goto out; if (PyType_Ready(&samr_QueryDomainInfo2_Type) < 0) goto out; if (PyType_Ready(&samr_QueryUserInfo2_Type) < 0) goto out; if (PyType_Ready(&samr_QueryDisplayInfo2_Type) < 0) goto out; if (PyType_Ready(&samr_GetDisplayEnumerationIndex2_Type) < 0) goto out; if (PyType_Ready(&samr_CreateUser2_Type) < 0) goto out; if (PyType_Ready(&samr_QueryDisplayInfo3_Type) < 0) goto out; if (PyType_Ready(&samr_AddMultipleMembersToAlias_Type) < 0) goto out; if (PyType_Ready(&samr_RemoveMultipleMembersFromAlias_Type) < 0) goto out; if (PyType_Ready(&samr_OemChangePasswordUser2_Type) < 0) goto out; if (PyType_Ready(&samr_ChangePasswordUser2_Type) < 0) goto out; if (PyType_Ready(&samr_GetDomPwInfo_Type) < 0) goto out; if (PyType_Ready(&samr_Connect2_Type) < 0) goto out; if (PyType_Ready(&samr_SetUserInfo2_Type) < 0) goto out; if (PyType_Ready(&samr_SetBootKeyInformation_Type) < 0) goto out; if (PyType_Ready(&samr_GetBootKeyInformation_Type) < 0) goto out; if (PyType_Ready(&samr_Connect3_Type) < 0) goto out; if (PyType_Ready(&samr_Connect4_Type) < 0) goto out; if (PyType_Ready(&samr_ChangePasswordUser3_Type) < 0) goto out; if (PyType_Ready(&samr_Connect5_Type) < 0) goto out; if (PyType_Ready(&samr_RidToSid_Type) < 0) goto out; if (PyType_Ready(&samr_SetDsrmPassword_Type) < 0) goto out; if (PyType_Ready(&samr_ValidatePassword_Type) < 0) goto out; if (PyType_Ready(&samr_InterfaceType) < 0) goto out; if (PyType_Ready(&samr_SyntaxType) < 0) goto out; if (!PyInterface_AddNdrRpcMethods(&samr_InterfaceType, py_ndr_samr_methods)) return NULL; #ifdef PY_SAMENTRY_PATCH PY_SAMENTRY_PATCH(&samr_SamEntry_Type); #endif #ifdef PY_SAMARRAY_PATCH PY_SAMARRAY_PATCH(&samr_SamArray_Type); #endif #ifdef PY_DOMINFO1_PATCH PY_DOMINFO1_PATCH(&samr_DomInfo1_Type); #endif #ifdef PY_DOMGENERALINFORMATION_PATCH PY_DOMGENERALINFORMATION_PATCH(&samr_DomGeneralInformation_Type); #endif #ifdef PY_DOMINFO3_PATCH PY_DOMINFO3_PATCH(&samr_DomInfo3_Type); #endif #ifdef PY_DOMOEMINFORMATION_PATCH PY_DOMOEMINFORMATION_PATCH(&samr_DomOEMInformation_Type); #endif #ifdef PY_DOMINFO5_PATCH PY_DOMINFO5_PATCH(&samr_DomInfo5_Type); #endif #ifdef PY_DOMINFO6_PATCH PY_DOMINFO6_PATCH(&samr_DomInfo6_Type); #endif #ifdef PY_DOMINFO7_PATCH PY_DOMINFO7_PATCH(&samr_DomInfo7_Type); #endif #ifdef PY_DOMINFO8_PATCH PY_DOMINFO8_PATCH(&samr_DomInfo8_Type); #endif #ifdef PY_DOMINFO9_PATCH PY_DOMINFO9_PATCH(&samr_DomInfo9_Type); #endif #ifdef PY_DOMGENERALINFORMATION2_PATCH PY_DOMGENERALINFORMATION2_PATCH(&samr_DomGeneralInformation2_Type); #endif #ifdef PY_DOMINFO12_PATCH PY_DOMINFO12_PATCH(&samr_DomInfo12_Type); #endif #ifdef PY_DOMINFO13_PATCH PY_DOMINFO13_PATCH(&samr_DomInfo13_Type); #endif #ifdef PY_DOMAININFO_PATCH PY_DOMAININFO_PATCH(&samr_DomainInfo_Type); #endif #ifdef PY_IDS_PATCH PY_IDS_PATCH(&samr_Ids_Type); #endif #ifdef PY_GROUPINFOALL_PATCH PY_GROUPINFOALL_PATCH(&samr_GroupInfoAll_Type); #endif #ifdef PY_GROUPINFOATTRIBUTES_PATCH PY_GROUPINFOATTRIBUTES_PATCH(&samr_GroupInfoAttributes_Type); #endif #ifdef PY_GROUPINFODESCRIPTION_PATCH PY_GROUPINFODESCRIPTION_PATCH(&samr_GroupInfoDescription_Type); #endif #ifdef PY_GROUPINFO_PATCH PY_GROUPINFO_PATCH(&samr_GroupInfo_Type); #endif #ifdef PY_RIDATTRARRAY_PATCH PY_RIDATTRARRAY_PATCH(&samr_RidAttrArray_Type); #endif #ifdef PY_ALIASINFOALL_PATCH PY_ALIASINFOALL_PATCH(&samr_AliasInfoAll_Type); #endif #ifdef PY_ALIASINFO_PATCH PY_ALIASINFO_PATCH(&samr_AliasInfo_Type); #endif #ifdef PY_USERINFO1_PATCH PY_USERINFO1_PATCH(&samr_UserInfo1_Type); #endif #ifdef PY_USERINFO2_PATCH PY_USERINFO2_PATCH(&samr_UserInfo2_Type); #endif #ifdef PY_LOGONHOURS_PATCH PY_LOGONHOURS_PATCH(&samr_LogonHours_Type); #endif #ifdef PY_USERINFO3_PATCH PY_USERINFO3_PATCH(&samr_UserInfo3_Type); #endif #ifdef PY_USERINFO4_PATCH PY_USERINFO4_PATCH(&samr_UserInfo4_Type); #endif #ifdef PY_USERINFO5_PATCH PY_USERINFO5_PATCH(&samr_UserInfo5_Type); #endif #ifdef PY_USERINFO6_PATCH PY_USERINFO6_PATCH(&samr_UserInfo6_Type); #endif #ifdef PY_USERINFO7_PATCH PY_USERINFO7_PATCH(&samr_UserInfo7_Type); #endif #ifdef PY_USERINFO8_PATCH PY_USERINFO8_PATCH(&samr_UserInfo8_Type); #endif #ifdef PY_USERINFO9_PATCH PY_USERINFO9_PATCH(&samr_UserInfo9_Type); #endif #ifdef PY_USERINFO10_PATCH PY_USERINFO10_PATCH(&samr_UserInfo10_Type); #endif #ifdef PY_USERINFO11_PATCH PY_USERINFO11_PATCH(&samr_UserInfo11_Type); #endif #ifdef PY_USERINFO12_PATCH PY_USERINFO12_PATCH(&samr_UserInfo12_Type); #endif #ifdef PY_USERINFO13_PATCH PY_USERINFO13_PATCH(&samr_UserInfo13_Type); #endif #ifdef PY_USERINFO14_PATCH PY_USERINFO14_PATCH(&samr_UserInfo14_Type); #endif #ifdef PY_USERINFO16_PATCH PY_USERINFO16_PATCH(&samr_UserInfo16_Type); #endif #ifdef PY_USERINFO17_PATCH PY_USERINFO17_PATCH(&samr_UserInfo17_Type); #endif #ifdef PY_PASSWORD_PATCH PY_PASSWORD_PATCH(&samr_Password_Type); #endif #ifdef PY_USERINFO18_PATCH PY_USERINFO18_PATCH(&samr_UserInfo18_Type); #endif #ifdef PY_USERINFO20_PATCH PY_USERINFO20_PATCH(&samr_UserInfo20_Type); #endif #ifdef PY_USERINFO21_PATCH PY_USERINFO21_PATCH(&samr_UserInfo21_Type); #endif #ifdef PY_CRYPTPASSWORD_PATCH PY_CRYPTPASSWORD_PATCH(&samr_CryptPassword_Type); #endif #ifdef PY_USERINFO23_PATCH PY_USERINFO23_PATCH(&samr_UserInfo23_Type); #endif #ifdef PY_USERINFO24_PATCH PY_USERINFO24_PATCH(&samr_UserInfo24_Type); #endif #ifdef PY_CRYPTPASSWORDEX_PATCH PY_CRYPTPASSWORDEX_PATCH(&samr_CryptPasswordEx_Type); #endif #ifdef PY_USERINFO25_PATCH PY_USERINFO25_PATCH(&samr_UserInfo25_Type); #endif #ifdef PY_USERINFO26_PATCH PY_USERINFO26_PATCH(&samr_UserInfo26_Type); #endif #ifdef PY_USERINFO_PATCH PY_USERINFO_PATCH(&samr_UserInfo_Type); #endif #ifdef PY_RIDWITHATTRIBUTE_PATCH PY_RIDWITHATTRIBUTE_PATCH(&samr_RidWithAttribute_Type); #endif #ifdef PY_RIDWITHATTRIBUTEARRAY_PATCH PY_RIDWITHATTRIBUTEARRAY_PATCH(&samr_RidWithAttributeArray_Type); #endif #ifdef PY_DISPENTRYGENERAL_PATCH PY_DISPENTRYGENERAL_PATCH(&samr_DispEntryGeneral_Type); #endif #ifdef PY_DISPINFOGENERAL_PATCH PY_DISPINFOGENERAL_PATCH(&samr_DispInfoGeneral_Type); #endif #ifdef PY_DISPENTRYFULL_PATCH PY_DISPENTRYFULL_PATCH(&samr_DispEntryFull_Type); #endif #ifdef PY_DISPINFOFULL_PATCH PY_DISPINFOFULL_PATCH(&samr_DispInfoFull_Type); #endif #ifdef PY_DISPENTRYFULLGROUP_PATCH PY_DISPENTRYFULLGROUP_PATCH(&samr_DispEntryFullGroup_Type); #endif #ifdef PY_DISPINFOFULLGROUPS_PATCH PY_DISPINFOFULLGROUPS_PATCH(&samr_DispInfoFullGroups_Type); #endif #ifdef PY_DISPENTRYASCII_PATCH PY_DISPENTRYASCII_PATCH(&samr_DispEntryAscii_Type); #endif #ifdef PY_DISPINFOASCII_PATCH PY_DISPINFOASCII_PATCH(&samr_DispInfoAscii_Type); #endif #ifdef PY_DISPINFO_PATCH PY_DISPINFO_PATCH(&samr_DispInfo_Type); #endif #ifdef PY_PWINFO_PATCH PY_PWINFO_PATCH(&samr_PwInfo_Type); #endif #ifdef PY_USERPWDCHANGEFAILUREINFORMATION_PATCH PY_USERPWDCHANGEFAILUREINFORMATION_PATCH(&userPwdChangeFailureInformation_Type); #endif #ifdef PY_CONNECTINFO1_PATCH PY_CONNECTINFO1_PATCH(&samr_ConnectInfo1_Type); #endif #ifdef PY_CONNECTINFO_PATCH PY_CONNECTINFO_PATCH(&samr_ConnectInfo_Type); #endif #ifdef PY_VALIDATIONBLOB_PATCH PY_VALIDATIONBLOB_PATCH(&samr_ValidationBlob_Type); #endif #ifdef PY_VALIDATEPASSWORDINFO_PATCH PY_VALIDATEPASSWORDINFO_PATCH(&samr_ValidatePasswordInfo_Type); #endif #ifdef PY_VALIDATEPASSWORDREPCTR_PATCH PY_VALIDATEPASSWORDREPCTR_PATCH(&samr_ValidatePasswordRepCtr_Type); #endif #ifdef PY_VALIDATEPASSWORDREP_PATCH PY_VALIDATEPASSWORDREP_PATCH(&samr_ValidatePasswordRep_Type); #endif #ifdef PY_VALIDATEPASSWORDREQ3_PATCH PY_VALIDATEPASSWORDREQ3_PATCH(&samr_ValidatePasswordReq3_Type); #endif #ifdef PY_VALIDATEPASSWORDREQ2_PATCH PY_VALIDATEPASSWORDREQ2_PATCH(&samr_ValidatePasswordReq2_Type); #endif #ifdef PY_VALIDATEPASSWORDREQ1_PATCH PY_VALIDATEPASSWORDREQ1_PATCH(&samr_ValidatePasswordReq1_Type); #endif #ifdef PY_VALIDATEPASSWORDREQ_PATCH PY_VALIDATEPASSWORDREQ_PATCH(&samr_ValidatePasswordReq_Type); #endif #ifdef PY_CONNECT_PATCH PY_CONNECT_PATCH(&samr_Connect_Type); #endif #ifdef PY_CLOSE_PATCH PY_CLOSE_PATCH(&samr_Close_Type); #endif #ifdef PY_SETSECURITY_PATCH PY_SETSECURITY_PATCH(&samr_SetSecurity_Type); #endif #ifdef PY_QUERYSECURITY_PATCH PY_QUERYSECURITY_PATCH(&samr_QuerySecurity_Type); #endif #ifdef PY_SHUTDOWN_PATCH PY_SHUTDOWN_PATCH(&samr_Shutdown_Type); #endif #ifdef PY_LOOKUPDOMAIN_PATCH PY_LOOKUPDOMAIN_PATCH(&samr_LookupDomain_Type); #endif #ifdef PY_ENUMDOMAINS_PATCH PY_ENUMDOMAINS_PATCH(&samr_EnumDomains_Type); #endif #ifdef PY_OPENDOMAIN_PATCH PY_OPENDOMAIN_PATCH(&samr_OpenDomain_Type); #endif #ifdef PY_QUERYDOMAININFO_PATCH PY_QUERYDOMAININFO_PATCH(&samr_QueryDomainInfo_Type); #endif #ifdef PY_SETDOMAININFO_PATCH PY_SETDOMAININFO_PATCH(&samr_SetDomainInfo_Type); #endif #ifdef PY_CREATEDOMAINGROUP_PATCH PY_CREATEDOMAINGROUP_PATCH(&samr_CreateDomainGroup_Type); #endif #ifdef PY_ENUMDOMAINGROUPS_PATCH PY_ENUMDOMAINGROUPS_PATCH(&samr_EnumDomainGroups_Type); #endif #ifdef PY_CREATEUSER_PATCH PY_CREATEUSER_PATCH(&samr_CreateUser_Type); #endif #ifdef PY_ENUMDOMAINUSERS_PATCH PY_ENUMDOMAINUSERS_PATCH(&samr_EnumDomainUsers_Type); #endif #ifdef PY_CREATEDOMALIAS_PATCH PY_CREATEDOMALIAS_PATCH(&samr_CreateDomAlias_Type); #endif #ifdef PY_ENUMDOMAINALIASES_PATCH PY_ENUMDOMAINALIASES_PATCH(&samr_EnumDomainAliases_Type); #endif #ifdef PY_GETALIASMEMBERSHIP_PATCH PY_GETALIASMEMBERSHIP_PATCH(&samr_GetAliasMembership_Type); #endif #ifdef PY_LOOKUPNAMES_PATCH PY_LOOKUPNAMES_PATCH(&samr_LookupNames_Type); #endif #ifdef PY_LOOKUPRIDS_PATCH PY_LOOKUPRIDS_PATCH(&samr_LookupRids_Type); #endif #ifdef PY_OPENGROUP_PATCH PY_OPENGROUP_PATCH(&samr_OpenGroup_Type); #endif #ifdef PY_QUERYGROUPINFO_PATCH PY_QUERYGROUPINFO_PATCH(&samr_QueryGroupInfo_Type); #endif #ifdef PY_SETGROUPINFO_PATCH PY_SETGROUPINFO_PATCH(&samr_SetGroupInfo_Type); #endif #ifdef PY_ADDGROUPMEMBER_PATCH PY_ADDGROUPMEMBER_PATCH(&samr_AddGroupMember_Type); #endif #ifdef PY_DELETEDOMAINGROUP_PATCH PY_DELETEDOMAINGROUP_PATCH(&samr_DeleteDomainGroup_Type); #endif #ifdef PY_DELETEGROUPMEMBER_PATCH PY_DELETEGROUPMEMBER_PATCH(&samr_DeleteGroupMember_Type); #endif #ifdef PY_QUERYGROUPMEMBER_PATCH PY_QUERYGROUPMEMBER_PATCH(&samr_QueryGroupMember_Type); #endif #ifdef PY_SETMEMBERATTRIBUTESOFGROUP_PATCH PY_SETMEMBERATTRIBUTESOFGROUP_PATCH(&samr_SetMemberAttributesOfGroup_Type); #endif #ifdef PY_OPENALIAS_PATCH PY_OPENALIAS_PATCH(&samr_OpenAlias_Type); #endif #ifdef PY_QUERYALIASINFO_PATCH PY_QUERYALIASINFO_PATCH(&samr_QueryAliasInfo_Type); #endif #ifdef PY_SETALIASINFO_PATCH PY_SETALIASINFO_PATCH(&samr_SetAliasInfo_Type); #endif #ifdef PY_DELETEDOMALIAS_PATCH PY_DELETEDOMALIAS_PATCH(&samr_DeleteDomAlias_Type); #endif #ifdef PY_ADDALIASMEMBER_PATCH PY_ADDALIASMEMBER_PATCH(&samr_AddAliasMember_Type); #endif #ifdef PY_DELETEALIASMEMBER_PATCH PY_DELETEALIASMEMBER_PATCH(&samr_DeleteAliasMember_Type); #endif #ifdef PY_GETMEMBERSINALIAS_PATCH PY_GETMEMBERSINALIAS_PATCH(&samr_GetMembersInAlias_Type); #endif #ifdef PY_OPENUSER_PATCH PY_OPENUSER_PATCH(&samr_OpenUser_Type); #endif #ifdef PY_DELETEUSER_PATCH PY_DELETEUSER_PATCH(&samr_DeleteUser_Type); #endif #ifdef PY_QUERYUSERINFO_PATCH PY_QUERYUSERINFO_PATCH(&samr_QueryUserInfo_Type); #endif #ifdef PY_SETUSERINFO_PATCH PY_SETUSERINFO_PATCH(&samr_SetUserInfo_Type); #endif #ifdef PY_CHANGEPASSWORDUSER_PATCH PY_CHANGEPASSWORDUSER_PATCH(&samr_ChangePasswordUser_Type); #endif #ifdef PY_GETGROUPSFORUSER_PATCH PY_GETGROUPSFORUSER_PATCH(&samr_GetGroupsForUser_Type); #endif #ifdef PY_QUERYDISPLAYINFO_PATCH PY_QUERYDISPLAYINFO_PATCH(&samr_QueryDisplayInfo_Type); #endif #ifdef PY_GETDISPLAYENUMERATIONINDEX_PATCH PY_GETDISPLAYENUMERATIONINDEX_PATCH(&samr_GetDisplayEnumerationIndex_Type); #endif #ifdef PY_TESTPRIVATEFUNCTIONSDOMAIN_PATCH PY_TESTPRIVATEFUNCTIONSDOMAIN_PATCH(&samr_TestPrivateFunctionsDomain_Type); #endif #ifdef PY_TESTPRIVATEFUNCTIONSUSER_PATCH PY_TESTPRIVATEFUNCTIONSUSER_PATCH(&samr_TestPrivateFunctionsUser_Type); #endif #ifdef PY_GETUSERPWINFO_PATCH PY_GETUSERPWINFO_PATCH(&samr_GetUserPwInfo_Type); #endif #ifdef PY_REMOVEMEMBERFROMFOREIGNDOMAIN_PATCH PY_REMOVEMEMBERFROMFOREIGNDOMAIN_PATCH(&samr_RemoveMemberFromForeignDomain_Type); #endif #ifdef PY_QUERYDOMAININFO2_PATCH PY_QUERYDOMAININFO2_PATCH(&samr_QueryDomainInfo2_Type); #endif #ifdef PY_QUERYUSERINFO2_PATCH PY_QUERYUSERINFO2_PATCH(&samr_QueryUserInfo2_Type); #endif #ifdef PY_QUERYDISPLAYINFO2_PATCH PY_QUERYDISPLAYINFO2_PATCH(&samr_QueryDisplayInfo2_Type); #endif #ifdef PY_GETDISPLAYENUMERATIONINDEX2_PATCH PY_GETDISPLAYENUMERATIONINDEX2_PATCH(&samr_GetDisplayEnumerationIndex2_Type); #endif #ifdef PY_CREATEUSER2_PATCH PY_CREATEUSER2_PATCH(&samr_CreateUser2_Type); #endif #ifdef PY_QUERYDISPLAYINFO3_PATCH PY_QUERYDISPLAYINFO3_PATCH(&samr_QueryDisplayInfo3_Type); #endif #ifdef PY_ADDMULTIPLEMEMBERSTOALIAS_PATCH PY_ADDMULTIPLEMEMBERSTOALIAS_PATCH(&samr_AddMultipleMembersToAlias_Type); #endif #ifdef PY_REMOVEMULTIPLEMEMBERSFROMALIAS_PATCH PY_REMOVEMULTIPLEMEMBERSFROMALIAS_PATCH(&samr_RemoveMultipleMembersFromAlias_Type); #endif #ifdef PY_OEMCHANGEPASSWORDUSER2_PATCH PY_OEMCHANGEPASSWORDUSER2_PATCH(&samr_OemChangePasswordUser2_Type); #endif #ifdef PY_CHANGEPASSWORDUSER2_PATCH PY_CHANGEPASSWORDUSER2_PATCH(&samr_ChangePasswordUser2_Type); #endif #ifdef PY_GETDOMPWINFO_PATCH PY_GETDOMPWINFO_PATCH(&samr_GetDomPwInfo_Type); #endif #ifdef PY_CONNECT2_PATCH PY_CONNECT2_PATCH(&samr_Connect2_Type); #endif #ifdef PY_SETUSERINFO2_PATCH PY_SETUSERINFO2_PATCH(&samr_SetUserInfo2_Type); #endif #ifdef PY_SETBOOTKEYINFORMATION_PATCH PY_SETBOOTKEYINFORMATION_PATCH(&samr_SetBootKeyInformation_Type); #endif #ifdef PY_GETBOOTKEYINFORMATION_PATCH PY_GETBOOTKEYINFORMATION_PATCH(&samr_GetBootKeyInformation_Type); #endif #ifdef PY_CONNECT3_PATCH PY_CONNECT3_PATCH(&samr_Connect3_Type); #endif #ifdef PY_CONNECT4_PATCH PY_CONNECT4_PATCH(&samr_Connect4_Type); #endif #ifdef PY_CHANGEPASSWORDUSER3_PATCH PY_CHANGEPASSWORDUSER3_PATCH(&samr_ChangePasswordUser3_Type); #endif #ifdef PY_CONNECT5_PATCH PY_CONNECT5_PATCH(&samr_Connect5_Type); #endif #ifdef PY_RIDTOSID_PATCH PY_RIDTOSID_PATCH(&samr_RidToSid_Type); #endif #ifdef PY_SETDSRMPASSWORD_PATCH PY_SETDSRMPASSWORD_PATCH(&samr_SetDsrmPassword_Type); #endif #ifdef PY_VALIDATEPASSWORD_PATCH PY_VALIDATEPASSWORD_PATCH(&samr_ValidatePassword_Type); #endif #ifdef PY_SAMR_PATCH PY_SAMR_PATCH(&samr_InterfaceType); #endif #ifdef PY_SAMR_ABSTRACT_SYNTAX_PATCH PY_SAMR_ABSTRACT_SYNTAX_PATCH(&samr_SyntaxType); #endif #ifdef PY_ABSTRACT_SYNTAX_PATCH PY_ABSTRACT_SYNTAX_PATCH(&samr_SyntaxType); #endif m = PyModule_Create(&moduledef); if (m == NULL) goto out; PyModule_AddObject(m, "SAMR_ACCESS_ALL_ACCESS", PyLong_FromUnsignedLongLong(0x0000003F)); PyModule_AddObject(m, "GENERIC_RIGHTS_SAM_ALL_ACCESS", PyLong_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_ACCESS_ALL_ACCESS))); PyModule_AddObject(m, "GENERIC_RIGHTS_SAM_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_ACCESS_ENUM_DOMAINS))); PyModule_AddObject(m, "GENERIC_RIGHTS_SAM_WRITE", PyLong_FromLong((STANDARD_RIGHTS_WRITE_ACCESS|SAMR_ACCESS_CREATE_DOMAIN|SAMR_ACCESS_INITIALIZE_SERVER|SAMR_ACCESS_SHUTDOWN_SERVER))); PyModule_AddObject(m, "GENERIC_RIGHTS_SAM_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_ACCESS_LOOKUP_DOMAIN|SAMR_ACCESS_CONNECT_TO_SERVER))); PyModule_AddObject(m, "SAMR_USER_ACCESS_ALL_ACCESS", PyLong_FromUnsignedLongLong(0x000007FF)); PyModule_AddObject(m, "GENERIC_RIGHTS_USER_ALL_ACCESS", PyLong_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_USER_ACCESS_ALL_ACCESS))); PyModule_AddObject(m, "GENERIC_RIGHTS_USER_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP|SAMR_USER_ACCESS_GET_GROUPS|SAMR_USER_ACCESS_GET_ATTRIBUTES|SAMR_USER_ACCESS_GET_LOGONINFO|SAMR_USER_ACCESS_GET_LOCALE))); PyModule_AddObject(m, "GENERIC_RIGHTS_USER_WRITE", PyLong_FromLong((STANDARD_RIGHTS_WRITE_ACCESS|SAMR_USER_ACCESS_CHANGE_PASSWORD|SAMR_USER_ACCESS_SET_LOC_COM|SAMR_USER_ACCESS_SET_ATTRIBUTES|SAMR_USER_ACCESS_SET_PASSWORD|SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP))); PyModule_AddObject(m, "GENERIC_RIGHTS_USER_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_USER_ACCESS_CHANGE_PASSWORD|SAMR_USER_ACCESS_GET_NAME_ETC))); PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_ALL_ACCESS", PyLong_FromUnsignedLongLong(0x000007FF)); PyModule_AddObject(m, "GENERIC_RIGHTS_DOMAIN_ALL_ACCESS", PyLong_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_DOMAIN_ACCESS_ALL_ACCESS))); PyModule_AddObject(m, "GENERIC_RIGHTS_DOMAIN_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS|SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2))); PyModule_AddObject(m, "GENERIC_RIGHTS_DOMAIN_WRITE", PyLong_FromLong((STANDARD_RIGHTS_WRITE_ACCESS|SAMR_DOMAIN_ACCESS_SET_INFO_3|SAMR_DOMAIN_ACCESS_CREATE_ALIAS|SAMR_DOMAIN_ACCESS_CREATE_GROUP|SAMR_DOMAIN_ACCESS_CREATE_USER|SAMR_DOMAIN_ACCESS_SET_INFO_2|SAMR_DOMAIN_ACCESS_SET_INFO_1))); PyModule_AddObject(m, "GENERIC_RIGHTS_DOMAIN_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT|SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS|SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1))); PyModule_AddObject(m, "SAMR_GROUP_ACCESS_ALL_ACCESS", PyLong_FromUnsignedLongLong(0x0000001F)); PyModule_AddObject(m, "GENERIC_RIGHTS_GROUP_ALL_ACCESS", PyLong_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_GROUP_ACCESS_ALL_ACCESS))); PyModule_AddObject(m, "GENERIC_RIGHTS_GROUP_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_GROUP_ACCESS_GET_MEMBERS))); PyModule_AddObject(m, "GENERIC_RIGHTS_GROUP_WRITE", PyLong_FromLong((STANDARD_RIGHTS_WRITE_ACCESS|SAMR_GROUP_ACCESS_REMOVE_MEMBER|SAMR_GROUP_ACCESS_ADD_MEMBER|SAMR_GROUP_ACCESS_SET_INFO))); PyModule_AddObject(m, "GENERIC_RIGHTS_GROUP_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_GROUP_ACCESS_LOOKUP_INFO))); PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_ALL_ACCESS", PyLong_FromUnsignedLongLong(0x0000001F)); PyModule_AddObject(m, "GENERIC_RIGHTS_ALIAS_ALL_ACCESS", PyLong_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_ALIAS_ACCESS_ALL_ACCESS))); PyModule_AddObject(m, "GENERIC_RIGHTS_ALIAS_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_ALIAS_ACCESS_GET_MEMBERS))); PyModule_AddObject(m, "GENERIC_RIGHTS_ALIAS_WRITE", PyLong_FromLong((STANDARD_RIGHTS_WRITE_ACCESS|SAMR_ALIAS_ACCESS_REMOVE_MEMBER|SAMR_ALIAS_ACCESS_ADD_MEMBER|SAMR_ALIAS_ACCESS_SET_INFO))); PyModule_AddObject(m, "GENERIC_RIGHTS_ALIAS_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_ALIAS_ACCESS_LOOKUP_INFO))); PyModule_AddObject(m, "SAMR_ENUM_USERS_MULTIPLIER", PyLong_FromUnsignedLongLong(54)); PyModule_AddObject(m, "PASS_MUST_CHANGE_AT_NEXT_LOGON", PyLong_FromUnsignedLongLong(0x01)); PyModule_AddObject(m, "PASS_DONT_CHANGE_AT_NEXT_LOGON", PyLong_FromUnsignedLongLong(0x00)); PyModule_AddObject(m, "ACB_DISABLED", PyLong_FromUnsignedLongLong((uint32_t)ACB_DISABLED)); PyModule_AddObject(m, "ACB_HOMDIRREQ", PyLong_FromUnsignedLongLong((uint32_t)ACB_HOMDIRREQ)); PyModule_AddObject(m, "ACB_PWNOTREQ", PyLong_FromUnsignedLongLong((uint32_t)ACB_PWNOTREQ)); PyModule_AddObject(m, "ACB_TEMPDUP", PyLong_FromUnsignedLongLong((uint32_t)ACB_TEMPDUP)); PyModule_AddObject(m, "ACB_NORMAL", PyLong_FromUnsignedLongLong((uint32_t)ACB_NORMAL)); PyModule_AddObject(m, "ACB_MNS", PyLong_FromUnsignedLongLong((uint32_t)ACB_MNS)); PyModule_AddObject(m, "ACB_DOMTRUST", PyLong_FromUnsignedLongLong((uint32_t)ACB_DOMTRUST)); PyModule_AddObject(m, "ACB_WSTRUST", PyLong_FromUnsignedLongLong((uint32_t)ACB_WSTRUST)); PyModule_AddObject(m, "ACB_SVRTRUST", PyLong_FromUnsignedLongLong((uint32_t)ACB_SVRTRUST)); PyModule_AddObject(m, "ACB_PWNOEXP", PyLong_FromUnsignedLongLong((uint32_t)ACB_PWNOEXP)); PyModule_AddObject(m, "ACB_AUTOLOCK", PyLong_FromUnsignedLongLong((uint32_t)ACB_AUTOLOCK)); PyModule_AddObject(m, "ACB_ENC_TXT_PWD_ALLOWED", PyLong_FromUnsignedLongLong((uint32_t)ACB_ENC_TXT_PWD_ALLOWED)); PyModule_AddObject(m, "ACB_SMARTCARD_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)ACB_SMARTCARD_REQUIRED)); PyModule_AddObject(m, "ACB_TRUSTED_FOR_DELEGATION", PyLong_FromUnsignedLongLong((uint32_t)ACB_TRUSTED_FOR_DELEGATION)); PyModule_AddObject(m, "ACB_NOT_DELEGATED", PyLong_FromUnsignedLongLong((uint32_t)ACB_NOT_DELEGATED)); PyModule_AddObject(m, "ACB_USE_DES_KEY_ONLY", PyLong_FromUnsignedLongLong((uint32_t)ACB_USE_DES_KEY_ONLY)); PyModule_AddObject(m, "ACB_DONT_REQUIRE_PREAUTH", PyLong_FromUnsignedLongLong((uint32_t)ACB_DONT_REQUIRE_PREAUTH)); PyModule_AddObject(m, "ACB_PW_EXPIRED", PyLong_FromUnsignedLongLong((uint32_t)ACB_PW_EXPIRED)); PyModule_AddObject(m, "ACB_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION", PyLong_FromUnsignedLongLong((uint32_t)ACB_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION)); PyModule_AddObject(m, "ACB_NO_AUTH_DATA_REQD", PyLong_FromUnsignedLongLong((uint32_t)ACB_NO_AUTH_DATA_REQD)); PyModule_AddObject(m, "ACB_PARTIAL_SECRETS_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)ACB_PARTIAL_SECRETS_ACCOUNT)); PyModule_AddObject(m, "ACB_USE_AES_KEYS", PyLong_FromUnsignedLongLong((uint32_t)ACB_USE_AES_KEYS)); PyModule_AddObject(m, "SAMR_ACCESS_CONNECT_TO_SERVER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ACCESS_CONNECT_TO_SERVER)); PyModule_AddObject(m, "SAMR_ACCESS_SHUTDOWN_SERVER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ACCESS_SHUTDOWN_SERVER)); PyModule_AddObject(m, "SAMR_ACCESS_INITIALIZE_SERVER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ACCESS_INITIALIZE_SERVER)); PyModule_AddObject(m, "SAMR_ACCESS_CREATE_DOMAIN", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ACCESS_CREATE_DOMAIN)); PyModule_AddObject(m, "SAMR_ACCESS_ENUM_DOMAINS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ACCESS_ENUM_DOMAINS)); PyModule_AddObject(m, "SAMR_ACCESS_LOOKUP_DOMAIN", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ACCESS_LOOKUP_DOMAIN)); PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_NAME_ETC", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_GET_NAME_ETC)); PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_LOCALE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_GET_LOCALE)); PyModule_AddObject(m, "SAMR_USER_ACCESS_SET_LOC_COM", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_SET_LOC_COM)); PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_LOGONINFO", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_GET_LOGONINFO)); PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_ATTRIBUTES", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_GET_ATTRIBUTES)); PyModule_AddObject(m, "SAMR_USER_ACCESS_SET_ATTRIBUTES", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_SET_ATTRIBUTES)); PyModule_AddObject(m, "SAMR_USER_ACCESS_CHANGE_PASSWORD", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_CHANGE_PASSWORD)); PyModule_AddObject(m, "SAMR_USER_ACCESS_SET_PASSWORD", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_SET_PASSWORD)); PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_GROUPS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_GET_GROUPS)); PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP)); PyModule_AddObject(m, "SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP)); PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1)); PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_SET_INFO_1", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_SET_INFO_1)); PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2)); PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_SET_INFO_2", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_SET_INFO_2)); PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_CREATE_USER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_CREATE_USER)); PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_CREATE_GROUP", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_CREATE_GROUP)); PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_CREATE_ALIAS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_CREATE_ALIAS)); PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS)); PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS)); PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT)); PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_SET_INFO_3", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_SET_INFO_3)); PyModule_AddObject(m, "SAMR_GROUP_ACCESS_LOOKUP_INFO", PyLong_FromUnsignedLongLong((uint32_t)SAMR_GROUP_ACCESS_LOOKUP_INFO)); PyModule_AddObject(m, "SAMR_GROUP_ACCESS_SET_INFO", PyLong_FromUnsignedLongLong((uint32_t)SAMR_GROUP_ACCESS_SET_INFO)); PyModule_AddObject(m, "SAMR_GROUP_ACCESS_ADD_MEMBER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_GROUP_ACCESS_ADD_MEMBER)); PyModule_AddObject(m, "SAMR_GROUP_ACCESS_REMOVE_MEMBER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_GROUP_ACCESS_REMOVE_MEMBER)); PyModule_AddObject(m, "SAMR_GROUP_ACCESS_GET_MEMBERS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_GROUP_ACCESS_GET_MEMBERS)); PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_ADD_MEMBER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ALIAS_ACCESS_ADD_MEMBER)); PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_REMOVE_MEMBER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ALIAS_ACCESS_REMOVE_MEMBER)); PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_GET_MEMBERS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ALIAS_ACCESS_GET_MEMBERS)); PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_LOOKUP_INFO", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ALIAS_ACCESS_LOOKUP_INFO)); PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_SET_INFO", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ALIAS_ACCESS_SET_INFO)); PyModule_AddObject(m, "DomainPasswordInformation", PyLong_FromLong((uint16_t)DomainPasswordInformation)); PyModule_AddObject(m, "DomainGeneralInformation", PyLong_FromLong((uint16_t)DomainGeneralInformation)); PyModule_AddObject(m, "DomainLogoffInformation", PyLong_FromLong((uint16_t)DomainLogoffInformation)); PyModule_AddObject(m, "DomainOemInformation", PyLong_FromLong((uint16_t)DomainOemInformation)); PyModule_AddObject(m, "DomainNameInformation", PyLong_FromLong((uint16_t)DomainNameInformation)); PyModule_AddObject(m, "DomainReplicationInformation", PyLong_FromLong((uint16_t)DomainReplicationInformation)); PyModule_AddObject(m, "DomainServerRoleInformation", PyLong_FromLong((uint16_t)DomainServerRoleInformation)); PyModule_AddObject(m, "DomainModifiedInformation", PyLong_FromLong((uint16_t)DomainModifiedInformation)); PyModule_AddObject(m, "DomainStateInformation", PyLong_FromLong((uint16_t)DomainStateInformation)); PyModule_AddObject(m, "DomainUasInformation", PyLong_FromLong((uint16_t)DomainUasInformation)); PyModule_AddObject(m, "DomainGeneralInformation2", PyLong_FromLong((uint16_t)DomainGeneralInformation2)); PyModule_AddObject(m, "DomainLockoutInformation", PyLong_FromLong((uint16_t)DomainLockoutInformation)); PyModule_AddObject(m, "DomainModifiedInformation2", PyLong_FromLong((uint16_t)DomainModifiedInformation2)); PyModule_AddObject(m, "SAMR_ROLE_STANDALONE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ROLE_STANDALONE)); PyModule_AddObject(m, "SAMR_ROLE_DOMAIN_MEMBER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ROLE_DOMAIN_MEMBER)); PyModule_AddObject(m, "SAMR_ROLE_DOMAIN_BDC", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ROLE_DOMAIN_BDC)); PyModule_AddObject(m, "SAMR_ROLE_DOMAIN_PDC", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ROLE_DOMAIN_PDC)); PyModule_AddObject(m, "DOMAIN_PASSWORD_COMPLEX", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_PASSWORD_COMPLEX)); PyModule_AddObject(m, "DOMAIN_PASSWORD_NO_ANON_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_PASSWORD_NO_ANON_CHANGE)); PyModule_AddObject(m, "DOMAIN_PASSWORD_NO_CLEAR_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_PASSWORD_NO_CLEAR_CHANGE)); PyModule_AddObject(m, "DOMAIN_PASSWORD_LOCKOUT_ADMINS", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_PASSWORD_LOCKOUT_ADMINS)); PyModule_AddObject(m, "DOMAIN_PASSWORD_STORE_CLEARTEXT", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_PASSWORD_STORE_CLEARTEXT)); PyModule_AddObject(m, "DOMAIN_REFUSE_PASSWORD_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_REFUSE_PASSWORD_CHANGE)); PyModule_AddObject(m, "DOMAIN_SERVER_ENABLED", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_SERVER_ENABLED)); PyModule_AddObject(m, "DOMAIN_SERVER_DISABLED", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_SERVER_DISABLED)); PyModule_AddObject(m, "GROUPINFOALL", PyLong_FromLong((uint16_t)GROUPINFOALL)); PyModule_AddObject(m, "GROUPINFONAME", PyLong_FromLong((uint16_t)GROUPINFONAME)); PyModule_AddObject(m, "GROUPINFOATTRIBUTES", PyLong_FromLong((uint16_t)GROUPINFOATTRIBUTES)); PyModule_AddObject(m, "GROUPINFODESCRIPTION", PyLong_FromLong((uint16_t)GROUPINFODESCRIPTION)); PyModule_AddObject(m, "GROUPINFOALL2", PyLong_FromLong((uint16_t)GROUPINFOALL2)); PyModule_AddObject(m, "ALIASINFOALL", PyLong_FromLong((uint16_t)ALIASINFOALL)); PyModule_AddObject(m, "ALIASINFONAME", PyLong_FromLong((uint16_t)ALIASINFONAME)); PyModule_AddObject(m, "ALIASINFODESCRIPTION", PyLong_FromLong((uint16_t)ALIASINFODESCRIPTION)); PyModule_AddObject(m, "UserGeneralInformation", PyLong_FromLong((uint16_t)UserGeneralInformation)); PyModule_AddObject(m, "UserPreferencesInformation", PyLong_FromLong((uint16_t)UserPreferencesInformation)); PyModule_AddObject(m, "UserLogonInformation", PyLong_FromLong((uint16_t)UserLogonInformation)); PyModule_AddObject(m, "UserLogonHoursInformation", PyLong_FromLong((uint16_t)UserLogonHoursInformation)); PyModule_AddObject(m, "UserAccountInformation", PyLong_FromLong((uint16_t)UserAccountInformation)); PyModule_AddObject(m, "UserNameInformation", PyLong_FromLong((uint16_t)UserNameInformation)); PyModule_AddObject(m, "UserAccountNameInformation", PyLong_FromLong((uint16_t)UserAccountNameInformation)); PyModule_AddObject(m, "UserFullNameInformation", PyLong_FromLong((uint16_t)UserFullNameInformation)); PyModule_AddObject(m, "UserPrimaryGroupInformation", PyLong_FromLong((uint16_t)UserPrimaryGroupInformation)); PyModule_AddObject(m, "UserHomeInformation", PyLong_FromLong((uint16_t)UserHomeInformation)); PyModule_AddObject(m, "UserScriptInformation", PyLong_FromLong((uint16_t)UserScriptInformation)); PyModule_AddObject(m, "UserProfileInformation", PyLong_FromLong((uint16_t)UserProfileInformation)); PyModule_AddObject(m, "UserAdminCommentInformation", PyLong_FromLong((uint16_t)UserAdminCommentInformation)); PyModule_AddObject(m, "UserWorkStationsInformation", PyLong_FromLong((uint16_t)UserWorkStationsInformation)); PyModule_AddObject(m, "UserControlInformation", PyLong_FromLong((uint16_t)UserControlInformation)); PyModule_AddObject(m, "UserExpiresInformation", PyLong_FromLong((uint16_t)UserExpiresInformation)); PyModule_AddObject(m, "UserInternal1Information", PyLong_FromLong((uint16_t)UserInternal1Information)); PyModule_AddObject(m, "UserParametersInformation", PyLong_FromLong((uint16_t)UserParametersInformation)); PyModule_AddObject(m, "UserAllInformation", PyLong_FromLong((uint16_t)UserAllInformation)); PyModule_AddObject(m, "UserInternal4Information", PyLong_FromLong((uint16_t)UserInternal4Information)); PyModule_AddObject(m, "UserInternal5Information", PyLong_FromLong((uint16_t)UserInternal5Information)); PyModule_AddObject(m, "UserInternal4InformationNew", PyLong_FromLong((uint16_t)UserInternal4InformationNew)); PyModule_AddObject(m, "UserInternal5InformationNew", PyLong_FromLong((uint16_t)UserInternal5InformationNew)); PyModule_AddObject(m, "SAMR_FIELD_ACCOUNT_NAME", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_ACCOUNT_NAME)); PyModule_AddObject(m, "SAMR_FIELD_FULL_NAME", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_FULL_NAME)); PyModule_AddObject(m, "SAMR_FIELD_RID", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_RID)); PyModule_AddObject(m, "SAMR_FIELD_PRIMARY_GID", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_PRIMARY_GID)); PyModule_AddObject(m, "SAMR_FIELD_DESCRIPTION", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_DESCRIPTION)); PyModule_AddObject(m, "SAMR_FIELD_COMMENT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_COMMENT)); PyModule_AddObject(m, "SAMR_FIELD_HOME_DIRECTORY", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_HOME_DIRECTORY)); PyModule_AddObject(m, "SAMR_FIELD_HOME_DRIVE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_HOME_DRIVE)); PyModule_AddObject(m, "SAMR_FIELD_LOGON_SCRIPT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_LOGON_SCRIPT)); PyModule_AddObject(m, "SAMR_FIELD_PROFILE_PATH", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_PROFILE_PATH)); PyModule_AddObject(m, "SAMR_FIELD_WORKSTATIONS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_WORKSTATIONS)); PyModule_AddObject(m, "SAMR_FIELD_LAST_LOGON", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_LAST_LOGON)); PyModule_AddObject(m, "SAMR_FIELD_LAST_LOGOFF", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_LAST_LOGOFF)); PyModule_AddObject(m, "SAMR_FIELD_LOGON_HOURS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_LOGON_HOURS)); PyModule_AddObject(m, "SAMR_FIELD_BAD_PWD_COUNT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_BAD_PWD_COUNT)); PyModule_AddObject(m, "SAMR_FIELD_NUM_LOGONS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_NUM_LOGONS)); PyModule_AddObject(m, "SAMR_FIELD_ALLOW_PWD_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_ALLOW_PWD_CHANGE)); PyModule_AddObject(m, "SAMR_FIELD_FORCE_PWD_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_FORCE_PWD_CHANGE)); PyModule_AddObject(m, "SAMR_FIELD_LAST_PWD_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_LAST_PWD_CHANGE)); PyModule_AddObject(m, "SAMR_FIELD_ACCT_EXPIRY", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_ACCT_EXPIRY)); PyModule_AddObject(m, "SAMR_FIELD_ACCT_FLAGS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_ACCT_FLAGS)); PyModule_AddObject(m, "SAMR_FIELD_PARAMETERS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_PARAMETERS)); PyModule_AddObject(m, "SAMR_FIELD_COUNTRY_CODE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_COUNTRY_CODE)); PyModule_AddObject(m, "SAMR_FIELD_CODE_PAGE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_CODE_PAGE)); PyModule_AddObject(m, "SAMR_FIELD_NT_PASSWORD_PRESENT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_NT_PASSWORD_PRESENT)); PyModule_AddObject(m, "SAMR_FIELD_LM_PASSWORD_PRESENT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_LM_PASSWORD_PRESENT)); PyModule_AddObject(m, "SAMR_FIELD_PRIVATE_DATA", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_PRIVATE_DATA)); PyModule_AddObject(m, "SAMR_FIELD_EXPIRED_FLAG", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_EXPIRED_FLAG)); PyModule_AddObject(m, "SAMR_FIELD_SEC_DESC", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_SEC_DESC)); PyModule_AddObject(m, "SAMR_FIELD_OWF_PWD", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_OWF_PWD)); PyModule_AddObject(m, "SAMR_CONNECT_PRE_W2K", PyLong_FromUnsignedLongLong((uint32_t)SAMR_CONNECT_PRE_W2K)); PyModule_AddObject(m, "SAMR_CONNECT_W2K", PyLong_FromUnsignedLongLong((uint32_t)SAMR_CONNECT_W2K)); PyModule_AddObject(m, "SAMR_CONNECT_AFTER_W2K", PyLong_FromUnsignedLongLong((uint32_t)SAMR_CONNECT_AFTER_W2K)); PyModule_AddObject(m, "SAM_PWD_CHANGE_NO_ERROR", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_NO_ERROR)); PyModule_AddObject(m, "SAM_PWD_CHANGE_PASSWORD_TOO_SHORT", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_PASSWORD_TOO_SHORT)); PyModule_AddObject(m, "SAM_PWD_CHANGE_PWD_IN_HISTORY", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_PWD_IN_HISTORY)); PyModule_AddObject(m, "SAM_PWD_CHANGE_USERNAME_IN_PASSWORD", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_USERNAME_IN_PASSWORD)); PyModule_AddObject(m, "SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD)); PyModule_AddObject(m, "SAM_PWD_CHANGE_NOT_COMPLEX", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_NOT_COMPLEX)); PyModule_AddObject(m, "SAM_PWD_CHANGE_MACHINE_NOT_DEFAULT", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_MACHINE_NOT_DEFAULT)); PyModule_AddObject(m, "SAM_PWD_CHANGE_FAILED_BY_FILTER", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_FAILED_BY_FILTER)); PyModule_AddObject(m, "SAM_PWD_CHANGE_PASSWORD_TOO_LONG", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_PASSWORD_TOO_LONG)); PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET", PyLong_FromUnsignedLongLong((uint32_t)SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET)); PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME", PyLong_FromUnsignedLongLong((uint32_t)SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME)); PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_LOCKOUT_TIME", PyLong_FromUnsignedLongLong((uint32_t)SAMR_VALIDATE_FIELD_LOCKOUT_TIME)); PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT)); PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH", PyLong_FromUnsignedLongLong((uint32_t)SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH)); PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_PASSWORD_HISTORY", PyLong_FromUnsignedLongLong((uint32_t)SAMR_VALIDATE_FIELD_PASSWORD_HISTORY)); PyModule_AddObject(m, "NetValidateAuthentication", PyLong_FromLong((uint16_t)NetValidateAuthentication)); PyModule_AddObject(m, "NetValidatePasswordChange", PyLong_FromLong((uint16_t)NetValidatePasswordChange)); PyModule_AddObject(m, "NetValidatePasswordReset", PyLong_FromLong((uint16_t)NetValidatePasswordReset)); PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_SUCCESS", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_SUCCESS)); PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE)); PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT)); PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED)); PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_BAD_PASSWORD", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_BAD_PASSWORD)); PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT)); PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PWD_TOO_SHORT", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PWD_TOO_SHORT)); PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PWD_TOO_LONG", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PWD_TOO_LONG)); PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH)); PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT)); PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR)); Py_INCREF((PyObject *)(void *)&samr_SamEntry_Type); PyModule_AddObject(m, "SamEntry", (PyObject *)(void *)&samr_SamEntry_Type); Py_INCREF((PyObject *)(void *)&samr_SamArray_Type); PyModule_AddObject(m, "SamArray", (PyObject *)(void *)&samr_SamArray_Type); Py_INCREF((PyObject *)(void *)&samr_DomInfo1_Type); PyModule_AddObject(m, "DomInfo1", (PyObject *)(void *)&samr_DomInfo1_Type); Py_INCREF((PyObject *)(void *)&samr_DomGeneralInformation_Type); PyModule_AddObject(m, "DomGeneralInformation", (PyObject *)(void *)&samr_DomGeneralInformation_Type); Py_INCREF((PyObject *)(void *)&samr_DomInfo3_Type); PyModule_AddObject(m, "DomInfo3", (PyObject *)(void *)&samr_DomInfo3_Type); Py_INCREF((PyObject *)(void *)&samr_DomOEMInformation_Type); PyModule_AddObject(m, "DomOEMInformation", (PyObject *)(void *)&samr_DomOEMInformation_Type); Py_INCREF((PyObject *)(void *)&samr_DomInfo5_Type); PyModule_AddObject(m, "DomInfo5", (PyObject *)(void *)&samr_DomInfo5_Type); Py_INCREF((PyObject *)(void *)&samr_DomInfo6_Type); PyModule_AddObject(m, "DomInfo6", (PyObject *)(void *)&samr_DomInfo6_Type); Py_INCREF((PyObject *)(void *)&samr_DomInfo7_Type); PyModule_AddObject(m, "DomInfo7", (PyObject *)(void *)&samr_DomInfo7_Type); Py_INCREF((PyObject *)(void *)&samr_DomInfo8_Type); PyModule_AddObject(m, "DomInfo8", (PyObject *)(void *)&samr_DomInfo8_Type); Py_INCREF((PyObject *)(void *)&samr_DomInfo9_Type); PyModule_AddObject(m, "DomInfo9", (PyObject *)(void *)&samr_DomInfo9_Type); Py_INCREF((PyObject *)(void *)&samr_DomGeneralInformation2_Type); PyModule_AddObject(m, "DomGeneralInformation2", (PyObject *)(void *)&samr_DomGeneralInformation2_Type); Py_INCREF((PyObject *)(void *)&samr_DomInfo12_Type); PyModule_AddObject(m, "DomInfo12", (PyObject *)(void *)&samr_DomInfo12_Type); Py_INCREF((PyObject *)(void *)&samr_DomInfo13_Type); PyModule_AddObject(m, "DomInfo13", (PyObject *)(void *)&samr_DomInfo13_Type); Py_INCREF((PyObject *)(void *)&samr_DomainInfo_Type); PyModule_AddObject(m, "DomainInfo", (PyObject *)(void *)&samr_DomainInfo_Type); Py_INCREF((PyObject *)(void *)&samr_Ids_Type); PyModule_AddObject(m, "Ids", (PyObject *)(void *)&samr_Ids_Type); Py_INCREF((PyObject *)(void *)&samr_GroupInfoAll_Type); PyModule_AddObject(m, "GroupInfoAll", (PyObject *)(void *)&samr_GroupInfoAll_Type); Py_INCREF((PyObject *)(void *)&samr_GroupInfoAttributes_Type); PyModule_AddObject(m, "GroupInfoAttributes", (PyObject *)(void *)&samr_GroupInfoAttributes_Type); Py_INCREF((PyObject *)(void *)&samr_GroupInfoDescription_Type); PyModule_AddObject(m, "GroupInfoDescription", (PyObject *)(void *)&samr_GroupInfoDescription_Type); Py_INCREF((PyObject *)(void *)&samr_GroupInfo_Type); PyModule_AddObject(m, "GroupInfo", (PyObject *)(void *)&samr_GroupInfo_Type); Py_INCREF((PyObject *)(void *)&samr_RidAttrArray_Type); PyModule_AddObject(m, "RidAttrArray", (PyObject *)(void *)&samr_RidAttrArray_Type); Py_INCREF((PyObject *)(void *)&samr_AliasInfoAll_Type); PyModule_AddObject(m, "AliasInfoAll", (PyObject *)(void *)&samr_AliasInfoAll_Type); Py_INCREF((PyObject *)(void *)&samr_AliasInfo_Type); PyModule_AddObject(m, "AliasInfo", (PyObject *)(void *)&samr_AliasInfo_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo1_Type); PyModule_AddObject(m, "UserInfo1", (PyObject *)(void *)&samr_UserInfo1_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo2_Type); PyModule_AddObject(m, "UserInfo2", (PyObject *)(void *)&samr_UserInfo2_Type); Py_INCREF((PyObject *)(void *)&samr_LogonHours_Type); PyModule_AddObject(m, "LogonHours", (PyObject *)(void *)&samr_LogonHours_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo3_Type); PyModule_AddObject(m, "UserInfo3", (PyObject *)(void *)&samr_UserInfo3_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo4_Type); PyModule_AddObject(m, "UserInfo4", (PyObject *)(void *)&samr_UserInfo4_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo5_Type); PyModule_AddObject(m, "UserInfo5", (PyObject *)(void *)&samr_UserInfo5_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo6_Type); PyModule_AddObject(m, "UserInfo6", (PyObject *)(void *)&samr_UserInfo6_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo7_Type); PyModule_AddObject(m, "UserInfo7", (PyObject *)(void *)&samr_UserInfo7_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo8_Type); PyModule_AddObject(m, "UserInfo8", (PyObject *)(void *)&samr_UserInfo8_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo9_Type); PyModule_AddObject(m, "UserInfo9", (PyObject *)(void *)&samr_UserInfo9_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo10_Type); PyModule_AddObject(m, "UserInfo10", (PyObject *)(void *)&samr_UserInfo10_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo11_Type); PyModule_AddObject(m, "UserInfo11", (PyObject *)(void *)&samr_UserInfo11_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo12_Type); PyModule_AddObject(m, "UserInfo12", (PyObject *)(void *)&samr_UserInfo12_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo13_Type); PyModule_AddObject(m, "UserInfo13", (PyObject *)(void *)&samr_UserInfo13_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo14_Type); PyModule_AddObject(m, "UserInfo14", (PyObject *)(void *)&samr_UserInfo14_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo16_Type); PyModule_AddObject(m, "UserInfo16", (PyObject *)(void *)&samr_UserInfo16_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo17_Type); PyModule_AddObject(m, "UserInfo17", (PyObject *)(void *)&samr_UserInfo17_Type); Py_INCREF((PyObject *)(void *)&samr_Password_Type); PyModule_AddObject(m, "Password", (PyObject *)(void *)&samr_Password_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo18_Type); PyModule_AddObject(m, "UserInfo18", (PyObject *)(void *)&samr_UserInfo18_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo20_Type); PyModule_AddObject(m, "UserInfo20", (PyObject *)(void *)&samr_UserInfo20_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo21_Type); PyModule_AddObject(m, "UserInfo21", (PyObject *)(void *)&samr_UserInfo21_Type); Py_INCREF((PyObject *)(void *)&samr_CryptPassword_Type); PyModule_AddObject(m, "CryptPassword", (PyObject *)(void *)&samr_CryptPassword_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo23_Type); PyModule_AddObject(m, "UserInfo23", (PyObject *)(void *)&samr_UserInfo23_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo24_Type); PyModule_AddObject(m, "UserInfo24", (PyObject *)(void *)&samr_UserInfo24_Type); Py_INCREF((PyObject *)(void *)&samr_CryptPasswordEx_Type); PyModule_AddObject(m, "CryptPasswordEx", (PyObject *)(void *)&samr_CryptPasswordEx_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo25_Type); PyModule_AddObject(m, "UserInfo25", (PyObject *)(void *)&samr_UserInfo25_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo26_Type); PyModule_AddObject(m, "UserInfo26", (PyObject *)(void *)&samr_UserInfo26_Type); Py_INCREF((PyObject *)(void *)&samr_UserInfo_Type); PyModule_AddObject(m, "UserInfo", (PyObject *)(void *)&samr_UserInfo_Type); Py_INCREF((PyObject *)(void *)&samr_RidWithAttribute_Type); PyModule_AddObject(m, "RidWithAttribute", (PyObject *)(void *)&samr_RidWithAttribute_Type); Py_INCREF((PyObject *)(void *)&samr_RidWithAttributeArray_Type); PyModule_AddObject(m, "RidWithAttributeArray", (PyObject *)(void *)&samr_RidWithAttributeArray_Type); Py_INCREF((PyObject *)(void *)&samr_DispEntryGeneral_Type); PyModule_AddObject(m, "DispEntryGeneral", (PyObject *)(void *)&samr_DispEntryGeneral_Type); Py_INCREF((PyObject *)(void *)&samr_DispInfoGeneral_Type); PyModule_AddObject(m, "DispInfoGeneral", (PyObject *)(void *)&samr_DispInfoGeneral_Type); Py_INCREF((PyObject *)(void *)&samr_DispEntryFull_Type); PyModule_AddObject(m, "DispEntryFull", (PyObject *)(void *)&samr_DispEntryFull_Type); Py_INCREF((PyObject *)(void *)&samr_DispInfoFull_Type); PyModule_AddObject(m, "DispInfoFull", (PyObject *)(void *)&samr_DispInfoFull_Type); Py_INCREF((PyObject *)(void *)&samr_DispEntryFullGroup_Type); PyModule_AddObject(m, "DispEntryFullGroup", (PyObject *)(void *)&samr_DispEntryFullGroup_Type); Py_INCREF((PyObject *)(void *)&samr_DispInfoFullGroups_Type); PyModule_AddObject(m, "DispInfoFullGroups", (PyObject *)(void *)&samr_DispInfoFullGroups_Type); Py_INCREF((PyObject *)(void *)&samr_DispEntryAscii_Type); PyModule_AddObject(m, "DispEntryAscii", (PyObject *)(void *)&samr_DispEntryAscii_Type); Py_INCREF((PyObject *)(void *)&samr_DispInfoAscii_Type); PyModule_AddObject(m, "DispInfoAscii", (PyObject *)(void *)&samr_DispInfoAscii_Type); Py_INCREF((PyObject *)(void *)&samr_DispInfo_Type); PyModule_AddObject(m, "DispInfo", (PyObject *)(void *)&samr_DispInfo_Type); Py_INCREF((PyObject *)(void *)&samr_PwInfo_Type); PyModule_AddObject(m, "PwInfo", (PyObject *)(void *)&samr_PwInfo_Type); Py_INCREF((PyObject *)(void *)&userPwdChangeFailureInformation_Type); PyModule_AddObject(m, "userPwdChangeFailureInformation", (PyObject *)(void *)&userPwdChangeFailureInformation_Type); Py_INCREF((PyObject *)(void *)&samr_ConnectInfo1_Type); PyModule_AddObject(m, "ConnectInfo1", (PyObject *)(void *)&samr_ConnectInfo1_Type); Py_INCREF((PyObject *)(void *)&samr_ConnectInfo_Type); PyModule_AddObject(m, "ConnectInfo", (PyObject *)(void *)&samr_ConnectInfo_Type); Py_INCREF((PyObject *)(void *)&samr_ValidationBlob_Type); PyModule_AddObject(m, "ValidationBlob", (PyObject *)(void *)&samr_ValidationBlob_Type); Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordInfo_Type); PyModule_AddObject(m, "ValidatePasswordInfo", (PyObject *)(void *)&samr_ValidatePasswordInfo_Type); Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordRepCtr_Type); PyModule_AddObject(m, "ValidatePasswordRepCtr", (PyObject *)(void *)&samr_ValidatePasswordRepCtr_Type); Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordRep_Type); PyModule_AddObject(m, "ValidatePasswordRep", (PyObject *)(void *)&samr_ValidatePasswordRep_Type); Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordReq3_Type); PyModule_AddObject(m, "ValidatePasswordReq3", (PyObject *)(void *)&samr_ValidatePasswordReq3_Type); Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordReq2_Type); PyModule_AddObject(m, "ValidatePasswordReq2", (PyObject *)(void *)&samr_ValidatePasswordReq2_Type); Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordReq1_Type); PyModule_AddObject(m, "ValidatePasswordReq1", (PyObject *)(void *)&samr_ValidatePasswordReq1_Type); Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordReq_Type); PyModule_AddObject(m, "ValidatePasswordReq", (PyObject *)(void *)&samr_ValidatePasswordReq_Type); Py_INCREF((PyObject *)(void *)&samr_Connect_Type); PyModule_AddObject(m, "Connect", (PyObject *)(void *)&samr_Connect_Type); Py_INCREF((PyObject *)(void *)&samr_Close_Type); PyModule_AddObject(m, "Close", (PyObject *)(void *)&samr_Close_Type); Py_INCREF((PyObject *)(void *)&samr_SetSecurity_Type); PyModule_AddObject(m, "SetSecurity", (PyObject *)(void *)&samr_SetSecurity_Type); Py_INCREF((PyObject *)(void *)&samr_QuerySecurity_Type); PyModule_AddObject(m, "QuerySecurity", (PyObject *)(void *)&samr_QuerySecurity_Type); Py_INCREF((PyObject *)(void *)&samr_Shutdown_Type); PyModule_AddObject(m, "Shutdown", (PyObject *)(void *)&samr_Shutdown_Type); Py_INCREF((PyObject *)(void *)&samr_LookupDomain_Type); PyModule_AddObject(m, "LookupDomain", (PyObject *)(void *)&samr_LookupDomain_Type); Py_INCREF((PyObject *)(void *)&samr_EnumDomains_Type); PyModule_AddObject(m, "EnumDomains", (PyObject *)(void *)&samr_EnumDomains_Type); Py_INCREF((PyObject *)(void *)&samr_OpenDomain_Type); PyModule_AddObject(m, "OpenDomain", (PyObject *)(void *)&samr_OpenDomain_Type); Py_INCREF((PyObject *)(void *)&samr_QueryDomainInfo_Type); PyModule_AddObject(m, "QueryDomainInfo", (PyObject *)(void *)&samr_QueryDomainInfo_Type); Py_INCREF((PyObject *)(void *)&samr_SetDomainInfo_Type); PyModule_AddObject(m, "SetDomainInfo", (PyObject *)(void *)&samr_SetDomainInfo_Type); Py_INCREF((PyObject *)(void *)&samr_CreateDomainGroup_Type); PyModule_AddObject(m, "CreateDomainGroup", (PyObject *)(void *)&samr_CreateDomainGroup_Type); Py_INCREF((PyObject *)(void *)&samr_EnumDomainGroups_Type); PyModule_AddObject(m, "EnumDomainGroups", (PyObject *)(void *)&samr_EnumDomainGroups_Type); Py_INCREF((PyObject *)(void *)&samr_CreateUser_Type); PyModule_AddObject(m, "CreateUser", (PyObject *)(void *)&samr_CreateUser_Type); Py_INCREF((PyObject *)(void *)&samr_EnumDomainUsers_Type); PyModule_AddObject(m, "EnumDomainUsers", (PyObject *)(void *)&samr_EnumDomainUsers_Type); Py_INCREF((PyObject *)(void *)&samr_CreateDomAlias_Type); PyModule_AddObject(m, "CreateDomAlias", (PyObject *)(void *)&samr_CreateDomAlias_Type); Py_INCREF((PyObject *)(void *)&samr_EnumDomainAliases_Type); PyModule_AddObject(m, "EnumDomainAliases", (PyObject *)(void *)&samr_EnumDomainAliases_Type); Py_INCREF((PyObject *)(void *)&samr_GetAliasMembership_Type); PyModule_AddObject(m, "GetAliasMembership", (PyObject *)(void *)&samr_GetAliasMembership_Type); Py_INCREF((PyObject *)(void *)&samr_LookupNames_Type); PyModule_AddObject(m, "LookupNames", (PyObject *)(void *)&samr_LookupNames_Type); Py_INCREF((PyObject *)(void *)&samr_LookupRids_Type); PyModule_AddObject(m, "LookupRids", (PyObject *)(void *)&samr_LookupRids_Type); Py_INCREF((PyObject *)(void *)&samr_OpenGroup_Type); PyModule_AddObject(m, "OpenGroup", (PyObject *)(void *)&samr_OpenGroup_Type); Py_INCREF((PyObject *)(void *)&samr_QueryGroupInfo_Type); PyModule_AddObject(m, "QueryGroupInfo", (PyObject *)(void *)&samr_QueryGroupInfo_Type); Py_INCREF((PyObject *)(void *)&samr_SetGroupInfo_Type); PyModule_AddObject(m, "SetGroupInfo", (PyObject *)(void *)&samr_SetGroupInfo_Type); Py_INCREF((PyObject *)(void *)&samr_AddGroupMember_Type); PyModule_AddObject(m, "AddGroupMember", (PyObject *)(void *)&samr_AddGroupMember_Type); Py_INCREF((PyObject *)(void *)&samr_DeleteDomainGroup_Type); PyModule_AddObject(m, "DeleteDomainGroup", (PyObject *)(void *)&samr_DeleteDomainGroup_Type); Py_INCREF((PyObject *)(void *)&samr_DeleteGroupMember_Type); PyModule_AddObject(m, "DeleteGroupMember", (PyObject *)(void *)&samr_DeleteGroupMember_Type); Py_INCREF((PyObject *)(void *)&samr_QueryGroupMember_Type); PyModule_AddObject(m, "QueryGroupMember", (PyObject *)(void *)&samr_QueryGroupMember_Type); Py_INCREF((PyObject *)(void *)&samr_SetMemberAttributesOfGroup_Type); PyModule_AddObject(m, "SetMemberAttributesOfGroup", (PyObject *)(void *)&samr_SetMemberAttributesOfGroup_Type); Py_INCREF((PyObject *)(void *)&samr_OpenAlias_Type); PyModule_AddObject(m, "OpenAlias", (PyObject *)(void *)&samr_OpenAlias_Type); Py_INCREF((PyObject *)(void *)&samr_QueryAliasInfo_Type); PyModule_AddObject(m, "QueryAliasInfo", (PyObject *)(void *)&samr_QueryAliasInfo_Type); Py_INCREF((PyObject *)(void *)&samr_SetAliasInfo_Type); PyModule_AddObject(m, "SetAliasInfo", (PyObject *)(void *)&samr_SetAliasInfo_Type); Py_INCREF((PyObject *)(void *)&samr_DeleteDomAlias_Type); PyModule_AddObject(m, "DeleteDomAlias", (PyObject *)(void *)&samr_DeleteDomAlias_Type); Py_INCREF((PyObject *)(void *)&samr_AddAliasMember_Type); PyModule_AddObject(m, "AddAliasMember", (PyObject *)(void *)&samr_AddAliasMember_Type); Py_INCREF((PyObject *)(void *)&samr_DeleteAliasMember_Type); PyModule_AddObject(m, "DeleteAliasMember", (PyObject *)(void *)&samr_DeleteAliasMember_Type); Py_INCREF((PyObject *)(void *)&samr_GetMembersInAlias_Type); PyModule_AddObject(m, "GetMembersInAlias", (PyObject *)(void *)&samr_GetMembersInAlias_Type); Py_INCREF((PyObject *)(void *)&samr_OpenUser_Type); PyModule_AddObject(m, "OpenUser", (PyObject *)(void *)&samr_OpenUser_Type); Py_INCREF((PyObject *)(void *)&samr_DeleteUser_Type); PyModule_AddObject(m, "DeleteUser", (PyObject *)(void *)&samr_DeleteUser_Type); Py_INCREF((PyObject *)(void *)&samr_QueryUserInfo_Type); PyModule_AddObject(m, "QueryUserInfo", (PyObject *)(void *)&samr_QueryUserInfo_Type); Py_INCREF((PyObject *)(void *)&samr_SetUserInfo_Type); PyModule_AddObject(m, "SetUserInfo", (PyObject *)(void *)&samr_SetUserInfo_Type); Py_INCREF((PyObject *)(void *)&samr_ChangePasswordUser_Type); PyModule_AddObject(m, "ChangePasswordUser", (PyObject *)(void *)&samr_ChangePasswordUser_Type); Py_INCREF((PyObject *)(void *)&samr_GetGroupsForUser_Type); PyModule_AddObject(m, "GetGroupsForUser", (PyObject *)(void *)&samr_GetGroupsForUser_Type); Py_INCREF((PyObject *)(void *)&samr_QueryDisplayInfo_Type); PyModule_AddObject(m, "QueryDisplayInfo", (PyObject *)(void *)&samr_QueryDisplayInfo_Type); Py_INCREF((PyObject *)(void *)&samr_GetDisplayEnumerationIndex_Type); PyModule_AddObject(m, "GetDisplayEnumerationIndex", (PyObject *)(void *)&samr_GetDisplayEnumerationIndex_Type); Py_INCREF((PyObject *)(void *)&samr_TestPrivateFunctionsDomain_Type); PyModule_AddObject(m, "TestPrivateFunctionsDomain", (PyObject *)(void *)&samr_TestPrivateFunctionsDomain_Type); Py_INCREF((PyObject *)(void *)&samr_TestPrivateFunctionsUser_Type); PyModule_AddObject(m, "TestPrivateFunctionsUser", (PyObject *)(void *)&samr_TestPrivateFunctionsUser_Type); Py_INCREF((PyObject *)(void *)&samr_GetUserPwInfo_Type); PyModule_AddObject(m, "GetUserPwInfo", (PyObject *)(void *)&samr_GetUserPwInfo_Type); Py_INCREF((PyObject *)(void *)&samr_RemoveMemberFromForeignDomain_Type); PyModule_AddObject(m, "RemoveMemberFromForeignDomain", (PyObject *)(void *)&samr_RemoveMemberFromForeignDomain_Type); Py_INCREF((PyObject *)(void *)&samr_QueryDomainInfo2_Type); PyModule_AddObject(m, "QueryDomainInfo2", (PyObject *)(void *)&samr_QueryDomainInfo2_Type); Py_INCREF((PyObject *)(void *)&samr_QueryUserInfo2_Type); PyModule_AddObject(m, "QueryUserInfo2", (PyObject *)(void *)&samr_QueryUserInfo2_Type); Py_INCREF((PyObject *)(void *)&samr_QueryDisplayInfo2_Type); PyModule_AddObject(m, "QueryDisplayInfo2", (PyObject *)(void *)&samr_QueryDisplayInfo2_Type); Py_INCREF((PyObject *)(void *)&samr_GetDisplayEnumerationIndex2_Type); PyModule_AddObject(m, "GetDisplayEnumerationIndex2", (PyObject *)(void *)&samr_GetDisplayEnumerationIndex2_Type); Py_INCREF((PyObject *)(void *)&samr_CreateUser2_Type); PyModule_AddObject(m, "CreateUser2", (PyObject *)(void *)&samr_CreateUser2_Type); Py_INCREF((PyObject *)(void *)&samr_QueryDisplayInfo3_Type); PyModule_AddObject(m, "QueryDisplayInfo3", (PyObject *)(void *)&samr_QueryDisplayInfo3_Type); Py_INCREF((PyObject *)(void *)&samr_AddMultipleMembersToAlias_Type); PyModule_AddObject(m, "AddMultipleMembersToAlias", (PyObject *)(void *)&samr_AddMultipleMembersToAlias_Type); Py_INCREF((PyObject *)(void *)&samr_RemoveMultipleMembersFromAlias_Type); PyModule_AddObject(m, "RemoveMultipleMembersFromAlias", (PyObject *)(void *)&samr_RemoveMultipleMembersFromAlias_Type); Py_INCREF((PyObject *)(void *)&samr_OemChangePasswordUser2_Type); PyModule_AddObject(m, "OemChangePasswordUser2", (PyObject *)(void *)&samr_OemChangePasswordUser2_Type); Py_INCREF((PyObject *)(void *)&samr_ChangePasswordUser2_Type); PyModule_AddObject(m, "ChangePasswordUser2", (PyObject *)(void *)&samr_ChangePasswordUser2_Type); Py_INCREF((PyObject *)(void *)&samr_GetDomPwInfo_Type); PyModule_AddObject(m, "GetDomPwInfo", (PyObject *)(void *)&samr_GetDomPwInfo_Type); Py_INCREF((PyObject *)(void *)&samr_Connect2_Type); PyModule_AddObject(m, "Connect2", (PyObject *)(void *)&samr_Connect2_Type); Py_INCREF((PyObject *)(void *)&samr_SetUserInfo2_Type); PyModule_AddObject(m, "SetUserInfo2", (PyObject *)(void *)&samr_SetUserInfo2_Type); Py_INCREF((PyObject *)(void *)&samr_SetBootKeyInformation_Type); PyModule_AddObject(m, "SetBootKeyInformation", (PyObject *)(void *)&samr_SetBootKeyInformation_Type); Py_INCREF((PyObject *)(void *)&samr_GetBootKeyInformation_Type); PyModule_AddObject(m, "GetBootKeyInformation", (PyObject *)(void *)&samr_GetBootKeyInformation_Type); Py_INCREF((PyObject *)(void *)&samr_Connect3_Type); PyModule_AddObject(m, "Connect3", (PyObject *)(void *)&samr_Connect3_Type); Py_INCREF((PyObject *)(void *)&samr_Connect4_Type); PyModule_AddObject(m, "Connect4", (PyObject *)(void *)&samr_Connect4_Type); Py_INCREF((PyObject *)(void *)&samr_ChangePasswordUser3_Type); PyModule_AddObject(m, "ChangePasswordUser3", (PyObject *)(void *)&samr_ChangePasswordUser3_Type); Py_INCREF((PyObject *)(void *)&samr_Connect5_Type); PyModule_AddObject(m, "Connect5", (PyObject *)(void *)&samr_Connect5_Type); Py_INCREF((PyObject *)(void *)&samr_RidToSid_Type); PyModule_AddObject(m, "RidToSid", (PyObject *)(void *)&samr_RidToSid_Type); Py_INCREF((PyObject *)(void *)&samr_SetDsrmPassword_Type); PyModule_AddObject(m, "SetDsrmPassword", (PyObject *)(void *)&samr_SetDsrmPassword_Type); Py_INCREF((PyObject *)(void *)&samr_ValidatePassword_Type); PyModule_AddObject(m, "ValidatePassword", (PyObject *)(void *)&samr_ValidatePassword_Type); Py_INCREF((PyObject *)(void *)&samr_InterfaceType); PyModule_AddObject(m, "samr", (PyObject *)(void *)&samr_InterfaceType); Py_INCREF((PyObject *)(void *)&samr_SyntaxType); PyModule_AddObject(m, "samr_abstract_syntax", (PyObject *)(void *)&samr_SyntaxType); Py_INCREF((PyObject *)(void *)&samr_SyntaxType); PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&samr_SyntaxType); #ifdef PY_MOD_SAMR_PATCH PY_MOD_SAMR_PATCH(m); #endif out: Py_XDECREF(dep_samba_dcerpc_misc); Py_XDECREF(dep_samba_dcerpc_lsa); Py_XDECREF(dep_samba_dcerpc_security); Py_XDECREF(dep_talloc); Py_XDECREF(dep_samba_dcerpc_base); return m; }