diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-09-13 16:28:25 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:51:43 -0500 |
commit | 48e2a2bfb75cdc914345b498012e82331546f0c0 (patch) | |
tree | 8c8d2d5a5583adffce55a4022ba120cec7c32ab8 | |
parent | a4743f3a76dc88f765f9bc5dde8054b60d3045cc (diff) | |
download | samba-48e2a2bfb75cdc914345b498012e82331546f0c0.tar.gz samba-48e2a2bfb75cdc914345b498012e82331546f0c0.tar.bz2 samba-48e2a2bfb75cdc914345b498012e82331546f0c0.zip |
r18481: Use pidl-generated server side code for dfs.
(This used to be commit 3f337c104d42321595161d0283b39357df252a8e)
-rw-r--r-- | source3/Makefile.in | 4 | ||||
-rw-r--r-- | source3/include/includes.h | 1 | ||||
-rw-r--r-- | source3/include/rpc_dfs.h | 405 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_dfs.c | 1201 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_dfs.h | 29 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_lsa.c | 4233 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_lsa.h | 88 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_unixinfo.c | 280 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_unixinfo.h | 11 | ||||
-rw-r--r-- | source3/rpc_parse/parse_dfs.c | 2737 | ||||
-rw-r--r-- | source3/rpc_server/srv_dfs.c | 602 | ||||
-rw-r--r-- | source3/rpc_server/srv_dfs_nt.c | 207 | ||||
-rw-r--r-- | source3/script/build_idl.sh | 2 | ||||
-rw-r--r-- | source3/smbd/msdfs.c | 11 |
14 files changed, 5928 insertions, 3883 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in index 9c4ca01d93..778e520ca1 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -332,7 +332,7 @@ RPC_SVCCTL_OBJ = rpc_server/srv_svcctl.o rpc_server/srv_svcctl_nt.o \ RPC_NTSVCS_OBJ = rpc_server/srv_ntsvcs.o rpc_server/srv_ntsvcs_nt.o -RPC_DFS_OBJ = rpc_server/srv_dfs.o rpc_server/srv_dfs_nt.o +RPC_DFS_OBJ = librpc/gen_ndr/srv_dfs.o rpc_server/srv_dfs_nt.o RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o @@ -353,7 +353,7 @@ RPC_PARSE_OBJ = rpc_parse/parse_lsa.o rpc_parse/parse_net.o \ rpc_parse/parse_reg.o rpc_parse/parse_rpc.o \ rpc_parse/parse_samr.o rpc_parse/parse_srv.o \ rpc_parse/parse_wks.o rpc_parse/parse_ds.o \ - rpc_parse/parse_spoolss.o rpc_parse/parse_dfs.o \ + rpc_parse/parse_spoolss.o \ rpc_parse/parse_echo.o rpc_parse/parse_shutdown.o \ rpc_parse/parse_svcctl.o \ rpc_parse/parse_eventlog.o rpc_parse/parse_buffer.o \ diff --git a/source3/include/includes.h b/source3/include/includes.h index 635cf3807f..319a475bcf 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1005,7 +1005,6 @@ extern int errno; #include "rpc_wkssvc.h" #include "rpc_spoolss.h" #include "rpc_eventlog.h" -#include "rpc_dfs.h" #include "rpc_ds.h" #include "rpc_echo.h" #include "rpc_shutdown.h" diff --git a/source3/include/rpc_dfs.h b/source3/include/rpc_dfs.h deleted file mode 100644 index e78db52254..0000000000 --- a/source3/include/rpc_dfs.h +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * header auto-generated by pidl. DO NOT MODIFY! - */ - - -#ifndef _RPC_NETDFS_H -#define _RPC_NETDFS_H - -#define DFS_GETMANAGERVERSION 0 -#define DFS_ADD 1 -#define DFS_REMOVE 2 -#define DFS_SETINFO 3 -#define DFS_GETINFO 4 -#define DFS_ENUM 5 -#define DFS_RENAME 6 -#define DFS_MOVE 7 -#define DFS_MANAGERGETCONFIGINFO 8 -#define DFS_MANAGERSENDSITEINFO 9 -#define DFS_ADDFTROOT 10 -#define DFS_REMOVEFTROOT 11 -#define DFS_ADDSTDROOT 12 -#define DFS_REMOVESTDROOT 13 -#define DFS_MANAGERINITIALIZE 14 -#define DFS_ADDSTDROOTFORCED 15 -#define DFS_GETDCADDRESS 16 -#define DFS_SETDCADDRESS 17 -#define DFS_FLUSHFTTABLE 18 -#define DFS_ADD2 19 -#define DFS_REMOVE2 20 -#define DFS_ENUMEX 21 -#define DFS_SETINFO2 22 - -typedef struct netdfs_dfs_Info0 { - uint32 dummy; -} NETDFS_DFS_INFO0; - -typedef struct netdfs_dfs_Info1 { - uint32 ptr0_path; - UNISTR2 path; -} NETDFS_DFS_INFO1; - -typedef struct netdfs_dfs_Info2 { - uint32 ptr0_path; - UNISTR2 path; - uint32 ptr0_comment; - UNISTR2 comment; - uint32 state; - uint32 num_stores; -} NETDFS_DFS_INFO2; - -typedef struct netdfs_dfs_StorageInfo { - uint32 state; - uint32 ptr0_server; - UNISTR2 server; - uint32 ptr0_share; - UNISTR2 share; -} NETDFS_DFS_STORAGEINFO; - -typedef struct netdfs_dfs_Info3 { - uint32 ptr0_path; - UNISTR2 path; - uint32 ptr0_comment; - UNISTR2 comment; - uint32 state; - uint32 num_stores; - uint32 ptr0_stores; - uint32 size_stores; - NETDFS_DFS_STORAGEINFO *stores; -} NETDFS_DFS_INFO3; - -typedef struct netdfs_dfs_Info4 { - uint32 ptr0_path; - UNISTR2 path; - uint32 ptr0_comment; - UNISTR2 comment; - uint32 state; - uint32 timeout; - struct uuid guid; - uint32 num_stores; - uint32 ptr0_stores; - uint32 size_stores; - NETDFS_DFS_STORAGEINFO *stores; -} NETDFS_DFS_INFO4; - -typedef struct netdfs_dfs_Info100 { - uint32 ptr0_comment; - UNISTR2 comment; -} NETDFS_DFS_INFO100; - -typedef struct netdfs_dfs_Info101 { - uint32 state; -} NETDFS_DFS_INFO101; - -typedef struct netdfs_dfs_Info102 { - uint32 timeout; -} NETDFS_DFS_INFO102; - -typedef struct netdfs_dfs_Info200 { - uint32 ptr0_dom_root; - UNISTR2 dom_root; -} NETDFS_DFS_INFO200; - -typedef struct netdfs_dfs_Info300 { - uint32 flags; - uint32 ptr0_dom_root; - UNISTR2 dom_root; -} NETDFS_DFS_INFO300; - -typedef struct netdfs_dfs_Info_ctr { - uint32 switch_value; - uint32 ptr0; - union netdfs_dfs_Info { - NETDFS_DFS_INFO0 info0; - NETDFS_DFS_INFO1 info1; - NETDFS_DFS_INFO2 info2; - NETDFS_DFS_INFO3 info3; - NETDFS_DFS_INFO4 info4; - NETDFS_DFS_INFO100 info100; - NETDFS_DFS_INFO101 info101; - NETDFS_DFS_INFO102 info102; - } u; -} NETDFS_DFS_INFO_CTR; - -typedef struct netdfs_dfs_EnumArray1 { - uint32 count; - uint32 ptr0_s; - uint32 size_s; - NETDFS_DFS_INFO1 *s; -} NETDFS_DFS_ENUMARRAY1; - -typedef struct netdfs_dfs_EnumArray2 { - uint32 count; - uint32 ptr0_s; - uint32 size_s; - NETDFS_DFS_INFO2 *s; -} NETDFS_DFS_ENUMARRAY2; - -typedef struct netdfs_dfs_EnumArray3 { - uint32 count; - uint32 ptr0_s; - uint32 size_s; - NETDFS_DFS_INFO3 *s; -} NETDFS_DFS_ENUMARRAY3; - -typedef struct netdfs_dfs_EnumArray4 { - uint32 count; - uint32 ptr0_s; - uint32 size_s; - NETDFS_DFS_INFO4 *s; -} NETDFS_DFS_ENUMARRAY4; - -typedef struct netdfs_dfs_EnumArray200 { - uint32 count; - uint32 ptr0_s; - uint32 size_s; - NETDFS_DFS_INFO200 *s; -} NETDFS_DFS_ENUMARRAY200; - -typedef struct netdfs_dfs_EnumArray300 { - uint32 count; - uint32 ptr0_s; - uint32 size_s; - NETDFS_DFS_INFO300 *s; -} NETDFS_DFS_ENUMARRAY300; - -typedef struct netdfs_dfs_EnumInfo_ctr { - uint32 switch_value; - uint32 ptr0; - union netdfs_dfs_EnumInfo { - NETDFS_DFS_ENUMARRAY1 info1; - NETDFS_DFS_ENUMARRAY2 info2; - NETDFS_DFS_ENUMARRAY3 info3; - NETDFS_DFS_ENUMARRAY4 info4; - NETDFS_DFS_ENUMARRAY200 info200; - NETDFS_DFS_ENUMARRAY300 info300; - } u; -} NETDFS_DFS_ENUMINFO_CTR; - -typedef struct netdfs_dfs_EnumStruct { - uint32 level; - NETDFS_DFS_ENUMINFO_CTR e; -} NETDFS_DFS_ENUMSTRUCT; - -typedef struct netdfs_q_dfs_GetManagerVersion { - uint32 dummy; -} NETDFS_Q_DFS_GETMANAGERVERSION; - -typedef struct netdfs_r_dfs_GetManagerVersion { - uint32 exist_flag; -} NETDFS_R_DFS_GETMANAGERVERSION; - -typedef struct netdfs_q_dfs_Add { - UNISTR2 path; - UNISTR2 server; - uint32 ptr0_share; - UNISTR2 share; - uint32 ptr0_comment; - UNISTR2 comment; - uint32 flags; -} NETDFS_Q_DFS_ADD; - -typedef struct netdfs_r_dfs_Add { - WERROR status; -} NETDFS_R_DFS_ADD; - -typedef struct netdfs_q_dfs_Remove { - UNISTR2 path; - uint32 ptr0_server; - UNISTR2 server; - uint32 ptr0_share; - UNISTR2 share; -} NETDFS_Q_DFS_REMOVE; - -typedef struct netdfs_r_dfs_Remove { - WERROR status; -} NETDFS_R_DFS_REMOVE; - -typedef struct netdfs_q_dfs_SetInfo { - uint32 dummy; -} NETDFS_Q_DFS_SETINFO; - -typedef struct netdfs_r_dfs_SetInfo { - WERROR status; -} NETDFS_R_DFS_SETINFO; - -typedef struct netdfs_q_dfs_GetInfo { - UNISTR2 path; - uint32 ptr0_server; - UNISTR2 server; - uint32 ptr0_share; - UNISTR2 share; - uint32 level; -} NETDFS_Q_DFS_GETINFO; - -typedef struct netdfs_r_dfs_GetInfo { - NETDFS_DFS_INFO_CTR info; - WERROR status; -} NETDFS_R_DFS_GETINFO; - -typedef struct netdfs_q_dfs_Enum { - uint32 level; - uint32 bufsize; - uint32 ptr0_info; - NETDFS_DFS_ENUMSTRUCT info; - uint32 ptr0_total; - uint32 total; -} NETDFS_Q_DFS_ENUM; - -typedef struct netdfs_r_dfs_Enum { - uint32 ptr0_info; - NETDFS_DFS_ENUMSTRUCT info; - uint32 ptr0_total; - uint32 total; - WERROR status; -} NETDFS_R_DFS_ENUM; - -typedef struct netdfs_q_dfs_Rename { - uint32 dummy; -} NETDFS_Q_DFS_RENAME; - -typedef struct netdfs_r_dfs_Rename { - WERROR status; -} NETDFS_R_DFS_RENAME; - -typedef struct netdfs_q_dfs_Move { - uint32 dummy; -} NETDFS_Q_DFS_MOVE; - -typedef struct netdfs_r_dfs_Move { - WERROR status; -} NETDFS_R_DFS_MOVE; - -typedef struct netdfs_q_dfs_ManagerGetConfigInfo { - uint32 dummy; -} NETDFS_Q_DFS_MANAGERGETCONFIGINFO; - -typedef struct netdfs_r_dfs_ManagerGetConfigInfo { - WERROR status; -} NETDFS_R_DFS_MANAGERGETCONFIGINFO; - -typedef struct netdfs_q_dfs_ManagerSendSiteInfo { - uint32 dummy; -} NETDFS_Q_DFS_MANAGERSENDSITEINFO; - -typedef struct netdfs_r_dfs_ManagerSendSiteInfo { - WERROR status; -} NETDFS_R_DFS_MANAGERSENDSITEINFO; - -typedef struct netdfs_q_dfs_AddFtRoot { - uint32 dummy; -} NETDFS_Q_DFS_ADDFTROOT; - -typedef struct netdfs_r_dfs_AddFtRoot { - WERROR status; -} NETDFS_R_DFS_ADDFTROOT; - -typedef struct netdfs_q_dfs_RemoveFtRoot { - uint32 dummy; -} NETDFS_Q_DFS_REMOVEFTROOT; - -typedef struct netdfs_r_dfs_RemoveFtRoot { - WERROR status; -} NETDFS_R_DFS_REMOVEFTROOT; - -typedef struct netdfs_q_dfs_AddStdRoot { - uint32 dummy; -} NETDFS_Q_DFS_ADDSTDROOT; - -typedef struct netdfs_r_dfs_AddStdRoot { - WERROR status; -} NETDFS_R_DFS_ADDSTDROOT; - -typedef struct netdfs_q_dfs_RemoveStdRoot { - uint32 dummy; -} NETDFS_Q_DFS_REMOVESTDROOT; - -typedef struct netdfs_r_dfs_RemoveStdRoot { - WERROR status; -} NETDFS_R_DFS_REMOVESTDROOT; - -typedef struct netdfs_q_dfs_ManagerInitialize { - uint32 dummy; -} NETDFS_Q_DFS_MANAGERINITIALIZE; - -typedef struct netdfs_r_dfs_ManagerInitialize { - WERROR status; -} NETDFS_R_DFS_MANAGERINITIALIZE; - -typedef struct netdfs_q_dfs_AddStdRootForced { - uint32 dummy; -} NETDFS_Q_DFS_ADDSTDROOTFORCED; - -typedef struct netdfs_r_dfs_AddStdRootForced { - WERROR status; -} NETDFS_R_DFS_ADDSTDROOTFORCED; - -typedef struct netdfs_q_dfs_GetDcAddress { - uint32 dummy; -} NETDFS_Q_DFS_GETDCADDRESS; - -typedef struct netdfs_r_dfs_GetDcAddress { - WERROR status; -} NETDFS_R_DFS_GETDCADDRESS; - -typedef struct netdfs_q_dfs_SetDcAddress { - uint32 dummy; -} NETDFS_Q_DFS_SETDCADDRESS; - -typedef struct netdfs_r_dfs_SetDcAddress { - WERROR status; -} NETDFS_R_DFS_SETDCADDRESS; - -typedef struct netdfs_q_dfs_FlushFtTable { - uint32 dummy; -} NETDFS_Q_DFS_FLUSHFTTABLE; - -typedef struct netdfs_r_dfs_FlushFtTable { - WERROR status; -} NETDFS_R_DFS_FLUSHFTTABLE; - -typedef struct netdfs_q_dfs_Add2 { - uint32 dummy; -} NETDFS_Q_DFS_ADD2; - -typedef struct netdfs_r_dfs_Add2 { - WERROR status; -} NETDFS_R_DFS_ADD2; - -typedef struct netdfs_q_dfs_Remove2 { - uint32 dummy; -} NETDFS_Q_DFS_REMOVE2; - -typedef struct netdfs_r_dfs_Remove2 { - WERROR status; -} NETDFS_R_DFS_REMOVE2; - -typedef struct netdfs_q_dfs_EnumEx { - uint32 ptr0_dfs_name; - UNISTR2 dfs_name; - uint32 level; - uint32 bufsize; - uint32 ptr0_info; - NETDFS_DFS_ENUMSTRUCT info; - uint32 ptr0_total; - uint32 total; -} NETDFS_Q_DFS_ENUMEX; - -typedef struct netdfs_r_dfs_EnumEx { - uint32 ptr0_info; - NETDFS_DFS_ENUMSTRUCT info; - uint32 ptr0_total; - uint32 total; - WERROR status; -} NETDFS_R_DFS_ENUMEX; - -typedef struct netdfs_q_dfs_SetInfo2 { - uint32 dummy; -} NETDFS_Q_DFS_SETINFO2; - -typedef struct netdfs_r_dfs_SetInfo2 { - WERROR status; -} NETDFS_R_DFS_SETINFO2; - -#endif /* _RPC_NETDFS_H */ diff --git a/source3/librpc/gen_ndr/srv_dfs.c b/source3/librpc/gen_ndr/srv_dfs.c new file mode 100644 index 0000000000..75f3cd3949 --- /dev/null +++ b/source3/librpc/gen_ndr/srv_dfs.c @@ -0,0 +1,1201 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_dfs.h" + +static BOOL api_dfs_GetManagerVersion(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_GetManagerVersion r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_GetManagerVersion"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_GetManagerVersion(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + _dfs_GetManagerVersion(p, r.out.exist_flag); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_GetManagerVersion(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Add(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Add r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Add"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Add(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_Add(p, r.in.path, r.in.server, r.in.share, r.in.comment, r.in.flags); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Add(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Remove(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Remove r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Remove"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Remove(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_Remove(p, r.in.path, r.in.server, r.in.share); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Remove(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_SetInfo(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_SetInfo r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_SetInfo"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_SetInfo(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_SetInfo(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_SetInfo(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_GetInfo(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_GetInfo r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_GetInfo"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_GetInfo(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_GetInfo(p, r.in.path, r.in.server, r.in.share, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_GetInfo(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Enum(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Enum r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Enum"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Enum(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.info = r.in.info; + r.out.total = r.in.total; + r.out.result = _dfs_Enum(p, r.in.level, r.in.bufsize, r.in.info, r.in.unknown, r.in.total); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Enum(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Rename(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Rename r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Rename"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Rename(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_Rename(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Rename(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Move(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Move r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Move"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Move(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_Move(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Move(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_ManagerGetConfigInfo(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_ManagerGetConfigInfo r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_ManagerGetConfigInfo"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_ManagerGetConfigInfo(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_ManagerGetConfigInfo(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_ManagerGetConfigInfo(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_ManagerSendSiteInfo(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_ManagerSendSiteInfo r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_ManagerSendSiteInfo"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_ManagerSendSiteInfo(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_ManagerSendSiteInfo(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_ManagerSendSiteInfo(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_AddFtRoot(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_AddFtRoot r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_AddFtRoot"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_AddFtRoot(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_AddFtRoot(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_AddFtRoot(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_RemoveFtRoot(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_RemoveFtRoot r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_RemoveFtRoot"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_RemoveFtRoot(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_RemoveFtRoot(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_RemoveFtRoot(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_AddStdRoot(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_AddStdRoot r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_AddStdRoot"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_AddStdRoot(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_AddStdRoot(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_AddStdRoot(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_RemoveStdRoot(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_RemoveStdRoot r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_RemoveStdRoot"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_RemoveStdRoot(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_RemoveStdRoot(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_RemoveStdRoot(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_ManagerInitialize(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_ManagerInitialize r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_ManagerInitialize"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_ManagerInitialize(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_ManagerInitialize(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_ManagerInitialize(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_AddStdRootForced(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_AddStdRootForced r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_AddStdRootForced"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_AddStdRootForced(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_AddStdRootForced(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_AddStdRootForced(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_GetDcAddress(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_GetDcAddress r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_GetDcAddress"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_GetDcAddress(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_GetDcAddress(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_GetDcAddress(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_SetDcAddress(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_SetDcAddress r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_SetDcAddress"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_SetDcAddress(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_SetDcAddress(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_SetDcAddress(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_FlushFtTable(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_FlushFtTable r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_FlushFtTable"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_FlushFtTable(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_FlushFtTable(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_FlushFtTable(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Add2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Add2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Add2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Add2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_Add2(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Add2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Remove2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Remove2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Remove2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Remove2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_Remove2(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Remove2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_EnumEx(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_EnumEx r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_EnumEx"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_EnumEx(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.info = r.in.info; + r.out.total = r.in.total; + r.out.result = _dfs_EnumEx(p, r.in.name, r.in.level, r.in.bufsize, r.in.info, r.in.total); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_EnumEx(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_SetInfo2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_SetInfo2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_SetInfo2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_SetInfo2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_SetInfo2(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_SetInfo2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + + +/* Tables */ +static struct api_struct api_netdfs_cmds[] = +{ + {"DFS_GETMANAGERVERSION", DCERPC_DFS_GETMANAGERVERSION, api_dfs_GetManagerVersion}, + {"DFS_ADD", DCERPC_DFS_ADD, api_dfs_Add}, + {"DFS_REMOVE", DCERPC_DFS_REMOVE, api_dfs_Remove}, + {"DFS_SETINFO", DCERPC_DFS_SETINFO, api_dfs_SetInfo}, + {"DFS_GETINFO", DCERPC_DFS_GETINFO, api_dfs_GetInfo}, + {"DFS_ENUM", DCERPC_DFS_ENUM, api_dfs_Enum}, + {"DFS_RENAME", DCERPC_DFS_RENAME, api_dfs_Rename}, + {"DFS_MOVE", DCERPC_DFS_MOVE, api_dfs_Move}, + {"DFS_MANAGERGETCONFIGINFO", DCERPC_DFS_MANAGERGETCONFIGINFO, api_dfs_ManagerGetConfigInfo}, + {"DFS_MANAGERSENDSITEINFO", DCERPC_DFS_MANAGERSENDSITEINFO, api_dfs_ManagerSendSiteInfo}, + {"DFS_ADDFTROOT", DCERPC_DFS_ADDFTROOT, api_dfs_AddFtRoot}, + {"DFS_REMOVEFTROOT", DCERPC_DFS_REMOVEFTROOT, api_dfs_RemoveFtRoot}, + {"DFS_ADDSTDROOT", DCERPC_DFS_ADDSTDROOT, api_dfs_AddStdRoot}, + {"DFS_REMOVESTDROOT", DCERPC_DFS_REMOVESTDROOT, api_dfs_RemoveStdRoot}, + {"DFS_MANAGERINITIALIZE", DCERPC_DFS_MANAGERINITIALIZE, api_dfs_ManagerInitialize}, + {"DFS_ADDSTDROOTFORCED", DCERPC_DFS_ADDSTDROOTFORCED, api_dfs_AddStdRootForced}, + {"DFS_GETDCADDRESS", DCERPC_DFS_GETDCADDRESS, api_dfs_GetDcAddress}, + {"DFS_SETDCADDRESS", DCERPC_DFS_SETDCADDRESS, api_dfs_SetDcAddress}, + {"DFS_FLUSHFTTABLE", DCERPC_DFS_FLUSHFTTABLE, api_dfs_FlushFtTable}, + {"DFS_ADD2", DCERPC_DFS_ADD2, api_dfs_Add2}, + {"DFS_REMOVE2", DCERPC_DFS_REMOVE2, api_dfs_Remove2}, + {"DFS_ENUMEX", DCERPC_DFS_ENUMEX, api_dfs_EnumEx}, + {"DFS_SETINFO2", DCERPC_DFS_SETINFO2, api_dfs_SetInfo2}, +}; + +void netdfs_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_netdfs_cmds; + *n_fns = sizeof(api_netdfs_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_netdfs_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "netdfs", "netdfs", api_netdfs_cmds, sizeof(api_netdfs_cmds) / sizeof(struct api_struct)); +} diff --git a/source3/librpc/gen_ndr/srv_dfs.h b/source3/librpc/gen_ndr/srv_dfs.h new file mode 100644 index 0000000000..6806be07e6 --- /dev/null +++ b/source3/librpc/gen_ndr/srv_dfs.h @@ -0,0 +1,29 @@ +#include "librpc/gen_ndr/ndr_dfs.h" +#ifndef __SRV_NETDFS__ +#define __SRV_NETDFS__ +void _dfs_GetManagerVersion(pipes_struct *p, uint32_t *exist_flag); +WERROR _dfs_Add(pipes_struct *p, const char *path, const char *server, const char *share, const char *comment, uint32_t flags); +WERROR _dfs_Remove(pipes_struct *p, const char *path, const char *server, const char *share); +WERROR _dfs_SetInfo(pipes_struct *p); +WERROR _dfs_GetInfo(pipes_struct *p, const char *path, const char *server, const char *share, uint32_t level, union dfs_Info *info); +WERROR _dfs_Enum(pipes_struct *p, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct *info, uint32_t *unknown, uint32_t *total); +WERROR _dfs_Rename(pipes_struct *p); +WERROR _dfs_Move(pipes_struct *p); +WERROR _dfs_ManagerGetConfigInfo(pipes_struct *p); +WERROR _dfs_ManagerSendSiteInfo(pipes_struct *p); +WERROR _dfs_AddFtRoot(pipes_struct *p); +WERROR _dfs_RemoveFtRoot(pipes_struct *p); +WERROR _dfs_AddStdRoot(pipes_struct *p); +WERROR _dfs_RemoveStdRoot(pipes_struct *p); +WERROR _dfs_ManagerInitialize(pipes_struct *p); +WERROR _dfs_AddStdRootForced(pipes_struct *p); +WERROR _dfs_GetDcAddress(pipes_struct *p); +WERROR _dfs_SetDcAddress(pipes_struct *p); +WERROR _dfs_FlushFtTable(pipes_struct *p); +WERROR _dfs_Add2(pipes_struct *p); +WERROR _dfs_Remove2(pipes_struct *p); +WERROR _dfs_EnumEx(pipes_struct *p, const char *name, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct *info, uint32_t *total); +WERROR _dfs_SetInfo2(pipes_struct *p); +void netdfs_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_netdfs_init(void); +#endif /* __SRV_NETDFS__ */ diff --git a/source3/librpc/gen_ndr/srv_lsa.c b/source3/librpc/gen_ndr/srv_lsa.c new file mode 100644 index 0000000000..20d564b65f --- /dev/null +++ b/source3/librpc/gen_ndr/srv_lsa.c @@ -0,0 +1,4233 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_lsa.h" + +static BOOL api_lsa_Close(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_Close r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_Close"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_Close(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.handle = r.in.handle; + r.out.result = _lsa_Close(p, r.in.handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_Close(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_Delete(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_Delete r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_Delete"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_Delete(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_Delete(p, r.in.handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_Delete(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumPrivs(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumPrivs r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumPrivs"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumPrivs(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.resume_handle = r.in.resume_handle; + r.out.result = _lsa_EnumPrivs(p, r.in.handle, r.in.resume_handle, r.in.max_count, r.out.privs); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumPrivs(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QuerySecurity(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QuerySecurity r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QuerySecurity"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QuerySecurity(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QuerySecurity(p, r.in.handle, r.in.sec_info, r.out.sdbuf); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QuerySecurity(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetSecObj(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetSecObj r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetSecObj"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetSecObj(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetSecObj(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetSecObj(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_ChangePassword(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_ChangePassword r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_ChangePassword"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_ChangePassword(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_ChangePassword(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_ChangePassword(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_OpenPolicy(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_OpenPolicy r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_OpenPolicy"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_OpenPolicy(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_OpenPolicy(p, r.in.system_name, r.in.attr, r.in.access_mask, r.out.handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_OpenPolicy(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QueryInfoPolicy(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QueryInfoPolicy r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QueryInfoPolicy"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QueryInfoPolicy(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QueryInfoPolicy(p, r.in.handle, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QueryInfoPolicy(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetInfoPolicy(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetInfoPolicy r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetInfoPolicy"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetInfoPolicy(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetInfoPolicy(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetInfoPolicy(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_ClearAuditLog(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_ClearAuditLog r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_ClearAuditLog"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_ClearAuditLog(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_ClearAuditLog(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_ClearAuditLog(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CreateAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CreateAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CreateAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CreateAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CreateAccount(p, r.in.handle, r.in.sid, r.in.access_mask, r.out.acct_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CreateAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumAccounts(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumAccounts r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumAccounts"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumAccounts(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.resume_handle = r.in.resume_handle; + r.out.result = _lsa_EnumAccounts(p, r.in.handle, r.in.resume_handle, r.in.num_entries, r.out.sids); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumAccounts(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CreateTrustedDomain(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CreateTrustedDomain r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CreateTrustedDomain"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CreateTrustedDomain(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CreateTrustedDomain(p, r.in.handle, r.in.info, r.in.access_mask, r.out.trustdom_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CreateTrustedDomain(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumTrustDom(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumTrustDom r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumTrustDom"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumTrustDom(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.resume_handle = r.in.resume_handle; + r.out.result = _lsa_EnumTrustDom(p, r.in.handle, r.in.resume_handle, r.in.max_size, r.out.domains); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumTrustDom(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupNames(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupNames r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupNames"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupNames(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.sids = r.in.sids; + r.out.count = r.in.count; + r.out.result = _lsa_LookupNames(p, r.in.handle, r.in.num_names, r.in.names, r.out.domains, r.in.sids, r.in.level, r.in.count); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupNames(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupSids(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupSids r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupSids"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupSids(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.names = r.in.names; + r.out.count = r.in.count; + r.out.result = _lsa_LookupSids(p, r.in.handle, r.in.sids, r.out.domains, r.in.names, r.in.level, r.in.count); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupSids(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CreateSecret(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CreateSecret r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CreateSecret"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CreateSecret(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CreateSecret(p, r.in.handle, r.in.name, r.in.access_mask, r.out.sec_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CreateSecret(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_OpenAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_OpenAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_OpenAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_OpenAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_OpenAccount(p, r.in.handle, r.in.sid, r.in.access_mask, r.out.acct_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_OpenAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumPrivsAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumPrivsAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumPrivsAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumPrivsAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_EnumPrivsAccount(p, r.in.handle, r.out.privs); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumPrivsAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_AddPrivilegesToAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_AddPrivilegesToAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_AddPrivilegesToAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_AddPrivilegesToAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_AddPrivilegesToAccount(p, r.in.handle, r.in.privs); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_AddPrivilegesToAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_RemovePrivilegesFromAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_RemovePrivilegesFromAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_RemovePrivilegesFromAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_RemovePrivilegesFromAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_RemovePrivilegesFromAccount(p, r.in.handle, r.in.remove_all, r.in.privs); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_RemovePrivilegesFromAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_GetQuotasForAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_GetQuotasForAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_GetQuotasForAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_GetQuotasForAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_GetQuotasForAccount(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_GetQuotasForAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetQuotasForAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetQuotasForAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetQuotasForAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetQuotasForAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetQuotasForAccount(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetQuotasForAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_GetSystemAccessAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_GetSystemAccessAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_GetSystemAccessAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_GetSystemAccessAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_GetSystemAccessAccount(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_GetSystemAccessAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetSystemAccessAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetSystemAccessAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetSystemAccessAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetSystemAccessAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetSystemAccessAccount(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetSystemAccessAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_OpenTrustedDomain(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_OpenTrustedDomain r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_OpenTrustedDomain"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_OpenTrustedDomain(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_OpenTrustedDomain(p, r.in.handle, r.in.sid, r.in.access_mask, r.out.trustdom_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_OpenTrustedDomain(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QueryTrustedDomainInfo(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QueryTrustedDomainInfo r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QueryTrustedDomainInfo"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QueryTrustedDomainInfo(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QueryTrustedDomainInfo(p, r.in.trustdom_handle, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QueryTrustedDomainInfo(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetInformationTrustedDomain(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetInformationTrustedDomain r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetInformationTrustedDomain"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetInformationTrustedDomain(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetInformationTrustedDomain(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetInformationTrustedDomain(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_OpenSecret(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_OpenSecret r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_OpenSecret"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_OpenSecret(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_OpenSecret(p, r.in.handle, r.in.name, r.in.access_mask, r.out.sec_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_OpenSecret(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetSecret(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetSecret r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetSecret"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetSecret(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetSecret(p, r.in.sec_handle, r.in.new_val, r.in.old_val); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetSecret(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QuerySecret(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QuerySecret r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QuerySecret"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QuerySecret(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.new_val = r.in.new_val; + r.out.new_mtime = r.in.new_mtime; + r.out.old_val = r.in.old_val; + r.out.old_mtime = r.in.old_mtime; + r.out.result = _lsa_QuerySecret(p, r.in.sec_handle, r.in.new_val, r.in.new_mtime, r.in.old_val, r.in.old_mtime); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QuerySecret(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupPrivValue(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupPrivValue r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupPrivValue"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupPrivValue(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LookupPrivValue(p, r.in.handle, r.in.name, r.out.luid); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupPrivValue(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupPrivName(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupPrivName r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupPrivName"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupPrivName(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LookupPrivName(p, r.in.handle, r.in.luid, r.out.name); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupPrivName(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupPrivDisplayName(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupPrivDisplayName r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupPrivDisplayName"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupPrivDisplayName(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.language_id = r.in.language_id; + r.out.result = _lsa_LookupPrivDisplayName(p, r.in.handle, r.in.name, r.out.disp_name, r.in.language_id, r.in.unknown); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupPrivDisplayName(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_DeleteObject(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_DeleteObject r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_DeleteObject"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_DeleteObject(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_DeleteObject(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_DeleteObject(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumAccountsWithUserRight(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumAccountsWithUserRight r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumAccountsWithUserRight"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumAccountsWithUserRight(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_EnumAccountsWithUserRight(p, r.in.handle, r.in.name, r.out.sids); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumAccountsWithUserRight(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumAccountRights(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumAccountRights r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumAccountRights"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumAccountRights(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_EnumAccountRights(p, r.in.handle, r.in.sid, r.out.rights); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumAccountRights(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_AddAccountRights(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_AddAccountRights r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_AddAccountRights"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_AddAccountRights(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_AddAccountRights(p, r.in.handle, r.in.sid, r.in.rights); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_AddAccountRights(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_RemoveAccountRights(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_RemoveAccountRights r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_RemoveAccountRights"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_RemoveAccountRights(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_RemoveAccountRights(p, r.in.handle, r.in.sid, r.in.unknown, r.in.rights); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_RemoveAccountRights(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QueryTrustedDomainInfoBySid(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QueryTrustedDomainInfoBySid r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QueryTrustedDomainInfoBySid"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QueryTrustedDomainInfoBySid(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QueryTrustedDomainInfoBySid(p, r.in.handle, r.in.dom_sid, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QueryTrustedDomainInfoBySid(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetTrustedDomainInfo(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetTrustedDomainInfo r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetTrustedDomainInfo"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetTrustedDomainInfo(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetTrustedDomainInfo(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetTrustedDomainInfo(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_DeleteTrustedDomain(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_DeleteTrustedDomain r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_DeleteTrustedDomain"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_DeleteTrustedDomain(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_DeleteTrustedDomain(p, r.in.handle, r.in.dom_sid); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_DeleteTrustedDomain(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_StorePrivateData(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_StorePrivateData r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_StorePrivateData"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_StorePrivateData(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_StorePrivateData(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_StorePrivateData(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_RetrievePrivateData(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_RetrievePrivateData r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_RetrievePrivateData"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_RetrievePrivateData(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_RetrievePrivateData(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_RetrievePrivateData(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_OpenPolicy2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_OpenPolicy2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_OpenPolicy2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_OpenPolicy2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_OpenPolicy2(p, r.in.system_name, r.in.attr, r.in.access_mask, r.out.handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_OpenPolicy2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_GetUserName(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_GetUserName r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_GetUserName"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_GetUserName(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.account_name = r.in.account_name; + r.out.authority_name = r.in.authority_name; + r.out.result = _lsa_GetUserName(p, r.in.system_name, r.in.account_name, r.in.authority_name); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_GetUserName(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QueryInfoPolicy2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QueryInfoPolicy2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QueryInfoPolicy2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QueryInfoPolicy2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QueryInfoPolicy2(p, r.in.handle, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QueryInfoPolicy2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetInfoPolicy2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetInfoPolicy2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetInfoPolicy2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetInfoPolicy2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetInfoPolicy2(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetInfoPolicy2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QueryTrustedDomainInfoByName(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QueryTrustedDomainInfoByName r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QueryTrustedDomainInfoByName"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QueryTrustedDomainInfoByName(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QueryTrustedDomainInfoByName(p, r.in.handle, r.in.trusted_domain, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QueryTrustedDomainInfoByName(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetTrustedDomainInfoByName(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetTrustedDomainInfoByName r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetTrustedDomainInfoByName"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetTrustedDomainInfoByName(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetTrustedDomainInfoByName(p, r.in.handle, r.in.trusted_domain, r.in.level, r.in.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetTrustedDomainInfoByName(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumTrustedDomainsEx(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumTrustedDomainsEx r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumTrustedDomainsEx"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumTrustedDomainsEx(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.resume_handle = r.in.resume_handle; + r.out.result = _lsa_EnumTrustedDomainsEx(p, r.in.handle, r.in.resume_handle, r.out.domains, r.in.max_size); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumTrustedDomainsEx(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CreateTrustedDomainEx(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CreateTrustedDomainEx r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CreateTrustedDomainEx"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CreateTrustedDomainEx(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CreateTrustedDomainEx(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CreateTrustedDomainEx(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CloseTrustedDomainEx(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CloseTrustedDomainEx r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CloseTrustedDomainEx"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CloseTrustedDomainEx(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.handle = r.in.handle; + r.out.result = _lsa_CloseTrustedDomainEx(p, r.in.handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CloseTrustedDomainEx(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QueryDomainInformationPolicy(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QueryDomainInformationPolicy r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QueryDomainInformationPolicy"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QueryDomainInformationPolicy(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QueryDomainInformationPolicy(p, r.in.handle, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QueryDomainInformationPolicy(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetDomainInformationPolicy(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetDomainInformationPolicy r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetDomainInformationPolicy"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetDomainInformationPolicy(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetDomainInformationPolicy(p, r.in.handle, r.in.level, r.in.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetDomainInformationPolicy(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_OpenTrustedDomainByName(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_OpenTrustedDomainByName r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_OpenTrustedDomainByName"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_OpenTrustedDomainByName(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_OpenTrustedDomainByName(p, r.in.handle, r.in.name, r.in.access_mask, r.out.trustdom_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_OpenTrustedDomainByName(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_TestCall(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_TestCall r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_TestCall"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_TestCall(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_TestCall(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_TestCall(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupSids2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupSids2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupSids2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupSids2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.names = r.in.names; + r.out.count = r.in.count; + r.out.result = _lsa_LookupSids2(p, r.in.handle, r.in.sids, r.out.domains, r.in.names, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupSids2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupNames2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupNames2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupNames2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupNames2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.sids = r.in.sids; + r.out.count = r.in.count; + r.out.result = _lsa_LookupNames2(p, r.in.handle, r.in.num_names, r.in.names, r.out.domains, r.in.sids, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupNames2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CreateTrustedDomainEx2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CreateTrustedDomainEx2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CreateTrustedDomainEx2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CreateTrustedDomainEx2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CreateTrustedDomainEx2(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CreateTrustedDomainEx2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRWRITE(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRWRITE r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRWRITE"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRWRITE(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRWRITE(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRWRITE(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRREAD(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRREAD r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRREAD"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRREAD(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRREAD(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRREAD(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRENUMERATE(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRENUMERATE r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRENUMERATE"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRENUMERATE(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRENUMERATE(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRENUMERATE(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRWRITEDOMAINCREDENTIALS r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRWRITEDOMAINCREDENTIALS"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRWRITEDOMAINCREDENTIALS(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRWRITEDOMAINCREDENTIALS(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRWRITEDOMAINCREDENTIALS(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRREADDOMAINCREDENTIALS r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRREADDOMAINCREDENTIALS"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRREADDOMAINCREDENTIALS(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRREADDOMAINCREDENTIALS(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRREADDOMAINCREDENTIALS(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRDELETE(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRDELETE r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRDELETE"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRDELETE(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRDELETE(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRDELETE(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRGETTARGETINFO(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRGETTARGETINFO r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRGETTARGETINFO"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRGETTARGETINFO(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRGETTARGETINFO(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRGETTARGETINFO(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRPROFILELOADED(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRPROFILELOADED r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRPROFILELOADED"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRPROFILELOADED(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRPROFILELOADED(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRPROFILELOADED(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupNames3(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupNames3 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupNames3"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupNames3(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.sids = r.in.sids; + r.out.count = r.in.count; + r.out.result = _lsa_LookupNames3(p, r.in.handle, r.in.num_names, r.in.names, r.out.domains, r.in.sids, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupNames3(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRGETSESSIONTYPES(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRGETSESSIONTYPES r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRGETSESSIONTYPES"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRGETSESSIONTYPES(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRGETSESSIONTYPES(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRGETSESSIONTYPES(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARREGISTERAUDITEVENT(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARREGISTERAUDITEVENT r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARREGISTERAUDITEVENT"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARREGISTERAUDITEVENT(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARREGISTERAUDITEVENT(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARREGISTERAUDITEVENT(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARGENAUDITEVENT(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARGENAUDITEVENT r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARGENAUDITEVENT"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARGENAUDITEVENT(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARGENAUDITEVENT(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARGENAUDITEVENT(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARUNREGISTERAUDITEVENT r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARUNREGISTERAUDITEVENT"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARUNREGISTERAUDITEVENT(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARUNREGISTERAUDITEVENT(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARUNREGISTERAUDITEVENT(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARQUERYFORESTTRUSTINFORMATION(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARQUERYFORESTTRUSTINFORMATION r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARQUERYFORESTTRUSTINFORMATION"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARQUERYFORESTTRUSTINFORMATION(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARQUERYFORESTTRUSTINFORMATION(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARQUERYFORESTTRUSTINFORMATION(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARSETFORESTTRUSTINFORMATION r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARSETFORESTTRUSTINFORMATION"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARSETFORESTTRUSTINFORMATION(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARSETFORESTTRUSTINFORMATION(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARSETFORESTTRUSTINFORMATION(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRRENAME(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRRENAME r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRRENAME"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRRENAME(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRRENAME(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRRENAME(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupSids3(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupSids3 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupSids3"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupSids3(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.names = r.in.names; + r.out.count = r.in.count; + r.out.result = _lsa_LookupSids3(p, r.in.sids, r.out.domains, r.in.names, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupSids3(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupNames4(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupNames4 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupNames4"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupNames4(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.sids = r.in.sids; + r.out.count = r.in.count; + r.out.result = _lsa_LookupNames4(p, r.in.num_names, r.in.names, r.out.domains, r.in.sids, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupNames4(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSAROPENPOLICYSCE(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSAROPENPOLICYSCE r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSAROPENPOLICYSCE"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSAROPENPOLICYSCE(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSAROPENPOLICYSCE(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSAROPENPOLICYSCE(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARADTREPORTSECURITYEVENT r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARADTREPORTSECURITYEVENT"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARADTREPORTSECURITYEVENT(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARADTREPORTSECURITYEVENT(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARADTREPORTSECURITYEVENT(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + + +/* Tables */ +static struct api_struct api_lsarpc_cmds[] = +{ + {"LSA_CLOSE", DCERPC_LSA_CLOSE, api_lsa_Close}, + {"LSA_DELETE", DCERPC_LSA_DELETE, api_lsa_Delete}, + {"LSA_ENUMPRIVS", DCERPC_LSA_ENUMPRIVS, api_lsa_EnumPrivs}, + {"LSA_QUERYSECURITY", DCERPC_LSA_QUERYSECURITY, api_lsa_QuerySecurity}, + {"LSA_SETSECOBJ", DCERPC_LSA_SETSECOBJ, api_lsa_SetSecObj}, + {"LSA_CHANGEPASSWORD", DCERPC_LSA_CHANGEPASSWORD, api_lsa_ChangePassword}, + {"LSA_OPENPOLICY", DCERPC_LSA_OPENPOLICY, api_lsa_OpenPolicy}, + {"LSA_QUERYINFOPOLICY", DCERPC_LSA_QUERYINFOPOLICY, api_lsa_QueryInfoPolicy}, + {"LSA_SETINFOPOLICY", DCERPC_LSA_SETINFOPOLICY, api_lsa_SetInfoPolicy}, + {"LSA_CLEARAUDITLOG", DCERPC_LSA_CLEARAUDITLOG, api_lsa_ClearAuditLog}, + {"LSA_CREATEACCOUNT", DCERPC_LSA_CREATEACCOUNT, api_lsa_CreateAccount}, + {"LSA_ENUMACCOUNTS", DCERPC_LSA_ENUMACCOUNTS, api_lsa_EnumAccounts}, + {"LSA_CREATETRUSTEDDOMAIN", DCERPC_LSA_CREATETRUSTEDDOMAIN, api_lsa_CreateTrustedDomain}, + {"LSA_ENUMTRUSTDOM", DCERPC_LSA_ENUMTRUSTDOM, api_lsa_EnumTrustDom}, + {"LSA_LOOKUPNAMES", DCERPC_LSA_LOOKUPNAMES, api_lsa_LookupNames}, + {"LSA_LOOKUPSIDS", DCERPC_LSA_LOOKUPSIDS, api_lsa_LookupSids}, + {"LSA_CREATESECRET", DCERPC_LSA_CREATESECRET, api_lsa_CreateSecret}, + {"LSA_OPENACCOUNT", DCERPC_LSA_OPENACCOUNT, api_lsa_OpenAccount}, + {"LSA_ENUMPRIVSACCOUNT", DCERPC_LSA_ENUMPRIVSACCOUNT, api_lsa_EnumPrivsAccount}, + {"LSA_ADDPRIVILEGESTOACCOUNT", DCERPC_LSA_ADDPRIVILEGESTOACCOUNT, api_lsa_AddPrivilegesToAccount}, + {"LSA_REMOVEPRIVILEGESFROMACCOUNT", DCERPC_LSA_REMOVEPRIVILEGESFROMACCOUNT, api_lsa_RemovePrivilegesFromAccount}, + {"LSA_GETQUOTASFORACCOUNT", DCERPC_LSA_GETQUOTASFORACCOUNT, api_lsa_GetQuotasForAccount}, + {"LSA_SETQUOTASFORACCOUNT", DCERPC_LSA_SETQUOTASFORACCOUNT, api_lsa_SetQuotasForAccount}, + {"LSA_GETSYSTEMACCESSACCOUNT", DCERPC_LSA_GETSYSTEMACCESSACCOUNT, api_lsa_GetSystemAccessAccount}, + {"LSA_SETSYSTEMACCESSACCOUNT", DCERPC_LSA_SETSYSTEMACCESSACCOUNT, api_lsa_SetSystemAccessAccount}, + {"LSA_OPENTRUSTEDDOMAIN", DCERPC_LSA_OPENTRUSTEDDOMAIN, api_lsa_OpenTrustedDomain}, + {"LSA_QUERYTRUSTEDDOMAININFO", DCERPC_LSA_QUERYTRUSTEDDOMAININFO, api_lsa_QueryTrustedDomainInfo}, + {"LSA_SETINFORMATIONTRUSTEDDOMAIN", DCERPC_LSA_SETINFORMATIONTRUSTEDDOMAIN, api_lsa_SetInformationTrustedDomain}, + {"LSA_OPENSECRET", DCERPC_LSA_OPENSECRET, api_lsa_OpenSecret}, + {"LSA_SETSECRET", DCERPC_LSA_SETSECRET, api_lsa_SetSecret}, + {"LSA_QUERYSECRET", DCERPC_LSA_QUERYSECRET, api_lsa_QuerySecret}, + {"LSA_LOOKUPPRIVVALUE", DCERPC_LSA_LOOKUPPRIVVALUE, api_lsa_LookupPrivValue}, + {"LSA_LOOKUPPRIVNAME", DCERPC_LSA_LOOKUPPRIVNAME, api_lsa_LookupPrivName}, + {"LSA_LOOKUPPRIVDISPLAYNAME", DCERPC_LSA_LOOKUPPRIVDISPLAYNAME, api_lsa_LookupPrivDisplayName}, + {"LSA_DELETEOBJECT", DCERPC_LSA_DELETEOBJECT, api_lsa_DeleteObject}, + {"LSA_ENUMACCOUNTSWITHUSERRIGHT", DCERPC_LSA_ENUMACCOUNTSWITHUSERRIGHT, api_lsa_EnumAccountsWithUserRight}, + {"LSA_ENUMACCOUNTRIGHTS", DCERPC_LSA_ENUMACCOUNTRIGHTS, api_lsa_EnumAccountRights}, + {"LSA_ADDACCOUNTRIGHTS", DCERPC_LSA_ADDACCOUNTRIGHTS, api_lsa_AddAccountRights}, + {"LSA_REMOVEACCOUNTRIGHTS", DCERPC_LSA_REMOVEACCOUNTRIGHTS, api_lsa_RemoveAccountRights}, + {"LSA_QUERYTRUSTEDDOMAININFOBYSID", DCERPC_LSA_QUERYTRUSTEDDOMAININFOBYSID, api_lsa_QueryTrustedDomainInfoBySid}, + {"LSA_SETTRUSTEDDOMAININFO", DCERPC_LSA_SETTRUSTEDDOMAININFO, api_lsa_SetTrustedDomainInfo}, + {"LSA_DELETETRUSTEDDOMAIN", DCERPC_LSA_DELETETRUSTEDDOMAIN, api_lsa_DeleteTrustedDomain}, + {"LSA_STOREPRIVATEDATA", DCERPC_LSA_STOREPRIVATEDATA, api_lsa_StorePrivateData}, + {"LSA_RETRIEVEPRIVATEDATA", DCERPC_LSA_RETRIEVEPRIVATEDATA, api_lsa_RetrievePrivateData}, + {"LSA_OPENPOLICY2", DCERPC_LSA_OPENPOLICY2, api_lsa_OpenPolicy2}, + {"LSA_GETUSERNAME", DCERPC_LSA_GETUSERNAME, api_lsa_GetUserName}, + {"LSA_QUERYINFOPOLICY2", DCERPC_LSA_QUERYINFOPOLICY2, api_lsa_QueryInfoPolicy2}, + {"LSA_SETINFOPOLICY2", DCERPC_LSA_SETINFOPOLICY2, api_lsa_SetInfoPolicy2}, + {"LSA_QUERYTRUSTEDDOMAININFOBYNAME", DCERPC_LSA_QUERYTRUSTEDDOMAININFOBYNAME, api_lsa_QueryTrustedDomainInfoByName}, + {"LSA_SETTRUSTEDDOMAININFOBYNAME", DCERPC_LSA_SETTRUSTEDDOMAININFOBYNAME, api_lsa_SetTrustedDomainInfoByName}, + {"LSA_ENUMTRUSTEDDOMAINSEX", DCERPC_LSA_ENUMTRUSTEDDOMAINSEX, api_lsa_EnumTrustedDomainsEx}, + {"LSA_CREATETRUSTEDDOMAINEX", DCERPC_LSA_CREATETRUSTEDDOMAINEX, api_lsa_CreateTrustedDomainEx}, + {"LSA_CLOSETRUSTEDDOMAINEX", DCERPC_LSA_CLOSETRUSTEDDOMAINEX, api_lsa_CloseTrustedDomainEx}, + {"LSA_QUERYDOMAININFORMATIONPOLICY", DCERPC_LSA_QUERYDOMAININFORMATIONPOLICY, api_lsa_QueryDomainInformationPolicy}, + {"LSA_SETDOMAININFORMATIONPOLICY", DCERPC_LSA_SETDOMAININFORMATIONPOLICY, api_lsa_SetDomainInformationPolicy}, + {"LSA_OPENTRUSTEDDOMAINBYNAME", DCERPC_LSA_OPENTRUSTEDDOMAINBYNAME, api_lsa_OpenTrustedDomainByName}, + {"LSA_TESTCALL", DCERPC_LSA_TESTCALL, api_lsa_TestCall}, + {"LSA_LOOKUPSIDS2", DCERPC_LSA_LOOKUPSIDS2, api_lsa_LookupSids2}, + {"LSA_LOOKUPNAMES2", DCERPC_LSA_LOOKUPNAMES2, api_lsa_LookupNames2}, + {"LSA_CREATETRUSTEDDOMAINEX2", DCERPC_LSA_CREATETRUSTEDDOMAINEX2, api_lsa_CreateTrustedDomainEx2}, + {"LSA_CREDRWRITE", DCERPC_LSA_CREDRWRITE, api_lsa_CREDRWRITE}, + {"LSA_CREDRREAD", DCERPC_LSA_CREDRREAD, api_lsa_CREDRREAD}, + {"LSA_CREDRENUMERATE", DCERPC_LSA_CREDRENUMERATE, api_lsa_CREDRENUMERATE}, + {"LSA_CREDRWRITEDOMAINCREDENTIALS", DCERPC_LSA_CREDRWRITEDOMAINCREDENTIALS, api_lsa_CREDRWRITEDOMAINCREDENTIALS}, + {"LSA_CREDRREADDOMAINCREDENTIALS", DCERPC_LSA_CREDRREADDOMAINCREDENTIALS, api_lsa_CREDRREADDOMAINCREDENTIALS}, + {"LSA_CREDRDELETE", DCERPC_LSA_CREDRDELETE, api_lsa_CREDRDELETE}, + {"LSA_CREDRGETTARGETINFO", DCERPC_LSA_CREDRGETTARGETINFO, api_lsa_CREDRGETTARGETINFO}, + {"LSA_CREDRPROFILELOADED", DCERPC_LSA_CREDRPROFILELOADED, api_lsa_CREDRPROFILELOADED}, + {"LSA_LOOKUPNAMES3", DCERPC_LSA_LOOKUPNAMES3, api_lsa_LookupNames3}, + {"LSA_CREDRGETSESSIONTYPES", DCERPC_LSA_CREDRGETSESSIONTYPES, api_lsa_CREDRGETSESSIONTYPES}, + {"LSA_LSARREGISTERAUDITEVENT", DCERPC_LSA_LSARREGISTERAUDITEVENT, api_lsa_LSARREGISTERAUDITEVENT}, + {"LSA_LSARGENAUDITEVENT", DCERPC_LSA_LSARGENAUDITEVENT, api_lsa_LSARGENAUDITEVENT}, + {"LSA_LSARUNREGISTERAUDITEVENT", DCERPC_LSA_LSARUNREGISTERAUDITEVENT, api_lsa_LSARUNREGISTERAUDITEVENT}, + {"LSA_LSARQUERYFORESTTRUSTINFORMATION", DCERPC_LSA_LSARQUERYFORESTTRUSTINFORMATION, api_lsa_LSARQUERYFORESTTRUSTINFORMATION}, + {"LSA_LSARSETFORESTTRUSTINFORMATION", DCERPC_LSA_LSARSETFORESTTRUSTINFORMATION, api_lsa_LSARSETFORESTTRUSTINFORMATION}, + {"LSA_CREDRRENAME", DCERPC_LSA_CREDRRENAME, api_lsa_CREDRRENAME}, + {"LSA_LOOKUPSIDS3", DCERPC_LSA_LOOKUPSIDS3, api_lsa_LookupSids3}, + {"LSA_LOOKUPNAMES4", DCERPC_LSA_LOOKUPNAMES4, api_lsa_LookupNames4}, + {"LSA_LSAROPENPOLICYSCE", DCERPC_LSA_LSAROPENPOLICYSCE, api_lsa_LSAROPENPOLICYSCE}, + {"LSA_LSARADTREGISTERSECURITYEVENTSOURCE", DCERPC_LSA_LSARADTREGISTERSECURITYEVENTSOURCE, api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE}, + {"LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE", DCERPC_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE, api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE}, + {"LSA_LSARADTREPORTSECURITYEVENT", DCERPC_LSA_LSARADTREPORTSECURITYEVENT, api_lsa_LSARADTREPORTSECURITYEVENT}, +}; + +void lsarpc_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_lsarpc_cmds; + *n_fns = sizeof(api_lsarpc_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_netdfs_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "lsarpc", "lsarpc", api_lsarpc_cmds, sizeof(api_lsarpc_cmds) / sizeof(struct api_struct)); +} diff --git a/source3/librpc/gen_ndr/srv_lsa.h b/source3/librpc/gen_ndr/srv_lsa.h new file mode 100644 index 0000000000..b6fdf5f1d3 --- /dev/null +++ b/source3/librpc/gen_ndr/srv_lsa.h @@ -0,0 +1,88 @@ +#include "librpc/gen_ndr/ndr_lsa.h" +#ifndef __SRV_LSARPC__ +#define __SRV_LSARPC__ +NTSTATUS _lsa_Close(pipes_struct *p, struct policy_handle *handle); +NTSTATUS _lsa_Delete(pipes_struct *p, struct policy_handle *handle); +NTSTATUS _lsa_EnumPrivs(pipes_struct *p, struct policy_handle *handle, uint32_t *resume_handle, uint32_t max_count, struct lsa_PrivArray *privs); +NTSTATUS _lsa_QuerySecurity(pipes_struct *p, struct policy_handle *handle, uint32_t sec_info, struct sec_desc_buf *sdbuf); +NTSTATUS _lsa_SetSecObj(pipes_struct *p); +NTSTATUS _lsa_ChangePassword(pipes_struct *p); +NTSTATUS _lsa_OpenPolicy(pipes_struct *p, uint16_t *system_name, struct lsa_ObjectAttribute *attr, uint32_t access_mask, struct policy_handle *handle); +NTSTATUS _lsa_QueryInfoPolicy(pipes_struct *p, struct policy_handle *handle, uint16_t level, union lsa_PolicyInformation *info); +NTSTATUS _lsa_SetInfoPolicy(pipes_struct *p); +NTSTATUS _lsa_ClearAuditLog(pipes_struct *p); +NTSTATUS _lsa_CreateAccount(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *sid, uint32_t access_mask, struct policy_handle *acct_handle); +NTSTATUS _lsa_EnumAccounts(pipes_struct *p, struct policy_handle *handle, uint32_t *resume_handle, uint32_t num_entries, struct lsa_SidArray *sids); +NTSTATUS _lsa_CreateTrustedDomain(pipes_struct *p, struct policy_handle *handle, struct lsa_DomainInfo *info, uint32_t access_mask, struct policy_handle *trustdom_handle); +NTSTATUS _lsa_EnumTrustDom(pipes_struct *p, struct policy_handle *handle, uint32_t *resume_handle, uint32_t max_size, struct lsa_DomainList *domains); +NTSTATUS _lsa_LookupNames(pipes_struct *p, struct policy_handle *handle, uint32_t num_names, struct lsa_String *names, struct lsa_RefDomainList *domains, struct lsa_TransSidArray *sids, uint16_t level, uint32_t *count); +NTSTATUS _lsa_LookupSids(pipes_struct *p, struct policy_handle *handle, struct lsa_SidArray *sids, struct lsa_RefDomainList *domains, struct lsa_TransNameArray *names, uint16_t level, uint32_t *count); +NTSTATUS _lsa_CreateSecret(pipes_struct *p, struct policy_handle *handle, struct lsa_String name, uint32_t access_mask, struct policy_handle *sec_handle); +NTSTATUS _lsa_OpenAccount(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *sid, uint32_t access_mask, struct policy_handle *acct_handle); +NTSTATUS _lsa_EnumPrivsAccount(pipes_struct *p, struct policy_handle *handle, struct lsa_PrivilegeSet *privs); +NTSTATUS _lsa_AddPrivilegesToAccount(pipes_struct *p, struct policy_handle *handle, struct lsa_PrivilegeSet *privs); +NTSTATUS _lsa_RemovePrivilegesFromAccount(pipes_struct *p, struct policy_handle *handle, uint8_t remove_all, struct lsa_PrivilegeSet *privs); +NTSTATUS _lsa_GetQuotasForAccount(pipes_struct *p); +NTSTATUS _lsa_SetQuotasForAccount(pipes_struct *p); +NTSTATUS _lsa_GetSystemAccessAccount(pipes_struct *p); +NTSTATUS _lsa_SetSystemAccessAccount(pipes_struct *p); +NTSTATUS _lsa_OpenTrustedDomain(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *sid, uint32_t access_mask, struct policy_handle *trustdom_handle); +NTSTATUS _lsa_QueryTrustedDomainInfo(pipes_struct *p, struct policy_handle *trustdom_handle, enum lsa_TrustDomInfoEnum level, union lsa_TrustedDomainInfo *info); +NTSTATUS _lsa_SetInformationTrustedDomain(pipes_struct *p); +NTSTATUS _lsa_OpenSecret(pipes_struct *p, struct policy_handle *handle, struct lsa_String name, uint32_t access_mask, struct policy_handle *sec_handle); +NTSTATUS _lsa_SetSecret(pipes_struct *p, struct policy_handle *sec_handle, struct lsa_DATA_BUF *new_val, struct lsa_DATA_BUF *old_val); +NTSTATUS _lsa_QuerySecret(pipes_struct *p, struct policy_handle *sec_handle, struct lsa_DATA_BUF_PTR *new_val, NTTIME *new_mtime, struct lsa_DATA_BUF_PTR *old_val, NTTIME *old_mtime); +NTSTATUS _lsa_LookupPrivValue(pipes_struct *p, struct policy_handle *handle, struct lsa_String *name, struct lsa_LUID *luid); +NTSTATUS _lsa_LookupPrivName(pipes_struct *p, struct policy_handle *handle, struct lsa_LUID *luid, struct lsa_StringLarge *name); +NTSTATUS _lsa_LookupPrivDisplayName(pipes_struct *p, struct policy_handle *handle, struct lsa_String *name, struct lsa_StringLarge *disp_name, uint16_t *language_id, uint16_t unknown); +NTSTATUS _lsa_DeleteObject(pipes_struct *p); +NTSTATUS _lsa_EnumAccountsWithUserRight(pipes_struct *p, struct policy_handle *handle, struct lsa_String *name, struct lsa_SidArray *sids); +NTSTATUS _lsa_EnumAccountRights(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *sid, struct lsa_RightSet *rights); +NTSTATUS _lsa_AddAccountRights(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *sid, struct lsa_RightSet *rights); +NTSTATUS _lsa_RemoveAccountRights(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *sid, uint32_t unknown, struct lsa_RightSet *rights); +NTSTATUS _lsa_QueryTrustedDomainInfoBySid(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *dom_sid, enum lsa_TrustDomInfoEnum level, union lsa_TrustedDomainInfo *info); +NTSTATUS _lsa_SetTrustedDomainInfo(pipes_struct *p); +NTSTATUS _lsa_DeleteTrustedDomain(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *dom_sid); +NTSTATUS _lsa_StorePrivateData(pipes_struct *p); +NTSTATUS _lsa_RetrievePrivateData(pipes_struct *p); +NTSTATUS _lsa_OpenPolicy2(pipes_struct *p, const char *system_name, struct lsa_ObjectAttribute *attr, uint32_t access_mask, struct policy_handle *handle); +NTSTATUS _lsa_GetUserName(pipes_struct *p, const char *system_name, struct lsa_String *account_name, struct lsa_StringPointer *authority_name); +NTSTATUS _lsa_QueryInfoPolicy2(pipes_struct *p, struct policy_handle *handle, uint16_t level, union lsa_PolicyInformation *info); +NTSTATUS _lsa_SetInfoPolicy2(pipes_struct *p); +NTSTATUS _lsa_QueryTrustedDomainInfoByName(pipes_struct *p, struct policy_handle *handle, struct lsa_String trusted_domain, enum lsa_TrustDomInfoEnum level, union lsa_TrustedDomainInfo *info); +NTSTATUS _lsa_SetTrustedDomainInfoByName(pipes_struct *p, struct policy_handle *handle, struct lsa_String trusted_domain, enum lsa_TrustDomInfoEnum level, union lsa_TrustedDomainInfo *info); +NTSTATUS _lsa_EnumTrustedDomainsEx(pipes_struct *p, struct policy_handle *handle, uint32_t *resume_handle, struct lsa_DomainListEx *domains, uint32_t max_size); +NTSTATUS _lsa_CreateTrustedDomainEx(pipes_struct *p); +NTSTATUS _lsa_CloseTrustedDomainEx(pipes_struct *p, struct policy_handle *handle); +NTSTATUS _lsa_QueryDomainInformationPolicy(pipes_struct *p, struct policy_handle *handle, uint16_t level, union lsa_DomainInformationPolicy *info); +NTSTATUS _lsa_SetDomainInformationPolicy(pipes_struct *p, struct policy_handle *handle, uint16_t level, union lsa_DomainInformationPolicy *info); +NTSTATUS _lsa_OpenTrustedDomainByName(pipes_struct *p, struct policy_handle *handle, struct lsa_String name, uint32_t access_mask, struct policy_handle *trustdom_handle); +NTSTATUS _lsa_TestCall(pipes_struct *p); +NTSTATUS _lsa_LookupSids2(pipes_struct *p, struct policy_handle *handle, struct lsa_SidArray *sids, struct lsa_RefDomainList *domains, struct lsa_TransNameArray2 *names, uint16_t level, uint32_t *count, uint32_t unknown1, uint32_t unknown2); +NTSTATUS _lsa_LookupNames2(pipes_struct *p, struct policy_handle *handle, uint32_t num_names, struct lsa_String *names, struct lsa_RefDomainList *domains, struct lsa_TransSidArray2 *sids, uint16_t level, uint32_t *count, uint32_t unknown1, uint32_t unknown2); +NTSTATUS _lsa_CreateTrustedDomainEx2(pipes_struct *p); +NTSTATUS _lsa_CREDRWRITE(pipes_struct *p); +NTSTATUS _lsa_CREDRREAD(pipes_struct *p); +NTSTATUS _lsa_CREDRENUMERATE(pipes_struct *p); +NTSTATUS _lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p); +NTSTATUS _lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p); +NTSTATUS _lsa_CREDRDELETE(pipes_struct *p); +NTSTATUS _lsa_CREDRGETTARGETINFO(pipes_struct *p); +NTSTATUS _lsa_CREDRPROFILELOADED(pipes_struct *p); +NTSTATUS _lsa_LookupNames3(pipes_struct *p, struct policy_handle *handle, uint32_t num_names, struct lsa_String *names, struct lsa_RefDomainList *domains, struct lsa_TransSidArray3 *sids, uint16_t level, uint32_t *count, uint32_t unknown1, uint32_t unknown2); +NTSTATUS _lsa_CREDRGETSESSIONTYPES(pipes_struct *p); +NTSTATUS _lsa_LSARREGISTERAUDITEVENT(pipes_struct *p); +NTSTATUS _lsa_LSARGENAUDITEVENT(pipes_struct *p); +NTSTATUS _lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p); +NTSTATUS _lsa_LSARQUERYFORESTTRUSTINFORMATION(pipes_struct *p); +NTSTATUS _lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p); +NTSTATUS _lsa_CREDRRENAME(pipes_struct *p); +NTSTATUS _lsa_LookupSids3(pipes_struct *p, struct lsa_SidArray *sids, struct lsa_RefDomainList *domains, struct lsa_TransNameArray2 *names, uint16_t level, uint32_t *count, uint32_t unknown1, uint32_t unknown2); +NTSTATUS _lsa_LookupNames4(pipes_struct *p, uint32_t num_names, struct lsa_String *names, struct lsa_RefDomainList *domains, struct lsa_TransSidArray3 *sids, uint16_t level, uint32_t *count, uint32_t unknown1, uint32_t unknown2); +NTSTATUS _lsa_LSAROPENPOLICYSCE(pipes_struct *p); +NTSTATUS _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p); +NTSTATUS _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p); +NTSTATUS _lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p); +void lsarpc_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_netdfs_init(void); +#endif /* __SRV_LSARPC__ */ diff --git a/source3/librpc/gen_ndr/srv_unixinfo.c b/source3/librpc/gen_ndr/srv_unixinfo.c new file mode 100644 index 0000000000..1c58e94405 --- /dev/null +++ b/source3/librpc/gen_ndr/srv_unixinfo.c @@ -0,0 +1,280 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_unixinfo.h" + +static BOOL api_unixinfo_SidToUid(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct unixinfo_SidToUid r; + TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_SidToUid"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_unixinfo_SidToUid(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _unixinfo_SidToUid(p, r.in.sid, r.out.uid); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_unixinfo_SidToUid(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_unixinfo_UidToSid(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct unixinfo_UidToSid r; + TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_UidToSid"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_unixinfo_UidToSid(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _unixinfo_UidToSid(p, r.in.uid, r.out.sid); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_unixinfo_UidToSid(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_unixinfo_SidToGid(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct unixinfo_SidToGid r; + TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_SidToGid"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_unixinfo_SidToGid(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _unixinfo_SidToGid(p, r.in.sid, r.out.gid); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_unixinfo_SidToGid(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_unixinfo_GidToSid(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct unixinfo_GidToSid r; + TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_GidToSid"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_unixinfo_GidToSid(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _unixinfo_GidToSid(p, r.in.gid, r.out.sid); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_unixinfo_GidToSid(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_unixinfo_GetPWUid(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct unixinfo_GetPWUid r; + TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_GetPWUid"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_unixinfo_GetPWUid(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.count = r.in.count; + r.out.result = _unixinfo_GetPWUid(p, r.in.count, r.in.uids, r.out.infos); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_unixinfo_GetPWUid(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + + +/* Tables */ +static struct api_struct api_unixinfo_cmds[] = +{ + {"UNIXINFO_SIDTOUID", DCERPC_UNIXINFO_SIDTOUID, api_unixinfo_SidToUid}, + {"UNIXINFO_UIDTOSID", DCERPC_UNIXINFO_UIDTOSID, api_unixinfo_UidToSid}, + {"UNIXINFO_SIDTOGID", DCERPC_UNIXINFO_SIDTOGID, api_unixinfo_SidToGid}, + {"UNIXINFO_GIDTOSID", DCERPC_UNIXINFO_GIDTOSID, api_unixinfo_GidToSid}, + {"UNIXINFO_GETPWUID", DCERPC_UNIXINFO_GETPWUID, api_unixinfo_GetPWUid}, +}; + +void unixinfo_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_unixinfo_cmds; + *n_fns = sizeof(api_unixinfo_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_netdfs_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "unixinfo", "unixinfo", api_unixinfo_cmds, sizeof(api_unixinfo_cmds) / sizeof(struct api_struct)); +} diff --git a/source3/librpc/gen_ndr/srv_unixinfo.h b/source3/librpc/gen_ndr/srv_unixinfo.h new file mode 100644 index 0000000000..751b85162d --- /dev/null +++ b/source3/librpc/gen_ndr/srv_unixinfo.h @@ -0,0 +1,11 @@ +#include "librpc/gen_ndr/ndr_unixinfo.h" +#ifndef __SRV_UNIXINFO__ +#define __SRV_UNIXINFO__ +NTSTATUS _unixinfo_SidToUid(pipes_struct *p, struct dom_sid sid, uint64_t *uid); +NTSTATUS _unixinfo_UidToSid(pipes_struct *p, uint64_t uid, struct dom_sid *sid); +NTSTATUS _unixinfo_SidToGid(pipes_struct *p, struct dom_sid sid, uint64_t *gid); +NTSTATUS _unixinfo_GidToSid(pipes_struct *p, uint64_t gid, struct dom_sid *sid); +NTSTATUS _unixinfo_GetPWUid(pipes_struct *p, uint32_t *count, uint64_t *uids, struct unixinfo_GetPWUidInfo *infos); +void unixinfo_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_netdfs_init(void); +#endif /* __SRV_UNIXINFO__ */ diff --git a/source3/rpc_parse/parse_dfs.c b/source3/rpc_parse/parse_dfs.c deleted file mode 100644 index f246e2f254..0000000000 --- a/source3/rpc_parse/parse_dfs.c +++ /dev/null @@ -1,2737 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * parser auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" - -#undef DBGC_CLASS -#define DBGC_CLASS DBGC_RPC_PARSE - -/* netdfs structures */ -BOOL init_netdfs_dfs_Info0(NETDFS_DFS_INFO0 *v) -{ - DEBUG(5,("init_netdfs_dfs_Info0\n")); - - return True; -} - -BOOL netdfs_io_dfs_Info0_p(const char *desc, NETDFS_DFS_INFO0 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info0_p"); - depth++; - return True; -} - -BOOL netdfs_io_dfs_Info0_d(const char *desc, NETDFS_DFS_INFO0 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info0_d"); - depth++; - return True; -} - -BOOL init_netdfs_dfs_Info1(NETDFS_DFS_INFO1 *v, const char *path) -{ - DEBUG(5,("init_netdfs_dfs_Info1\n")); - - if (path) { - v->ptr0_path = 1; - init_unistr2(&v->path, path, UNI_FLAGS_NONE); - } else { - v->ptr0_path = 0; - } - - return True; -} - -BOOL netdfs_io_dfs_Info1_p(const char *desc, NETDFS_DFS_INFO1 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info1_p"); - depth++; - if (!prs_uint32("ptr0_path", ps, depth, &v->ptr0_path)) - return False; - - - return True; -} - -BOOL netdfs_io_dfs_Info1_d(const char *desc, NETDFS_DFS_INFO1 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info1_d"); - depth++; - if (v->ptr0_path) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("path", &v->path, 1, ps, depth)) - return False; - } - - return True; -} - -BOOL init_netdfs_dfs_Info2(NETDFS_DFS_INFO2 *v, const char *path, const char *comment, uint32 state, uint32 num_stores) -{ - DEBUG(5,("init_netdfs_dfs_Info2\n")); - - if (path) { - v->ptr0_path = 1; - init_unistr2(&v->path, path, UNI_FLAGS_NONE); - } else { - v->ptr0_path = 0; - } - - if (comment) { - v->ptr0_comment = 1; - init_unistr2(&v->comment, comment, UNI_FLAGS_NONE); - } else { - v->ptr0_comment = 0; - } - - v->state = state; - - v->num_stores = num_stores; - - return True; -} - -BOOL netdfs_io_dfs_Info2_p(const char *desc, NETDFS_DFS_INFO2 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info2_p"); - depth++; - if (!prs_uint32("ptr0_path", ps, depth, &v->ptr0_path)) - return False; - - - if (!prs_uint32("ptr0_comment", ps, depth, &v->ptr0_comment)) - return False; - - - if (!prs_uint32("state", ps, depth, &v->state)) - return False; - - if (!prs_uint32("num_stores", ps, depth, &v->num_stores)) - return False; - - return True; -} - -BOOL netdfs_io_dfs_Info2_d(const char *desc, NETDFS_DFS_INFO2 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info2_d"); - depth++; - if (v->ptr0_path) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("path", &v->path, 1, ps, depth)) - return False; - } - - if (v->ptr0_comment) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("comment", &v->comment, 1, ps, depth)) - return False; - } - - - - return True; -} - -BOOL init_netdfs_dfs_StorageInfo(NETDFS_DFS_STORAGEINFO *v, uint32 state, const char *server, const char *share) -{ - DEBUG(5,("init_netdfs_dfs_StorageInfo\n")); - - v->state = state; - - if (server) { - v->ptr0_server = 1; - init_unistr2(&v->server, server, UNI_FLAGS_NONE); - } else { - v->ptr0_server = 0; - } - - if (share) { - v->ptr0_share = 1; - init_unistr2(&v->share, share, UNI_FLAGS_NONE); - } else { - v->ptr0_share = 0; - } - - return True; -} - -BOOL netdfs_io_dfs_StorageInfo_p(const char *desc, NETDFS_DFS_STORAGEINFO *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_StorageInfo_p"); - depth++; - if (!prs_uint32("state", ps, depth, &v->state)) - return False; - - if (!prs_uint32("ptr0_server", ps, depth, &v->ptr0_server)) - return False; - - - if (!prs_uint32("ptr0_share", ps, depth, &v->ptr0_share)) - return False; - - - return True; -} - -BOOL netdfs_io_dfs_StorageInfo_d(const char *desc, NETDFS_DFS_STORAGEINFO *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_StorageInfo_d"); - depth++; - - if (v->ptr0_server) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("server", &v->server, 1, ps, depth)) - return False; - } - - if (v->ptr0_share) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("share", &v->share, 1, ps, depth)) - return False; - } - - return True; -} - -BOOL init_netdfs_dfs_Info3(NETDFS_DFS_INFO3 *v, const char *path, const char *comment, uint32 state, uint32 num_stores, NETDFS_DFS_STORAGEINFO **stores) -{ - DEBUG(5,("init_netdfs_dfs_Info3\n")); - - if (path) { - v->ptr0_path = 1; - init_unistr2(&v->path, path, UNI_FLAGS_NONE); - } else { - v->ptr0_path = 0; - } - - if (comment) { - v->ptr0_comment = 1; - init_unistr2(&v->comment, comment, UNI_FLAGS_NONE); - } else { - v->ptr0_comment = 0; - } - - v->state = state; - - v->num_stores = num_stores; - - if (stores) { - v->ptr0_stores = 1; - v->stores = *stores; - } else { - v->ptr0_stores = 0; - } - - return True; -} - -BOOL netdfs_io_dfs_Info3_p(const char *desc, NETDFS_DFS_INFO3 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info3_p"); - depth++; - if (!prs_uint32("ptr0_path", ps, depth, &v->ptr0_path)) - return False; - - - if (!prs_uint32("ptr0_comment", ps, depth, &v->ptr0_comment)) - return False; - - - if (!prs_uint32("state", ps, depth, &v->state)) - return False; - - if (!prs_uint32("num_stores", ps, depth, &v->num_stores)) - return False; - - if (!prs_uint32("ptr0_stores", ps, depth, &v->ptr0_stores)) - return False; - - - return True; -} - -BOOL netdfs_io_dfs_Info3_d(const char *desc, NETDFS_DFS_INFO3 *v, prs_struct *ps, int depth) -{ - uint32 i_stores_1; - - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info3_d"); - depth++; - if (v->ptr0_path) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("path", &v->path, 1, ps, depth)) - return False; - } - - if (v->ptr0_comment) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("comment", &v->comment, 1, ps, depth)) - return False; - } - - - - if (v->ptr0_stores) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("size_stores", ps, depth, &v->size_stores)) - return False; - - if (UNMARSHALLING(ps)) { - v->stores = (NETDFS_DFS_STORAGEINFO *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores); - } - for (i_stores_1=0; i_stores_1<v->num_stores;i_stores_1++) { - if (!netdfs_io_dfs_StorageInfo_p("stores", &v->stores[i_stores_1], ps, depth)) - return False; - } - for (i_stores_1=0; i_stores_1<v->num_stores;i_stores_1++) { - if (!netdfs_io_dfs_StorageInfo_d("stores", &v->stores[i_stores_1], ps, depth)) - return False; - } - } - - return True; -} - -BOOL init_netdfs_dfs_Info4(NETDFS_DFS_INFO4 *v, const char *path, const char *comment, uint32 state, uint32 timeout, struct uuid guid, uint32 num_stores, NETDFS_DFS_STORAGEINFO **stores) -{ - DEBUG(5,("init_netdfs_dfs_Info4\n")); - - if (path) { - v->ptr0_path = 1; - init_unistr2(&v->path, path, UNI_FLAGS_NONE); - } else { - v->ptr0_path = 0; - } - - if (comment) { - v->ptr0_comment = 1; - init_unistr2(&v->comment, comment, UNI_FLAGS_NONE); - } else { - v->ptr0_comment = 0; - } - - v->state = state; - - v->timeout = timeout; - - - - v->num_stores = num_stores; - - if (stores) { - v->ptr0_stores = 1; - v->stores = *stores; - } else { - v->ptr0_stores = 0; - } - - return True; -} - -BOOL netdfs_io_dfs_Info4_p(const char *desc, NETDFS_DFS_INFO4 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info4_p"); - depth++; - if (!prs_uint32("ptr0_path", ps, depth, &v->ptr0_path)) - return False; - - - if (!prs_uint32("ptr0_comment", ps, depth, &v->ptr0_comment)) - return False; - - - if (!prs_uint32("state", ps, depth, &v->state)) - return False; - - if (!prs_uint32("timeout", ps, depth, &v->timeout)) - return False; - - if (!smb_io_uuid("guid", &v->guid, ps, depth)) - return False; - - if (!prs_uint32("num_stores", ps, depth, &v->num_stores)) - return False; - - if (!prs_uint32("ptr0_stores", ps, depth, &v->ptr0_stores)) - return False; - - - return True; -} - -BOOL netdfs_io_dfs_Info4_d(const char *desc, NETDFS_DFS_INFO4 *v, prs_struct *ps, int depth) -{ - uint32 i_stores_1; - - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info4_d"); - depth++; - if (v->ptr0_path) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("path", &v->path, 1, ps, depth)) - return False; - } - - if (v->ptr0_comment) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("comment", &v->comment, 1, ps, depth)) - return False; - } - - - - - - if (v->ptr0_stores) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("size_stores", ps, depth, &v->size_stores)) - return False; - - if (UNMARSHALLING(ps)) { - v->stores = (NETDFS_DFS_STORAGEINFO *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores); - } - for (i_stores_1=0; i_stores_1<v->num_stores;i_stores_1++) { - if (!netdfs_io_dfs_StorageInfo_p("stores", &v->stores[i_stores_1], ps, depth)) - return False; - } - for (i_stores_1=0; i_stores_1<v->num_stores;i_stores_1++) { - if (!netdfs_io_dfs_StorageInfo_d("stores", &v->stores[i_stores_1], ps, depth)) - return False; - } - } - - return True; -} - -BOOL init_netdfs_dfs_Info100(NETDFS_DFS_INFO100 *v, const char *comment) -{ - DEBUG(5,("init_netdfs_dfs_Info100\n")); - - if (comment) { - v->ptr0_comment = 1; - init_unistr2(&v->comment, comment, UNI_FLAGS_NONE); - } else { - v->ptr0_comment = 0; - } - - return True; -} - -BOOL netdfs_io_dfs_Info100_p(const char *desc, NETDFS_DFS_INFO100 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info100_p"); - depth++; - if (!prs_uint32("ptr0_comment", ps, depth, &v->ptr0_comment)) - return False; - - - return True; -} - -BOOL netdfs_io_dfs_Info100_d(const char *desc, NETDFS_DFS_INFO100 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info100_d"); - depth++; - if (v->ptr0_comment) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("comment", &v->comment, 1, ps, depth)) - return False; - } - - return True; -} - -BOOL init_netdfs_dfs_Info101(NETDFS_DFS_INFO101 *v, uint32 state) -{ - DEBUG(5,("init_netdfs_dfs_Info101\n")); - - v->state = state; - - return True; -} - -BOOL netdfs_io_dfs_Info101_p(const char *desc, NETDFS_DFS_INFO101 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info101_p"); - depth++; - if (!prs_uint32("state", ps, depth, &v->state)) - return False; - - return True; -} - -BOOL netdfs_io_dfs_Info101_d(const char *desc, NETDFS_DFS_INFO101 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info101_d"); - depth++; - - return True; -} - -BOOL init_netdfs_dfs_Info102(NETDFS_DFS_INFO102 *v, uint32 timeout) -{ - DEBUG(5,("init_netdfs_dfs_Info102\n")); - - v->timeout = timeout; - - return True; -} - -BOOL netdfs_io_dfs_Info102_p(const char *desc, NETDFS_DFS_INFO102 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info102_p"); - depth++; - if (!prs_uint32("timeout", ps, depth, &v->timeout)) - return False; - - return True; -} - -BOOL netdfs_io_dfs_Info102_d(const char *desc, NETDFS_DFS_INFO102 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info102_d"); - depth++; - - return True; -} - -BOOL init_netdfs_dfs_Info200(NETDFS_DFS_INFO200 *v, const char *dom_root) -{ - DEBUG(5,("init_netdfs_dfs_Info200\n")); - - if (dom_root) { - v->ptr0_dom_root = 1; - init_unistr2(&v->dom_root, dom_root, UNI_FLAGS_NONE); - } else { - v->ptr0_dom_root = 0; - } - - return True; -} - -BOOL netdfs_io_dfs_Info200_p(const char *desc, NETDFS_DFS_INFO200 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info200_p"); - depth++; - if (!prs_uint32("ptr0_dom_root", ps, depth, &v->ptr0_dom_root)) - return False; - - - return True; -} - -BOOL netdfs_io_dfs_Info200_d(const char *desc, NETDFS_DFS_INFO200 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info200_d"); - depth++; - if (v->ptr0_dom_root) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("dom_root", &v->dom_root, 1, ps, depth)) - return False; - } - - return True; -} - -BOOL init_netdfs_dfs_Info300(NETDFS_DFS_INFO300 *v, uint32 flags, const char *dom_root) -{ - DEBUG(5,("init_netdfs_dfs_Info300\n")); - - v->flags = flags; - - if (dom_root) { - v->ptr0_dom_root = 1; - init_unistr2(&v->dom_root, dom_root, UNI_FLAGS_NONE); - } else { - v->ptr0_dom_root = 0; - } - - return True; -} - -BOOL netdfs_io_dfs_Info300_p(const char *desc, NETDFS_DFS_INFO300 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info300_p"); - depth++; - if (!prs_uint32("flags", ps, depth, &v->flags)) - return False; - - if (!prs_uint32("ptr0_dom_root", ps, depth, &v->ptr0_dom_root)) - return False; - - - return True; -} - -BOOL netdfs_io_dfs_Info300_d(const char *desc, NETDFS_DFS_INFO300 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_Info300_d"); - depth++; - - if (v->ptr0_dom_root) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("dom_root", &v->dom_root, 1, ps, depth)) - return False; - } - - return True; -} - -BOOL netdfs_io_dfs_Info_p(const char *desc, NETDFS_DFS_INFO_CTR* v, prs_struct *ps, int depth) -{ - if (!prs_uint32("switch_value", ps, depth, &v->switch_value)) - return False; - - switch (v->switch_value) { - case 0: - depth++; - if (!prs_uint32("ptr0_info0", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - case 1: - depth++; - if (!prs_uint32("ptr0_info1", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - case 2: - depth++; - if (!prs_uint32("ptr0_info2", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - case 3: - depth++; - if (!prs_uint32("ptr0_info3", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - case 4: - depth++; - if (!prs_uint32("ptr0_info4", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - case 100: - depth++; - if (!prs_uint32("ptr0_info100", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - case 101: - depth++; - if (!prs_uint32("ptr0_info101", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - case 102: - depth++; - if (!prs_uint32("ptr0_info102", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - default: - return False; - - } - - return True; -} - -BOOL netdfs_io_dfs_Info_d(const char *desc, NETDFS_DFS_INFO_CTR* v, prs_struct *ps, int depth) -{ - switch (v->switch_value) { - case 0: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 1)) - return False; - - if (!netdfs_io_dfs_Info0_p("info0", &v->u.info0, ps, depth)) - return False; - if (!netdfs_io_dfs_Info0_d("info0", &v->u.info0, ps, depth)) - return False; - } - depth--; - break; - - case 1: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_Info1_p("info1", &v->u.info1, ps, depth)) - return False; - if (!netdfs_io_dfs_Info1_d("info1", &v->u.info1, ps, depth)) - return False; - } - depth--; - break; - - case 2: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_Info2_p("info2", &v->u.info2, ps, depth)) - return False; - if (!netdfs_io_dfs_Info2_d("info2", &v->u.info2, ps, depth)) - return False; - } - depth--; - break; - - case 3: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_Info3_p("info3", &v->u.info3, ps, depth)) - return False; - if (!netdfs_io_dfs_Info3_d("info3", &v->u.info3, ps, depth)) - return False; - } - depth--; - break; - - case 4: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_Info4_p("info4", &v->u.info4, ps, depth)) - return False; - if (!netdfs_io_dfs_Info4_d("info4", &v->u.info4, ps, depth)) - return False; - } - depth--; - break; - - case 100: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_Info100_p("info100", &v->u.info100, ps, depth)) - return False; - if (!netdfs_io_dfs_Info100_d("info100", &v->u.info100, ps, depth)) - return False; - } - depth--; - break; - - case 101: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_Info101_p("info101", &v->u.info101, ps, depth)) - return False; - if (!netdfs_io_dfs_Info101_d("info101", &v->u.info101, ps, depth)) - return False; - } - depth--; - break; - - case 102: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_Info102_p("info102", &v->u.info102, ps, depth)) - return False; - if (!netdfs_io_dfs_Info102_d("info102", &v->u.info102, ps, depth)) - return False; - } - depth--; - break; - - } - - return True; -} -BOOL init_netdfs_dfs_EnumArray1(NETDFS_DFS_ENUMARRAY1 *v, uint32 count, NETDFS_DFS_INFO1 **s) -{ - DEBUG(5,("init_netdfs_dfs_EnumArray1\n")); - - v->count = count; - - if (s) { - v->ptr0_s = 1; - v->s = *s; - } else { - v->ptr0_s = 0; - } - - return True; -} - -BOOL netdfs_io_dfs_EnumArray1_p(const char *desc, NETDFS_DFS_ENUMARRAY1 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumArray1_p"); - depth++; - if (!prs_uint32("count", ps, depth, &v->count)) - return False; - - if (!prs_uint32("ptr0_s", ps, depth, &v->ptr0_s)) - return False; - - - return True; -} - -BOOL netdfs_io_dfs_EnumArray1_d(const char *desc, NETDFS_DFS_ENUMARRAY1 *v, prs_struct *ps, int depth) -{ - uint32 i_s_1; - - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumArray1_d"); - depth++; - - if (v->ptr0_s) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("size_s", ps, depth, &v->size_s)) - return False; - - if (UNMARSHALLING(ps)) { - v->s = (NETDFS_DFS_INFO1 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); - } - for (i_s_1=0; i_s_1<v->count;i_s_1++) { - if (!netdfs_io_dfs_Info1_p("s", &v->s[i_s_1], ps, depth)) - return False; - } - for (i_s_1=0; i_s_1<v->count;i_s_1++) { - if (!netdfs_io_dfs_Info1_d("s", &v->s[i_s_1], ps, depth)) - return False; - } - } - - return True; -} - -BOOL init_netdfs_dfs_EnumArray2(NETDFS_DFS_ENUMARRAY2 *v, uint32 count, NETDFS_DFS_INFO2 **s) -{ - DEBUG(5,("init_netdfs_dfs_EnumArray2\n")); - - v->count = count; - - if (s) { - v->ptr0_s = 1; - v->s = *s; - } else { - v->ptr0_s = 0; - } - - return True; -} - -BOOL netdfs_io_dfs_EnumArray2_p(const char *desc, NETDFS_DFS_ENUMARRAY2 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumArray2_p"); - depth++; - if (!prs_uint32("count", ps, depth, &v->count)) - return False; - - if (!prs_uint32("ptr0_s", ps, depth, &v->ptr0_s)) - return False; - - - return True; -} - -BOOL netdfs_io_dfs_EnumArray2_d(const char *desc, NETDFS_DFS_ENUMARRAY2 *v, prs_struct *ps, int depth) -{ - uint32 i_s_1; - - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumArray2_d"); - depth++; - - if (v->ptr0_s) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("size_s", ps, depth, &v->size_s)) - return False; - - if (UNMARSHALLING(ps)) { - v->s = (NETDFS_DFS_INFO2 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); - } - for (i_s_1=0; i_s_1<v->count;i_s_1++) { - if (!netdfs_io_dfs_Info2_p("s", &v->s[i_s_1], ps, depth)) - return False; - } - for (i_s_1=0; i_s_1<v->count;i_s_1++) { - if (!netdfs_io_dfs_Info2_d("s", &v->s[i_s_1], ps, depth)) - return False; - } - } - - return True; -} - -BOOL init_netdfs_dfs_EnumArray3(NETDFS_DFS_ENUMARRAY3 *v, uint32 count, NETDFS_DFS_INFO3 **s) -{ - DEBUG(5,("init_netdfs_dfs_EnumArray3\n")); - - v->count = count; - - if (s) { - v->ptr0_s = 1; - v->s = *s; - } else { - v->ptr0_s = 0; - } - - return True; -} - -BOOL netdfs_io_dfs_EnumArray3_p(const char *desc, NETDFS_DFS_ENUMARRAY3 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumArray3_p"); - depth++; - if (!prs_uint32("count", ps, depth, &v->count)) - return False; - - if (!prs_uint32("ptr0_s", ps, depth, &v->ptr0_s)) - return False; - - - return True; -} - -BOOL netdfs_io_dfs_EnumArray3_d(const char *desc, NETDFS_DFS_ENUMARRAY3 *v, prs_struct *ps, int depth) -{ - uint32 i_s_1; - - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumArray3_d"); - depth++; - - if (v->ptr0_s) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("size_s", ps, depth, &v->size_s)) - return False; - - if (UNMARSHALLING(ps)) { - v->s = (NETDFS_DFS_INFO3 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); - } - for (i_s_1=0; i_s_1<v->count;i_s_1++) { - if (!netdfs_io_dfs_Info3_p("s", &v->s[i_s_1], ps, depth)) - return False; - } - for (i_s_1=0; i_s_1<v->count;i_s_1++) { - if (!netdfs_io_dfs_Info3_d("s", &v->s[i_s_1], ps, depth)) - return False; - } - } - - return True; -} - -BOOL init_netdfs_dfs_EnumArray4(NETDFS_DFS_ENUMARRAY4 *v, uint32 count, NETDFS_DFS_INFO4 **s) -{ - DEBUG(5,("init_netdfs_dfs_EnumArray4\n")); - - v->count = count; - - if (s) { - v->ptr0_s = 1; - v->s = *s; - } else { - v->ptr0_s = 0; - } - - return True; -} - -BOOL netdfs_io_dfs_EnumArray4_p(const char *desc, NETDFS_DFS_ENUMARRAY4 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumArray4_p"); - depth++; - if (!prs_uint32("count", ps, depth, &v->count)) - return False; - - if (!prs_uint32("ptr0_s", ps, depth, &v->ptr0_s)) - return False; - - - return True; -} - -BOOL netdfs_io_dfs_EnumArray4_d(const char *desc, NETDFS_DFS_ENUMARRAY4 *v, prs_struct *ps, int depth) -{ - uint32 i_s_1; - - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumArray4_d"); - depth++; - - if (v->ptr0_s) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("size_s", ps, depth, &v->size_s)) - return False; - - if (UNMARSHALLING(ps)) { - v->s = (NETDFS_DFS_INFO4 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); - } - for (i_s_1=0; i_s_1<v->count;i_s_1++) { - if (!netdfs_io_dfs_Info4_p("s", &v->s[i_s_1], ps, depth)) - return False; - } - for (i_s_1=0; i_s_1<v->count;i_s_1++) { - if (!netdfs_io_dfs_Info4_d("s", &v->s[i_s_1], ps, depth)) - return False; - } - } - - return True; -} - -BOOL init_netdfs_dfs_EnumArray200(NETDFS_DFS_ENUMARRAY200 *v, uint32 count, NETDFS_DFS_INFO200 **s) -{ - DEBUG(5,("init_netdfs_dfs_EnumArray200\n")); - - v->count = count; - - if (s) { - v->ptr0_s = 1; - v->s = *s; - } else { - v->ptr0_s = 0; - } - - return True; -} - -BOOL netdfs_io_dfs_EnumArray200_p(const char *desc, NETDFS_DFS_ENUMARRAY200 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumArray200_p"); - depth++; - if (!prs_uint32("count", ps, depth, &v->count)) - return False; - - if (!prs_uint32("ptr0_s", ps, depth, &v->ptr0_s)) - return False; - - - return True; -} - -BOOL netdfs_io_dfs_EnumArray200_d(const char *desc, NETDFS_DFS_ENUMARRAY200 *v, prs_struct *ps, int depth) -{ - uint32 i_s_1; - - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumArray200_d"); - depth++; - - if (v->ptr0_s) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("size_s", ps, depth, &v->size_s)) - return False; - - if (UNMARSHALLING(ps)) { - v->s = (NETDFS_DFS_INFO200 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); - } - for (i_s_1=0; i_s_1<v->count;i_s_1++) { - if (!netdfs_io_dfs_Info200_p("s", &v->s[i_s_1], ps, depth)) - return False; - } - for (i_s_1=0; i_s_1<v->count;i_s_1++) { - if (!netdfs_io_dfs_Info200_d("s", &v->s[i_s_1], ps, depth)) - return False; - } - } - - return True; -} - -BOOL init_netdfs_dfs_EnumArray300(NETDFS_DFS_ENUMARRAY300 *v, uint32 count, NETDFS_DFS_INFO300 **s) -{ - DEBUG(5,("init_netdfs_dfs_EnumArray300\n")); - - v->count = count; - - if (s) { - v->ptr0_s = 1; - v->s = *s; - } else { - v->ptr0_s = 0; - } - - return True; -} - -BOOL netdfs_io_dfs_EnumArray300_p(const char *desc, NETDFS_DFS_ENUMARRAY300 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumArray300_p"); - depth++; - if (!prs_uint32("count", ps, depth, &v->count)) - return False; - - if (!prs_uint32("ptr0_s", ps, depth, &v->ptr0_s)) - return False; - - - return True; -} - -BOOL netdfs_io_dfs_EnumArray300_d(const char *desc, NETDFS_DFS_ENUMARRAY300 *v, prs_struct *ps, int depth) -{ - uint32 i_s_1; - - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumArray300_d"); - depth++; - - if (v->ptr0_s) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("size_s", ps, depth, &v->size_s)) - return False; - - if (UNMARSHALLING(ps)) { - v->s = (NETDFS_DFS_INFO300 *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); - } - for (i_s_1=0; i_s_1<v->count;i_s_1++) { - if (!netdfs_io_dfs_Info300_p("s", &v->s[i_s_1], ps, depth)) - return False; - } - for (i_s_1=0; i_s_1<v->count;i_s_1++) { - if (!netdfs_io_dfs_Info300_d("s", &v->s[i_s_1], ps, depth)) - return False; - } - } - - return True; -} - -BOOL netdfs_io_dfs_EnumInfo_p(const char *desc, NETDFS_DFS_ENUMINFO_CTR* v, prs_struct *ps, int depth) -{ - if (!prs_uint32("switch_value", ps, depth, &v->switch_value)) - return False; - - switch (v->switch_value) { - case 1: - depth++; - if (!prs_uint32("ptr0_info1", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - case 2: - depth++; - if (!prs_uint32("ptr0_info2", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - case 3: - depth++; - if (!prs_uint32("ptr0_info3", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - case 4: - depth++; - if (!prs_uint32("ptr0_info4", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - case 200: - depth++; - if (!prs_uint32("ptr0_info200", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - case 300: - depth++; - if (!prs_uint32("ptr0_info300", ps, depth, &v->ptr0)) - return False; - - depth--; - break; - - default: - return False; - - } - - return True; -} - -BOOL netdfs_io_dfs_EnumInfo_d(const char *desc, NETDFS_DFS_ENUMINFO_CTR* v, prs_struct *ps, int depth) -{ - switch (v->switch_value) { - case 1: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_EnumArray1_p("info1", &v->u.info1, ps, depth)) - return False; - if (!netdfs_io_dfs_EnumArray1_d("info1", &v->u.info1, ps, depth)) - return False; - } - depth--; - break; - - case 2: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_EnumArray2_p("info2", &v->u.info2, ps, depth)) - return False; - if (!netdfs_io_dfs_EnumArray2_d("info2", &v->u.info2, ps, depth)) - return False; - } - depth--; - break; - - case 3: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_EnumArray3_p("info3", &v->u.info3, ps, depth)) - return False; - if (!netdfs_io_dfs_EnumArray3_d("info3", &v->u.info3, ps, depth)) - return False; - } - depth--; - break; - - case 4: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_EnumArray4_p("info4", &v->u.info4, ps, depth)) - return False; - if (!netdfs_io_dfs_EnumArray4_d("info4", &v->u.info4, ps, depth)) - return False; - } - depth--; - break; - - case 200: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_EnumArray200_p("info200", &v->u.info200, ps, depth)) - return False; - if (!netdfs_io_dfs_EnumArray200_d("info200", &v->u.info200, ps, depth)) - return False; - } - depth--; - break; - - case 300: - depth++; - if (v->ptr0) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_EnumArray300_p("info300", &v->u.info300, ps, depth)) - return False; - if (!netdfs_io_dfs_EnumArray300_d("info300", &v->u.info300, ps, depth)) - return False; - } - depth--; - break; - - } - - return True; -} -BOOL init_netdfs_dfs_EnumStruct(NETDFS_DFS_ENUMSTRUCT *v, uint32 level, NETDFS_DFS_ENUMINFO_CTR e) -{ - DEBUG(5,("init_netdfs_dfs_EnumStruct\n")); - - v->level = level; - - v->e = e; - v->e.switch_value = v->level; - - return True; -} - -BOOL netdfs_io_dfs_EnumStruct_p(const char *desc, NETDFS_DFS_ENUMSTRUCT *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumStruct_p"); - depth++; - if (!prs_uint32("level", ps, depth, &v->level)) - return False; - - if (!netdfs_io_dfs_EnumInfo_p("e", &v->e, ps, depth)) - return False; - - return True; -} - -BOOL netdfs_io_dfs_EnumStruct_d(const char *desc, NETDFS_DFS_ENUMSTRUCT *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_dfs_EnumStruct_d"); - depth++; - - if (!prs_align_custom(ps, 4)) - return False; - - if (!netdfs_io_dfs_EnumInfo_d("e", &v->e, ps, depth)) - return False; - - return True; -} - -/* netdfs functions */ -BOOL init_netdfs_q_dfs_GetManagerVersion(NETDFS_Q_DFS_GETMANAGERVERSION *v) -{ - DEBUG(5,("init_netdfs_q_dfs_GetManagerVersion\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_GetManagerVersion(const char *desc, NETDFS_Q_DFS_GETMANAGERVERSION *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_GetManagerVersion"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_GetManagerVersion(NETDFS_R_DFS_GETMANAGERVERSION *v, uint32 *exist_flag) -{ - DEBUG(5,("init_netdfs_r_dfs_GetManagerVersion\n")); - - if (!exist_flag) - return False; - - v->exist_flag = *exist_flag; - - return True; -} - -BOOL netdfs_io_r_dfs_GetManagerVersion(const char *desc, NETDFS_R_DFS_GETMANAGERVERSION *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_GetManagerVersion"); - depth++; - if (!prs_uint32("exist_flag", ps, depth, &v->exist_flag)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_Add(NETDFS_Q_DFS_ADD *v, const char *path, const char *server, const char *share, const char *comment, uint32 flags) -{ - DEBUG(5,("init_netdfs_q_dfs_Add\n")); - - if (!path) - return False; - - init_unistr2(&v->path, path, UNI_FLAGS_NONE); - - if (!server) - return False; - - init_unistr2(&v->server, server, UNI_FLAGS_NONE); - - if (share) { - v->ptr0_share = 1; - init_unistr2(&v->share, share, UNI_FLAGS_NONE); - } else { - v->ptr0_share = 0; - } - - if (comment) { - v->ptr0_comment = 1; - init_unistr2(&v->comment, comment, UNI_FLAGS_NONE); - } else { - v->ptr0_comment = 0; - } - - v->flags = flags; - - return True; -} - -BOOL netdfs_io_q_dfs_Add(const char *desc, NETDFS_Q_DFS_ADD *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_Add"); - depth++; - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("path", &v->path, 1, ps, depth)) - return False; - - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("server", &v->server, 1, ps, depth)) - return False; - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("ptr0_share", ps, depth, &v->ptr0_share)) - return False; - - if (v->ptr0_share) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("share", &v->share, 1, ps, depth)) - return False; - } - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("ptr0_comment", ps, depth, &v->ptr0_comment)) - return False; - - if (v->ptr0_comment) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("comment", &v->comment, 1, ps, depth)) - return False; - } - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("flags", ps, depth, &v->flags)) - return False; - - return True; -} - -BOOL init_netdfs_r_dfs_Add(NETDFS_R_DFS_ADD *v, const char *path, const char *server, const char *share, const char *comment, uint32 flags, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_Add\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_Add(const char *desc, NETDFS_R_DFS_ADD *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_Add"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_Remove(NETDFS_Q_DFS_REMOVE *v, const char *path, const char *server, const char *share) -{ - DEBUG(5,("init_netdfs_q_dfs_Remove\n")); - - if (!path) - return False; - - init_unistr2(&v->path, path, UNI_FLAGS_NONE); - - if (server) { - v->ptr0_server = 1; - init_unistr2(&v->server, server, UNI_FLAGS_NONE); - } else { - v->ptr0_server = 0; - } - - if (share) { - v->ptr0_share = 1; - init_unistr2(&v->share, share, UNI_FLAGS_NONE); - } else { - v->ptr0_share = 0; - } - - return True; -} - -BOOL netdfs_io_q_dfs_Remove(const char *desc, NETDFS_Q_DFS_REMOVE *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_Remove"); - depth++; - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("path", &v->path, 1, ps, depth)) - return False; - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("ptr0_server", ps, depth, &v->ptr0_server)) - return False; - - if (v->ptr0_server) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("server", &v->server, 1, ps, depth)) - return False; - } - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("ptr0_share", ps, depth, &v->ptr0_share)) - return False; - - if (v->ptr0_share) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("share", &v->share, 1, ps, depth)) - return False; - } - - return True; -} - -BOOL init_netdfs_r_dfs_Remove(NETDFS_R_DFS_REMOVE *v, const char *path, const char *server, const char *share, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_Remove\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_Remove(const char *desc, NETDFS_R_DFS_REMOVE *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_Remove"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_SetInfo(NETDFS_Q_DFS_SETINFO *v) -{ - DEBUG(5,("init_netdfs_q_dfs_SetInfo\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_SetInfo(const char *desc, NETDFS_Q_DFS_SETINFO *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_SetInfo"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_SetInfo(NETDFS_R_DFS_SETINFO *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_SetInfo\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_SetInfo(const char *desc, NETDFS_R_DFS_SETINFO *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_SetInfo"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_GetInfo(NETDFS_Q_DFS_GETINFO *v, const char *path, const char *server, const char *share, uint32 level) -{ - DEBUG(5,("init_netdfs_q_dfs_GetInfo\n")); - - if (!path) - return False; - - init_unistr2(&v->path, path, UNI_FLAGS_NONE); - - if (server) { - v->ptr0_server = 1; - init_unistr2(&v->server, server, UNI_FLAGS_NONE); - } else { - v->ptr0_server = 0; - } - - if (share) { - v->ptr0_share = 1; - init_unistr2(&v->share, share, UNI_FLAGS_NONE); - } else { - v->ptr0_share = 0; - } - - v->level = level; - - return True; -} - -BOOL netdfs_io_q_dfs_GetInfo(const char *desc, NETDFS_Q_DFS_GETINFO *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_GetInfo"); - depth++; - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("path", &v->path, 1, ps, depth)) - return False; - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("ptr0_server", ps, depth, &v->ptr0_server)) - return False; - - if (v->ptr0_server) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("server", &v->server, 1, ps, depth)) - return False; - } - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("ptr0_share", ps, depth, &v->ptr0_share)) - return False; - - if (v->ptr0_share) { - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("share", &v->share, 1, ps, depth)) - return False; - } - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("level", ps, depth, &v->level)) - return False; - - return True; -} - -BOOL init_netdfs_r_dfs_GetInfo(NETDFS_R_DFS_GETINFO *v, const char *path, const char *server, const char *share, uint32 level, NETDFS_DFS_INFO_CTR *info, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_GetInfo\n")); - - if (!info) - return False; - - v->info = *info; - v->info.switch_value = level; - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_GetInfo(const char *desc, NETDFS_R_DFS_GETINFO *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_GetInfo"); - depth++; - if (!netdfs_io_dfs_Info_p("info", &v->info, ps, depth)) - return False; - if (!netdfs_io_dfs_Info_d("info", &v->info, ps, depth)) - return False; - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_Enum(NETDFS_Q_DFS_ENUM *v, uint32 level, uint32 bufsize, NETDFS_DFS_ENUMSTRUCT *info, uint32 *total) -{ - DEBUG(5,("init_netdfs_q_dfs_Enum\n")); - - v->level = level; - - v->bufsize = bufsize; - - if (info) { - v->ptr0_info = 1; - v->info = *info; - } else { - v->ptr0_info = 0; - } - - if (total) { - v->ptr0_total = 1; - v->total = *total; - } else { - v->ptr0_total = 0; - } - - return True; -} - -BOOL netdfs_io_q_dfs_Enum(const char *desc, NETDFS_Q_DFS_ENUM *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_Enum"); - depth++; - if (!prs_uint32("level", ps, depth, &v->level)) - return False; - - if (!prs_uint32("bufsize", ps, depth, &v->bufsize)) - return False; - - if (!prs_uint32("ptr0_info", ps, depth, &v->ptr0_info)) - return False; - - if (v->ptr0_info) { - if (!netdfs_io_dfs_EnumStruct_p("info", &v->info, ps, depth)) - return False; - if (!netdfs_io_dfs_EnumStruct_d("info", &v->info, ps, depth)) - return False; - } - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("ptr0_total", ps, depth, &v->ptr0_total)) - return False; - - if (v->ptr0_total) { - if (!prs_uint32("total", ps, depth, &v->total)) - return False; - } - - return True; -} - -BOOL init_netdfs_r_dfs_Enum(NETDFS_R_DFS_ENUM *v, uint32 level, uint32 bufsize, NETDFS_DFS_ENUMSTRUCT *info, uint32 *unknown, uint32 *total, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_Enum\n")); - - if (info) { - v->ptr0_info = 1; - v->info = *info; - } else { - v->ptr0_info = 0; - } - - if (total) { - v->ptr0_total = 1; - v->total = *total; - } else { - v->ptr0_total = 0; - } - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_Enum(const char *desc, NETDFS_R_DFS_ENUM *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_Enum"); - depth++; - if (!prs_uint32("ptr0_info", ps, depth, &v->ptr0_info)) - return False; - - if (v->ptr0_info) { - if (!netdfs_io_dfs_EnumStruct_p("info", &v->info, ps, depth)) - return False; - if (!netdfs_io_dfs_EnumStruct_d("info", &v->info, ps, depth)) - return False; - } - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("ptr0_total", ps, depth, &v->ptr0_total)) - return False; - - if (v->ptr0_total) { - if (!prs_uint32("total", ps, depth, &v->total)) - return False; - } - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_Rename(NETDFS_Q_DFS_RENAME *v) -{ - DEBUG(5,("init_netdfs_q_dfs_Rename\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_Rename(const char *desc, NETDFS_Q_DFS_RENAME *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_Rename"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_Rename(NETDFS_R_DFS_RENAME *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_Rename\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_Rename(const char *desc, NETDFS_R_DFS_RENAME *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_Rename"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_Move(NETDFS_Q_DFS_MOVE *v) -{ - DEBUG(5,("init_netdfs_q_dfs_Move\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_Move(const char *desc, NETDFS_Q_DFS_MOVE *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_Move"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_Move(NETDFS_R_DFS_MOVE *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_Move\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_Move(const char *desc, NETDFS_R_DFS_MOVE *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_Move"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_ManagerGetConfigInfo(NETDFS_Q_DFS_MANAGERGETCONFIGINFO *v) -{ - DEBUG(5,("init_netdfs_q_dfs_ManagerGetConfigInfo\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_ManagerGetConfigInfo(const char *desc, NETDFS_Q_DFS_MANAGERGETCONFIGINFO *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_ManagerGetConfigInfo"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_ManagerGetConfigInfo(NETDFS_R_DFS_MANAGERGETCONFIGINFO *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_ManagerGetConfigInfo\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_ManagerGetConfigInfo(const char *desc, NETDFS_R_DFS_MANAGERGETCONFIGINFO *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_ManagerGetConfigInfo"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_ManagerSendSiteInfo(NETDFS_Q_DFS_MANAGERSENDSITEINFO *v) -{ - DEBUG(5,("init_netdfs_q_dfs_ManagerSendSiteInfo\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_ManagerSendSiteInfo(const char *desc, NETDFS_Q_DFS_MANAGERSENDSITEINFO *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_ManagerSendSiteInfo"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_ManagerSendSiteInfo(NETDFS_R_DFS_MANAGERSENDSITEINFO *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_ManagerSendSiteInfo\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_ManagerSendSiteInfo(const char *desc, NETDFS_R_DFS_MANAGERSENDSITEINFO *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_ManagerSendSiteInfo"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_AddFtRoot(NETDFS_Q_DFS_ADDFTROOT *v) -{ - DEBUG(5,("init_netdfs_q_dfs_AddFtRoot\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_AddFtRoot(const char *desc, NETDFS_Q_DFS_ADDFTROOT *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_AddFtRoot"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_AddFtRoot(NETDFS_R_DFS_ADDFTROOT *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_AddFtRoot\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_AddFtRoot(const char *desc, NETDFS_R_DFS_ADDFTROOT *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_AddFtRoot"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_RemoveFtRoot(NETDFS_Q_DFS_REMOVEFTROOT *v) -{ - DEBUG(5,("init_netdfs_q_dfs_RemoveFtRoot\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_RemoveFtRoot(const char *desc, NETDFS_Q_DFS_REMOVEFTROOT *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_RemoveFtRoot"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_RemoveFtRoot(NETDFS_R_DFS_REMOVEFTROOT *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_RemoveFtRoot\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_RemoveFtRoot(const char *desc, NETDFS_R_DFS_REMOVEFTROOT *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_RemoveFtRoot"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_AddStdRoot(NETDFS_Q_DFS_ADDSTDROOT *v) -{ - DEBUG(5,("init_netdfs_q_dfs_AddStdRoot\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_AddStdRoot(const char *desc, NETDFS_Q_DFS_ADDSTDROOT *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_AddStdRoot"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_AddStdRoot(NETDFS_R_DFS_ADDSTDROOT *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_AddStdRoot\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_AddStdRoot(const char *desc, NETDFS_R_DFS_ADDSTDROOT *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_AddStdRoot"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_RemoveStdRoot(NETDFS_Q_DFS_REMOVESTDROOT *v) -{ - DEBUG(5,("init_netdfs_q_dfs_RemoveStdRoot\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_RemoveStdRoot(const char *desc, NETDFS_Q_DFS_REMOVESTDROOT *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_RemoveStdRoot"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_RemoveStdRoot(NETDFS_R_DFS_REMOVESTDROOT *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_RemoveStdRoot\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_RemoveStdRoot(const char *desc, NETDFS_R_DFS_REMOVESTDROOT *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_RemoveStdRoot"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_ManagerInitialize(NETDFS_Q_DFS_MANAGERINITIALIZE *v) -{ - DEBUG(5,("init_netdfs_q_dfs_ManagerInitialize\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_ManagerInitialize(const char *desc, NETDFS_Q_DFS_MANAGERINITIALIZE *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_ManagerInitialize"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_ManagerInitialize(NETDFS_R_DFS_MANAGERINITIALIZE *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_ManagerInitialize\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_ManagerInitialize(const char *desc, NETDFS_R_DFS_MANAGERINITIALIZE *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_ManagerInitialize"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_AddStdRootForced(NETDFS_Q_DFS_ADDSTDROOTFORCED *v) -{ - DEBUG(5,("init_netdfs_q_dfs_AddStdRootForced\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_AddStdRootForced(const char *desc, NETDFS_Q_DFS_ADDSTDROOTFORCED *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_AddStdRootForced"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_AddStdRootForced(NETDFS_R_DFS_ADDSTDROOTFORCED *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_AddStdRootForced\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_AddStdRootForced(const char *desc, NETDFS_R_DFS_ADDSTDROOTFORCED *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_AddStdRootForced"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_GetDcAddress(NETDFS_Q_DFS_GETDCADDRESS *v) -{ - DEBUG(5,("init_netdfs_q_dfs_GetDcAddress\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_GetDcAddress(const char *desc, NETDFS_Q_DFS_GETDCADDRESS *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_GetDcAddress"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_GetDcAddress(NETDFS_R_DFS_GETDCADDRESS *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_GetDcAddress\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_GetDcAddress(const char *desc, NETDFS_R_DFS_GETDCADDRESS *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_GetDcAddress"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_SetDcAddress(NETDFS_Q_DFS_SETDCADDRESS *v) -{ - DEBUG(5,("init_netdfs_q_dfs_SetDcAddress\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_SetDcAddress(const char *desc, NETDFS_Q_DFS_SETDCADDRESS *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_SetDcAddress"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_SetDcAddress(NETDFS_R_DFS_SETDCADDRESS *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_SetDcAddress\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_SetDcAddress(const char *desc, NETDFS_R_DFS_SETDCADDRESS *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_SetDcAddress"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_FlushFtTable(NETDFS_Q_DFS_FLUSHFTTABLE *v) -{ - DEBUG(5,("init_netdfs_q_dfs_FlushFtTable\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_FlushFtTable(const char *desc, NETDFS_Q_DFS_FLUSHFTTABLE *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_FlushFtTable"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_FlushFtTable(NETDFS_R_DFS_FLUSHFTTABLE *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_FlushFtTable\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_FlushFtTable(const char *desc, NETDFS_R_DFS_FLUSHFTTABLE *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_FlushFtTable"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_Add2(NETDFS_Q_DFS_ADD2 *v) -{ - DEBUG(5,("init_netdfs_q_dfs_Add2\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_Add2(const char *desc, NETDFS_Q_DFS_ADD2 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_Add2"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_Add2(NETDFS_R_DFS_ADD2 *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_Add2\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_Add2(const char *desc, NETDFS_R_DFS_ADD2 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_Add2"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_Remove2(NETDFS_Q_DFS_REMOVE2 *v) -{ - DEBUG(5,("init_netdfs_q_dfs_Remove2\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_Remove2(const char *desc, NETDFS_Q_DFS_REMOVE2 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_Remove2"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_Remove2(NETDFS_R_DFS_REMOVE2 *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_Remove2\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_Remove2(const char *desc, NETDFS_R_DFS_REMOVE2 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_Remove2"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_EnumEx(NETDFS_Q_DFS_ENUMEX *v, uint32 level, uint32 bufsize, NETDFS_DFS_ENUMSTRUCT *info, uint32 *total, const char *dfs_name) -{ - DEBUG(5,("init_netdfs_q_dfs_EnumEx\n")); - - if (!dfs_name) - return False; - - init_unistr2(&v->dfs_name, dfs_name, UNI_STR_TERMINATE); - - v->level = level; - - v->bufsize = bufsize; - - if (info) { - v->ptr0_info = 1; - v->info = *info; - } else { - v->ptr0_info = 0; - } - - if (total) { - v->ptr0_total = 1; - v->total = *total; - } else { - v->ptr0_total = 0; - } - - return True; -} - -BOOL netdfs_io_q_dfs_EnumEx(const char *desc, NETDFS_Q_DFS_ENUMEX *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_EnumEx"); - depth++; - if (!prs_align_custom(ps, 4)) - return False; - - if (!smb_io_unistr2("dfs_name", &v->dfs_name, 1, ps, depth)) - return False; - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("level", ps, depth, &v->level)) - return False; - - if (!prs_uint32("bufsize", ps, depth, &v->bufsize)) - return False; - - if (!prs_uint32("ptr0_info", ps, depth, &v->ptr0_info)) - return False; - - if (v->ptr0_info) { - if (!netdfs_io_dfs_EnumStruct_p("info", &v->info, ps, depth)) - return False; - if (!netdfs_io_dfs_EnumStruct_d("info", &v->info, ps, depth)) - return False; - } - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("ptr0_total", ps, depth, &v->ptr0_total)) - return False; - - if (v->ptr0_total) { - if (!prs_uint32("total", ps, depth, &v->total)) - return False; - } - - return True; -} - -BOOL init_netdfs_r_dfs_EnumEx(NETDFS_R_DFS_ENUMEX *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_EnumEx\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_EnumEx(const char *desc, NETDFS_R_DFS_ENUMEX *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_EnumEx"); - depth++; - if (!prs_uint32("ptr0_info", ps, depth, &v->ptr0_info)) - return False; - - if (v->ptr0_info) { - if (!netdfs_io_dfs_EnumStruct_p("info", &v->info, ps, depth)) - return False; - if (!netdfs_io_dfs_EnumStruct_d("info", &v->info, ps, depth)) - return False; - } - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_uint32("ptr0_total", ps, depth, &v->ptr0_total)) - return False; - - if (v->ptr0_total) { - if (!prs_uint32("total", ps, depth, &v->total)) - return False; - } - - if (!prs_align_custom(ps, 4)) - return False; - - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; - - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - -BOOL init_netdfs_q_dfs_SetInfo2(NETDFS_Q_DFS_SETINFO2 *v) -{ - DEBUG(5,("init_netdfs_q_dfs_SetInfo2\n")); - - return True; -} - -BOOL netdfs_io_q_dfs_SetInfo2(const char *desc, NETDFS_Q_DFS_SETINFO2 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_q_dfs_SetInfo2"); - depth++; - return True; -} - -BOOL init_netdfs_r_dfs_SetInfo2(NETDFS_R_DFS_SETINFO2 *v, WERROR status) -{ - DEBUG(5,("init_netdfs_r_dfs_SetInfo2\n")); - - v->status = status; - - return True; -} - -BOOL netdfs_io_r_dfs_SetInfo2(const char *desc, NETDFS_R_DFS_SETINFO2 *v, prs_struct *ps, int depth) -{ - if (v == NULL) - return False; - - prs_debug(ps, depth, desc, "netdfs_io_r_dfs_SetInfo2"); - depth++; - if (!prs_werror("status", ps, depth, &v->status)) - return False; - - return True; -} - diff --git a/source3/rpc_server/srv_dfs.c b/source3/rpc_server/srv_dfs.c deleted file mode 100644 index 44a9c06a3c..0000000000 --- a/source3/rpc_server/srv_dfs.c +++ /dev/null @@ -1,602 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "nterr.h" - -#undef DBGC_CLASS -#define DBGC_CLASS DBGC_RPC - -/****************************************************************** - api_dfs_GetManagerVersion - *****************************************************************/ - -static BOOL api_dfs_GetManagerVersion(pipes_struct *p) -{ - NETDFS_Q_DFS_GETMANAGERVERSION q_u; - NETDFS_R_DFS_GETMANAGERVERSION r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_GetManagerVersion("", &q_u, data, 0)) - return False; - - _dfs_GetManagerVersion(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_GetManagerVersion("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_Add - *****************************************************************/ - -static BOOL api_dfs_Add(pipes_struct *p) -{ - NETDFS_Q_DFS_ADD q_u; - NETDFS_R_DFS_ADD r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_Add("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_Add(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_Add("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_Remove - *****************************************************************/ - -static BOOL api_dfs_Remove(pipes_struct *p) -{ - NETDFS_Q_DFS_REMOVE q_u; - NETDFS_R_DFS_REMOVE r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_Remove("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_Remove(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_Remove("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_SetInfo - *****************************************************************/ - -static BOOL api_dfs_SetInfo(pipes_struct *p) -{ - NETDFS_Q_DFS_SETINFO q_u; - NETDFS_R_DFS_SETINFO r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_SetInfo("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_SetInfo(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_SetInfo("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_GetInfo - *****************************************************************/ - -static BOOL api_dfs_GetInfo(pipes_struct *p) -{ - NETDFS_Q_DFS_GETINFO q_u; - NETDFS_R_DFS_GETINFO r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_GetInfo("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_GetInfo(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_GetInfo("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_Enum - *****************************************************************/ - -static BOOL api_dfs_Enum(pipes_struct *p) -{ - NETDFS_Q_DFS_ENUM q_u; - NETDFS_R_DFS_ENUM r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_Enum("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_Enum(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_Enum("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_Rename - *****************************************************************/ - -static BOOL api_dfs_Rename(pipes_struct *p) -{ - NETDFS_Q_DFS_RENAME q_u; - NETDFS_R_DFS_RENAME r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_Rename("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_Rename(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_Rename("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_Move - *****************************************************************/ - -static BOOL api_dfs_Move(pipes_struct *p) -{ - NETDFS_Q_DFS_MOVE q_u; - NETDFS_R_DFS_MOVE r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_Move("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_Move(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_Move("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_ManagerGetConfigInfo - *****************************************************************/ - -static BOOL api_dfs_ManagerGetConfigInfo(pipes_struct *p) -{ - NETDFS_Q_DFS_MANAGERGETCONFIGINFO q_u; - NETDFS_R_DFS_MANAGERGETCONFIGINFO r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_ManagerGetConfigInfo("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_ManagerGetConfigInfo(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_ManagerGetConfigInfo("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_ManagerSendSiteInfo - *****************************************************************/ - -static BOOL api_dfs_ManagerSendSiteInfo(pipes_struct *p) -{ - NETDFS_Q_DFS_MANAGERSENDSITEINFO q_u; - NETDFS_R_DFS_MANAGERSENDSITEINFO r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_ManagerSendSiteInfo("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_ManagerSendSiteInfo(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_ManagerSendSiteInfo("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_AddFtRoot - *****************************************************************/ - -static BOOL api_dfs_AddFtRoot(pipes_struct *p) -{ - NETDFS_Q_DFS_ADDFTROOT q_u; - NETDFS_R_DFS_ADDFTROOT r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_AddFtRoot("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_AddFtRoot(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_AddFtRoot("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_RemoveFtRoot - *****************************************************************/ - -static BOOL api_dfs_RemoveFtRoot(pipes_struct *p) -{ - NETDFS_Q_DFS_REMOVEFTROOT q_u; - NETDFS_R_DFS_REMOVEFTROOT r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_RemoveFtRoot("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_RemoveFtRoot(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_RemoveFtRoot("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_AddStdRoot - *****************************************************************/ - -static BOOL api_dfs_AddStdRoot(pipes_struct *p) -{ - NETDFS_Q_DFS_ADDSTDROOT q_u; - NETDFS_R_DFS_ADDSTDROOT r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_AddStdRoot("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_AddStdRoot(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_AddStdRoot("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_RemoveStdRoot - *****************************************************************/ - -static BOOL api_dfs_RemoveStdRoot(pipes_struct *p) -{ - NETDFS_Q_DFS_REMOVESTDROOT q_u; - NETDFS_R_DFS_REMOVESTDROOT r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_RemoveStdRoot("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_RemoveStdRoot(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_RemoveStdRoot("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_ManagerInitialize - *****************************************************************/ - -static BOOL api_dfs_ManagerInitialize(pipes_struct *p) -{ - NETDFS_Q_DFS_MANAGERINITIALIZE q_u; - NETDFS_R_DFS_MANAGERINITIALIZE r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_ManagerInitialize("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_ManagerInitialize(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_ManagerInitialize("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_AddStdRootForced - *****************************************************************/ - -static BOOL api_dfs_AddStdRootForced(pipes_struct *p) -{ - NETDFS_Q_DFS_ADDSTDROOTFORCED q_u; - NETDFS_R_DFS_ADDSTDROOTFORCED r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_AddStdRootForced("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_AddStdRootForced(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_AddStdRootForced("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_GetDcAddress - *****************************************************************/ - -static BOOL api_dfs_GetDcAddress(pipes_struct *p) -{ - NETDFS_Q_DFS_GETDCADDRESS q_u; - NETDFS_R_DFS_GETDCADDRESS r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_GetDcAddress("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_GetDcAddress(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_GetDcAddress("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_SetDcAddress - *****************************************************************/ - -static BOOL api_dfs_SetDcAddress(pipes_struct *p) -{ - NETDFS_Q_DFS_SETDCADDRESS q_u; - NETDFS_R_DFS_SETDCADDRESS r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_SetDcAddress("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_SetDcAddress(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_SetDcAddress("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_FlushFtTable - *****************************************************************/ - -static BOOL api_dfs_FlushFtTable(pipes_struct *p) -{ - NETDFS_Q_DFS_FLUSHFTTABLE q_u; - NETDFS_R_DFS_FLUSHFTTABLE r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_FlushFtTable("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_FlushFtTable(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_FlushFtTable("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_Add2 - *****************************************************************/ - -static BOOL api_dfs_Add2(pipes_struct *p) -{ - NETDFS_Q_DFS_ADD2 q_u; - NETDFS_R_DFS_ADD2 r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_Add2("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_Add2(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_Add2("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_Remove2 - *****************************************************************/ - -static BOOL api_dfs_Remove2(pipes_struct *p) -{ - NETDFS_Q_DFS_REMOVE2 q_u; - NETDFS_R_DFS_REMOVE2 r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_Remove2("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_Remove2(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_Remove2("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_EnumEx - *****************************************************************/ - -static BOOL api_dfs_EnumEx(pipes_struct *p) -{ - NETDFS_Q_DFS_ENUMEX q_u; - NETDFS_R_DFS_ENUMEX r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_EnumEx("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_EnumEx(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_EnumEx("", &r_u, rdata, 0)) - return False; - - return True; -} -/****************************************************************** - api_dfs_SetInfo2 - *****************************************************************/ - -static BOOL api_dfs_SetInfo2(pipes_struct *p) -{ - NETDFS_Q_DFS_SETINFO2 q_u; - NETDFS_R_DFS_SETINFO2 r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!netdfs_io_q_dfs_SetInfo2("", &q_u, data, 0)) - return False; - - r_u.status = _dfs_SetInfo2(p, &q_u, &r_u); - - if (!netdfs_io_r_dfs_SetInfo2("", &r_u, rdata, 0)) - return False; - - return True; -} - -/* Tables */ -static struct api_struct api_netdfs_cmds[] = -{ - {"DFS_GETMANAGERVERSION", DFS_GETMANAGERVERSION, api_dfs_GetManagerVersion}, - {"DFS_ADD", DFS_ADD, api_dfs_Add}, - {"DFS_REMOVE", DFS_REMOVE, api_dfs_Remove}, - {"DFS_SETINFO", DFS_SETINFO, api_dfs_SetInfo}, - {"DFS_GETINFO", DFS_GETINFO, api_dfs_GetInfo}, - {"DFS_ENUM", DFS_ENUM, api_dfs_Enum}, - {"DFS_RENAME", DFS_RENAME, api_dfs_Rename}, - {"DFS_MOVE", DFS_MOVE, api_dfs_Move}, - {"DFS_MANAGERGETCONFIGINFO", DFS_MANAGERGETCONFIGINFO, api_dfs_ManagerGetConfigInfo}, - {"DFS_MANAGERSENDSITEINFO", DFS_MANAGERSENDSITEINFO, api_dfs_ManagerSendSiteInfo}, - {"DFS_ADDFTROOT", DFS_ADDFTROOT, api_dfs_AddFtRoot}, - {"DFS_REMOVEFTROOT", DFS_REMOVEFTROOT, api_dfs_RemoveFtRoot}, - {"DFS_ADDSTDROOT", DFS_ADDSTDROOT, api_dfs_AddStdRoot}, - {"DFS_REMOVESTDROOT", DFS_REMOVESTDROOT, api_dfs_RemoveStdRoot}, - {"DFS_MANAGERINITIALIZE", DFS_MANAGERINITIALIZE, api_dfs_ManagerInitialize}, - {"DFS_ADDSTDROOTFORCED", DFS_ADDSTDROOTFORCED, api_dfs_AddStdRootForced}, - {"DFS_GETDCADDRESS", DFS_GETDCADDRESS, api_dfs_GetDcAddress}, - {"DFS_SETDCADDRESS", DFS_SETDCADDRESS, api_dfs_SetDcAddress}, - {"DFS_FLUSHFTTABLE", DFS_FLUSHFTTABLE, api_dfs_FlushFtTable}, - {"DFS_ADD2", DFS_ADD2, api_dfs_Add2}, - {"DFS_REMOVE2", DFS_REMOVE2, api_dfs_Remove2}, - {"DFS_ENUMEX", DFS_ENUMEX, api_dfs_EnumEx}, - {"DFS_SETINFO2", DFS_SETINFO2, api_dfs_SetInfo2}, -}; - -void netdfs_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_netdfs_cmds; - *n_fns = sizeof(api_netdfs_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_netdfs_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "netdfs", "netdfs", api_netdfs_cmds, sizeof(api_netdfs_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/rpc_server/srv_dfs_nt.c b/source3/rpc_server/srv_dfs_nt.c index abdd9e8f23..4a5aad58b9 100644 --- a/source3/rpc_server/srv_dfs_nt.c +++ b/source3/rpc_server/srv_dfs_nt.c @@ -3,7 +3,7 @@ * RPC Pipe client / server routines for Dfs * Copyright (C) Shirish Kalele 2000. * Copyright (C) Jeremy Allison 2001. - * Copyright (C) Jelmer Vernooij 2005. + * Copyright (C) Jelmer Vernooij 2005-2006. * * 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 @@ -30,21 +30,20 @@ /* This function does not return a WERROR or NTSTATUS code but rather 1 if dfs exists, or 0 otherwise. */ -uint32 _dfs_GetManagerVersion(pipes_struct *p, NETDFS_Q_DFS_GETMANAGERVERSION *q_u, NETDFS_R_DFS_GETMANAGERVERSION *r_u) +void _dfs_GetManagerVersion(pipes_struct *p, uint32 *exists) { if(lp_host_msdfs()) - return 1; + *exists = 1; else - return 0; + *exists = 0; } -WERROR _dfs_Add(pipes_struct *p, NETDFS_Q_DFS_ADD* q_u, NETDFS_R_DFS_ADD *r_u) +WERROR _dfs_Add(pipes_struct *p, const char *path, const char *server, const char *share, const char *comment, uint32_t flags) { struct junction_map jn; struct referral* old_referral_list = NULL; BOOL exists = False; - pstring dfspath, servername, sharename; pstring altpath; if (p->pipe_user.ut.uid != 0) { @@ -52,19 +51,15 @@ WERROR _dfs_Add(pipes_struct *p, NETDFS_Q_DFS_ADD* q_u, NETDFS_R_DFS_ADD *r_u) return WERR_ACCESS_DENIED; } - unistr2_to_ascii(dfspath, &q_u->path, sizeof(dfspath)-1); - unistr2_to_ascii(servername, &q_u->server, sizeof(servername)-1); - unistr2_to_ascii(sharename, &q_u->share, sizeof(sharename)-1); - DEBUG(5,("init_reply_dfs_add: Request to add %s -> %s\\%s.\n", - dfspath, servername, sharename)); + path, server, share)); - pstrcpy(altpath, servername); + pstrcpy(altpath, server); pstrcat(altpath, "\\"); - pstrcat(altpath, sharename); + pstrcat(altpath, share); /* The following call can change the cwd. */ - if(get_referred_path(p->mem_ctx, dfspath, &jn, NULL, NULL)) { + if(get_referred_path(p->mem_ctx, path, &jn, NULL, NULL)) { exists = True; jn.referral_count += 1; old_referral_list = jn.referral_list; @@ -98,13 +93,11 @@ WERROR _dfs_Add(pipes_struct *p, NETDFS_Q_DFS_ADD* q_u, NETDFS_R_DFS_ADD *r_u) return WERR_OK; } -WERROR _dfs_Remove(pipes_struct *p, NETDFS_Q_DFS_REMOVE *q_u, - NETDFS_R_DFS_REMOVE *r_u) +WERROR _dfs_Remove(pipes_struct *p, const char *path, const char *server, const char *share) { struct junction_map jn; BOOL found = False; - pstring dfspath, servername, sharename; pstring altpath; if (p->pipe_user.ut.uid != 0) { @@ -112,31 +105,22 @@ WERROR _dfs_Remove(pipes_struct *p, NETDFS_Q_DFS_REMOVE *q_u, return WERR_ACCESS_DENIED; } - unistr2_to_ascii(dfspath, &q_u->path, sizeof(dfspath)-1); - if(q_u->ptr0_server) { - unistr2_to_ascii(servername, &q_u->server, sizeof(servername)-1); - } - - if(q_u->ptr0_share) { - unistr2_to_ascii(sharename, &q_u->share, sizeof(sharename)-1); - } - - if(q_u->ptr0_server && q_u->ptr0_share) { - pstrcpy(altpath, servername); + if(server && share) { + pstrcpy(altpath, server); pstrcat(altpath, "\\"); - pstrcat(altpath, sharename); + pstrcat(altpath, share); strlower_m(altpath); } DEBUG(5,("init_reply_dfs_remove: Request to remove %s -> %s\\%s.\n", - dfspath, servername, sharename)); + path, server, share)); - if(!get_referred_path(p->mem_ctx, dfspath, &jn, NULL, NULL)) { + if(!get_referred_path(p->mem_ctx, path, &jn, NULL, NULL)) { return WERR_DFS_NO_SUCH_VOL; } /* if no server-share pair given, remove the msdfs link completely */ - if(!q_u->ptr0_server && !q_u->ptr0_share) { + if(!server && !share) { if(!remove_msdfs_link(&jn)) { vfs_ChDir(p->conn,p->conn->connectpath); return WERR_DFS_NO_SUCH_VOL; @@ -181,61 +165,50 @@ WERROR _dfs_Remove(pipes_struct *p, NETDFS_Q_DFS_REMOVE *q_u, return WERR_OK; } -static BOOL init_reply_dfs_info_1(struct junction_map* j, NETDFS_DFS_INFO1* dfs1) +static BOOL init_reply_dfs_info_1(TALLOC_CTX *mem_ctx, struct junction_map* j, struct dfs_Info1* dfs1) { - pstring str; - dfs1->ptr0_path = 1; - slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname(), - j->service_name, j->volume_name); - DEBUG(5,("init_reply_dfs_info_1: initing entrypath: %s\n",str)); - init_unistr2(&dfs1->path,str,UNI_STR_TERMINATE); + dfs1->path = talloc_asprintf(mem_ctx, + "\\\\%s\\%s\\%s", global_myname(), + j->service_name, j->volume_name); + DEBUG(5,("init_reply_dfs_info_1: initing entrypath: %s\n",dfs1->path)); return True; } -static BOOL init_reply_dfs_info_2(struct junction_map* j, NETDFS_DFS_INFO2* dfs2) +static BOOL init_reply_dfs_info_2(TALLOC_CTX *mem_ctx, struct junction_map* j, struct dfs_Info2* dfs2) { - pstring str; - dfs2->ptr0_path = 1; - slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname(), - j->service_name, j->volume_name); - init_unistr2(&dfs2->path, str, UNI_STR_TERMINATE); - dfs2->ptr0_comment = 0; - init_unistr2(&dfs2->comment, j->comment, UNI_STR_TERMINATE); + dfs2->path = talloc_asprintf(mem_ctx, + "\\\\%s\\%s\\%s", global_myname(), j->service_name, j->volume_name); + dfs2->comment = talloc_strdup(mem_ctx, j->comment); dfs2->state = 1; /* set up state of dfs junction as OK */ dfs2->num_stores = j->referral_count; return True; } -static BOOL init_reply_dfs_info_3(TALLOC_CTX *ctx, struct junction_map* j, NETDFS_DFS_INFO3* dfs3) +static BOOL init_reply_dfs_info_3(TALLOC_CTX *mem_ctx, struct junction_map* j, struct dfs_Info3* dfs3) { int ii; - pstring str; - dfs3->ptr0_path = 1; if (j->volume_name[0] == '\0') - slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s", + dfs3->path = talloc_asprintf(mem_ctx, "\\\\%s\\%s", global_myname(), j->service_name); else - slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname(), + dfs3->path = talloc_asprintf(mem_ctx, "\\\\%s\\%s\\%s", global_myname(), j->service_name, j->volume_name); - init_unistr2(&dfs3->path, str, UNI_STR_TERMINATE); - dfs3->ptr0_comment = 1; - init_unistr2(&dfs3->comment, j->comment, UNI_STR_TERMINATE); + dfs3->comment = talloc_strdup(mem_ctx, j->comment); dfs3->state = 1; - dfs3->num_stores = dfs3->size_stores = j->referral_count; - dfs3->ptr0_stores = 1; + dfs3->num_stores = j->referral_count; /* also enumerate the stores */ - dfs3->stores = TALLOC_ARRAY(ctx, NETDFS_DFS_STORAGEINFO, j->referral_count); + dfs3->stores = TALLOC_ARRAY(mem_ctx, struct dfs_StorageInfo, j->referral_count); if (!dfs3->stores) return False; - memset(dfs3->stores, '\0', j->referral_count * sizeof(NETDFS_DFS_STORAGEINFO)); + memset(dfs3->stores, '\0', j->referral_count * sizeof(struct dfs_StorageInfo)); for(ii=0;ii<j->referral_count;ii++) { char* p; pstring path; - NETDFS_DFS_STORAGEINFO* stor = &(dfs3->stores[ii]); + struct dfs_StorageInfo* stor = &(dfs3->stores[ii]); struct referral* ref = &(j->referral_list[ii]); pstrcpy(path, ref->alternate_path); @@ -248,24 +221,21 @@ static BOOL init_reply_dfs_info_3(TALLOC_CTX *ctx, struct junction_map* j, NETDF *p = '\0'; DEBUG(5,("storage %d: %s.%s\n",ii,path,p+1)); stor->state = 2; /* set all stores as ONLINE */ - init_unistr2(&stor->server, path, UNI_STR_TERMINATE); - init_unistr2(&stor->share, p+1, UNI_STR_TERMINATE); - stor->ptr0_server = stor->ptr0_share = 1; + stor->server = talloc_strdup(mem_ctx, path); + stor->share = talloc_strdup(mem_ctx, p+1); } return True; } -static BOOL init_reply_dfs_info_100(struct junction_map* j, NETDFS_DFS_INFO100* dfs100) +static BOOL init_reply_dfs_info_100(TALLOC_CTX *mem_ctx, struct junction_map* j, struct dfs_Info100* dfs100) { - dfs100->ptr0_comment = 1; - init_unistr2(&dfs100->comment, j->comment, UNI_STR_TERMINATE); + dfs100->comment = talloc_strdup(mem_ctx, j->comment); return True; } -WERROR _dfs_Enum(pipes_struct *p, NETDFS_Q_DFS_ENUM *q_u, NETDFS_R_DFS_ENUM *r_u) +WERROR _dfs_Enum(pipes_struct *p, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct *info, uint32_t *unknown, uint32_t *total) { - uint32 level = q_u->level; struct junction_map jn[MAX_MSDFS_JUNCTIONS]; int num_jn = 0; int i; @@ -275,37 +245,27 @@ WERROR _dfs_Enum(pipes_struct *p, NETDFS_Q_DFS_ENUM *q_u, NETDFS_R_DFS_ENUM *r_u DEBUG(5,("_dfs_Enum: %d junctions found in Dfs, doing level %d\n", num_jn, level)); - r_u->ptr0_info = q_u->ptr0_info; - r_u->ptr0_total = q_u->ptr0_total; - r_u->total = num_jn; - - r_u->info = q_u->info; + *total = num_jn; /* Create the return array */ switch (level) { case 1: - if ((r_u->info.e.u.info1.s = TALLOC_ARRAY(p->mem_ctx, NETDFS_DFS_INFO1, num_jn)) == NULL) { + if ((info->e.info1->s = TALLOC_ARRAY(p->mem_ctx, struct dfs_Info1, num_jn)) == NULL) { return WERR_NOMEM; } - r_u->info.e.u.info1.count = num_jn; - r_u->info.e.u.info1.ptr0_s = 1; - r_u->info.e.u.info1.size_s = num_jn; + info->e.info1->count = num_jn; break; case 2: - if ((r_u->info.e.u.info2.s = TALLOC_ARRAY(p->mem_ctx, NETDFS_DFS_INFO2, num_jn)) == NULL) { + if ((info->e.info2->s = TALLOC_ARRAY(p->mem_ctx, struct dfs_Info2, num_jn)) == NULL) { return WERR_NOMEM; } - r_u->info.e.u.info2.count = num_jn; - r_u->info.e.u.info2.ptr0_s = 1; - r_u->info.e.u.info2.size_s = num_jn; + info->e.info2->count = num_jn; break; case 3: - if ((r_u->info.e.u.info3.s = TALLOC_ARRAY(p->mem_ctx, NETDFS_DFS_INFO3, num_jn)) == NULL) { + if ((info->e.info3->s = TALLOC_ARRAY(p->mem_ctx, struct dfs_Info3, num_jn)) == NULL) { return WERR_NOMEM; } - r_u->info.e.u.info3.count = num_jn; - r_u->info.e.u.info3.ptr0_s = 1; - r_u->info.e.u.info3.size_s = num_jn; + info->e.info3->count = num_jn; break; default: return WERR_INVALID_PARAM; @@ -314,35 +274,28 @@ WERROR _dfs_Enum(pipes_struct *p, NETDFS_Q_DFS_ENUM *q_u, NETDFS_R_DFS_ENUM *r_u for (i = 0; i < num_jn; i++) { switch (level) { case 1: - init_reply_dfs_info_1(&jn[i], &r_u->info.e.u.info1.s[i]); + init_reply_dfs_info_1(p->mem_ctx, &jn[i], &info->e.info1->s[i]); break; case 2: - init_reply_dfs_info_2(&jn[i], &r_u->info.e.u.info2.s[i]); + init_reply_dfs_info_2(p->mem_ctx, &jn[i], &info->e.info2->s[i]); break; case 3: - init_reply_dfs_info_3(p->mem_ctx, &jn[i], &r_u->info.e.u.info3.s[i]); + init_reply_dfs_info_3(p->mem_ctx, &jn[i], &info->e.info3->s[i]); break; default: return WERR_INVALID_PARAM; } } - r_u->status = WERR_OK; - - return r_u->status; + return WERR_OK; } -WERROR _dfs_GetInfo(pipes_struct *p, NETDFS_Q_DFS_GETINFO *q_u, - NETDFS_R_DFS_GETINFO *r_u) +WERROR _dfs_GetInfo(pipes_struct *p, const char *path, const char *server, const char *share, uint32_t level, union dfs_Info *info) { - UNISTR2* uni_path = &q_u->path; - uint32 level = q_u->level; int consumedcnt = sizeof(pstring); - pstring path; - BOOL ret = False; struct junction_map jn; + BOOL ret; - unistr2_to_ascii(path, uni_path, sizeof(path)-1); if(!create_junction(path, &jn)) return WERR_DFS_NO_SUCH_SERVER; @@ -353,132 +306,126 @@ WERROR _dfs_GetInfo(pipes_struct *p, NETDFS_Q_DFS_GETINFO *q_u, } vfs_ChDir(p->conn,p->conn->connectpath); - r_u->info.switch_value = level; - r_u->info.ptr0 = 1; - r_u->status = WERR_OK; switch (level) { - case 1: ret = init_reply_dfs_info_1(&jn, &r_u->info.u.info1); break; - case 2: ret = init_reply_dfs_info_2(&jn, &r_u->info.u.info2); break; - case 3: ret = init_reply_dfs_info_3(p->mem_ctx, &jn, &r_u->info.u.info3); break; - case 100: ret = init_reply_dfs_info_100(&jn, &r_u->info.u.info100); break; + case 1: ret = init_reply_dfs_info_1(p->mem_ctx, &jn, info->info1); break; + case 2: ret = init_reply_dfs_info_2(p->mem_ctx, &jn, info->info2); break; + case 3: ret = init_reply_dfs_info_3(p->mem_ctx, &jn, info->info3); break; + case 100: ret = init_reply_dfs_info_100(p->mem_ctx, &jn, info->info100); break; default: - r_u->info.ptr0 = 1; - r_u->info.switch_value = 0; - r_u->status = WERR_OK; - ret = True; - break; + info->info1 = NULL; + return WERR_INVALID_PARAM; } if (!ret) - r_u->status = WERR_INVALID_PARAM; + return WERR_INVALID_PARAM; - return r_u->status; + return WERR_OK; } -WERROR _dfs_SetInfo(pipes_struct *p, NETDFS_Q_DFS_SETINFO *q_u, NETDFS_R_DFS_SETINFO *r_u) +WERROR _dfs_SetInfo(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_Rename(pipes_struct *p, NETDFS_Q_DFS_RENAME *q_u, NETDFS_R_DFS_RENAME *r_u) +WERROR _dfs_Rename(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_Move(pipes_struct *p, NETDFS_Q_DFS_MOVE *q_u, NETDFS_R_DFS_MOVE *r_u) +WERROR _dfs_Move(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_ManagerGetConfigInfo(pipes_struct *p, NETDFS_Q_DFS_MANAGERGETCONFIGINFO *q_u, NETDFS_R_DFS_MANAGERGETCONFIGINFO *r_u) +WERROR _dfs_ManagerGetConfigInfo(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_ManagerSendSiteInfo(pipes_struct *p, NETDFS_Q_DFS_MANAGERSENDSITEINFO *q_u, NETDFS_R_DFS_MANAGERSENDSITEINFO *r_u) +WERROR _dfs_ManagerSendSiteInfo(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_AddFtRoot(pipes_struct *p, NETDFS_Q_DFS_ADDFTROOT *q_u, NETDFS_R_DFS_ADDFTROOT *r_u) +WERROR _dfs_AddFtRoot(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_RemoveFtRoot(pipes_struct *p, NETDFS_Q_DFS_REMOVEFTROOT *q_u, NETDFS_R_DFS_REMOVEFTROOT *r_u) +WERROR _dfs_RemoveFtRoot(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_AddStdRoot(pipes_struct *p, NETDFS_Q_DFS_ADDSTDROOT *q_u, NETDFS_R_DFS_ADDSTDROOT *r_u) +WERROR _dfs_AddStdRoot(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_RemoveStdRoot(pipes_struct *p, NETDFS_Q_DFS_REMOVESTDROOT *q_u, NETDFS_R_DFS_REMOVESTDROOT *r_u) +WERROR _dfs_RemoveStdRoot(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_ManagerInitialize(pipes_struct *p, NETDFS_Q_DFS_MANAGERINITIALIZE *q_u, NETDFS_R_DFS_MANAGERINITIALIZE *r_u) +WERROR _dfs_ManagerInitialize(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_AddStdRootForced(pipes_struct *p, NETDFS_Q_DFS_ADDSTDROOTFORCED *q_u, NETDFS_R_DFS_ADDSTDROOTFORCED *r_u) +WERROR _dfs_AddStdRootForced(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_GetDcAddress(pipes_struct *p, NETDFS_Q_DFS_GETDCADDRESS *q_u, NETDFS_R_DFS_GETDCADDRESS *r_u) +WERROR _dfs_GetDcAddress(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_SetDcAddress(pipes_struct *p, NETDFS_Q_DFS_SETDCADDRESS *q_u, NETDFS_R_DFS_SETDCADDRESS *r_u) +WERROR _dfs_SetDcAddress(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_FlushFtTable(pipes_struct *p, NETDFS_Q_DFS_FLUSHFTTABLE *q_u, NETDFS_R_DFS_FLUSHFTTABLE *r_u) +WERROR _dfs_FlushFtTable(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_Add2(pipes_struct *p, NETDFS_Q_DFS_ADD2 *q_u, NETDFS_R_DFS_ADD2 *r_u) +WERROR _dfs_Add2(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_Remove2(pipes_struct *p, NETDFS_Q_DFS_REMOVE2 *q_u, NETDFS_R_DFS_REMOVE2 *r_u) +WERROR _dfs_Remove2(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_EnumEx(pipes_struct *p, NETDFS_Q_DFS_ENUMEX *q_u, NETDFS_R_DFS_ENUMEX *r_u) +WERROR _dfs_EnumEx(pipes_struct *p, const char *name, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct *info, uint32_t *total) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; } -WERROR _dfs_SetInfo2(pipes_struct *p, NETDFS_Q_DFS_SETINFO2 *q_u, NETDFS_R_DFS_SETINFO2 *r_u) +WERROR _dfs_SetInfo2(pipes_struct *p) { /* FIXME: Implement your code here */ return WERR_NOT_SUPPORTED; diff --git a/source3/script/build_idl.sh b/source3/script/build_idl.sh index 29c1d5f436..627ab8c8be 100644 --- a/source3/script/build_idl.sh +++ b/source3/script/build_idl.sh @@ -1,6 +1,6 @@ #!/bin/sh -PIDL_ARGS="--outputdir librpc/gen_ndr --header --ndr-parser --samba3-ndr-client --" +PIDL_ARGS="--outputdir librpc/gen_ndr --header --ndr-parser --samba3-ndr-server --samba3-ndr-client --" PIDL_EXTRA_ARGS="$*" oldpwd=`pwd` diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 44415ddd16..1f04356b4f 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -30,7 +30,7 @@ extern uint32 global_client_caps; into the dfs_path structure **********************************************************************/ -static BOOL parse_dfs_path(char *pathname, struct dfs_path *pdp) +static BOOL parse_dfs_path(const char *pathname, struct dfs_path *pdp) { pstring pathname_local; char *p, *temp; @@ -317,7 +317,8 @@ TALLOC_CTX can be NULL here if struct referral **reflistpp, int *refcntp are also NULL. *****************************************************************/ -static BOOL resolve_dfs_path(TALLOC_CTX *ctx, pstring dfspath, struct dfs_path *dp, +static BOOL resolve_dfs_path(TALLOC_CTX *ctx, const char *dfspath, + struct dfs_path *dp, connection_struct *conn, BOOL search_flag, struct referral **reflistpp, int *refcntp, BOOL *self_referralp, int *consumedcntp) @@ -459,7 +460,7 @@ BOOL dfs_redirect( pstring pathname, connection_struct *conn, BOOL search_wcard_ Return a self referral. **********************************************************************/ -static BOOL self_ref(TALLOC_CTX *ctx, char *pathname, struct junction_map *jucn, +static BOOL self_ref(TALLOC_CTX *ctx, const char *pathname, struct junction_map *jucn, int *consumedcntp, BOOL *self_referralp) { struct referral *ref; @@ -490,7 +491,7 @@ static BOOL self_ref(TALLOC_CTX *ctx, char *pathname, struct junction_map *jucn, junction_map structure. **********************************************************************/ -BOOL get_referred_path(TALLOC_CTX *ctx, char *pathname, struct junction_map *jucn, +BOOL get_referred_path(TALLOC_CTX *ctx, const char *pathname, struct junction_map *jucn, int *consumedcntp, BOOL *self_referralp) { struct dfs_path dp; @@ -880,7 +881,7 @@ int setup_dfs_referral(connection_struct *orig_conn, char *pathname, int max_ref Creates a junction structure from a Dfs pathname **********************************************************************/ -BOOL create_junction(char *pathname, struct junction_map *jucn) +BOOL create_junction(const char *pathname, struct junction_map *jucn) { struct dfs_path dp; |