From c3eb37f292cd0b31063d25f0f0cc3dfe53b320e5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 16 Nov 2004 13:14:02 +0000 Subject: r3787: a function to generate a random GUID metze (This used to be commit 8bd2e3cb4e5123a3e26965b8535e16ee18005714) --- source4/librpc/ndr/ndr_basic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4') diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 70fd0b34a4..9507f4d33b 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -1195,6 +1195,16 @@ NTSTATUS GUID_from_string(const char *s, struct GUID *guid) return NT_STATUS_OK; } +/* generate a random GUID */ +struct GUID GUID_random(void) +{ + struct GUID guid; + + generate_random_buffer((uint8_t *)&guid, sizeof(guid)); + + return guid; +} + /* its useful to be able to display these in debugging messages */ -- cgit