diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-11-19 18:22:20 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:15:56 -0500 |
commit | 3372adce58070febd728ee0f941e48d69acc40b4 (patch) | |
tree | 2515cc2a0b065567a3c667ee62a14abde8b7277f | |
parent | 28a01d3fdff813a20f28b7f9cadea658a0ae9c23 (diff) | |
download | samba-3372adce58070febd728ee0f941e48d69acc40b4.tar.gz samba-3372adce58070febd728ee0f941e48d69acc40b4.tar.bz2 samba-3372adce58070febd728ee0f941e48d69acc40b4.zip |
r19794: Convert DFS
(This used to be commit 2efd3b35097a780ce99abad8a10eca536f37fc26)
-rw-r--r-- | source3/librpc/gen_ndr/cli_dfs.c | 28 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/cli_dfs.h | 4 | ||||
-rw-r--r-- | source3/rpcclient/cmd_dfs.c | 13 |
3 files changed, 20 insertions, 25 deletions
diff --git a/source3/librpc/gen_ndr/cli_dfs.c b/source3/librpc/gen_ndr/cli_dfs.c index a5f4e681e0..fd722e1cce 100644 --- a/source3/librpc/gen_ndr/cli_dfs.c +++ b/source3/librpc/gen_ndr/cli_dfs.c @@ -165,7 +165,7 @@ NTSTATUS rpccli_dfs_GetInfo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, co return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct *info, uint32_t *unknown, uint32_t *total) +NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct **info, uint32_t *unknown, uint32_t **total) { struct dfs_Enum r; NTSTATUS status; @@ -173,9 +173,9 @@ NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint3 /* In parameters */ r.in.level = level; r.in.bufsize = bufsize; - r.in.info = info; + r.in.info = *info; r.in.unknown = unknown; - r.in.total = total; + r.in.total = *total; if (DEBUGLEVEL >= 10) NDR_PRINT_IN_DEBUG(dfs_Enum, &r); @@ -194,12 +194,8 @@ NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint3 } /* Return variables */ - if ( info ) { - *info = *r.out.info; - } - if ( total ) { - *total = *r.out.total; - } + *info = r.out.info; + *total = r.out.total; /* Return result */ return werror_to_ntstatus(r.out.result); @@ -640,7 +636,7 @@ NTSTATUS rpccli_dfs_Remove2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx) return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *name, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct *info, uint32_t *total) +NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *name, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct **info, uint32_t **total) { struct dfs_EnumEx r; NTSTATUS status; @@ -649,8 +645,8 @@ NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, con r.in.name = name; r.in.level = level; r.in.bufsize = bufsize; - r.in.info = info; - r.in.total = total; + r.in.info = *info; + r.in.total = *total; if (DEBUGLEVEL >= 10) NDR_PRINT_IN_DEBUG(dfs_EnumEx, &r); @@ -669,12 +665,8 @@ NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, con } /* Return variables */ - if ( info ) { - *info = *r.out.info; - } - if ( total ) { - *total = *r.out.total; - } + *info = r.out.info; + *total = r.out.total; /* Return result */ return werror_to_ntstatus(r.out.result); diff --git a/source3/librpc/gen_ndr/cli_dfs.h b/source3/librpc/gen_ndr/cli_dfs.h index 9f310741d5..b0ec188795 100644 --- a/source3/librpc/gen_ndr/cli_dfs.h +++ b/source3/librpc/gen_ndr/cli_dfs.h @@ -6,7 +6,7 @@ NTSTATUS rpccli_dfs_Add(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const NTSTATUS rpccli_dfs_Remove(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *path, const char *server, const char *share); NTSTATUS rpccli_dfs_SetInfo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_dfs_GetInfo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *path, const char *server, const char *share, uint32_t level, union dfs_Info *info); -NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct *info, uint32_t *unknown, uint32_t *total); +NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct **info, uint32_t *unknown, uint32_t **total); NTSTATUS rpccli_dfs_Rename(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_dfs_Move(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_dfs_ManagerGetConfigInfo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); @@ -22,6 +22,6 @@ NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct NTSTATUS rpccli_dfs_FlushFtTable(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_dfs_Add2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_dfs_Remove2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *name, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct *info, uint32_t *total); +NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *name, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct **info, uint32_t **total); NTSTATUS rpccli_dfs_SetInfo2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); #endif /* __CLI_NETDFS__ */ diff --git a/source3/rpcclient/cmd_dfs.c b/source3/rpcclient/cmd_dfs.c index bdc94c3c20..e9e26987e5 100644 --- a/source3/rpcclient/cmd_dfs.c +++ b/source3/rpcclient/cmd_dfs.c @@ -174,6 +174,7 @@ static NTSTATUS cmd_dfs_enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, int argc, const char **argv) { struct dfs_EnumStruct str; + struct dfs_EnumStruct *pstr = &str; struct dfs_EnumArray1 info1; struct dfs_EnumArray2 info2; struct dfs_EnumArray3 info3; @@ -183,6 +184,7 @@ static NTSTATUS cmd_dfs_enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, NTSTATUS result; uint32 total = 0; + uint32 *ptotal = &total; uint32 unknown = 0; if (argc > 2) { @@ -206,8 +208,8 @@ static NTSTATUS cmd_dfs_enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, break; } - result = rpccli_dfs_Enum(cli, mem_ctx, str.level, 0xFFFFFFFF, &str, &unknown, - &total); + result = rpccli_dfs_Enum(cli, mem_ctx, str.level, 0xFFFFFFFF, &pstr, + &unknown, &ptotal); if (NT_STATUS_IS_OK(result)) display_dfs_enumstruct(&str); @@ -221,6 +223,7 @@ static NTSTATUS cmd_dfs_enumex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, int argc, const char **argv) { struct dfs_EnumStruct str; + struct dfs_EnumStruct *pstr = &str; struct dfs_EnumArray1 info1; struct dfs_EnumArray2 info2; struct dfs_EnumArray3 info3; @@ -230,6 +233,7 @@ static NTSTATUS cmd_dfs_enumex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, NTSTATUS result; uint32 total = 0; + uint32 *ptotal = &total; if (argc < 2 || argc > 3) { printf("Usage: %s dfs_name [info_level]\n", argv[0]); @@ -251,9 +255,8 @@ static NTSTATUS cmd_dfs_enumex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, break; } - result = rpccli_dfs_EnumEx(cli, mem_ctx, argv[1], - str.level, 0xFFFFFFFF, &str, - &total); + result = rpccli_dfs_EnumEx(cli, mem_ctx, argv[1], str.level, + 0xFFFFFFFF, &pstr, &ptotal); if (NT_STATUS_IS_OK(result)) display_dfs_enumstruct(&str); |