winsvc.h header

This header is used by Security and Identity. For more information, see:

Functions

Title Description
ChangeServiceConfig2A Changes the optional configuration parameters of a service.
ChangeServiceConfig2W Changes the optional configuration parameters of a service.
ChangeServiceConfigA Changes the configuration parameters of a service.
ChangeServiceConfigW Changes the configuration parameters of a service.
CloseServiceHandle Closes a handle to a service control manager or service object.
ControlService Sends a control code to a service.
ControlServiceExA Sends a control code to a service.
ControlServiceExW Sends a control code to a service.
CreateServiceA Creates a service object and adds it to the specified service control manager database.
CreateServiceW Creates a service object and adds it to the specified service control manager database.
DeleteService Marks the specified service for deletion from the service control manager database.
EnumDependentServicesA Retrieves the name and status of each service that depends on the specified service.
EnumDependentServicesW Retrieves the name and status of each service that depends on the specified service.
EnumServicesStatusA Enumerates services in the specified service control manager database. The name and status of each service are provided.
EnumServicesStatusExA Enumerates services in the specified service control manager database. The name and status of each service are provided, along with additional data based on the specified information level.
EnumServicesStatusExW Enumerates services in the specified service control manager database. The name and status of each service are provided, along with additional data based on the specified information level.
EnumServicesStatusW Enumerates services in the specified service control manager database. The name and status of each service are provided.
GetServiceDirectory Returns a path for a per-service filesystem location for a service to read and/or write state to.
GetServiceDisplayNameA Retrieves the display name of the specified service.
GetServiceDisplayNameW Retrieves the display name of the specified service.
GetServiceKeyNameA Retrieves the service name of the specified service.
GetServiceKeyNameW Retrieves the service name of the specified service.
GetServiceRegistryStateKey Returns a handle for a registry key for a service to read and/or write state to.
LockServiceDatabase Requests ownership of the service control manager (SCM) database lock. Only one process can own the lock at any specified time.
NotifyBootConfigStatus Reports the boot status to the service control manager. It is used by boot verification programs.
NotifyServiceStatusChangeA Enables an application to receive notification when the specified service is created or deleted or when its status changes.
NotifyServiceStatusChangeW Enables an application to receive notification when the specified service is created or deleted or when its status changes.
OpenSCManagerA Establishes a connection to the service control manager on the specified computer and opens the specified service control manager database.
OpenSCManagerW Establishes a connection to the service control manager on the specified computer and opens the specified service control manager database.
OpenServiceA Opens an existing service.
OpenServiceW Opens an existing service.
QueryServiceConfig2A Retrieves the optional configuration parameters of the specified service.
QueryServiceConfig2W Retrieves the optional configuration parameters of the specified service.
QueryServiceConfigA Retrieves the configuration parameters of the specified service.
QueryServiceConfigW Retrieves the configuration parameters of the specified service.
QueryServiceDynamicInformation Retrieves dynamic information related to the current service start.
QueryServiceLockStatusA Retrieves the lock status of the specified service control manager database.
QueryServiceLockStatusW Retrieves the lock status of the specified service control manager database.
QueryServiceObjectSecurity Retrieves a copy of the security descriptor associated with a service object.
QueryServiceStatus Retrieves the current status of the specified service.
QueryServiceStatusEx Retrieves the current status of the specified service based on the specified information level.
RegisterServiceCtrlHandlerA Registers a function to handle service control requests.
RegisterServiceCtrlHandlerExA Registers a function to handle extended service control requests.
RegisterServiceCtrlHandlerExW Registers a function to handle extended service control requests.
RegisterServiceCtrlHandlerW Registers a function to handle service control requests.
SetServiceObjectSecurity Sets the security descriptor of a service object.
SetServiceStatus Updates the service control manager's status information for the calling service.
StartServiceA Starts a service.
StartServiceCtrlDispatcherA Connects the main thread of a service process to the service control manager, which causes the thread to be the service control dispatcher thread for the calling process.
StartServiceCtrlDispatcherW Connects the main thread of a service process to the service control manager, which causes the thread to be the service control dispatcher thread for the calling process.
StartServiceW Starts a service.
UnlockServiceDatabase Unlocks a service control manager database by releasing the specified lock.

Callback functions

Title Description
LPHANDLER_FUNCTION An application-defined callback function used with the RegisterServiceCtrlHandler function. A service program can use it as the control handler function of a particular service.
LPHANDLER_FUNCTION_EX An application-defined callback function used with the RegisterServiceCtrlHandlerEx function. A service program can use it as the control handler function of a particular service.
LPSERVICE_MAIN_FUNCTIONA The entry point for a service.
LPSERVICE_MAIN_FUNCTIONW The entry point for a service.

Structures

Title Description
ENUM_SERVICE_STATUS_PROCESSA Contains the name of a service in a service control manager database and information about the service. It is used by the EnumServicesStatusEx function.
ENUM_SERVICE_STATUS_PROCESSW Contains the name of a service in a service control manager database and information about the service. It is used by the EnumServicesStatusEx function.
ENUM_SERVICE_STATUSA Contains the name of a service in a service control manager database and information about that service. It is used by the EnumDependentServices and EnumServicesStatus functions.
ENUM_SERVICE_STATUSW Contains the name of a service in a service control manager database and information about that service. It is used by the EnumDependentServices and EnumServicesStatus functions.
QUERY_SERVICE_CONFIGA Contains configuration information for an installed service. It is used by the QueryServiceConfig function.
QUERY_SERVICE_CONFIGW Contains configuration information for an installed service. It is used by the QueryServiceConfig function.
QUERY_SERVICE_LOCK_STATUSA Contains information about the lock status of a service control manager database. It is used by the QueryServiceLockStatus function.
QUERY_SERVICE_LOCK_STATUSW Contains information about the lock status of a service control manager database. It is used by the QueryServiceLockStatus function.
SC_ACTION Represents an action that the service control manager can perform.
SERVICE_CONTROL_STATUS_REASON_PARAMSA Contains service control parameters.
SERVICE_CONTROL_STATUS_REASON_PARAMSW Contains service control parameters.
SERVICE_DELAYED_AUTO_START_INFO Contains the delayed auto-start setting of an auto-start service.
SERVICE_DESCRIPTIONA Contains a service description.
SERVICE_DESCRIPTIONW Contains a service description.
SERVICE_FAILURE_ACTIONS_FLAG Contains the failure actions flag setting of a service. This setting determines when failure actions are to be executed.
SERVICE_FAILURE_ACTIONSA Represents the action the service controller should take on each failure of a service. A service is considered failed when it terminates without reporting a status of SERVICE_STOPPED to the service controller.
SERVICE_FAILURE_ACTIONSW Represents the action the service controller should take on each failure of a service. A service is considered failed when it terminates without reporting a status of SERVICE_STOPPED to the service controller.
SERVICE_LAUNCH_PROTECTED_INFO Indicates a service protection type.
SERVICE_NOTIFY_2A Represents service status notification information.
SERVICE_NOTIFY_2W Represents service status notification information.
SERVICE_PREFERRED_NODE_INFO Represents the preferred node on which to run a service.
SERVICE_PRESHUTDOWN_INFO Contains preshutdown settings.
SERVICE_REQUIRED_PRIVILEGES_INFOA Represents the required privileges for a service.
SERVICE_REQUIRED_PRIVILEGES_INFOW Represents the required privileges for a service.
SERVICE_SID_INFO Represents a service security identifier (SID).
SERVICE_STATUS Contains status information for a service.
SERVICE_STATUS_PROCESS Contains process status information for a service. The ControlServiceEx, EnumServicesStatusEx, NotifyServiceStatusChange, and QueryServiceStatusEx functions use this structure.
SERVICE_TABLE_ENTRYA Specifies the ServiceMain function for a service that can run in the calling process. It is used by the StartServiceCtrlDispatcher function.
SERVICE_TABLE_ENTRYW Specifies the ServiceMain function for a service that can run in the calling process. It is used by the StartServiceCtrlDispatcher function.
SERVICE_TIMECHANGE_INFO Contains system time change settings.
SERVICE_TRIGGER Represents a service trigger event. This structure is used by the SERVICE_TRIGGER_INFO structure.
SERVICE_TRIGGER_INFO Contains trigger event information for a service. This structure is used by the ChangeServiceConfig2 and QueryServiceConfig2 functions.
SERVICE_TRIGGER_SPECIFIC_DATA_ITEM Contains trigger-specific data for a service trigger event.

Enumerations

Title Description
SERVICE_DIRECTORY_TYPE Specifies the type of a per-service directory path.
SERVICE_REGISTRY_STATE_TYPE Specifies a state type for a service registry key.