Q about pidl client code in Samba 3

Gerald (Jerry) Carter jerry at samba.org
Wed Sep 27 22:51:14 GMT 2006


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

Gerald (Jerry) Carter wrote:
> Jelmer,
> 
>>> I'm looking at the return code in rpccli_winreg_EnumKey():
>>>
>>> 	/* Return variables */
>>> 	*name = *r.out.name;
>>> 	*keyclass = *r.out.keyclass;
>>> 	*last_changed_time = *r.out.last_changed_time;
> 
> Here's another thing I don't get.  name in this
> case is struct winreg_String and is an [in,out,ref]
> variable.  The problem with EnumKey is that the name
> has to point to an existing buffer.  But the libndr
> layer just works on strlen() in this case.
> 
> So I allocated a string of the correct size and called
> 
> 	memset(name.name, 'a', maxsiz-1);
> 	name.name[maxsize-1] = '\0';
> 
> Is there an easier way to call these in/out ref
> pointers?

Ignore this one.  I misread the IDL.  It's a struct
winreg_StringBuf.  I'm assuming in this case you do
have to initialize the buffer size before passing
it to the rpccli_winreg_XX() functions.




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

iD8DBQFFGwBiIR7qMdg1EfYRAvteAKCBY6n/PRQESkdJ0IGZCV+hhm0HBQCg7Ng0
qfrq+UsbEqGd/+H7+39yk+c=
=sGyO
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list