diff options
author | Günther Deschner <gd@samba.org> | 2008-11-14 12:03:18 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-01-08 11:18:57 +0100 |
commit | 176bbcf90cd890111177aeebce3f0563ac2da584 (patch) | |
tree | a088dd6d474d92eff7c19eeab766dd664dbb58e3 | |
parent | 550c64bef9cfc3f2aca6edcaeaf5e351aa4d8ee0 (diff) | |
download | samba-176bbcf90cd890111177aeebce3f0563ac2da584.tar.gz samba-176bbcf90cd890111177aeebce3f0563ac2da584.tar.bz2 samba-176bbcf90cd890111177aeebce3f0563ac2da584.zip |
svcctl: add svcctl_ConfigLevel from samba 3.
Guenther
-rw-r--r-- | librpc/gen_ndr/cli_svcctl.c | 4 | ||||
-rw-r--r-- | librpc/gen_ndr/cli_svcctl.h | 4 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_svcctl.c | 37 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_svcctl.h | 1 | ||||
-rw-r--r-- | librpc/gen_ndr/svcctl.h | 17 | ||||
-rw-r--r-- | librpc/idl/svcctl.idl | 10 | ||||
-rw-r--r-- | source3/include/rpc_svcctl.h | 4 | ||||
-rw-r--r-- | source4/torture/rpc/svcctl.c | 2 |
8 files changed, 60 insertions, 19 deletions
diff --git a/librpc/gen_ndr/cli_svcctl.c b/librpc/gen_ndr/cli_svcctl.c index 5784996f27..175a4fe5c5 100644 --- a/librpc/gen_ndr/cli_svcctl.c +++ b/librpc/gen_ndr/cli_svcctl.c @@ -1924,7 +1924,7 @@ NTSTATUS rpccli_svcctl_ChangeServiceConfig2W(struct rpc_pipe_client *cli, NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, + enum svcctl_ConfigLevel info_level /* [in] */, uint8_t *buffer /* [out] */, uint32_t buf_size /* [in] */, uint32_t *bytes_needed /* [out] [ref] */, @@ -1975,7 +1975,7 @@ NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli, NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, + enum svcctl_ConfigLevel info_level /* [in] */, uint8_t *buffer /* [out] [ref,size_is(buf_size)] */, uint32_t buf_size /* [in] [range(0,8192)] */, uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, diff --git a/librpc/gen_ndr/cli_svcctl.h b/librpc/gen_ndr/cli_svcctl.h index d56663abae..2dcb7447ea 100644 --- a/librpc/gen_ndr/cli_svcctl.h +++ b/librpc/gen_ndr/cli_svcctl.h @@ -283,7 +283,7 @@ NTSTATUS rpccli_svcctl_ChangeServiceConfig2W(struct rpc_pipe_client *cli, NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, + enum svcctl_ConfigLevel info_level /* [in] */, uint8_t *buffer /* [out] */, uint32_t buf_size /* [in] */, uint32_t *bytes_needed /* [out] [ref] */, @@ -291,7 +291,7 @@ NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli, NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, + enum svcctl_ConfigLevel info_level /* [in] */, uint8_t *buffer /* [out] [ref,size_is(buf_size)] */, uint32_t buf_size /* [in] [range(0,8192)] */, uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, diff --git a/librpc/gen_ndr/ndr_svcctl.c b/librpc/gen_ndr/ndr_svcctl.c index cdea71f4d4..afbb4fe39d 100644 --- a/librpc/gen_ndr/ndr_svcctl.c +++ b/librpc/gen_ndr/ndr_svcctl.c @@ -591,6 +591,31 @@ _PUBLIC_ size_t ndr_size_QUERY_SERVICE_CONFIG(const struct QUERY_SERVICE_CONFIG return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_QUERY_SERVICE_CONFIG, ic); } +static enum ndr_err_code ndr_push_svcctl_ConfigLevel(struct ndr_push *ndr, int ndr_flags, enum svcctl_ConfigLevel r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_ConfigLevel(struct ndr_pull *ndr, int ndr_flags, enum svcctl_ConfigLevel *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_ConfigLevel(struct ndr_print *ndr, const char *name, enum svcctl_ConfigLevel r) +{ + const char *val = NULL; + + switch (r) { + case SERVICE_CONFIG_DESCRIPTION: val = "SERVICE_CONFIG_DESCRIPTION"; break; + case SERVICE_CONFIG_FAILURE_ACTIONS: val = "SERVICE_CONFIG_FAILURE_ACTIONS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + static enum ndr_err_code ndr_push_svcctl_StatusLevel(struct ndr_push *ndr, int ndr_flags, enum svcctl_StatusLevel r) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); @@ -5285,7 +5310,7 @@ static enum ndr_err_code ndr_push_svcctl_QueryServiceConfig2A(struct ndr_push *n return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.info_level)); + NDR_CHECK(ndr_push_svcctl_ConfigLevel(ndr, NDR_SCALARS, r->in.info_level)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); } if (flags & NDR_OUT) { @@ -5313,7 +5338,7 @@ static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfig2A(struct ndr_pull *n NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); + NDR_CHECK(ndr_pull_svcctl_ConfigLevel(ndr, NDR_SCALARS, &r->in.info_level)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); NDR_PULL_ALLOC(ndr, r->out.bytes_needed); ZERO_STRUCTP(r->out.bytes_needed); @@ -5347,7 +5372,7 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceConfig2A(struct ndr_print *ndr, const ndr->depth++; ndr_print_policy_handle(ndr, "handle", r->in.handle); ndr->depth--; - ndr_print_uint32(ndr, "info_level", r->in.info_level); + ndr_print_svcctl_ConfigLevel(ndr, "info_level", r->in.info_level); ndr_print_uint32(ndr, "buf_size", r->in.buf_size); ndr->depth--; } @@ -5372,7 +5397,7 @@ static enum ndr_err_code ndr_push_svcctl_QueryServiceConfig2W(struct ndr_push *n return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.info_level)); + NDR_CHECK(ndr_push_svcctl_ConfigLevel(ndr, NDR_SCALARS, r->in.info_level)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); } if (flags & NDR_OUT) { @@ -5404,7 +5429,7 @@ static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfig2W(struct ndr_pull *n NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); + NDR_CHECK(ndr_pull_svcctl_ConfigLevel(ndr, NDR_SCALARS, &r->in.info_level)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); if (r->in.buf_size < 0 || r->in.buf_size > 8192) { return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); @@ -5452,7 +5477,7 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceConfig2W(struct ndr_print *ndr, const ndr->depth++; ndr_print_policy_handle(ndr, "handle", r->in.handle); ndr->depth--; - ndr_print_uint32(ndr, "info_level", r->in.info_level); + ndr_print_svcctl_ConfigLevel(ndr, "info_level", r->in.info_level); ndr_print_uint32(ndr, "buf_size", r->in.buf_size); ndr->depth--; } diff --git a/librpc/gen_ndr/ndr_svcctl.h b/librpc/gen_ndr/ndr_svcctl.h index 6a96531058..3108cbd6e3 100644 --- a/librpc/gen_ndr/ndr_svcctl.h +++ b/librpc/gen_ndr/ndr_svcctl.h @@ -113,6 +113,7 @@ enum ndr_err_code ndr_push_QUERY_SERVICE_CONFIG(struct ndr_push *ndr, int ndr_fl enum ndr_err_code ndr_pull_QUERY_SERVICE_CONFIG(struct ndr_pull *ndr, int ndr_flags, struct QUERY_SERVICE_CONFIG *r); void ndr_print_QUERY_SERVICE_CONFIG(struct ndr_print *ndr, const char *name, const struct QUERY_SERVICE_CONFIG *r); size_t ndr_size_QUERY_SERVICE_CONFIG(const struct QUERY_SERVICE_CONFIG *r, struct smb_iconv_convenience *ic, int flags); +void ndr_print_svcctl_ConfigLevel(struct ndr_print *ndr, const char *name, enum svcctl_ConfigLevel r); void ndr_print_svcctl_StatusLevel(struct ndr_print *ndr, const char *name, enum svcctl_StatusLevel r); void ndr_print_svcctl_CloseServiceHandle(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CloseServiceHandle *r); void ndr_print_svcctl_ControlService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ControlService *r); diff --git a/librpc/gen_ndr/svcctl.h b/librpc/gen_ndr/svcctl.h index 542bddad8b..66be271383 100644 --- a/librpc/gen_ndr/svcctl.h +++ b/librpc/gen_ndr/svcctl.h @@ -128,6 +128,19 @@ struct QUERY_SERVICE_CONFIG { const char *displayname;/* [unique,range(0,8192),charset(UTF16)] */ }/* [gensize,public] */; +enum svcctl_ConfigLevel +#ifndef USE_UINT_ENUMS + { + SERVICE_CONFIG_DESCRIPTION=0x00000001, + SERVICE_CONFIG_FAILURE_ACTIONS=0x00000002 +} +#else + { __donnot_use_enum_svcctl_ConfigLevel=0x7FFFFFFF} +#define SERVICE_CONFIG_DESCRIPTION ( 0x00000001 ) +#define SERVICE_CONFIG_FAILURE_ACTIONS ( 0x00000002 ) +#endif +; + enum svcctl_StatusLevel #ifndef USE_UINT_ENUMS { @@ -723,7 +736,7 @@ struct svcctl_ChangeServiceConfig2W { struct svcctl_QueryServiceConfig2A { struct { struct policy_handle *handle;/* [ref] */ - uint32_t info_level; + enum svcctl_ConfigLevel info_level; uint32_t buf_size; } in; @@ -739,7 +752,7 @@ struct svcctl_QueryServiceConfig2A { struct svcctl_QueryServiceConfig2W { struct { struct policy_handle *handle;/* [ref] */ - uint32_t info_level; + enum svcctl_ConfigLevel info_level; uint32_t buf_size;/* [range(0,8192)] */ } in; diff --git a/librpc/idl/svcctl.idl b/librpc/idl/svcctl.idl index b263d899d9..500d4949e3 100644 --- a/librpc/idl/svcctl.idl +++ b/librpc/idl/svcctl.idl @@ -528,9 +528,15 @@ import "misc.idl", "security.idl"; /*****************/ /* Function 0x26 */ + + typedef [v1_enum] enum { + SERVICE_CONFIG_DESCRIPTION = 0x00000001, + SERVICE_CONFIG_FAILURE_ACTIONS = 0x00000002 + } svcctl_ConfigLevel; + WERROR svcctl_QueryServiceConfig2A( [in,ref] policy_handle *handle, - [in] uint32 info_level, + [in] svcctl_ConfigLevel info_level, [out] uint8 buffer[buf_size], [in] uint32 buf_size, [out,ref] uint32 *bytes_needed @@ -540,7 +546,7 @@ import "misc.idl", "security.idl"; /* Function 0x27 */ WERROR svcctl_QueryServiceConfig2W( [in,ref] policy_handle *handle, - [in] uint32 info_level, + [in] svcctl_ConfigLevel info_level, [out,ref,size_is(buf_size)] uint8 *buffer, [in] [range(0,8192)] uint32 buf_size, [out,ref] [range(0,8192)] uint32 *bytes_needed diff --git a/source3/include/rpc_svcctl.h b/source3/include/rpc_svcctl.h index 253ae9a12b..baa1404316 100644 --- a/source3/include/rpc_svcctl.h +++ b/source3/include/rpc_svcctl.h @@ -83,10 +83,6 @@ #define SVCCTL_SVC_ERROR_CRITICAL 0x00000002 #define SVCCTL_SVC_ERROR_SEVERE 0x00000003 -/* QueryServiceConfig2 options */ -#define SERVICE_CONFIG_DESCRIPTION 0x00000001 -#define SERVICE_CONFIG_FAILURE_ACTIONS 0x00000002 - /* Service Config - values for ServiceType field*/ diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c index 8d8f43a0cf..5cd002de8e 100644 --- a/source4/torture/rpc/svcctl.c +++ b/source4/torture/rpc/svcctl.c @@ -124,7 +124,7 @@ static bool test_QueryServiceConfig2W(struct torture_context *tctx, struct dcerp struct policy_handle h, s; NTSTATUS status; - uint32_t info_level = 1; + uint32_t info_level = SERVICE_CONFIG_DESCRIPTION; uint8_t *buffer; uint32_t buf_size = 0; uint32_t bytes_needed = 0; |