mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
svcctl: add svcctl_ConfigLevel from samba 3.
Guenther
This commit is contained in:
parent
550c64bef9
commit
176bbcf90c
@ -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)] */,
|
||||
|
@ -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)] */,
|
||||
|
@ -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--;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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*/
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user