From 8709182fd3c740619fdb075b24023b1eaf192fcd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 8 Apr 2004 19:06:37 +0000 Subject: r126: - add first srvsvc and wkssvc server side stuff - we know can browse the server via the Windows Explorer - some little fixes to the winreg server pipe metze (This used to be commit 6f213a3494d3b5ab629944394b20a84075a04438) --- source4/rpc_server/common/common.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 source4/rpc_server/common/common.h (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h new file mode 100644 index 0000000000..bf31958b89 --- /dev/null +++ b/source4/rpc_server/common/common.h @@ -0,0 +1,28 @@ +/* + Unix SMB/CIFS implementation. + + common macros for the dcerpc server interfaces + + Copyright (C) Stefan (metze) Metzmacher 2004 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#define WERR_TALLOC_CHECK(x) do {\ + if (!(x)) {\ + r->out.result = WERR_NOMEM;\ + return NT_STATUS_OK;\ + }\ +} while (0) -- cgit From 21e6b1531b4e656af5962fdbeb671350f653fc26 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 4 May 2004 06:07:52 +0000 Subject: r464: a big improvement to the API for writing server-side RPC servers. Previously the server pipe code needed to return the RPC level status (nearly always "OK") and separately set the function call return using r->out.result. All the programmers writing servers (metze, jelmer and me) were often getting this wrong, by doing things like "return NT_STATUS_NO_MEMORY" which was really quite meaningless as there is no code like that at the dcerpc level. I have now modified pidl to generate the necessary boilerplate so that just returning the status you want from the function will work. So for a NTSTATUS function you return NT_STATUS_XXX and from a WERROR function you return WERR_XXX. If you really want to generate a DCERPC level fault rather than just a return value in your function then you should use the DCESRV_FAULT() macro which will correctly generate a fault for you. As a side effect, this also adds automatic type checking of all of our server side rpc functions, which was impossible with the old API. When I changed the API I found and fixed quite a few functions with the wrong type information, so this is definately useful. I have also changed the server side template generation to generate a DCERPC "operation range error" by default when you have not yet filled in a server side function. This allows us to correctly implement functions in any order in our rpc pipe servers and give the client the right information about the fault. (This used to be commit a4df5c7cf88891a78d82c8d6d7f058d8485e73f0) --- source4/rpc_server/common/common.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index bf31958b89..17b76840af 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -4,6 +4,7 @@ common macros for the dcerpc server interfaces Copyright (C) Stefan (metze) Metzmacher 2004 + Copyright (C) Andrew Tridgell 2004 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,8 +22,15 @@ */ #define WERR_TALLOC_CHECK(x) do {\ - if (!(x)) {\ - r->out.result = WERR_NOMEM;\ - return NT_STATUS_OK;\ - }\ + if (!(x)) return WERR_NOMEM;\ } while (0) + +/* a useful macro for generating a RPC fault in the backend code */ +#define DCESRV_FAULT(code) do { \ + dce_call->fault_code = code; \ + return r->out.result; \ +} while(0) + +/* a useful macro for checking the validity of a dcerpc policy handle + and giving the right fault code if invalid */ +#define DCESRV_CHECK_HANDLE(h) do {if (!(h)) DCESRV_FAULT(DCERPC_FAULT_CONTEXT_MISMATCH); } while (0) -- cgit From 0ed08d9398d0ee8d9fdbc0f387415adc32ba675e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 8 May 2004 00:02:31 +0000 Subject: r578: initial server side implementation of samr_CreateUser(), samr_CreateUser2(), samr_LookupNames(), samr_OpenUser(), and samr_DeleteUser() this uses a user template in the SAM db, of objectclass "userTemplate" and dn CN=TemplateUser,CN=Templates,$BASEDN. Using a template allows an admin to add any default user attributes that they might want to the user template and all new users will receive those attributes. (This used to be commit 10b6e0011b5952c98432dc2d4b2058ac89a9cc2d) --- source4/rpc_server/common/common.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index 17b76840af..afc238f6b6 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -34,3 +34,14 @@ /* a useful macro for checking the validity of a dcerpc policy handle and giving the right fault code if invalid */ #define DCESRV_CHECK_HANDLE(h) do {if (!(h)) DCESRV_FAULT(DCERPC_FAULT_CONTEXT_MISMATCH); } while (0) + +/* this checks for a valid policy handle, and gives a fault if an + invalid handle or NT_STATUS_INVALID_HANDLE if the handle is of the + wrong type */ +#define DCESRV_PULL_HANDLE(h, inhandle, t) do { \ + (h) = dcesrv_handle_fetch(dce_call->conn, (inhandle), DCESRV_HANDLE_ANY); \ + DCESRV_CHECK_HANDLE(h); \ + if ((t) != DCESRV_HANDLE_ANY && (h)->wire_handle.handle_type != (t)) { \ + return NT_STATUS_INVALID_HANDLE; \ + } \ +} while (0) -- cgit From 766d7dd2024c55faa46fd4b479c72fed40ef082a Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 20 Jun 2004 10:48:00 +0000 Subject: r1205: Whoops - this should fix the build. (This used to be commit e21f324937df2fe70b693112bd0b6fe6575d70ed) --- source4/rpc_server/common/common.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index afc238f6b6..d3ae0db014 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -38,10 +38,13 @@ /* this checks for a valid policy handle, and gives a fault if an invalid handle or NT_STATUS_INVALID_HANDLE if the handle is of the wrong type */ -#define DCESRV_PULL_HANDLE(h, inhandle, t) do { \ +#define DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, retval) do { \ (h) = dcesrv_handle_fetch(dce_call->conn, (inhandle), DCESRV_HANDLE_ANY); \ DCESRV_CHECK_HANDLE(h); \ if ((t) != DCESRV_HANDLE_ANY && (h)->wire_handle.handle_type != (t)) { \ - return NT_STATUS_INVALID_HANDLE; \ + return retval; \ } \ } while (0) + +#define DCESRV_PULL_HANDLE(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, NT_STATUS_INVALID_HANDLE) +#define DCESRV_PULL_HANDLE_WERR(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, WERR_BADFID) -- cgit From 19a242eb3a32961fcc9119e8a4e31829359fb1bd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 10 Oct 2004 01:28:32 +0000 Subject: r2887: fix comment metze (This used to be commit 5143a9bd8aa84b80763c304638a27395b53b54cc) --- source4/rpc_server/common/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index d3ae0db014..a1d3836ed0 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -36,7 +36,7 @@ #define DCESRV_CHECK_HANDLE(h) do {if (!(h)) DCESRV_FAULT(DCERPC_FAULT_CONTEXT_MISMATCH); } while (0) /* this checks for a valid policy handle, and gives a fault if an - invalid handle or NT_STATUS_INVALID_HANDLE if the handle is of the + invalid handle or retval if the handle is of the wrong type */ #define DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, retval) do { \ (h) = dcesrv_handle_fetch(dce_call->conn, (inhandle), DCESRV_HANDLE_ANY); \ -- cgit From 707661a87ebf92362df9c3adfe87a94b8e60ec35 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 13 Oct 2004 15:04:51 +0000 Subject: r2953: add NTSTATUS_TALLOC_CHECK(x) metze (This used to be commit a2cc9517208adedbcbed4b01d18a1478f75d70df) --- source4/rpc_server/common/common.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index a1d3836ed0..a45f183ca6 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -21,6 +21,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define NTSTATUS_TALLOC_CHECK(x) do {\ + if (!(x)) return NT_STATUS_NO_MEMORY;\ +} while (0) + #define WERR_TALLOC_CHECK(x) do {\ if (!(x)) return WERR_NOMEM;\ } while (0) -- cgit From 577218b2aded7adb367f3f33bcc5560f3d4c0ec2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 10 Jan 2005 12:15:26 +0000 Subject: r4640: first stage in the server side support for multiple context_ids on one pipe this stage does the following: - simplifies the dcerpc_handle handling, and all the callers of it - split out the context_id depenent state into a linked list of established contexts - fixed some talloc handling in several rpc servers that i noticed while doing the above (This used to be commit fde042b3fc609c94e2c7eedcdd72ecdf489cf63b) --- source4/rpc_server/common/common.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index a45f183ca6..67c758a698 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -43,12 +43,19 @@ invalid handle or retval if the handle is of the wrong type */ #define DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, retval) do { \ - (h) = dcesrv_handle_fetch(dce_call->conn, (inhandle), DCESRV_HANDLE_ANY); \ + (h) = dcesrv_handle_fetch(dce_call->context, (inhandle), DCESRV_HANDLE_ANY); \ DCESRV_CHECK_HANDLE(h); \ if ((t) != DCESRV_HANDLE_ANY && (h)->wire_handle.handle_type != (t)) { \ return retval; \ } \ } while (0) +/* this checks for a valid policy handle and gives a dcerpc fault + if its the wrong type of handle */ +#define DCESRV_PULL_HANDLE_FAULT(h, inhandle, t) do { \ + (h) = dcesrv_handle_fetch(dce_call->context, (inhandle), t); \ + DCESRV_CHECK_HANDLE(h); \ +} while (0) + #define DCESRV_PULL_HANDLE(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, NT_STATUS_INVALID_HANDLE) #define DCESRV_PULL_HANDLE_WERR(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, WERR_BADFID) -- cgit From 6bf82c05c1a9ab37afca21978885712da093b633 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 3 May 2005 15:38:19 +0000 Subject: r6606: add a DCESRV_FAULT_VOID() marco to use in void functions metze (This used to be commit a379836de63951bcfbc281425af3db7094248f2f) --- source4/rpc_server/common/common.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index 67c758a698..a43ca74530 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -35,6 +35,12 @@ return r->out.result; \ } while(0) +/* a useful macro for generating a RPC fault in the backend code */ +#define DCESRV_FAULT_VOID(code) do { \ + dce_call->fault_code = code; \ + return; \ +} while(0) + /* a useful macro for checking the validity of a dcerpc policy handle and giving the right fault code if invalid */ #define DCESRV_CHECK_HANDLE(h) do {if (!(h)) DCESRV_FAULT(DCERPC_FAULT_CONTEXT_MISMATCH); } while (0) -- cgit From 4ac2be99588b48b0652a524bf12fb1aa9c3f5fbb Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 7 Mar 2006 11:07:23 +0000 Subject: r13924: Split more prototypes out of include/proto.h + initial work on header file dependencies (This used to be commit 122835876748a3eaf5e8d31ad1abddab9acb8781) --- source4/rpc_server/common/common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index a43ca74530..d0807d849d 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -65,3 +65,5 @@ #define DCESRV_PULL_HANDLE(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, NT_STATUS_INVALID_HANDLE) #define DCESRV_PULL_HANDLE_WERR(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, WERR_BADFID) + +#include "rpc_server/common/proto.h" -- cgit From e3f2414cf9e582a4e4deecc662b64a7bb2679a34 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 14 Mar 2006 15:03:25 +0000 Subject: r14380: Reduce the size of structs.h (This used to be commit 1a16a6f1dfa66499af43a6b88b3ea69a6a75f1fe) --- source4/rpc_server/common/common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index d0807d849d..5f0dd9127e 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -66,4 +66,6 @@ #define DCESRV_PULL_HANDLE(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, NT_STATUS_INVALID_HANDLE) #define DCESRV_PULL_HANDLE_WERR(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, WERR_BADFID) +struct dcesrv_context; + #include "rpc_server/common/proto.h" -- cgit From 657325d684b838ee7dd6379a4a6034c1fedabcae Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 29 Apr 2006 11:48:56 +0000 Subject: r15319: remove unneeded macros metze (This used to be commit 9611c8aa9ce0eba1703d5eecc52e67a9e5fba15f) --- source4/rpc_server/common/common.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index 5f0dd9127e..0dc3814c71 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -21,14 +21,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define NTSTATUS_TALLOC_CHECK(x) do {\ - if (!(x)) return NT_STATUS_NO_MEMORY;\ -} while (0) - -#define WERR_TALLOC_CHECK(x) do {\ - if (!(x)) return WERR_NOMEM;\ -} while (0) - /* a useful macro for generating a RPC fault in the backend code */ #define DCESRV_FAULT(code) do { \ dce_call->fault_code = code; \ -- cgit From 9c66f601f1520a99b9236c32bc9f03a33bd4b2aa Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 23 Jul 2006 18:43:07 +0000 Subject: r17206: Add a modular API for share configuration. Commit the classic backwards compatible module which is the default one (This used to be commit a89cc346b9296cb49929898d257a064a6c2bae86) --- source4/rpc_server/common/common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index 0dc3814c71..7fec95ac52 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -60,4 +60,5 @@ struct dcesrv_context; +#include "param/share.h" #include "rpc_server/common/proto.h" -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/rpc_server/common/common.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index 7fec95ac52..5ddfca43b5 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -8,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -17,8 +17,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ /* a useful macro for generating a RPC fault in the backend code */ -- cgit From afe3e8172ddaa5e4aa811faceecda4f943d6e2ef Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 04:53:27 +0200 Subject: Install public header files again and include required prototypes. (This used to be commit 47ffbbf67435904754469544390b67d34c958343) --- source4/rpc_server/common/common.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index 5ddfca43b5..110ef6062d 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -57,7 +57,18 @@ #define DCESRV_PULL_HANDLE(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, NT_STATUS_INVALID_HANDLE) #define DCESRV_PULL_HANDLE_WERR(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, WERR_BADFID) +struct share_config; struct dcesrv_context; +enum srvsvc_ShareType dcesrv_common_get_share_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, struct share_config *scfg); +enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx); +const char *dcesrv_common_get_domain_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx); +const char *dcesrv_common_get_lan_root(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx); +const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, const char *server_unc); +uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx); +uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx); +uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx); +uint32_t dcesrv_common_get_share_permissions(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, struct share_config *scfg); +uint32_t dcesrv_common_get_share_current_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, struct share_config *scfg); +const char *dcesrv_common_get_share_path(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, struct share_config *scfg); -#include "param/share.h" -#include "rpc_server/common/proto.h" +struct dcesrv_context; -- cgit From 1cf8130e110c63a3bfc04ef8e21ca4343a4ab35c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 14:18:31 +0200 Subject: Move handle utility functions to public header, remove more public headers. (This used to be commit 92e71c19f4e1d3ca123a083942ec578d21f7012c) --- source4/rpc_server/common/common.h | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'source4/rpc_server/common/common.h') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index 110ef6062d..af2d96cb3e 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -20,43 +20,6 @@ along with this program. If not, see . */ -/* a useful macro for generating a RPC fault in the backend code */ -#define DCESRV_FAULT(code) do { \ - dce_call->fault_code = code; \ - return r->out.result; \ -} while(0) - -/* a useful macro for generating a RPC fault in the backend code */ -#define DCESRV_FAULT_VOID(code) do { \ - dce_call->fault_code = code; \ - return; \ -} while(0) - -/* a useful macro for checking the validity of a dcerpc policy handle - and giving the right fault code if invalid */ -#define DCESRV_CHECK_HANDLE(h) do {if (!(h)) DCESRV_FAULT(DCERPC_FAULT_CONTEXT_MISMATCH); } while (0) - -/* this checks for a valid policy handle, and gives a fault if an - invalid handle or retval if the handle is of the - wrong type */ -#define DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, retval) do { \ - (h) = dcesrv_handle_fetch(dce_call->context, (inhandle), DCESRV_HANDLE_ANY); \ - DCESRV_CHECK_HANDLE(h); \ - if ((t) != DCESRV_HANDLE_ANY && (h)->wire_handle.handle_type != (t)) { \ - return retval; \ - } \ -} while (0) - -/* this checks for a valid policy handle and gives a dcerpc fault - if its the wrong type of handle */ -#define DCESRV_PULL_HANDLE_FAULT(h, inhandle, t) do { \ - (h) = dcesrv_handle_fetch(dce_call->context, (inhandle), t); \ - DCESRV_CHECK_HANDLE(h); \ -} while (0) - -#define DCESRV_PULL_HANDLE(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, NT_STATUS_INVALID_HANDLE) -#define DCESRV_PULL_HANDLE_WERR(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, WERR_BADFID) - struct share_config; struct dcesrv_context; enum srvsvc_ShareType dcesrv_common_get_share_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, struct share_config *scfg); -- cgit