From 340d9b71f9e75d634389104da5949ba59669ede2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 13 Dec 2003 02:20:40 +0000 Subject: added a basic dcerpc endpoint mapper to Samba4. Currently only implements the epm_Lookup() call, I'll add the other important calls soon. I was rather pleased to find that epm_Lookup() worked first time, which is particularly surprising given its complexity. This required quite a bit of new infrastructure: * a generic way of handling dcerpc policy handles in the rpc server * added type checked varients of talloc. These are much less error prone. I'd like to move to using these for nearly all uses of talloc. * added more dcerpc fault handling code, and translation from NTSTATUS to a dcerpc fault code * added data_blob_talloc_zero() for allocating an initially zero blob * added a endpoint enumeration hook in the dcerpc endpoint server operations (This used to be commit 3f85f9b782dc17417baf1ca557fcae22f5b6a83a) --- source4/include/talloc.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/include') diff --git a/source4/include/talloc.h b/source4/include/talloc.h index 4badddbb88..60a2822f38 100644 --- a/source4/include/talloc.h +++ b/source4/include/talloc.h @@ -46,6 +46,11 @@ char *talloc_vasprintf_append(TALLOC_CTX *t, char *, const char *, va_list ap) char *talloc_asprintf_append(TALLOC_CTX *t, char *, const char *, ...) PRINTF_ATTRIBUTE(3, 4); +/* useful macros for creating type checked pointers */ +#define talloc_p(ctx, type) (type *)talloc(ctx, sizeof(type)); +#define talloc_array_p(ctx, type, count) (type *)talloc_realloc_array(ctx, NULL, sizeof(type), count) +#define talloc_realloc_p(ctx, p, type, count) (type *)talloc_realloc_array(ctx, p, sizeof(type), count) + /** @} */ #endif /* ndef _TALLOC_H_ */ -- cgit