librpc: fix IDL for svcctl_ChangeServiceConfigW
[bbaumbach/samba-autobuild/.git] / librpc / idl / svcctl.idl
index a5685e8ae38ab49f1eb38a1eaa99647115ba3d08..a9dd3dec99031241ecc945c22b027281c3ee6960 100644 (file)
@@ -13,6 +13,17 @@ import "misc.idl", "security.idl";
   helpstring("Service Control")
 ] interface svcctl
 {
+       const int MAX_SERVICE_NAME_LENGTH = 256;
+       const short SC_MAX_DEPEND_SIZE = 4 * 1024;
+       const short SC_MAX_NAME_LENGTH = MAX_SERVICE_NAME_LENGTH + 1;
+       const short SC_MAX_PATH_LENGTH = 32 * 1024;
+       const short SC_MAX_PWD_SIZE = 514;
+       const short SC_MAX_COMPUTER_NAME_LENGTH = 1024;
+       const short SC_MAX_ACCOUNT_NAME_LENGTH = 2 * 1024;
+       const short SC_MAX_COMMENT_LENGTH = 128;
+       const short SC_MAX_ARGUMENT_LENGTH = 1024;
+       const short SC_MAX_ARGUMENTS = 1024;
+
        typedef struct {
                uint32 is_locked;
                [string,charset(UTF16)] uint16 *lock_owner;
@@ -80,39 +91,6 @@ import "misc.idl", "security.idl";
        const int SERVICE_TYPE_WIN32=SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS;
        const int SERVICE_TYPE_INTERACTIVE_PROCESS = 0x100;
 
-       typedef [public,bitmap32bit] bitmap {
-               SV_TYPE_WORKSTATION       = 0x00000001,
-               SV_TYPE_SERVER            = 0x00000002,
-               SV_TYPE_SQLSERVER         = 0x00000004,
-               SV_TYPE_DOMAIN_CTRL       = 0x00000008,
-               SV_TYPE_DOMAIN_BAKCTRL    = 0x00000010,
-               SV_TYPE_TIME_SOURCE       = 0x00000020,
-               SV_TYPE_AFP               = 0x00000040,
-               SV_TYPE_NOVELL            = 0x00000080,
-
-               SV_TYPE_DOMAIN_MEMBER     = 0x00000100,
-               SV_TYPE_PRINTQ_SERVER     = 0x00000200,
-               SV_TYPE_DIALIN_SERVER     = 0x00000400,
-               SV_TYPE_SERVER_UNIX       = 0x00000800,
-               SV_TYPE_NT                = 0x00001000,
-               SV_TYPE_WFW               = 0x00002000,
-               SV_TYPE_SERVER_MFPN       = 0x00004000,
-               SV_TYPE_SERVER_NT         = 0x00008000,
-               SV_TYPE_POTENTIAL_BROWSER = 0x00010000,
-               SV_TYPE_BACKUP_BROWSER    = 0x00020000,
-               SV_TYPE_MASTER_BROWSER    = 0x00040000,
-               SV_TYPE_DOMAIN_MASTER     = 0x00080000,
-               SV_TYPE_SERVER_OSF        = 0x00100000,
-               SV_TYPE_SERVER_VMS        = 0x00200000,
-               SV_TYPE_WIN95_PLUS        = 0x00400000,
-               SV_TYPE_DFS_SERVER        = 0x00800000,
-               SV_TYPE_ALTERNATE_XPORT   = 0x20000000,
-               SV_TYPE_LOCAL_LIST_ONLY   = 0x40000000,
-               SV_TYPE_DOMAIN_ENUM       = 0x80000000
-       } svcctl_ServerType;
-
-       const uint32 SV_TYPE_ALL        = 0xFFFFFFFF;
-
        /*****************/
        /* Function 0x00 */
        WERROR svcctl_CloseServiceHandle(
@@ -221,18 +199,20 @@ import "misc.idl", "security.idl";
                SVCCTL_DISABLED                 = 0x00000004
        } svcctl_StartType;
 
-       WERROR svcctl_ChangeServiceConfigW(
+       [public] WERROR svcctl_ChangeServiceConfigW(
                [in,ref] policy_handle *handle,
                [in] uint32 type,
                [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,
-               [in,unique] [string,charset(UTF16)] uint16 *dependencies,
-               [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
-               [in,unique] [string,charset(UTF16)] uint16 *password,
-               [in,unique] [string,charset(UTF16)] uint16 *display_name
+               [in,out,unique] uint32 *tag_id,
+               [in,unique,size_is(dwDependSize)] [string,charset(UTF16)] uint16 *dependencies,
+               [in,range(0, SC_MAX_DEPEND_SIZE)] uint32 dwDependSize,
+               [in,unique,range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] [string,charset(UTF16)] uint16 *service_start_name,
+               [in,unique,size_is(dwPwSize)] [string,charset(UTF16)] uint16 *password,
+               [in,range(0, SC_MAX_PWD_SIZE)] uint32 dwPwSize,
+               [in,unique,range(0, SC_MAX_NAME_LENGTH)] [string,charset(UTF16)] uint16 *display_name
        );
 
        /*****************/
@@ -404,10 +384,18 @@ import "misc.idl", "security.idl";
 
        /*****************/
        /* Function 0x13 */
+
+       const int SC_MAX_ARGUMENT_LENGTH = 1024;
+       const int SC_MAX_ARGUMENTS = 1024;
+
+       typedef struct {
+               [string,charset(UTF16),range(0,SC_MAX_ARGUMENT_LENGTH)] uint16 *string;
+       } svcctl_ArgumentString;
+
        WERROR svcctl_StartServiceW(
                [in,ref] policy_handle *handle,
-               [in] uint32 NumArgs,
-               [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
+               [in,range(0,SC_MAX_ARGUMENTS)] uint32 NumArgs,
+               [in,unique,size_is(NumArgs)] svcctl_ArgumentString *Arguments
        );
 
        /*****************/
@@ -509,7 +497,8 @@ import "misc.idl", "security.idl";
        WERROR svcctl_OpenServiceA(
                [in,ref] policy_handle *scmanager_handle,
                [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
-               [in] uint32 access_mask
+               [in] uint32 access_mask,
+               [out,ref] policy_handle *handle
        );
 
        /*****************/