[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SERVICE_STATUS
{
public static readonly int SizeOf = Marshal.SizeOf(typeof(SERVICE_STATUS));
public SERVICE_TYPES dwServiceType;
public SERVICE_STATE dwCurrentState;
public uint dwControlsAccepted;
public uint dwWin32ExitCode;
public uint dwServiceSpecificExitCode;
public uint dwCheckPoint;
public uint dwWaitHint;
}
VB .NET Definition:
Private Structure SERVICE_STATUS
Dim dwServiceType As Int32
Dim dwCurrentState As Int32
Dim dwControlsAccepted As Int32
Dim dwWin32ExitCode As Int32
Dim dwServiceSpecificExitCode As Int32
Dim dwCheckPoint As Int32
Dim dwWaitHint As Int32
End Structure
The ControlService function sends a control code to a service.
8/15/2008 12:33:46 PM - 74.74.236.101
The EnumDependentServices function retrieves the name and status of each service that depends on the specified service; that is, the specified service must be running before the dependent services can run.
3/16/2007 7:31:59 AM - anfortas.geo@yahoo.com-216.204.61.86
Enumerates services in the specified service control manager database. The name and status of each service are provided, long with additional data based on the specified information level.
7/8/2010 5:38:21 PM - -74.56.93.131
The QueryServiceStatusEx function retrieves the current status of the specified service based on the specified information level.
5/20/2011 5:54:47 AM - Arjan Mels-77.160.7.209
This API allows you top set the status on a Windows Service. This is especially helpful in .NET in the various events you override from the ServiceBase class. For example, in the OnStart event, here is a recommendatation (see below for a custom enumeration with the SERVICE_START_PENDING and other states):
6/30/2016 9:32:08 AM - Shavais-70.102.219.194
Enumerates services in the specified service control manager database. The name and status of each service are provided, long with additional data based on the specified information level.
7/8/2010 5:38:21 PM - -74.56.93.131
The EnumDependentServices function retrieves the name and status of each service that depends on the specified service; that is, the specified service must be running before the dependent services can run.
3/16/2007 7:31:59 AM - anfortas.geo@yahoo.com-216.204.61.86
The ControlService function sends a control code to a service.