1da6c28aaSamw/* 2da6c28aaSamw * CDDL HEADER START 3da6c28aaSamw * 4da6c28aaSamw * The contents of this file are subject to the terms of the 5da6c28aaSamw * Common Development and Distribution License (the "License"). 6da6c28aaSamw * You may not use this file except in compliance with the License. 7da6c28aaSamw * 8da6c28aaSamw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9da6c28aaSamw * or http://www.opensolaris.org/os/licensing. 10da6c28aaSamw * See the License for the specific language governing permissions 11da6c28aaSamw * and limitations under the License. 12da6c28aaSamw * 13da6c28aaSamw * When distributing Covered Code, include this CDDL HEADER in each 14da6c28aaSamw * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15da6c28aaSamw * If applicable, add the following below this CDDL HEADER, with the 16da6c28aaSamw * fields enclosed by brackets "[]" replaced with your own identifying 17da6c28aaSamw * information: Portions Copyright [yyyy] [name of copyright owner] 18da6c28aaSamw * 19da6c28aaSamw * CDDL HEADER END 20da6c28aaSamw */ 21da6c28aaSamw/* 22037cac00Sjoyce mcintosh * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23da6c28aaSamw * Use is subject to license terms. 24da6c28aaSamw */ 25da6c28aaSamw 26da6c28aaSamw#ifndef _MLSVC_SVCCTL_NDL_ 27da6c28aaSamw#define _MLSVC_SVCCTL_NDL_ 28da6c28aaSamw 29da6c28aaSamw/* 30da6c28aaSamw * NT Service Control Services (SVCCTL) RPC interface definition. 31da6c28aaSamw * This interface provides remote access to add, remove, start and 32da6c28aaSamw * stop services. 33da6c28aaSamw */ 34da6c28aaSamw 35da6c28aaSamw#include "ndrtypes.ndl" 36da6c28aaSamw 373db3f65cSamw/* Windows NT */ 38da6c28aaSamw#define SVCCTL_OPNUM_Close 0x00 393db3f65cSamw#define SVCCTL_OPNUM_ControlService 0x01 403db3f65cSamw#define SVCCTL_OPNUM_DeleteService 0x02 413db3f65cSamw#define SVCCTL_OPNUM_LockServiceDatabase 0x03 423db3f65cSamw#define SVCCTL_OPNUM_QueryServiceSecurity 0x04 433db3f65cSamw#define SVCCTL_OPNUM_SetServiceSecurity 0x05 44da6c28aaSamw#define SVCCTL_OPNUM_QueryServiceStatus 0x06 453db3f65cSamw#define SVCCTL_OPNUM_SetServiceStatus 0x07 463db3f65cSamw#define SVCCTL_OPNUM_UnlockServiceDatabase 0x08 473db3f65cSamw#define SVCCTL_OPNUM_NotifyBootConfigStatus 0x09 483db3f65cSamw#define SVCCTL_OPNUM_SetServiceBits 0x0a 493db3f65cSamw#define SVCCTL_OPNUM_ChangeServiceConfig 0x0b 503db3f65cSamw#define SVCCTL_OPNUM_CreateService 0x0c 513db3f65cSamw#define SVCCTL_OPNUM_EnumDependentServices 0x0d 52da6c28aaSamw#define SVCCTL_OPNUM_EnumServicesStatus 0x0E 53da6c28aaSamw#define SVCCTL_OPNUM_OpenManager 0x0F 54da6c28aaSamw#define SVCCTL_OPNUM_OpenService 0x10 55da6c28aaSamw#define SVCCTL_OPNUM_QueryServiceConfig 0x11 563db3f65cSamw#define SVCCTL_OPNUM_QueryServiceLockStatus 0x12 573db3f65cSamw#define SVCCTL_OPNUM_StartService 0x13 583db3f65cSamw#define SVCCTL_OPNUM_GetServiceDisplayNameW 0x14 593db3f65cSamw#define SVCCTL_OPNUM_GetServiceKeyNameW 0x15 603db3f65cSamw#define SVCCTL_OPNUM_SetServiceBitsA 0x16 613db3f65cSamw#define SVCCTL_OPNUM_ChangeServiceConfigA 0x17 623db3f65cSamw#define SVCCTL_OPNUM_CreateServiceA 0x18 633db3f65cSamw#define SVCCTL_OPNUM_EnumDependentServicesA 0x19 64037cac00Sjoyce mcintosh#define SVCCTL_OPNUM_EnumServicesStatusA 0x1a 653db3f65cSamw#define SVCCTL_OPNUM_OpenSCManagerA 0x1b 663db3f65cSamw#define SVCCTL_OPNUM_OpenServiceA 0x1c 673db3f65cSamw#define SVCCTL_OPNUM_QueryServiceConfigA 0x1d 683db3f65cSamw#define SVCCTL_OPNUM_QueryServiceLockStatusA 0x1e 693db3f65cSamw#define SVCCTL_OPNUM_StartServiceA 0x1f 703db3f65cSamw#define SVCCTL_OPNUM_GetServiceDisplayNameA 0x20 713db3f65cSamw#define SVCCTL_OPNUM_GetServiceKeyNameA 0x21 723db3f65cSamw#define SVCCTL_OPNUM_GetCurrentGroupStateW 0x22 733db3f65cSamw#define SVCCTL_OPNUM_EnumServiceGroupW 0x23 743db3f65cSamw#define SVCCTL_OPNUM_ChangeServiceConfig2A 0x24 753db3f65cSamw#define SVCCTL_OPNUM_ChangeServiceConfig2W 0x25 763db3f65cSamw#define SVCCTL_OPNUM_QueryServiceConfig2A 0x26 773db3f65cSamw 783db3f65cSamw/* Windows 2000 */ 793db3f65cSamw#define SVCCTL_OPNUM_QueryServiceConfig2W 0x27 803db3f65cSamw#define SVCCTL_OPNUM_QueryServiceStatusEx 0x28 81037cac00Sjoyce mcintosh#define SVCCTL_OPNUM_EnumServicesStatusExA 0x29 82037cac00Sjoyce mcintosh#define SVCCTL_OPNUM_EnumServicesStatusExW 0x2a 833db3f65cSamw 843db3f65cSamw/* Windows XP and Windows Server 2003 */ 853db3f65cSamw#define SVCCTL_OPNUM_SendTSMessage 0x2b 863db3f65cSamw 873db3f65cSamw/* Windows Vista */ 883db3f65cSamw#define SVCCTL_OPNUM_CreateServiceWOW64A 0x2c 893db3f65cSamw#define SVCCTL_OPNUM_CreateServiceWOW64W 0x2d 903db3f65cSamw#define SVCCTL_OPNUM_QueryServiceTagInfo 0x2e 913db3f65cSamw#define SVCCTL_OPNUM_NotifyServiceStatusChange 0x2f 923db3f65cSamw#define SVCCTL_OPNUM_GetNotifyResult 0x30 933db3f65cSamw#define SVCCTL_OPNUM_CloseNotifyHandle 0x31 943db3f65cSamw#define SVCCTL_OPNUM_ControlServiceExA 0x32 953db3f65cSamw#define SVCCTL_OPNUM_ControlServiceExW 0x33 963db3f65cSamw#define SVCCTL_OPNUM_SendPnPMessage 0x34 973db3f65cSamw#define SVCCTL_OPNUM_ValidatePnPService 0x35 983db3f65cSamw#define SVCCTL_OPNUM_OpenServiceStatusHandle 0x36 99da6c28aaSamw 1008d7e4166Sjose borregoCONTEXT_HANDLE(svcctl_handle) svcctl_handle_t; 101da6c28aaSamw 102da6c28aaSamw/* 103037cac00Sjoyce mcintosh * String definition for the ASCII interface. 104037cac00Sjoyce mcintosh */ 105037cac00Sjoyce mcintoshstruct svcctl_value { 106037cac00Sjoyce mcintosh DWORD vc_first_is; /* 0 */ 107037cac00Sjoyce mcintosh DWORD vc_length_is; 108037cac00Sjoyce mcintosh SIZE_IS(vc_length_is) 109037cac00Sjoyce mcintosh BYTE value[ANY_SIZE_ARRAY]; 110037cac00Sjoyce mcintosh}; 111037cac00Sjoyce mcintosh 112037cac00Sjoyce mcintosh/* 113da6c28aaSamw * The svc_status (SERVICE_STATUS) structure contains information about a 114da6c28aaSamw * service. The ControlService, EnumDependentServices, EnumServicesStatus, 115da6c28aaSamw * and QueryServiceStatus functions use this structure to return information 116da6c28aaSamw * about a service. A service uses this structure in the SetServiceStatus 117da6c28aaSamw * function to report its current status to the service control manager. 118da6c28aaSamw * 119da6c28aaSamw * service_type 120da6c28aaSamw * The type of service. This member can be one of the following values. 121da6c28aaSamw * 122da6c28aaSamw * SERVICE_FILE_SYSTEM_DRIVER 123da6c28aaSamw * SERVICE_KERNEL_DRIVER 124da6c28aaSamw * SERVICE_WIN32_OWN_PROCESS 125da6c28aaSamw * SERVICE_WIN32_SHARE_PROCESS 126da6c28aaSamw * 127da6c28aaSamw * If the service type is either SERVICE_WIN32_OWN_PROCESS or 128da6c28aaSamw * SERVICE_WIN32_SHARE_PROCESS, and the service is running in 129da6c28aaSamw * the context of the LocalSystem account, the following type 130da6c28aaSamw * may also be specified to indicate that the service can 131da6c28aaSamw * interact with the desktop. 132da6c28aaSamw * 133da6c28aaSamw * SERVICE_INTERACTIVE_PROCESS 134da6c28aaSamw * 135da6c28aaSamw * cur_state 136da6c28aaSamw * The current state of the service. This member can be one of the 137da6c28aaSamw * following values. 138da6c28aaSamw * 139da6c28aaSamw * SERVICE_CONTINUE_PENDING 140da6c28aaSamw * SERVICE_PAUSE_PENDING 141da6c28aaSamw * SERVICE_PAUSED 142da6c28aaSamw * SERVICE_RUNNING 143da6c28aaSamw * SERVICE_START_PENDING 144da6c28aaSamw * SERVICE_STOP_PENDING 145da6c28aaSamw * SERVICE_STOPPED 146da6c28aaSamw * 147da6c28aaSamw * ctrl_accepted 148da6c28aaSamw * The control codes that the service will accept and process in its 149da6c28aaSamw * handler function (see Handler and HandlerEx). A user interface 150da6c28aaSamw * process can control a service by specifying a control command in 151da6c28aaSamw * the ControlService function. By default, all services accept the 152da6c28aaSamw * SERVICE_CONTROL_INTERROGATE value. The following are the control 153da6c28aaSamw * codes. 154da6c28aaSamw * 155da6c28aaSamw * SERVICE_ACCEPT_STOP 156da6c28aaSamw * SERVICE_ACCEPT_PAUSE_CONTINUE 157da6c28aaSamw * SERVICE_ACCEPT_SHUTDOWN 158da6c28aaSamw * SERVICE_ACCEPT_PARAMCHANGE 159da6c28aaSamw * SERVICE_ACCEPT_NETBINDCHANGE 160da6c28aaSamw * 161da6c28aaSamw * w32_exitcode 162da6c28aaSamw * An error code that the service uses to report an error that occurs when 163da6c28aaSamw * it is starting or stopping. To return an error code specific to the 164da6c28aaSamw * service, the service must set this value to ERROR_SERVICE_SPECIFIC_ERROR 165da6c28aaSamw * to indicate that the dwServiceSpecificExitCode member contains the error 166da6c28aaSamw * code. The service should set this value to NO_ERROR when it is running 167da6c28aaSamw * and on normal termination. 168da6c28aaSamw * 169da6c28aaSamw * svc_specified_exitcode 170da6c28aaSamw * A service-specific error code that the service returns when an error 171da6c28aaSamw * occurs while the service is starting or stopping. This value is ignored 172da6c28aaSamw * unless the w32_exitcode member is set to ERROR_SERVICE_SPECIFIC_ERROR. 173da6c28aaSamw * 174da6c28aaSamw * check_point 175da6c28aaSamw * A value that the service increments periodically to report its progress 176da6c28aaSamw * during a lengthy start, stop, pause, or continue operation. For example, 177da6c28aaSamw * the service should increment this value as it completes each step of its 178da6c28aaSamw * initialization when it is starting up. The user interface program that 179da6c28aaSamw * invoked the operation on the service uses this value to track the progress 180da6c28aaSamw * of the service during a lengthy operation. This value is not valid and 181da6c28aaSamw * should be zero when the service does not have a start, stop, pause, or 182da6c28aaSamw * continue operation pending. 183da6c28aaSamw * 184da6c28aaSamw * wait_hint 185da6c28aaSamw * An estimate of the amount of time, in milliseconds, that the service 186da6c28aaSamw * expects a pending start, stop, pause, or continue operation to take 187da6c28aaSamw * before the service makes its next call to the SetServiceStatus 188da6c28aaSamw * function with either an incremented check_point value or a change in 189da6c28aaSamw * dwCurrentState. If the amount of time specified by wait_hint passes, 190da6c28aaSamw * and check_point has not been incremented, or cur_state has not changed, 191da6c28aaSamw * the service control manager or service control program can assume that 192da6c28aaSamw * an error has occurred and the service should be stopped. 193da6c28aaSamw */ 194da6c28aaSamwstruct svc_status { 195da6c28aaSamw DWORD service_type; 196da6c28aaSamw DWORD cur_state; 197da6c28aaSamw DWORD ctrl_accepted; 198da6c28aaSamw DWORD w32_exitcode; 199da6c28aaSamw DWORD svc_specified_exitcode; 200da6c28aaSamw DWORD check_point; 201da6c28aaSamw DWORD wait_hint; 202da6c28aaSamw}; 203da6c28aaSamwtypedef struct svc_status svc_status_t; 204da6c28aaSamw 205da6c28aaSamwstruct svc_enum_status { 206da6c28aaSamw DWORD svc_name; /* offset within response buffer */ 207da6c28aaSamw DWORD display_name; /* offset within response buffer */ 208da6c28aaSamw svc_status_t svc_status; 209da6c28aaSamw}; 210da6c28aaSamwtypedef struct svc_enum_status svc_enum_status_t; 211da6c28aaSamw 212da6c28aaSamwstruct svc_config { 213da6c28aaSamw DWORD service_type; 214da6c28aaSamw DWORD start_type; 215da6c28aaSamw DWORD error_control; 216da6c28aaSamw LPTSTR binary_pathname; 217da6c28aaSamw LPTSTR loadorder_group; 218da6c28aaSamw DWORD tag_id; 219da6c28aaSamw LPTSTR dependencies; 220da6c28aaSamw LPTSTR service_startname; 221da6c28aaSamw LPTSTR display_name; 222da6c28aaSamw}; 223da6c28aaSamwtypedef struct svc_config svc_config_t; 224da6c28aaSamw 225b89a8333Snatalie li - Sun Microsystems - Irvine United Statesstruct svc_failure_actions { 226b89a8333Snatalie li - Sun Microsystems - Irvine United States DWORD reset_period; 227b89a8333Snatalie li - Sun Microsystems - Irvine United States DWORD rebootmsg_offset; 228b89a8333Snatalie li - Sun Microsystems - Irvine United States DWORD command_offset; 229b89a8333Snatalie li - Sun Microsystems - Irvine United States DWORD actions; 230b89a8333Snatalie li - Sun Microsystems - Irvine United States DWORD actions_offset; 231b89a8333Snatalie li - Sun Microsystems - Irvine United States}; 232b89a8333Snatalie li - Sun Microsystems - Irvine United Statestypedef struct svc_failure_actions svc_failure_actions_t; 233b89a8333Snatalie li - Sun Microsystems - Irvine United States 234b89a8333Snatalie li - Sun Microsystems - Irvine United Statesstruct svc_description { 235b89a8333Snatalie li - Sun Microsystems - Irvine United States DWORD desc; /* offset of description string */ 236b89a8333Snatalie li - Sun Microsystems - Irvine United States}; 237b89a8333Snatalie li - Sun Microsystems - Irvine United Statestypedef struct svc_description svc_description_t; 238da6c28aaSamw 239*e3f2c991SKeyur Desai/* Boolean flag to control delayed start of service. Set 1=true, 0=false */ 240*e3f2c991SKeyur Desaistruct svc_delayed_auto_start { 241*e3f2c991SKeyur Desai DWORD dstart; 242*e3f2c991SKeyur Desai}; 243*e3f2c991SKeyur Desaitypedef struct svc_delayed_auto_start svc_delayed_auto_start_t; 244*e3f2c991SKeyur Desai 245*e3f2c991SKeyur Desai/* Boolean flag to control configured failure action. Set 1=true, 0=false */ 246*e3f2c991SKeyur Desaistruct svc_config_failure_action { 247*e3f2c991SKeyur Desai DWORD cfa; 248*e3f2c991SKeyur Desai}; 249*e3f2c991SKeyur Desaitypedef struct svc_config_failure_action svc_config_failure_action_t; 250*e3f2c991SKeyur Desai 251da6c28aaSamw/* 252da6c28aaSamw *********************************************************************** 253da6c28aaSamw * Close 254da6c28aaSamw *********************************************************************** 255da6c28aaSamw */ 256da6c28aaSamwOPERATION(SVCCTL_OPNUM_Close) 257da6c28aaSamwstruct svcctl_Close { 258da6c28aaSamw IN svcctl_handle_t handle; 259da6c28aaSamw OUT svcctl_handle_t result_handle; 260da6c28aaSamw OUT DWORD status; 261da6c28aaSamw}; 262da6c28aaSamw 263037cac00Sjoyce mcintosh/* 264037cac00Sjoyce mcintosh *********************************************************************** 265037cac00Sjoyce mcintosh * ControlService 266037cac00Sjoyce mcintosh *********************************************************************** 267037cac00Sjoyce mcintosh */ 268037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_ControlService) 269037cac00Sjoyce mcintoshstruct svcctl_ControlService { 270037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 271037cac00Sjoyce mcintosh IN DWORD control; 272037cac00Sjoyce mcintosh OUT svc_status_t service_status; 273037cac00Sjoyce mcintosh OUT DWORD status; 274037cac00Sjoyce mcintosh}; 275037cac00Sjoyce mcintosh 276037cac00Sjoyce mcintosh/* 277037cac00Sjoyce mcintosh *********************************************************************** 278037cac00Sjoyce mcintosh * DeleteService 279037cac00Sjoyce mcintosh *********************************************************************** 280037cac00Sjoyce mcintosh */ 281037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_DeleteService) 282037cac00Sjoyce mcintoshstruct svcctl_DeleteService { 283037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 284037cac00Sjoyce mcintosh OUT DWORD status; 285037cac00Sjoyce mcintosh}; 286037cac00Sjoyce mcintosh 287037cac00Sjoyce mcintosh/* 288037cac00Sjoyce mcintosh *********************************************************************** 289037cac00Sjoyce mcintosh * QueryServiceSecurity 290037cac00Sjoyce mcintosh *********************************************************************** 291037cac00Sjoyce mcintosh */ 292037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_QueryServiceSecurity) 293037cac00Sjoyce mcintoshstruct svcctl_QueryServiceSecurity { 294037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 295037cac00Sjoyce mcintosh IN DWORD security_info; 296037cac00Sjoyce mcintosh IN DWORD buf_size; 297037cac00Sjoyce mcintosh SIZE_IS(buf_size) 298037cac00Sjoyce mcintosh OUT REFERENCE LPBYTE buffer; 299037cac00Sjoyce mcintosh OUT DWORD bytes_needed; 300037cac00Sjoyce mcintosh OUT DWORD status; 301037cac00Sjoyce mcintosh}; 302037cac00Sjoyce mcintosh 303037cac00Sjoyce mcintosh/* 304037cac00Sjoyce mcintosh *********************************************************************** 305037cac00Sjoyce mcintosh * SetServiceSecurity 306037cac00Sjoyce mcintosh *********************************************************************** 307037cac00Sjoyce mcintosh */ 308037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_SetServiceSecurity) 309037cac00Sjoyce mcintoshstruct svcctl_SetServiceSecurity { 310037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 311037cac00Sjoyce mcintosh IN DWORD security_info; 312037cac00Sjoyce mcintosh SIZE_IS(buf_size) 313037cac00Sjoyce mcintosh IN REFERENCE LPBYTE buffer; 314037cac00Sjoyce mcintosh IN DWORD buf_size; 315037cac00Sjoyce mcintosh OUT DWORD status; 316037cac00Sjoyce mcintosh}; 317da6c28aaSamw 318da6c28aaSamw/* 319da6c28aaSamw *********************************************************************** 320da6c28aaSamw * OpenManager 321da6c28aaSamw *********************************************************************** 322da6c28aaSamw */ 323da6c28aaSamwOPERATION(SVCCTL_OPNUM_OpenManager) 324da6c28aaSamwstruct svcctl_OpenManager { 325da6c28aaSamw IN LPTSTR machine_name; 326da6c28aaSamw IN LPTSTR database_name; 327da6c28aaSamw IN DWORD desired_access; 328da6c28aaSamw OUT svcctl_handle_t handle; 329da6c28aaSamw OUT DWORD status; 330da6c28aaSamw}; 331da6c28aaSamw 332da6c28aaSamw 333da6c28aaSamw/* 334da6c28aaSamw *********************************************************************** 335da6c28aaSamw * OpenService 336da6c28aaSamw *********************************************************************** 337da6c28aaSamw */ 338da6c28aaSamwOPERATION(SVCCTL_OPNUM_OpenService) 339da6c28aaSamwstruct svcctl_OpenService { 340da6c28aaSamw IN svcctl_handle_t manager_handle; 341da6c28aaSamw IN REFERENCE LPTSTR service_name; 342da6c28aaSamw IN DWORD desired_access; 343da6c28aaSamw OUT svcctl_handle_t service_handle; 344da6c28aaSamw OUT DWORD status; 345da6c28aaSamw}; 346da6c28aaSamw 347da6c28aaSamw 348da6c28aaSamw/* 349da6c28aaSamw *********************************************************************** 350da6c28aaSamw * QueryServiceStatus 351da6c28aaSamw *********************************************************************** 352da6c28aaSamw */ 353da6c28aaSamwOPERATION(SVCCTL_OPNUM_QueryServiceStatus) 354da6c28aaSamwstruct svcctl_QueryServiceStatus { 355da6c28aaSamw IN svcctl_handle_t service_handle; 356da6c28aaSamw OUT svc_status_t service_status; 357da6c28aaSamw OUT DWORD status; 358da6c28aaSamw}; 359da6c28aaSamw 360da6c28aaSamw/* 361da6c28aaSamw *********************************************************************** 362037cac00Sjoyce mcintosh * EnumDependentServices 363037cac00Sjoyce mcintosh *********************************************************************** 364037cac00Sjoyce mcintosh */ 365037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_EnumDependentServices) 366037cac00Sjoyce mcintoshstruct svcctl_EnumDependentServices { 367037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 368037cac00Sjoyce mcintosh IN DWORD svc_state; 369037cac00Sjoyce mcintosh IN DWORD buf_size; 370037cac00Sjoyce mcintosh SIZE_IS(buf_size) 371037cac00Sjoyce mcintosh OUT REFERENCE LPBYTE services; 372037cac00Sjoyce mcintosh OUT DWORD bytes_needed; 373037cac00Sjoyce mcintosh OUT DWORD svc_num; 374037cac00Sjoyce mcintosh OUT DWORD status; 375037cac00Sjoyce mcintosh}; 376037cac00Sjoyce mcintosh 377037cac00Sjoyce mcintosh/* 378037cac00Sjoyce mcintosh *********************************************************************** 379da6c28aaSamw * EnumServicesStatus 380da6c28aaSamw *********************************************************************** 381da6c28aaSamw */ 382da6c28aaSamwOPERATION(SVCCTL_OPNUM_EnumServicesStatus) 383da6c28aaSamwstruct svcctl_EnumServicesStatus { 384da6c28aaSamw IN svcctl_handle_t manager_handle; 385da6c28aaSamw IN DWORD svc_type; 386da6c28aaSamw IN DWORD svc_state; 387b89a8333Snatalie li - Sun Microsystems - Irvine United States IN DWORD buf_size; 388b89a8333Snatalie li - Sun Microsystems - Irvine United States SIZE_IS(buf_size) 389b89a8333Snatalie li - Sun Microsystems - Irvine United States OUT REFERENCE LPBYTE services; 390da6c28aaSamw OUT DWORD bytes_needed; 391da6c28aaSamw OUT DWORD svc_num; 392b89a8333Snatalie li - Sun Microsystems - Irvine United States INOUT DWORD *resume_handle; 393da6c28aaSamw OUT DWORD status; 394da6c28aaSamw}; 395da6c28aaSamw 396da6c28aaSamw/* 397da6c28aaSamw *********************************************************************** 398da6c28aaSamw * QueryServiceConfig 399da6c28aaSamw *********************************************************************** 400da6c28aaSamw */ 401da6c28aaSamwOPERATION(SVCCTL_OPNUM_QueryServiceConfig) 402da6c28aaSamwstruct svcctl_QueryServiceConfig { 403da6c28aaSamw IN svcctl_handle_t service_handle; 404da6c28aaSamw IN DWORD buf_size; 405da6c28aaSamw OUT svc_config_t service_cfg; 406da6c28aaSamw OUT DWORD cfg_bytes; 407da6c28aaSamw OUT DWORD status; 408da6c28aaSamw}; 409da6c28aaSamw 410da6c28aaSamw/* 411da6c28aaSamw *********************************************************************** 412037cac00Sjoyce mcintosh * StartService 413037cac00Sjoyce mcintosh * 414037cac00Sjoyce mcintosh * argc: The number of strings in argv. If argv is NULL, 415037cac00Sjoyce mcintosh * argc may be 0. 416037cac00Sjoyce mcintosh * argv: A pointer to a buffer containing an array of 417037cac00Sjoyce mcintosh * null-terminated Unicode strings. 418037cac00Sjoyce mcintosh * 419037cac00Sjoyce mcintosh * For service management support, this should probably be: 420037cac00Sjoyce mcintosh * IN DWORD argc; 421037cac00Sjoyce mcintosh * SIZE_IS(buf_size) 422037cac00Sjoyce mcintosh * IN REFERENCE LPBYTE argv; 423037cac00Sjoyce mcintosh *********************************************************************** 424037cac00Sjoyce mcintosh */ 425037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_StartService) 426037cac00Sjoyce mcintoshstruct svcctl_StartService { 427037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 428037cac00Sjoyce mcintosh IN DWORD argc; 429037cac00Sjoyce mcintosh IN DWORD argv; 430037cac00Sjoyce mcintosh OUT DWORD status; 431037cac00Sjoyce mcintosh}; 432037cac00Sjoyce mcintosh 433037cac00Sjoyce mcintosh/* 434037cac00Sjoyce mcintosh *********************************************************************** 4353db3f65cSamw * GetServiceDisplayNameW 4363db3f65cSamw *********************************************************************** 4373db3f65cSamw */ 4383db3f65cSamwOPERATION(SVCCTL_OPNUM_GetServiceDisplayNameW) 4393db3f65cSamwstruct svcctl_GetServiceDisplayNameW { 440b89a8333Snatalie li - Sun Microsystems - Irvine United States IN svcctl_handle_t manager_handle; 441b89a8333Snatalie li - Sun Microsystems - Irvine United States IN REFERENCE LPTSTR service_name; 442b89a8333Snatalie li - Sun Microsystems - Irvine United States OUT REFERENCE LPTSTR display_name; 4433db3f65cSamw INOUT DWORD buf_size; 4443db3f65cSamw OUT DWORD status; 4453db3f65cSamw}; 4463db3f65cSamw 4473db3f65cSamw/* 4483db3f65cSamw *********************************************************************** 4493db3f65cSamw * GetServiceKeyNameW 4503db3f65cSamw *********************************************************************** 4513db3f65cSamw */ 4523db3f65cSamwOPERATION(SVCCTL_OPNUM_GetServiceKeyNameW) 4533db3f65cSamwstruct svcctl_GetServiceKeyNameW { 454b89a8333Snatalie li - Sun Microsystems - Irvine United States IN svcctl_handle_t manager_handle; 455b89a8333Snatalie li - Sun Microsystems - Irvine United States IN REFERENCE LPTSTR service_name; 456b89a8333Snatalie li - Sun Microsystems - Irvine United States OUT REFERENCE LPTSTR key_name; 4573db3f65cSamw INOUT DWORD buf_size; 4583db3f65cSamw OUT DWORD status; 4593db3f65cSamw}; 4603db3f65cSamw 4613db3f65cSamw/* 4623db3f65cSamw *********************************************************************** 463037cac00Sjoyce mcintosh * OpenSCManagerA 464037cac00Sjoyce mcintosh *********************************************************************** 465037cac00Sjoyce mcintosh */ 466037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_OpenSCManagerA) 467037cac00Sjoyce mcintoshstruct svcctl_OpenSCManagerA { 468037cac00Sjoyce mcintosh IN struct svcctl_value *machine_name; 469037cac00Sjoyce mcintosh IN struct svcctl_value *database_name; 470037cac00Sjoyce mcintosh IN DWORD desired_access; 471037cac00Sjoyce mcintosh OUT svcctl_handle_t handle; 472037cac00Sjoyce mcintosh OUT DWORD status; 473037cac00Sjoyce mcintosh}; 474037cac00Sjoyce mcintosh 475037cac00Sjoyce mcintosh/* 476037cac00Sjoyce mcintosh *********************************************************************** 477037cac00Sjoyce mcintosh * OpenServiceA 478037cac00Sjoyce mcintosh *********************************************************************** 479037cac00Sjoyce mcintosh */ 480037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_OpenServiceA) 481037cac00Sjoyce mcintoshstruct svcctl_OpenServiceA { 482037cac00Sjoyce mcintosh IN svcctl_handle_t manager_handle; 483037cac00Sjoyce mcintosh IN REFERENCE struct svcctl_value *service_name; 484037cac00Sjoyce mcintosh IN DWORD desired_access; 485037cac00Sjoyce mcintosh OUT svcctl_handle_t service_handle; 486037cac00Sjoyce mcintosh OUT DWORD status; 487037cac00Sjoyce mcintosh}; 488037cac00Sjoyce mcintosh 489037cac00Sjoyce mcintosh/* 490037cac00Sjoyce mcintosh *********************************************************************** 491037cac00Sjoyce mcintosh * EnumServicesStatusA 492037cac00Sjoyce mcintosh *********************************************************************** 493037cac00Sjoyce mcintosh */ 494037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_EnumServicesStatusA) 495037cac00Sjoyce mcintoshstruct svcctl_EnumServicesStatusA { 496037cac00Sjoyce mcintosh IN svcctl_handle_t manager_handle; 497037cac00Sjoyce mcintosh IN DWORD svc_type; 498037cac00Sjoyce mcintosh IN DWORD svc_state; 499037cac00Sjoyce mcintosh IN DWORD buf_size; 500037cac00Sjoyce mcintosh SIZE_IS(buf_size) 501037cac00Sjoyce mcintosh OUT REFERENCE LPBYTE services; 502037cac00Sjoyce mcintosh OUT DWORD bytes_needed; 503037cac00Sjoyce mcintosh OUT DWORD svc_num; 504037cac00Sjoyce mcintosh INOUT DWORD *resume_handle; 505037cac00Sjoyce mcintosh OUT DWORD status; 506037cac00Sjoyce mcintosh}; 507037cac00Sjoyce mcintosh 508037cac00Sjoyce mcintosh/* 509037cac00Sjoyce mcintosh *********************************************************************** 510b89a8333Snatalie li - Sun Microsystems - Irvine United States * QueryServiceConfig2W 511b89a8333Snatalie li - Sun Microsystems - Irvine United States *********************************************************************** 512b89a8333Snatalie li - Sun Microsystems - Irvine United States */ 513b89a8333Snatalie li - Sun Microsystems - Irvine United StatesOPERATION(SVCCTL_OPNUM_QueryServiceConfig2W) 514b89a8333Snatalie li - Sun Microsystems - Irvine United Statesstruct svcctl_QueryServiceConfig2W { 515b89a8333Snatalie li - Sun Microsystems - Irvine United States IN svcctl_handle_t service_handle; 516b89a8333Snatalie li - Sun Microsystems - Irvine United States IN DWORD info_level; 517b89a8333Snatalie li - Sun Microsystems - Irvine United States IN DWORD buf_size; 518b89a8333Snatalie li - Sun Microsystems - Irvine United States SIZE_IS(buf_size) 519b89a8333Snatalie li - Sun Microsystems - Irvine United States OUT REFERENCE LPBYTE buffer; 520b89a8333Snatalie li - Sun Microsystems - Irvine United States OUT DWORD bytes_needed; 521b89a8333Snatalie li - Sun Microsystems - Irvine United States OUT DWORD status; 522b89a8333Snatalie li - Sun Microsystems - Irvine United States}; 523b89a8333Snatalie li - Sun Microsystems - Irvine United States 524b89a8333Snatalie li - Sun Microsystems - Irvine United States/* 525b89a8333Snatalie li - Sun Microsystems - Irvine United States *********************************************************************** 526037cac00Sjoyce mcintosh * QueryServiceStatusEx 527037cac00Sjoyce mcintosh *********************************************************************** 528037cac00Sjoyce mcintosh */ 529037cac00Sjoyce mcintoshstruct svc_status_ex { 530037cac00Sjoyce mcintosh DWORD service_type; 531037cac00Sjoyce mcintosh DWORD cur_state; 532037cac00Sjoyce mcintosh DWORD ctrl_accepted; 533037cac00Sjoyce mcintosh DWORD w32_exitcode; 534037cac00Sjoyce mcintosh DWORD svc_specified_exitcode; 535037cac00Sjoyce mcintosh DWORD check_point; 536037cac00Sjoyce mcintosh DWORD wait_hint; 537037cac00Sjoyce mcintosh DWORD process_id; 538037cac00Sjoyce mcintosh DWORD service_flags; 539037cac00Sjoyce mcintosh}; 540037cac00Sjoyce mcintoshtypedef struct svc_status_ex svc_status_ex_t; 541037cac00Sjoyce mcintosh 542037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_QueryServiceStatusEx) 543037cac00Sjoyce mcintoshstruct svcctl_QueryServiceStatusEx { 544037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 545037cac00Sjoyce mcintosh IN DWORD info_level; 546037cac00Sjoyce mcintosh IN DWORD buf_size; 547037cac00Sjoyce mcintosh SIZE_IS(buf_size) 548037cac00Sjoyce mcintosh OUT REFERENCE LPBYTE buffer; 549037cac00Sjoyce mcintosh OUT DWORD bytes_needed; 550037cac00Sjoyce mcintosh OUT DWORD status; 551037cac00Sjoyce mcintosh}; 552037cac00Sjoyce mcintosh 553037cac00Sjoyce mcintosh/* 554037cac00Sjoyce mcintosh *********************************************************************** 555da6c28aaSamw * The SVCCTL interface definition. 556da6c28aaSamw *********************************************************************** 557da6c28aaSamw */ 558da6c28aaSamwINTERFACE(0) 559da6c28aaSamwunion svcctl_interface { 560da6c28aaSamw CASE(SVCCTL_OPNUM_Close) 561da6c28aaSamw struct svcctl_Close SvcClose; 562037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_ControlService) 563037cac00Sjoyce mcintosh struct svcctl_ControlService SvcControlService; 564037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_DeleteService) 565037cac00Sjoyce mcintosh struct svcctl_DeleteService SvcDeleteService; 566037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_QueryServiceSecurity) 567037cac00Sjoyce mcintosh struct svcctl_QueryServiceSecurity SvcQueryServiceSecurity; 568037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_SetServiceSecurity) 569037cac00Sjoyce mcintosh struct svcctl_SetServiceSecurity SvcSetServiceSecurity; 570da6c28aaSamw CASE(SVCCTL_OPNUM_OpenManager) 571da6c28aaSamw struct svcctl_OpenManager SvcOpenManager; 572da6c28aaSamw CASE(SVCCTL_OPNUM_OpenService) 573da6c28aaSamw struct svcctl_OpenService SvcOpenService; 574da6c28aaSamw CASE(SVCCTL_OPNUM_QueryServiceStatus) 575da6c28aaSamw struct svcctl_QueryServiceStatus SvcQueryServiceStatus; 576037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_EnumDependentServices) 577037cac00Sjoyce mcintosh struct svcctl_EnumDependentServices Svc_EnumDependentServices; 578da6c28aaSamw CASE(SVCCTL_OPNUM_EnumServicesStatus) 579da6c28aaSamw struct svcctl_EnumServicesStatus SvcEnumServicesStatus; 580da6c28aaSamw CASE(SVCCTL_OPNUM_QueryServiceConfig) 581da6c28aaSamw struct svcctl_QueryServiceConfig SvcQueryServiceConfig; 582037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_StartService) 583037cac00Sjoyce mcintosh struct svcctl_StartService SvcStartService; 5843db3f65cSamw CASE(SVCCTL_OPNUM_GetServiceDisplayNameW) 5853db3f65cSamw struct svcctl_GetServiceDisplayNameW SvcGetServiceDisplayNameW; 5863db3f65cSamw CASE(SVCCTL_OPNUM_GetServiceKeyNameW) 5873db3f65cSamw struct svcctl_GetServiceKeyNameW SvcGetServiceKeyNameW; 588037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_OpenSCManagerA) 589037cac00Sjoyce mcintosh struct svcctl_OpenSCManagerA SvcOpenSCManagerA; 590037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_OpenServiceA) 591037cac00Sjoyce mcintosh struct svcctl_OpenServiceA SvcOpenServiceA; 592037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_EnumServicesStatusA) 593037cac00Sjoyce mcintosh struct svcctl_EnumServicesStatusA SvcEnumServicesStatusA; 594b89a8333Snatalie li - Sun Microsystems - Irvine United States CASE(SVCCTL_OPNUM_QueryServiceConfig2W) 595b89a8333Snatalie li - Sun Microsystems - Irvine United States struct svcctl_QueryServiceConfig2W SvcQueryServiceConfig2W; 596037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_QueryServiceStatusEx) 597037cac00Sjoyce mcintosh struct svcctl_QueryServiceStatusEx SvcQueryServiceStatusEx; 598da6c28aaSamw}; 599da6c28aaSamw 600da6c28aaSamwtypedef union svcctl_interface svcctl_interface_t; 601da6c28aaSamwEXTERNTYPEINFO(svcctl_interface) 602da6c28aaSamw 603da6c28aaSamw 604da6c28aaSamw#endif /* _MLSVC_SVCCTL_NDL_ */ 605