svcctl: move SVC_STATUS_ to idl.
authorGünther Deschner <gd@samba.org>
Fri, 14 Nov 2008 10:58:12 +0000 (11:58 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 8 Jan 2009 09:58:10 +0000 (10:58 +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

index 3288e4a1ec76144b8c2cec8cb12e6d4fbc0ada5b..5784996f2776a7c110e6153a4b8c9142fac25b9f 100644 (file)
@@ -2026,7 +2026,7 @@ NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli,
 NTSTATUS rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
-                                           uint32_t info_level /* [in]  */,
+                                           enum svcctl_StatusLevel 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 fbd15b32a5ce27d80a9a2ec0f2a54cbf54b7c1c7..d56663abaea1799177591ee5d6567b9c0286fdd2 100644 (file)
@@ -299,7 +299,7 @@ NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli,
 NTSTATUS rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
                                            struct policy_handle *handle /* [in] [ref] */,
-                                           uint32_t info_level /* [in]  */,
+                                           enum svcctl_StatusLevel 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 590d493092de4437bc486735f327d23cdac863b9..cdea71f4d4a324f12527eb47b136913ab70ec77e 100644 (file)
@@ -591,6 +591,30 @@ _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_StatusLevel(struct ndr_push *ndr, int ndr_flags, enum svcctl_StatusLevel r)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_svcctl_StatusLevel(struct ndr_pull *ndr, int ndr_flags, enum svcctl_StatusLevel *r)
+{
+       uint32_t v;
+       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+       *r = v;
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_svcctl_StatusLevel(struct ndr_print *ndr, const char *name, enum svcctl_StatusLevel r)
+{
+       const char *val = NULL;
+
+       switch (r) {
+               case SVC_STATUS_PROCESS_INFO: val = "SVC_STATUS_PROCESS_INFO"; break;
+       }
+       ndr_print_enum(ndr, name, "ENUM", val, r);
+}
+
 static enum ndr_err_code ndr_push_svcctl_CloseServiceHandle(struct ndr_push *ndr, int flags, const struct svcctl_CloseServiceHandle *r)
 {
        if (flags & NDR_IN) {
@@ -5456,7 +5480,7 @@ static enum ndr_err_code ndr_push_svcctl_QueryServiceStatusEx(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_StatusLevel(ndr, NDR_SCALARS, r->in.info_level));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size));
        }
        if (flags & NDR_OUT) {
@@ -5488,7 +5512,7 @@ static enum ndr_err_code ndr_pull_svcctl_QueryServiceStatusEx(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_StatusLevel(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");
@@ -5536,7 +5560,7 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceStatusEx(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_StatusLevel(ndr, "info_level", r->in.info_level);
                ndr_print_uint32(ndr, "buf_size", r->in.buf_size);
                ndr->depth--;
        }
index 595a98041b0a2f0098ba8ddefcf3b01e8c1e3803..6a965310580e7bf6fcbb171f78ae406e472ee54d 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_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);
 void ndr_print_svcctl_DeleteService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_DeleteService *r);
index 9baa122e564c38bf4a9e9a0a1806e5a677d2977c..542bddad8bfe255790f5a9dd6720fd3b0c4b92b6 100644 (file)
@@ -128,6 +128,17 @@ struct QUERY_SERVICE_CONFIG {
        const char *displayname;/* [unique,range(0,8192),charset(UTF16)] */
 }/* [gensize,public] */;
 
+enum svcctl_StatusLevel
+#ifndef USE_UINT_ENUMS
+ {
+       SVC_STATUS_PROCESS_INFO=0x00000000
+}
+#else
+ { __donnot_use_enum_svcctl_StatusLevel=0x7FFFFFFF}
+#define SVC_STATUS_PROCESS_INFO ( 0x00000000 )
+#endif
+;
+
 
 struct svcctl_CloseServiceHandle {
        struct {
@@ -744,7 +755,7 @@ struct svcctl_QueryServiceConfig2W {
 struct svcctl_QueryServiceStatusEx {
        struct {
                struct policy_handle *handle;/* [ref] */
-               uint32_t info_level;
+               enum svcctl_StatusLevel info_level;
                uint32_t buf_size;/* [range(0,8192)] */
        } in;
 
index 4b88f5e5f415cc08a00e0dd890e3b9c6960883c9..b263d899d9db857a82d752c57c83e362b8493cfa 100644 (file)
@@ -548,9 +548,14 @@ import "misc.idl", "security.idl";
 
        /*****************/
        /* Function 0x28 */
+
+       typedef [v1_enum] enum {
+               SVC_STATUS_PROCESS_INFO         = 0x00000000
+       } svcctl_StatusLevel;
+
        WERROR svcctl_QueryServiceStatusEx(
                [in,ref] policy_handle *handle,
-               [in] uint32 info_level,
+               [in] svcctl_StatusLevel 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 7dd849d5b41deeeb8a33dd3298bbb5c2ead94b9a..253ae9a12bdbafd427b4c8b3cd2c964f2dc4d5be 100644 (file)
 #define SVC_HANDLE_IS_SERVICE                  0x0000002
 #define SVC_HANDLE_IS_DBLOCK                   0x0000003
 
-#define SVC_STATUS_PROCESS_INFO                 0x00000000
-
 /* utility structures for RPCs */
 
 /*