From be5edba117d3af9c9289bc5d37e7e037cb0a05f1 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 8 Feb 2011 00:04:20 +0100 Subject: libndr: share some uuid helpers. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Tue Feb 8 09:52:56 CET 2011 on sn-devel-104 --- librpc/ndr/uuid.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'librpc/ndr/uuid.c') diff --git a/librpc/ndr/uuid.c b/librpc/ndr/uuid.c index 33a7eeeb5a..b6a7fc7071 100644 --- a/librpc/ndr/uuid.c +++ b/librpc/ndr/uuid.c @@ -335,3 +335,20 @@ _PUBLIC_ bool policy_handle_empty(struct policy_handle *h) { return (h->handle_type == 0 && GUID_all_zero(&h->uuid)); } + +_PUBLIC_ bool is_valid_policy_hnd(const struct policy_handle *hnd) +{ + struct policy_handle tmp; + ZERO_STRUCT(tmp); + return (memcmp(&tmp, hnd, sizeof(tmp)) != 0); +} + +_PUBLIC_ bool policy_handle_equal(const struct policy_handle *hnd1, + const struct policy_handle *hnd2) +{ + if (!hnd1 || !hnd2) { + return false; + } + + return (memcmp(hnd1, hnd2, sizeof(*hnd1)) == 0); +} -- cgit