svcctl interface definitions
*/
-import "misc.idl";
+import "misc.idl", "security.idl";
[ uuid("367abb81-9844-35f1-ad32-98f038001003"),
version(2.0),
pointer_default(unique),
/*****************/
/* 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
);
[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,
+ [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
);
/*****************/
/* Function 0x0f */
+
+ /* Service Control Manager Bits */
+
typedef [bitmap32bit] bitmap {
SC_RIGHT_MGR_CONNECT = 0x0001,
SC_RIGHT_MGR_CREATE_SERVICE = 0x0002,
SC_RIGHT_MGR_MODIFY_BOOT_CONFIG = 0x0020
} svcctl_MgrAccessMask;
+ const int SC_MANAGER_READ_ACCESS =
+ (SEC_STD_READ_CONTROL |
+ SC_RIGHT_MGR_CONNECT |
+ SC_RIGHT_MGR_ENUMERATE_SERVICE |
+ SC_RIGHT_MGR_QUERY_LOCK_STATUS);
+
+ const int SC_MANAGER_EXECUTE_ACCESS = SC_MANAGER_READ_ACCESS;
+
+ const int SC_MANAGER_WRITE_ACCESS =
+ (SEC_STD_REQUIRED |
+ SC_MANAGER_READ_ACCESS |
+ SC_RIGHT_MGR_CREATE_SERVICE |
+ SC_RIGHT_MGR_LOCK |
+ SC_RIGHT_MGR_MODIFY_BOOT_CONFIG);
+
+ const int SC_MANAGER_ALL_ACCESS = SC_MANAGER_WRITE_ACCESS;
+
WERROR svcctl_OpenSCManagerW(
[in,unique] [string,charset(UTF16)] uint16 *MachineName,
[in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
/*****************/
/* Function 0x10 */
+
+ /* Service Object Bits */
+
typedef [bitmap32bit] bitmap {
SC_RIGHT_SVC_QUERY_CONFIG = 0x0001,
SC_RIGHT_SVC_CHANGE_CONFIG = 0x0002,
SC_RIGHT_SVC_USER_DEFINED_CONTROL = 0x0100
} svcctl_ServiceAccessMask;
+ const int SERVICE_READ_ACCESS =
+ (SEC_STD_READ_CONTROL |
+ SC_RIGHT_SVC_ENUMERATE_DEPENDENTS |
+ SC_RIGHT_SVC_INTERROGATE |
+ SC_RIGHT_SVC_QUERY_CONFIG |
+ SC_RIGHT_SVC_QUERY_STATUS |
+ SC_RIGHT_SVC_USER_DEFINED_CONTROL);
+
+ const int SERVICE_EXECUTE_ACCESS =
+ (SERVICE_READ_ACCESS |
+ SC_RIGHT_SVC_START |
+ SC_RIGHT_SVC_STOP |
+ SC_RIGHT_SVC_PAUSE_CONTINUE);
+
+ const int SERVICE_WRITE_ACCESS =
+ (SEC_STD_REQUIRED |
+ SERVICE_READ_ACCESS |
+ SERVICE_EXECUTE_ACCESS |
+ SC_RIGHT_SVC_CHANGE_CONFIG);
+
+ const int SERVICE_ALL_ACCESS = SERVICE_WRITE_ACCESS;
+
WERROR svcctl_OpenServiceW(
[in,ref] policy_handle *scmanager_handle,
[in] [string,charset(UTF16)] uint16 ServiceName[],
/*****************/
/* Function 0x11 */
+
+ typedef [public,gensize] struct {
+ uint32 service_type;
+ uint32 start_type;
+ uint32 error_control;
+ [string,charset(UTF16)] [range(0,8192)] uint16 *executablepath;
+ [string,charset(UTF16)] [range(0,8192)] uint16 *loadordergroup;
+ uint32 tag_id;
+ [string,charset(UTF16)] [range(0,8192)] uint16 *dependencies;
+ [string,charset(UTF16)] [range(0,8192)] uint16 *startname;
+ [string,charset(UTF16)] [range(0,8192)] uint16 *displayname;
+ } QUERY_SERVICE_CONFIG;
+
WERROR svcctl_QueryServiceConfigW(
[in,ref] policy_handle *handle,
- [out] uint8 query[buf_size], /*QUERY_SERVICE_CONFIG */
- [in] uint32 buf_size,
- [out,ref] uint32 *bytes_needed
+ [out] QUERY_SERVICE_CONFIG *query,
+ [in] [range(0,8192)] uint32 buf_size,
+ [out,ref] [range(0,8192)] uint32 *bytes_needed
);
/*****************/
/*****************/
/* 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
/* 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
);
/*****************/
[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
);
/*****************/