Request for help with PIDL

Jelmer Vernooij jelmer at samba.org
Wed Mar 31 15:48:47 MDT 2010


On Wed, 2010-03-31 at 01:43 +0300, Kamen Mazdrashki wrote:
> Hi guys,
> 
> I am trying to create 'drsblobs' python module out of
> "librpc/gen_ndr/py_drsblobs.c"
> generated file. Unfortunately py_drsblobs.c does not compile :(
> 
> Could you please take a look at py_drsblobs.c, line: 3305 to 3316
> static int py_package_PrimaryKerberosString_set_string(PyObject *py_obj,
> PyObject *value, void *closure)
> {
> struct package_PrimaryKerberosString *object = (struct
> package_PrimaryKerberosString *)py_talloc_get_ptr(py_obj);
> talloc_free(object->string);
> if (value == Py_None) {
> object->string = NULL;
> } else {
> object->string = talloc_ptrtype(py_talloc_get_mem_ctx(py_obj),
> object->string);
> *object->string = talloc_strdup(py_talloc_get_mem_ctx(py_obj),
> PyString_AsString(value));
> }
> return 0;
> }
> 
> and "librpc/idl/drsblobs.idl" - line: 337 to 341
> typedef struct {
> [value(2*strlen_m(string))] uint16 length;
> [value(2*strlen_m(string))] uint16 size;
> [relative,subcontext(0),subcontext_size(size),flag(STR_NOTERM|NDR_REMAINING)]
> string *string;
> } package_PrimaryKerberosString;
> 
> 
> What is wrong here?
> Is it the PIDL's Python generator or the IDL definition?
Either :-)

There is a bit too much magic involved in the "string" variable type
that the Python module can't handle without quite a bit of extra code.
In this particular situation it eliminates an extra pointer.

Ideally we should just replace the "string" variable type with the use
of a normal char type.

Cheers,

Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100331/4d8ef15b/attachment.pgp>


More information about the samba-technical mailing list