svcctl: remove redundant SERVICE_STATE_* defines.
[metze/samba/wip.git] / librpc / idl / svcctl.idl
index fa8e10988c4fa51c6e526900473dc2571679c405..5f04d91f1711e04ac73d24b0388934c1c907d1f2 100644 (file)
@@ -18,16 +18,44 @@ import "misc.idl", "security.idl";
                uint32 lock_duration;
        } SERVICE_LOCK_STATUS;
 
+       typedef [v1_enum] enum {
+               SVCCTL_STATE_UNKNOWN            = 0x00000000,   /* only used internally to smbd */
+               SVCCTL_STOPPED                  = 0x00000001,
+               SVCCTL_START_PENDING            = 0x00000002,
+               SVCCTL_STOP_PENDING             = 0x00000003,
+               SVCCTL_RUNNING                  = 0x00000004,
+               SVCCTL_CONTINUE_PENDING         = 0x00000005,
+               SVCCTL_PAUSE_PENDING            = 0x00000006,
+               SVCCTL_PAUSED                   = 0x00000007
+       } svcctl_ServiceStatus;
+
+       typedef [bitmap32bit] bitmap {
+               SVCCTL_ACCEPT_NONE                      = 0x00000000,
+               SVCCTL_ACCEPT_STOP                      = 0x00000001,
+               SVCCTL_ACCEPT_PAUSE_CONTINUE            = 0x00000002,
+               SVCCTL_ACCEPT_SHUTDOWN                  = 0x00000004,
+               SVCCTL_ACCEPT_PARAMCHANGE               = 0x00000008,
+               SVCCTL_ACCEPT_NETBINDCHANGE             = 0x00000010,
+               SVCCTL_ACCEPT_HARDWAREPROFILECHANGE     = 0x00000020,
+               SVCCTL_ACCEPT_POWEREVENT                = 0x00000040
+       } svcctl_ControlsAccepted;
+
        typedef struct {
                uint32 type;
-               uint32 state;
-               uint32 controls_accepted;
+               svcctl_ServiceStatus state;
+               svcctl_ControlsAccepted controls_accepted;
                WERROR win32_exit_code;
                uint32 service_exit_code;
                uint32 check_point;
                uint32 wait_hint;
        } SERVICE_STATUS;
 
+       typedef [public] struct {
+               SERVICE_STATUS status;
+               uint32 process_id;
+               uint32 service_flags;
+       } SERVICE_STATUS_PROCESS;
+
        typedef struct {
                [relative] astring *service_name;
                [relative] astring *display_name;
@@ -43,10 +71,6 @@ import "misc.idl", "security.idl";
        const int SERVICE_TYPE_WIN32_SHARE_PROCESS = 0x20;
        const int SERVICE_TYPE_WIN32=SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS;
 
-       const int SERVICE_STATE_ACTIVE   = 0x01;
-       const int SERVICE_STATE_INACTIVE = 0x02;
-       const int SERVICE_STATE_ALL      = 0x03;
-
        typedef [public,bitmap32bit] bitmap {
                SV_TYPE_WORKSTATION       = 0x00000001,
                SV_TYPE_SERVER            = 0x00000002,
@@ -89,13 +113,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
        );
 
@@ -166,11 +196,27 @@ import "misc.idl", "security.idl";
 
        /*****************/
        /* Function 0x0b */
+
+       typedef [v1_enum] enum {
+               SVCCTL_SVC_ERROR_IGNORE         = 0x00000000,
+               SVCCTL_SVC_ERROR_NORMAL         = 0x00000001,
+               SVCCTL_SVC_ERROR_CRITICAL       = 0x00000002,
+               SVCCTL_SVC_ERROR_SEVERE         = 0x00000003
+       } svcctl_ErrorControl;
+
+       typedef [v1_enum] enum {
+               SVCCTL_BOOT_START               = 0x00000000,
+               SVCCTL_SYSTEM_START             = 0x00000001,
+               SVCCTL_AUTO_START               = 0x00000002,
+               SVCCTL_DEMAND_START             = 0x00000003,
+               SVCCTL_DISABLED                 = 0x00000004
+       } svcctl_StartType;
+
        WERROR svcctl_ChangeServiceConfigW(
                [in,ref] policy_handle *handle,
                [in] uint32 type,
-               [in] uint32 start,
-               [in] uint32 error,
+               [in] svcctl_StartType start_type,
+               [in] svcctl_ErrorControl error_control,
                [in,unique] [string,charset(UTF16)] uint16 *binary_path,
                [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
                [out,ref] uint32 *tag_id,
@@ -188,8 +234,8 @@ import "misc.idl", "security.idl";
                [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
                [in] uint32 desired_access,
                [in] uint32 type,
-               [in] uint32 start_type,
-               [in] uint32 error_control,
+               [in] svcctl_StartType start_type,
+               [in] svcctl_ErrorControl error_control,
                [in] [string,charset(UTF16)] uint16 binary_path[],
                [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
                [in,out,unique] uint32 *TagId,
@@ -214,14 +260,21 @@ import "misc.idl", "security.idl";
 
        /*****************/
        /* Function 0x0e */
+
+       typedef [v1_enum] enum {
+               SERVICE_STATE_ACTIVE    = 0x00000001,
+               SERVICE_STATE_INACTIVE  = 0x00000002,
+               SERVICE_STATE_ALL       = ( SERVICE_STATE_ACTIVE | SERVICE_STATE_INACTIVE )
+       } svcctl_ServiceState;
+
        WERROR svcctl_EnumServicesStatusW(
                [in,ref] policy_handle *handle,
                [in] uint32 type,
-               [in] uint32 state,
-               [in] uint32 buf_size,
-               [out,size_is(buf_size)] uint8 service[*],
-               [out,ref] uint32 *bytes_needed,
-               [out,ref] uint32 *services_returned,
+               [in] svcctl_ServiceState state,
+               [out,ref,size_is(buf_size)] uint8 *service,
+               [in] [range(0,262144)] uint32 buf_size,
+               [out,ref] [range(0,262144)] uint32 *bytes_needed,
+               [out,ref] [range(0,262144)] uint32 *services_returned,
                [in,out,unique] uint32 *resume_handle
        );
 
@@ -314,8 +367,8 @@ import "misc.idl", "security.idl";
 
        typedef [public,gensize] struct {
                uint32 service_type;
-               uint32 start_type;
-               uint32 error_control;
+               svcctl_StartType start_type;
+               svcctl_ErrorControl error_control;
                [string,charset(UTF16)] [range(0,8192)] uint16 *executablepath;
                [string,charset(UTF16)] [range(0,8192)] uint16 *loadordergroup;
                uint32 tag_id;
@@ -380,8 +433,8 @@ import "misc.idl", "security.idl";
        WERROR svcctl_ChangeServiceConfigA(
                [in,ref] policy_handle *handle,
                [in] uint32 type,
-               [in] uint32 start,
-               [in] uint32 error,
+               [in] svcctl_StartType start_type,
+               [in] svcctl_ErrorControl error_control,
                [in,unique] [string,charset(UTF16)] uint16 *binary_path,
                [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
                [out,ref] uint32 *tag_id,
@@ -399,8 +452,8 @@ import "misc.idl", "security.idl";
                [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
                [in] uint32 desired_access,
                [in] uint32 type,
-               [in] uint32 start_type,
-               [in] uint32 error_control,
+               [in] svcctl_StartType start_type,
+               [in] svcctl_ErrorControl error_control,
                [in,unique] [string,charset(UTF16)] uint16 *binary_path,
                [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
                [out,unique] uint32 *TagId,
@@ -522,9 +575,39 @@ import "misc.idl", "security.idl";
 
        /*****************/
        /* Function 0x26 */
+
+       typedef [v1_enum] enum {
+               SERVICE_CONFIG_DESCRIPTION      = 0x00000001,
+               SERVICE_CONFIG_FAILURE_ACTIONS  = 0x00000002
+       } svcctl_ConfigLevel;
+
+       typedef [gensize,public] struct {
+               [relative] nstring *description;
+       } SERVICE_DESCRIPTION;
+
+       typedef [v1_enum] enum {
+               SC_ACTION_NONE          = 0,
+               SC_ACTION_RESTART       = 1,
+               SC_ACTION_REBOOT        = 2,
+               SC_ACTION_RUN_COMMAND   = 3
+       } SC_ACTION_TYPE;
+
+       typedef struct {
+               SC_ACTION_TYPE type;
+               uint32 delay;
+       } SC_ACTION;
+
+       typedef [public,gensize] struct {
+               uint32 reset_period;
+               [relative] nstring *rebootmsg;
+               [relative] nstring *command;
+               [range(0,1024)] uint32 num_actions;
+               [relative] [size_is(num_actions)] SC_ACTION *actions;
+       } SERVICE_FAILURE_ACTIONS;
+
        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
@@ -534,20 +617,25 @@ import "misc.idl", "security.idl";
        /* Function 0x27 */
        WERROR svcctl_QueryServiceConfig2W(
                [in,ref] policy_handle *handle,
-               [in] uint32 info_level,
-               [out] uint8 buffer[buf_size],
-               [in] uint32 buf_size,
-               [out,ref] uint32 *bytes_needed
+               [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
        );
 
        /*****************/
        /* 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,
-               [out] uint8 buffer[buf_size],
-               [in] uint32 buf_size,
-               [out,ref] uint32 *bytes_needed
+               [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
        );
 
        /*****************/
@@ -572,12 +660,12 @@ import "misc.idl", "security.idl";
                [in] uint32 info_level,
                [in] uint32 type,
                [in] uint32 state,
-               [out] uint8 services[buf_size],
-               [in] uint32 buf_size,
-               [out,ref] uint32 *bytes_needed,
-               [out,ref] uint32 *service_returned,
-               [in,out,unique] uint32 *resume_handle,
-               [out,ref] [string,charset(UTF16)] uint16 **group_name
+               [out,ref,size_is(buf_size)] uint8 *services,
+               [in] [range(0,262144)] uint32 buf_size,
+               [out,ref] [range(0,262144)] uint32 *bytes_needed,
+               [out,ref] [range(0,262144)] uint32 *service_returned,
+               [in,out,unique] [range(0,262144)] uint32 *resume_handle,
+               [in,unique] [string,charset(UTF16)] uint16 *group_name
        );
 
        /*****************/