Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Structures, prefix the name with the module name and a period.
SERVICE_STATUS (Structures)
.
C# Definition:
Complex Structure:
[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;
}
Easier Structure (which appears to work fine and allows you to avoid defining the SERVICE_TYPES and SERVICE_STATE enumerations and to use CLR compliant types (int)):
[StructLayout(LayoutKind.Sequential)]
private struct SERVICE_STATUS
{
public int serviceType;
public int currentState;
public int controlsAccepted;
public int win32ExitCode;
public int serviceSpecificExitCode;
public int checkPoint;
public int waitHint;
}
For example:
dwWaitHint / waitHint
Estimated time required for a pending start, stop, pause, or continue operation, in milliseconds. Before the specified amount of time has elapsed, the service should make its next call to the SetServiceStatus function with either an incremented dwCheckPoint value or a change in dwCurrentState. If the amount of time specified by dwWaitHint passes, and dwCheckPoint has not been incremented or dwCurrentState has not changed, the service control manager or service control program can assume that an error has occurred and the service should be stopped. However, if the service shares a process with other services, the service control manager cannot terminate the service application because it would have to terminate the other services sharing the process as well.
Requirements
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
[StructLayout(LayoutKind.Sequential)]
internal struct ServiceStatus
{
public SERVICE_TYPE dwServiceType;
public SERVICE_STATE dwCurrentState;
public CONTROLS_ACCEPTED dwControlsAccepted;
public long dwWin32ExitCode;
public long dwServiceSpecificExitCode;
public long dwCheckPoint;
public long dwWaitHint;
};
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
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.
8/15/2008 12:33:46 PM - 74.74.236.101
TODO - a short description
10/7/2010 10:31:58 AM - -196.25.255.210
Please edit this page!
Do you have...
helpful tips?
corrections to the existing content?
alternate definitions?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.