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/* 22*037cac00Sjoyce 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 64*037cac00Sjoyce 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 81*037cac00Sjoyce mcintosh#define SVCCTL_OPNUM_EnumServicesStatusExA 0x29 82*037cac00Sjoyce 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/* 103*037cac00Sjoyce mcintosh * String definition for the ASCII interface. 104*037cac00Sjoyce mcintosh */ 105*037cac00Sjoyce mcintoshstruct svcctl_value { 106*037cac00Sjoyce mcintosh DWORD vc_first_is; /* 0 */ 107*037cac00Sjoyce mcintosh DWORD vc_length_is; 108*037cac00Sjoyce mcintosh SIZE_IS(vc_length_is) 109*037cac00Sjoyce mcintosh BYTE value[ANY_SIZE_ARRAY]; 110*037cac00Sjoyce mcintosh}; 111*037cac00Sjoyce mcintosh 112*037cac00Sjoyce 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 239da6c28aaSamw/* 240da6c28aaSamw *********************************************************************** 241da6c28aaSamw * Close 242da6c28aaSamw *********************************************************************** 243da6c28aaSamw */ 244da6c28aaSamwOPERATION(SVCCTL_OPNUM_Close) 245da6c28aaSamwstruct svcctl_Close { 246da6c28aaSamw IN svcctl_handle_t handle; 247da6c28aaSamw OUT svcctl_handle_t result_handle; 248da6c28aaSamw OUT DWORD status; 249da6c28aaSamw}; 250da6c28aaSamw 251*037cac00Sjoyce mcintosh/* 252*037cac00Sjoyce mcintosh *********************************************************************** 253*037cac00Sjoyce mcintosh * ControlService 254*037cac00Sjoyce mcintosh *********************************************************************** 255*037cac00Sjoyce mcintosh */ 256*037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_ControlService) 257*037cac00Sjoyce mcintoshstruct svcctl_ControlService { 258*037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 259*037cac00Sjoyce mcintosh IN DWORD control; 260*037cac00Sjoyce mcintosh OUT svc_status_t service_status; 261*037cac00Sjoyce mcintosh OUT DWORD status; 262*037cac00Sjoyce mcintosh}; 263*037cac00Sjoyce mcintosh 264*037cac00Sjoyce mcintosh/* 265*037cac00Sjoyce mcintosh *********************************************************************** 266*037cac00Sjoyce mcintosh * DeleteService 267*037cac00Sjoyce mcintosh *********************************************************************** 268*037cac00Sjoyce mcintosh */ 269*037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_DeleteService) 270*037cac00Sjoyce mcintoshstruct svcctl_DeleteService { 271*037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 272*037cac00Sjoyce mcintosh OUT DWORD status; 273*037cac00Sjoyce mcintosh}; 274*037cac00Sjoyce mcintosh 275*037cac00Sjoyce mcintosh/* 276*037cac00Sjoyce mcintosh *********************************************************************** 277*037cac00Sjoyce mcintosh * QueryServiceSecurity 278*037cac00Sjoyce mcintosh *********************************************************************** 279*037cac00Sjoyce mcintosh */ 280*037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_QueryServiceSecurity) 281*037cac00Sjoyce mcintoshstruct svcctl_QueryServiceSecurity { 282*037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 283*037cac00Sjoyce mcintosh IN DWORD security_info; 284*037cac00Sjoyce mcintosh IN DWORD buf_size; 285*037cac00Sjoyce mcintosh SIZE_IS(buf_size) 286*037cac00Sjoyce mcintosh OUT REFERENCE LPBYTE buffer; 287*037cac00Sjoyce mcintosh OUT DWORD bytes_needed; 288*037cac00Sjoyce mcintosh OUT DWORD status; 289*037cac00Sjoyce mcintosh}; 290*037cac00Sjoyce mcintosh 291*037cac00Sjoyce mcintosh/* 292*037cac00Sjoyce mcintosh *********************************************************************** 293*037cac00Sjoyce mcintosh * SetServiceSecurity 294*037cac00Sjoyce mcintosh *********************************************************************** 295*037cac00Sjoyce mcintosh */ 296*037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_SetServiceSecurity) 297*037cac00Sjoyce mcintoshstruct svcctl_SetServiceSecurity { 298*037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 299*037cac00Sjoyce mcintosh IN DWORD security_info; 300*037cac00Sjoyce mcintosh SIZE_IS(buf_size) 301*037cac00Sjoyce mcintosh IN REFERENCE LPBYTE buffer; 302*037cac00Sjoyce mcintosh IN DWORD buf_size; 303*037cac00Sjoyce mcintosh OUT DWORD status; 304*037cac00Sjoyce mcintosh}; 305da6c28aaSamw 306da6c28aaSamw/* 307da6c28aaSamw *********************************************************************** 308da6c28aaSamw * OpenManager 309da6c28aaSamw *********************************************************************** 310da6c28aaSamw */ 311da6c28aaSamwOPERATION(SVCCTL_OPNUM_OpenManager) 312da6c28aaSamwstruct svcctl_OpenManager { 313da6c28aaSamw IN LPTSTR machine_name; 314da6c28aaSamw IN LPTSTR database_name; 315da6c28aaSamw IN DWORD desired_access; 316da6c28aaSamw OUT svcctl_handle_t handle; 317da6c28aaSamw OUT DWORD status; 318da6c28aaSamw}; 319da6c28aaSamw 320da6c28aaSamw 321da6c28aaSamw/* 322da6c28aaSamw *********************************************************************** 323da6c28aaSamw * OpenService 324da6c28aaSamw *********************************************************************** 325da6c28aaSamw */ 326da6c28aaSamwOPERATION(SVCCTL_OPNUM_OpenService) 327da6c28aaSamwstruct svcctl_OpenService { 328da6c28aaSamw IN svcctl_handle_t manager_handle; 329da6c28aaSamw IN REFERENCE LPTSTR service_name; 330da6c28aaSamw IN DWORD desired_access; 331da6c28aaSamw OUT svcctl_handle_t service_handle; 332da6c28aaSamw OUT DWORD status; 333da6c28aaSamw}; 334da6c28aaSamw 335da6c28aaSamw 336da6c28aaSamw/* 337da6c28aaSamw *********************************************************************** 338da6c28aaSamw * QueryServiceStatus 339da6c28aaSamw *********************************************************************** 340da6c28aaSamw */ 341da6c28aaSamwOPERATION(SVCCTL_OPNUM_QueryServiceStatus) 342da6c28aaSamwstruct svcctl_QueryServiceStatus { 343da6c28aaSamw IN svcctl_handle_t service_handle; 344da6c28aaSamw OUT svc_status_t service_status; 345da6c28aaSamw OUT DWORD status; 346da6c28aaSamw}; 347da6c28aaSamw 348da6c28aaSamw/* 349da6c28aaSamw *********************************************************************** 350*037cac00Sjoyce mcintosh * EnumDependentServices 351*037cac00Sjoyce mcintosh *********************************************************************** 352*037cac00Sjoyce mcintosh */ 353*037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_EnumDependentServices) 354*037cac00Sjoyce mcintoshstruct svcctl_EnumDependentServices { 355*037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 356*037cac00Sjoyce mcintosh IN DWORD svc_state; 357*037cac00Sjoyce mcintosh IN DWORD buf_size; 358*037cac00Sjoyce mcintosh SIZE_IS(buf_size) 359*037cac00Sjoyce mcintosh OUT REFERENCE LPBYTE services; 360*037cac00Sjoyce mcintosh OUT DWORD bytes_needed; 361*037cac00Sjoyce mcintosh OUT DWORD svc_num; 362*037cac00Sjoyce mcintosh OUT DWORD status; 363*037cac00Sjoyce mcintosh}; 364*037cac00Sjoyce mcintosh 365*037cac00Sjoyce mcintosh/* 366*037cac00Sjoyce mcintosh *********************************************************************** 367da6c28aaSamw * EnumServicesStatus 368da6c28aaSamw *********************************************************************** 369da6c28aaSamw */ 370da6c28aaSamwOPERATION(SVCCTL_OPNUM_EnumServicesStatus) 371da6c28aaSamwstruct svcctl_EnumServicesStatus { 372da6c28aaSamw IN svcctl_handle_t manager_handle; 373da6c28aaSamw IN DWORD svc_type; 374da6c28aaSamw IN DWORD svc_state; 375b89a8333Snatalie li - Sun Microsystems - Irvine United States IN DWORD buf_size; 376b89a8333Snatalie li - Sun Microsystems - Irvine United States SIZE_IS(buf_size) 377b89a8333Snatalie li - Sun Microsystems - Irvine United States OUT REFERENCE LPBYTE services; 378da6c28aaSamw OUT DWORD bytes_needed; 379da6c28aaSamw OUT DWORD svc_num; 380b89a8333Snatalie li - Sun Microsystems - Irvine United States INOUT DWORD *resume_handle; 381da6c28aaSamw OUT DWORD status; 382da6c28aaSamw}; 383da6c28aaSamw 384da6c28aaSamw/* 385da6c28aaSamw *********************************************************************** 386da6c28aaSamw * QueryServiceConfig 387da6c28aaSamw *********************************************************************** 388da6c28aaSamw */ 389da6c28aaSamwOPERATION(SVCCTL_OPNUM_QueryServiceConfig) 390da6c28aaSamwstruct svcctl_QueryServiceConfig { 391da6c28aaSamw IN svcctl_handle_t service_handle; 392da6c28aaSamw IN DWORD buf_size; 393da6c28aaSamw OUT svc_config_t service_cfg; 394da6c28aaSamw OUT DWORD cfg_bytes; 395da6c28aaSamw OUT DWORD status; 396da6c28aaSamw}; 397da6c28aaSamw 398da6c28aaSamw/* 399da6c28aaSamw *********************************************************************** 400*037cac00Sjoyce mcintosh * StartService 401*037cac00Sjoyce mcintosh * 402*037cac00Sjoyce mcintosh * argc: The number of strings in argv. If argv is NULL, 403*037cac00Sjoyce mcintosh * argc may be 0. 404*037cac00Sjoyce mcintosh * argv: A pointer to a buffer containing an array of 405*037cac00Sjoyce mcintosh * null-terminated Unicode strings. 406*037cac00Sjoyce mcintosh * 407*037cac00Sjoyce mcintosh * For service management support, this should probably be: 408*037cac00Sjoyce mcintosh * IN DWORD argc; 409*037cac00Sjoyce mcintosh * SIZE_IS(buf_size) 410*037cac00Sjoyce mcintosh * IN REFERENCE LPBYTE argv; 411*037cac00Sjoyce mcintosh *********************************************************************** 412*037cac00Sjoyce mcintosh */ 413*037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_StartService) 414*037cac00Sjoyce mcintoshstruct svcctl_StartService { 415*037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 416*037cac00Sjoyce mcintosh IN DWORD argc; 417*037cac00Sjoyce mcintosh IN DWORD argv; 418*037cac00Sjoyce mcintosh OUT DWORD status; 419*037cac00Sjoyce mcintosh}; 420*037cac00Sjoyce mcintosh 421*037cac00Sjoyce mcintosh/* 422*037cac00Sjoyce mcintosh *********************************************************************** 4233db3f65cSamw * GetServiceDisplayNameW 4243db3f65cSamw *********************************************************************** 4253db3f65cSamw */ 4263db3f65cSamwOPERATION(SVCCTL_OPNUM_GetServiceDisplayNameW) 4273db3f65cSamwstruct svcctl_GetServiceDisplayNameW { 428b89a8333Snatalie li - Sun Microsystems - Irvine United States IN svcctl_handle_t manager_handle; 429b89a8333Snatalie li - Sun Microsystems - Irvine United States IN REFERENCE LPTSTR service_name; 430b89a8333Snatalie li - Sun Microsystems - Irvine United States OUT REFERENCE LPTSTR display_name; 4313db3f65cSamw INOUT DWORD buf_size; 4323db3f65cSamw OUT DWORD status; 4333db3f65cSamw}; 4343db3f65cSamw 4353db3f65cSamw/* 4363db3f65cSamw *********************************************************************** 4373db3f65cSamw * GetServiceKeyNameW 4383db3f65cSamw *********************************************************************** 4393db3f65cSamw */ 4403db3f65cSamwOPERATION(SVCCTL_OPNUM_GetServiceKeyNameW) 4413db3f65cSamwstruct svcctl_GetServiceKeyNameW { 442b89a8333Snatalie li - Sun Microsystems - Irvine United States IN svcctl_handle_t manager_handle; 443b89a8333Snatalie li - Sun Microsystems - Irvine United States IN REFERENCE LPTSTR service_name; 444b89a8333Snatalie li - Sun Microsystems - Irvine United States OUT REFERENCE LPTSTR key_name; 4453db3f65cSamw INOUT DWORD buf_size; 4463db3f65cSamw OUT DWORD status; 4473db3f65cSamw}; 4483db3f65cSamw 4493db3f65cSamw/* 4503db3f65cSamw *********************************************************************** 451*037cac00Sjoyce mcintosh * OpenSCManagerA 452*037cac00Sjoyce mcintosh *********************************************************************** 453*037cac00Sjoyce mcintosh */ 454*037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_OpenSCManagerA) 455*037cac00Sjoyce mcintoshstruct svcctl_OpenSCManagerA { 456*037cac00Sjoyce mcintosh IN struct svcctl_value *machine_name; 457*037cac00Sjoyce mcintosh IN struct svcctl_value *database_name; 458*037cac00Sjoyce mcintosh IN DWORD desired_access; 459*037cac00Sjoyce mcintosh OUT svcctl_handle_t handle; 460*037cac00Sjoyce mcintosh OUT DWORD status; 461*037cac00Sjoyce mcintosh}; 462*037cac00Sjoyce mcintosh 463*037cac00Sjoyce mcintosh/* 464*037cac00Sjoyce mcintosh *********************************************************************** 465*037cac00Sjoyce mcintosh * OpenServiceA 466*037cac00Sjoyce mcintosh *********************************************************************** 467*037cac00Sjoyce mcintosh */ 468*037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_OpenServiceA) 469*037cac00Sjoyce mcintoshstruct svcctl_OpenServiceA { 470*037cac00Sjoyce mcintosh IN svcctl_handle_t manager_handle; 471*037cac00Sjoyce mcintosh IN REFERENCE struct svcctl_value *service_name; 472*037cac00Sjoyce mcintosh IN DWORD desired_access; 473*037cac00Sjoyce mcintosh OUT svcctl_handle_t service_handle; 474*037cac00Sjoyce mcintosh OUT DWORD status; 475*037cac00Sjoyce mcintosh}; 476*037cac00Sjoyce mcintosh 477*037cac00Sjoyce mcintosh/* 478*037cac00Sjoyce mcintosh *********************************************************************** 479*037cac00Sjoyce mcintosh * EnumServicesStatusA 480*037cac00Sjoyce mcintosh *********************************************************************** 481*037cac00Sjoyce mcintosh */ 482*037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_EnumServicesStatusA) 483*037cac00Sjoyce mcintoshstruct svcctl_EnumServicesStatusA { 484*037cac00Sjoyce mcintosh IN svcctl_handle_t manager_handle; 485*037cac00Sjoyce mcintosh IN DWORD svc_type; 486*037cac00Sjoyce mcintosh IN DWORD svc_state; 487*037cac00Sjoyce mcintosh IN DWORD buf_size; 488*037cac00Sjoyce mcintosh SIZE_IS(buf_size) 489*037cac00Sjoyce mcintosh OUT REFERENCE LPBYTE services; 490*037cac00Sjoyce mcintosh OUT DWORD bytes_needed; 491*037cac00Sjoyce mcintosh OUT DWORD svc_num; 492*037cac00Sjoyce mcintosh INOUT DWORD *resume_handle; 493*037cac00Sjoyce mcintosh OUT DWORD status; 494*037cac00Sjoyce mcintosh}; 495*037cac00Sjoyce mcintosh 496*037cac00Sjoyce mcintosh/* 497*037cac00Sjoyce mcintosh *********************************************************************** 498b89a8333Snatalie li - Sun Microsystems - Irvine United States * QueryServiceConfig2W 499b89a8333Snatalie li - Sun Microsystems - Irvine United States *********************************************************************** 500b89a8333Snatalie li - Sun Microsystems - Irvine United States */ 501b89a8333Snatalie li - Sun Microsystems - Irvine United StatesOPERATION(SVCCTL_OPNUM_QueryServiceConfig2W) 502b89a8333Snatalie li - Sun Microsystems - Irvine United Statesstruct svcctl_QueryServiceConfig2W { 503b89a8333Snatalie li - Sun Microsystems - Irvine United States IN svcctl_handle_t service_handle; 504b89a8333Snatalie li - Sun Microsystems - Irvine United States IN DWORD info_level; 505b89a8333Snatalie li - Sun Microsystems - Irvine United States IN DWORD buf_size; 506b89a8333Snatalie li - Sun Microsystems - Irvine United States SIZE_IS(buf_size) 507b89a8333Snatalie li - Sun Microsystems - Irvine United States OUT REFERENCE LPBYTE buffer; 508b89a8333Snatalie li - Sun Microsystems - Irvine United States OUT DWORD bytes_needed; 509b89a8333Snatalie li - Sun Microsystems - Irvine United States OUT DWORD status; 510b89a8333Snatalie li - Sun Microsystems - Irvine United States}; 511b89a8333Snatalie li - Sun Microsystems - Irvine United States 512b89a8333Snatalie li - Sun Microsystems - Irvine United States/* 513b89a8333Snatalie li - Sun Microsystems - Irvine United States *********************************************************************** 514*037cac00Sjoyce mcintosh * QueryServiceStatusEx 515*037cac00Sjoyce mcintosh *********************************************************************** 516*037cac00Sjoyce mcintosh */ 517*037cac00Sjoyce mcintoshstruct svc_status_ex { 518*037cac00Sjoyce mcintosh DWORD service_type; 519*037cac00Sjoyce mcintosh DWORD cur_state; 520*037cac00Sjoyce mcintosh DWORD ctrl_accepted; 521*037cac00Sjoyce mcintosh DWORD w32_exitcode; 522*037cac00Sjoyce mcintosh DWORD svc_specified_exitcode; 523*037cac00Sjoyce mcintosh DWORD check_point; 524*037cac00Sjoyce mcintosh DWORD wait_hint; 525*037cac00Sjoyce mcintosh DWORD process_id; 526*037cac00Sjoyce mcintosh DWORD service_flags; 527*037cac00Sjoyce mcintosh}; 528*037cac00Sjoyce mcintoshtypedef struct svc_status_ex svc_status_ex_t; 529*037cac00Sjoyce mcintosh 530*037cac00Sjoyce mcintoshOPERATION(SVCCTL_OPNUM_QueryServiceStatusEx) 531*037cac00Sjoyce mcintoshstruct svcctl_QueryServiceStatusEx { 532*037cac00Sjoyce mcintosh IN svcctl_handle_t service_handle; 533*037cac00Sjoyce mcintosh IN DWORD info_level; 534*037cac00Sjoyce mcintosh IN DWORD buf_size; 535*037cac00Sjoyce mcintosh SIZE_IS(buf_size) 536*037cac00Sjoyce mcintosh OUT REFERENCE LPBYTE buffer; 537*037cac00Sjoyce mcintosh OUT DWORD bytes_needed; 538*037cac00Sjoyce mcintosh OUT DWORD status; 539*037cac00Sjoyce mcintosh}; 540*037cac00Sjoyce mcintosh 541*037cac00Sjoyce mcintosh/* 542*037cac00Sjoyce mcintosh *********************************************************************** 543da6c28aaSamw * The SVCCTL interface definition. 544da6c28aaSamw *********************************************************************** 545da6c28aaSamw */ 546da6c28aaSamwINTERFACE(0) 547da6c28aaSamwunion svcctl_interface { 548da6c28aaSamw CASE(SVCCTL_OPNUM_Close) 549da6c28aaSamw struct svcctl_Close SvcClose; 550*037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_ControlService) 551*037cac00Sjoyce mcintosh struct svcctl_ControlService SvcControlService; 552*037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_DeleteService) 553*037cac00Sjoyce mcintosh struct svcctl_DeleteService SvcDeleteService; 554*037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_QueryServiceSecurity) 555*037cac00Sjoyce mcintosh struct svcctl_QueryServiceSecurity SvcQueryServiceSecurity; 556*037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_SetServiceSecurity) 557*037cac00Sjoyce mcintosh struct svcctl_SetServiceSecurity SvcSetServiceSecurity; 558da6c28aaSamw CASE(SVCCTL_OPNUM_OpenManager) 559da6c28aaSamw struct svcctl_OpenManager SvcOpenManager; 560da6c28aaSamw CASE(SVCCTL_OPNUM_OpenService) 561da6c28aaSamw struct svcctl_OpenService SvcOpenService; 562da6c28aaSamw CASE(SVCCTL_OPNUM_QueryServiceStatus) 563da6c28aaSamw struct svcctl_QueryServiceStatus SvcQueryServiceStatus; 564*037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_EnumDependentServices) 565*037cac00Sjoyce mcintosh struct svcctl_EnumDependentServices Svc_EnumDependentServices; 566da6c28aaSamw CASE(SVCCTL_OPNUM_EnumServicesStatus) 567da6c28aaSamw struct svcctl_EnumServicesStatus SvcEnumServicesStatus; 568da6c28aaSamw CASE(SVCCTL_OPNUM_QueryServiceConfig) 569da6c28aaSamw struct svcctl_QueryServiceConfig SvcQueryServiceConfig; 570*037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_StartService) 571*037cac00Sjoyce mcintosh struct svcctl_StartService SvcStartService; 5723db3f65cSamw CASE(SVCCTL_OPNUM_GetServiceDisplayNameW) 5733db3f65cSamw struct svcctl_GetServiceDisplayNameW SvcGetServiceDisplayNameW; 5743db3f65cSamw CASE(SVCCTL_OPNUM_GetServiceKeyNameW) 5753db3f65cSamw struct svcctl_GetServiceKeyNameW SvcGetServiceKeyNameW; 576*037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_OpenSCManagerA) 577*037cac00Sjoyce mcintosh struct svcctl_OpenSCManagerA SvcOpenSCManagerA; 578*037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_OpenServiceA) 579*037cac00Sjoyce mcintosh struct svcctl_OpenServiceA SvcOpenServiceA; 580*037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_EnumServicesStatusA) 581*037cac00Sjoyce mcintosh struct svcctl_EnumServicesStatusA SvcEnumServicesStatusA; 582b89a8333Snatalie li - Sun Microsystems - Irvine United States CASE(SVCCTL_OPNUM_QueryServiceConfig2W) 583b89a8333Snatalie li - Sun Microsystems - Irvine United States struct svcctl_QueryServiceConfig2W SvcQueryServiceConfig2W; 584*037cac00Sjoyce mcintosh CASE(SVCCTL_OPNUM_QueryServiceStatusEx) 585*037cac00Sjoyce mcintosh struct svcctl_QueryServiceStatusEx SvcQueryServiceStatusEx; 586da6c28aaSamw}; 587da6c28aaSamw 588da6c28aaSamwtypedef union svcctl_interface svcctl_interface_t; 589da6c28aaSamwEXTERNTYPEINFO(svcctl_interface) 590da6c28aaSamw 591da6c28aaSamw 592da6c28aaSamw#endif /* _MLSVC_SVCCTL_NDL_ */ 593