svcctl: add svcctl_ConfigLevel from samba 3.
authorGünther Deschner <gd@samba.org>
Fri, 14 Nov 2008 11:03:18 +0000 (12:03 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 8 Jan 2009 10:18:57 +0000 (11:18 +0100)
Guenther

librpc/gen_ndr/cli_svcctl.c
librpc/gen_ndr/cli_svcctl.h
librpc/gen_ndr/ndr_svcctl.c
librpc/gen_ndr/ndr_svcctl.h
librpc/gen_ndr/svcctl.h
librpc/idl/svcctl.idl
source3/include/rpc_svcctl.h
source4/torture/rpc/svcctl.c

index 5784996f2776a7c110e6153a4b8c9142fac25b9f..175a4fe5c580aca2b21e19163f68f50947b90cf2 100644 (file)
@@ -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)] */,
index d56663abaea1799177591ee5d6567b9c0286fdd2..2dcb7447ea7c0d335798f7142641d6699b9f1f31 100644 (file)
@@ -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)] */,
index cdea71f4d4a324f12527eb47b136913ab70ec77e..afbb4fe39d86feaac0b4f2502ce3b42a120975dd 100644 (file)
@@ -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--;
        }
index 6a965310580e7bf6fcbb171f78ae406e472ee54d..3108cbd6e3ef441f20f080ea1c2e41c39924a657 100644 (file)
@@ -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);
index 542bddad8bfe255790f5a9dd6720fd3b0c4b92b6..66be271383efa3a9795be958c79acea18bb6f707 100644 (file)
@@ -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;
 
index b263d899d9db857a82d752c57c83e362b8493cfa..500d4949e3bb885757cc24c0d443defaf76198b4 100644 (file)
@@ -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
index 253ae9a12bdbafd427b4c8b3cd2c964f2dc4d5be..baa1404316f2ca3609e230427f24ecb257a0ebc3 100644 (file)
 #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*/
 
index 8d8f43a0cf5281755554ed58662a76d6454f66e4..5cd002de8ea6d2aade06ef0ce4dfa172202b05ff 100644 (file)
@@ -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;