More pidl issues ni Samba 3

Gerald (Jerry) Carter jerry at samba.org
Thu Sep 28 16:22:58 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jelmer,

Given this IDL:

        /******************/
        /* Function: 0x09 */
        WERROR winreg_EnumKey(
                [in,ref]        policy_handle    *handle,
                [in]            uint32           enum_index,
                [in,out,ref]    winreg_StringBuf *name,
                [in,out,unique] winreg_StringBuf *keyclass,
                [in,out,unique] NTTIME           *last_changed_time
        );

I've now realized that the struct winreg_StringBuf.name
buffer comes back with different member than it went in with.
Even though the point of this call is to pass in a buffer
of the correct size.

Before call to rpccli_winreg_EnumKey():
   (gdb) print subkey_namebuf
   $3 = {
     length = 0,
     size = 76,
    name = 0x84fac40 ""
  }

After call to rpccli_winreg_EnumKey():
   (gdb) print subkey_namebuf
   $4 = {
     length = 12,
     size = 76,
     name = 0x84fae98 "Adobe"
   }

This is due to the shallow structure copy in the generated client
code.

   *name = *r.out.name;

Is this how things are expected to work ? I can live with it.
It's just a little surprising and can lead to memory leaks
if you aren't aware of it.

I still have the QueryValue() problem on my list where
the [in,out,ref] uint8 *data field not copied into the
return buffer but just tries "*data = *r.out.data".  I'll work
on that and send out an aggregate patch for pidl later.




cheers, jerry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFG/bhIR7qMdg1EfYRAn9nAJ97n6m63uc4o7ghnMjc4oiu7wX2wACdF14Q
aen/v8VZCUMnJyuamOa6NJQ=
=8gxY
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list