.tp_methods = registry_methods,
.tp_new = registry_new,
.tp_basicsize = sizeof(py_talloc_Object),
- .tp_dealloc = py_talloc_dealloc,
.tp_flags = Py_TPFLAGS_DEFAULT,
};
.tp_methods = hive_key_methods,
.tp_new = hive_new,
.tp_basicsize = sizeof(py_talloc_Object),
- .tp_dealloc = py_talloc_dealloc,
.tp_flags = Py_TPFLAGS_DEFAULT,
};
PyTypeObject PyRegistryKey = {
.tp_name = "RegistryKey",
.tp_basicsize = sizeof(py_talloc_Object),
- .tp_dealloc = py_talloc_dealloc,
.tp_flags = Py_TPFLAGS_DEFAULT,
};
PyErr_SetWERROR(result);
return NULL;
}
-
+
return py_talloc_steal(&PyRegistry, reg_ctx);
}
void initregistry(void)
{
PyObject *m;
+ PyTypeObject *talloc_type = PyTalloc_GetObjectType();
+
+ if (talloc_type == NULL)
+ return;
+
+ PyHiveKey.tp_base = talloc_type;
+ PyRegistry.tp_base = talloc_type;
+ PyRegistryKey.tp_base = talloc_type;
if (PyType_Ready(&PyHiveKey) < 0)
return;