mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
svcctl: fill in SERVICE_CONTROL from s3.
Guenther
This commit is contained in:
parent
738d066768
commit
5b4140a997
@ -89,13 +89,19 @@ import "misc.idl", "security.idl";
|
||||
/*****************/
|
||||
/* Function 0x01 */
|
||||
|
||||
typedef enum {
|
||||
FIXME=1
|
||||
/* Service Controls */
|
||||
|
||||
typedef [v1_enum] enum {
|
||||
SVCCTL_CONTROL_STOP = 0x00000001,
|
||||
SVCCTL_CONTROL_PAUSE = 0x00000002,
|
||||
SVCCTL_CONTROL_CONTINUE = 0x00000003,
|
||||
SVCCTL_CONTROL_INTERROGATE = 0x00000004,
|
||||
SVCCTL_CONTROL_SHUTDOWN = 0x00000005
|
||||
} SERVICE_CONTROL;
|
||||
|
||||
WERROR svcctl_ControlService(
|
||||
[in,ref] policy_handle *handle,
|
||||
[in] uint32 control,
|
||||
[in] SERVICE_CONTROL control,
|
||||
[out,ref] SERVICE_STATUS *service_status
|
||||
);
|
||||
|
||||
|
@ -103,14 +103,6 @@
|
||||
#define SVCCTL_DEMAND_START 0x00000003
|
||||
#define SVCCTL_DISABLED 0x00000004
|
||||
|
||||
/* Service Controls */
|
||||
|
||||
#define SVCCTL_CONTROL_STOP 0x00000001
|
||||
#define SVCCTL_CONTROL_PAUSE 0x00000002
|
||||
#define SVCCTL_CONTROL_CONTINUE 0x00000003
|
||||
#define SVCCTL_CONTROL_INTERROGATE 0x00000004
|
||||
#define SVCCTL_CONTROL_SHUTDOWN 0x00000005
|
||||
|
||||
#define SVC_HANDLE_IS_SCM 0x0000001
|
||||
#define SVC_HANDLE_IS_SERVICE 0x0000002
|
||||
#define SVC_HANDLE_IS_DBLOCK 0x0000003
|
||||
|
@ -53,7 +53,7 @@ NTSTATUS rpccli_svcctl_CloseServiceHandle(struct rpc_pipe_client *cli,
|
||||
NTSTATUS rpccli_svcctl_ControlService(struct rpc_pipe_client *cli,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
struct policy_handle *handle /* [in] [ref] */,
|
||||
uint32_t control /* [in] */,
|
||||
enum SERVICE_CONTROL control /* [in] */,
|
||||
struct SERVICE_STATUS *service_status /* [out] [ref] */,
|
||||
WERROR *werror)
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ NTSTATUS rpccli_svcctl_CloseServiceHandle(struct rpc_pipe_client *cli,
|
||||
NTSTATUS rpccli_svcctl_ControlService(struct rpc_pipe_client *cli,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
struct policy_handle *handle /* [in] [ref] */,
|
||||
uint32_t control /* [in] */,
|
||||
enum SERVICE_CONTROL control /* [in] */,
|
||||
struct SERVICE_STATUS *service_status /* [out] [ref] */,
|
||||
WERROR *werror);
|
||||
NTSTATUS rpccli_svcctl_DeleteService(struct rpc_pipe_client *cli,
|
||||
|
@ -297,6 +297,34 @@ _PUBLIC_ void ndr_print_svcctl_ServerType(struct ndr_print *ndr, const char *nam
|
||||
ndr->depth--;
|
||||
}
|
||||
|
||||
static enum ndr_err_code ndr_push_SERVICE_CONTROL(struct ndr_push *ndr, int ndr_flags, enum SERVICE_CONTROL r)
|
||||
{
|
||||
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
static enum ndr_err_code ndr_pull_SERVICE_CONTROL(struct ndr_pull *ndr, int ndr_flags, enum SERVICE_CONTROL *r)
|
||||
{
|
||||
uint32_t v;
|
||||
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
|
||||
*r = v;
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
_PUBLIC_ void ndr_print_SERVICE_CONTROL(struct ndr_print *ndr, const char *name, enum SERVICE_CONTROL r)
|
||||
{
|
||||
const char *val = NULL;
|
||||
|
||||
switch (r) {
|
||||
case SVCCTL_CONTROL_STOP: val = "SVCCTL_CONTROL_STOP"; break;
|
||||
case SVCCTL_CONTROL_PAUSE: val = "SVCCTL_CONTROL_PAUSE"; break;
|
||||
case SVCCTL_CONTROL_CONTINUE: val = "SVCCTL_CONTROL_CONTINUE"; break;
|
||||
case SVCCTL_CONTROL_INTERROGATE: val = "SVCCTL_CONTROL_INTERROGATE"; break;
|
||||
case SVCCTL_CONTROL_SHUTDOWN: val = "SVCCTL_CONTROL_SHUTDOWN"; break;
|
||||
}
|
||||
ndr_print_enum(ndr, name, "ENUM", val, r);
|
||||
}
|
||||
|
||||
static enum ndr_err_code ndr_push_svcctl_MgrAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
|
||||
{
|
||||
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
|
||||
@ -646,7 +674,7 @@ static enum ndr_err_code ndr_push_svcctl_ControlService(struct ndr_push *ndr, in
|
||||
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.control));
|
||||
NDR_CHECK(ndr_push_SERVICE_CONTROL(ndr, NDR_SCALARS, r->in.control));
|
||||
}
|
||||
if (flags & NDR_OUT) {
|
||||
if (r->out.service_status == NULL) {
|
||||
@ -672,7 +700,7 @@ static enum ndr_err_code ndr_pull_svcctl_ControlService(struct ndr_pull *ndr, in
|
||||
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.control));
|
||||
NDR_CHECK(ndr_pull_SERVICE_CONTROL(ndr, NDR_SCALARS, &r->in.control));
|
||||
NDR_PULL_ALLOC(ndr, r->out.service_status);
|
||||
ZERO_STRUCTP(r->out.service_status);
|
||||
}
|
||||
@ -703,7 +731,7 @@ _PUBLIC_ void ndr_print_svcctl_ControlService(struct ndr_print *ndr, const char
|
||||
ndr->depth++;
|
||||
ndr_print_policy_handle(ndr, "handle", r->in.handle);
|
||||
ndr->depth--;
|
||||
ndr_print_uint32(ndr, "control", r->in.control);
|
||||
ndr_print_SERVICE_CONTROL(ndr, "control", r->in.control);
|
||||
ndr->depth--;
|
||||
}
|
||||
if (flags & NDR_OUT) {
|
||||
|
@ -106,6 +106,7 @@ void ndr_print_ENUM_SERVICE_STATUS(struct ndr_print *ndr, const char *name, cons
|
||||
enum ndr_err_code ndr_push_svcctl_ServerType(struct ndr_push *ndr, int ndr_flags, uint32_t r);
|
||||
enum ndr_err_code ndr_pull_svcctl_ServerType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r);
|
||||
void ndr_print_svcctl_ServerType(struct ndr_print *ndr, const char *name, uint32_t r);
|
||||
void ndr_print_SERVICE_CONTROL(struct ndr_print *ndr, const char *name, enum SERVICE_CONTROL r);
|
||||
void ndr_print_svcctl_MgrAccessMask(struct ndr_print *ndr, const char *name, uint32_t r);
|
||||
void ndr_print_svcctl_ServiceAccessMask(struct ndr_print *ndr, const char *name, uint32_t r);
|
||||
enum ndr_err_code ndr_push_QUERY_SERVICE_CONFIG(struct ndr_push *ndr, int ndr_flags, const struct QUERY_SERVICE_CONFIG *r);
|
||||
|
@ -81,11 +81,19 @@ struct ENUM_SERVICE_STATUS {
|
||||
enum SERVICE_CONTROL
|
||||
#ifndef USE_UINT_ENUMS
|
||||
{
|
||||
FIXME=1
|
||||
SVCCTL_CONTROL_STOP=0x00000001,
|
||||
SVCCTL_CONTROL_PAUSE=0x00000002,
|
||||
SVCCTL_CONTROL_CONTINUE=0x00000003,
|
||||
SVCCTL_CONTROL_INTERROGATE=0x00000004,
|
||||
SVCCTL_CONTROL_SHUTDOWN=0x00000005
|
||||
}
|
||||
#else
|
||||
{ __donnot_use_enum_SERVICE_CONTROL=0x7FFFFFFF}
|
||||
#define FIXME ( 1 )
|
||||
#define SVCCTL_CONTROL_STOP ( 0x00000001 )
|
||||
#define SVCCTL_CONTROL_PAUSE ( 0x00000002 )
|
||||
#define SVCCTL_CONTROL_CONTINUE ( 0x00000003 )
|
||||
#define SVCCTL_CONTROL_INTERROGATE ( 0x00000004 )
|
||||
#define SVCCTL_CONTROL_SHUTDOWN ( 0x00000005 )
|
||||
#endif
|
||||
;
|
||||
|
||||
@ -137,7 +145,7 @@ struct svcctl_CloseServiceHandle {
|
||||
struct svcctl_ControlService {
|
||||
struct {
|
||||
struct policy_handle *handle;/* [ref] */
|
||||
uint32_t control;
|
||||
enum SERVICE_CONTROL control;
|
||||
} in;
|
||||
|
||||
struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user