1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
samba-mirror/source4/rpc_server
Andrew Tridgell 61a7dfc237 r2675: added a convenience function
void *talloc_reference(const void *context, const void *ptr);

this function makes a secondary reference to ptr, and hangs it off the
given context. This greatly simplifies some of the current reference
counting code in the samr server and I suspect it will be widely used
in other places too.

the way you use it is like this:

	domain_state->connect_state = talloc_reference(domain_state, connect_state);

that makes the element connect_state of domain_state a secondary
reference to connect_state. The connect_state structure will then only
be freed when both domain_state and the original connect_state go
away, allowing you to free them independently and in any order.

you could do this alrady using a talloc destructor, and that is what
the samr server did previously, but that meant this construct was
being reinvented in several places. So this convenience function sets
up the destructor for you, giving a much more convenient and less
error prone API.
(This used to be commit dc53150861)
2007-10-10 12:59:20 -05:00
..
common r2055: Add PRINTF_ATTRIBUTE to many more parts of the code, and a new 2007-10-10 12:58:21 -05:00
echo r2105: added a TestSleep() operation to the echo pipe and extended the 2007-10-10 12:58:25 -05:00
epmapper r2671: we're getting too many errors caused by the talloc_realloc() API not 2007-10-10 12:59:20 -05:00
lsa r2635: mem_ctx cleanups on the lsa and netlogon pipes in the rpc server 2007-10-10 12:59:15 -05:00
netlogon r2669: convert make_user_info() and associated functions from malloc to talloc 2007-10-10 12:59:19 -05:00
remote r2627: use the new talloc capabilities in a bunch more places in the rpc 2007-10-10 12:59:13 -05:00
samr r2675: added a convenience function 2007-10-10 12:59:20 -05:00
spoolss r2435: got rid of another pointless strnequal() 2007-10-10 12:58:52 -05:00
srvsvc r1546: fix the build the function name has changed to srvsvc_NetRemoteTOD 2007-10-10 12:57:41 -05:00
winreg r2627: use the new talloc capabilities in a bunch more places in the rpc 2007-10-10 12:59:13 -05:00
wkssvc r870: we should issue a rpc fault OP_RANGE_ERROR not a WERR_NOT_SUPPORTED for 2007-10-10 12:56:14 -05:00
config.m4 r1294: A nice, large, commit... 2007-10-10 12:56:49 -05:00
config.mk r1294: A nice, large, commit... 2007-10-10 12:56:49 -05:00
dcerpc_server.c r2673: in the rpc server, free up the old call when we decide to extend an 2007-10-10 12:59:20 -05:00
dcerpc_server.h r2627: use the new talloc capabilities in a bunch more places in the rpc 2007-10-10 12:59:13 -05:00
dcerpc_tcp.c r2646: - use a talloc destructor to ensure that sockets from the new socket 2007-10-10 12:59:16 -05:00
dcesrv_auth.c r2629: convert gensec to the new talloc model 2007-10-10 12:59:14 -05:00
handles.c r2627: use the new talloc capabilities in a bunch more places in the rpc 2007-10-10 12:59:13 -05:00