NT_OpenSCManager [machine name]

NT_OpenSCManager opens a connection to the service control manager on the computer specified and returns a handle for that connection. If no computer name is specified it opens a connection to the local SC Manager. NOTE: the computer name must not be prefixed with the double backslash. \\ntmach is not valid, just ntmach will work.

NT_EnumServicesStatus scHandle serviceTypeFlags serviceStatusFlags

NT_EnumServicesStatus enumurates all services that match the type and status flags specified.

Type flags:

SERVICE_DRIVER

SERVICE_WIN32

SERVICE_TYPE_ALL

SERVICE_KERNEL_DRIVER

SERVICE_FILE_SYSTEM_DRIVER

SERVICE_ADAPTER

SERVICE_RECOGNIZER_DRIVER

SERVICE_WIN32_OWN_PROCESS

SERVICE_WIN32_SHARE_PROCESS

SERVICE_INTERACTIVE_PROCESS

Status flags:

SERVICE_ACTIVE

SERVICE_INACTIVE

NT_EnumServicesStatus returns a list with one entry per service meeting the flags specified, with each list entry being a list of:

service internal name

service display name

service type

service status

service controls accepted

service win32 exit code

service specific exit code

service checkpoint

service wait hint

NT_OpenService scHandle serviceName accessFlags

NT_OpenService opens a specific service from the SC Manager handle return by NT_OpenSCManager and returns a handle for control operations for that service. Access flags are:

SERVICE_ALL_ACCESS

SERVICE_QUERY_CONFIG

SERVICE_CHANGE_CONFIG

SERVICE_QUERY_STATUS

SERVICE_ENUMERATE_DEPENDENTS

SERVICE_START

SERVICE_STOP

SERVICE_PAUSE_CONTINUE

SERVICE_INTERROGATE

SERVICE_USER_DEFINED_CONTROL

NT_ControlService serviceHandle controlCode

NT_ControlService manipulates the service specified by serviceHandle (returned from NT_OpenService). Control codes are:

SERVICE_CONTROL_STOP

SERVICE_CONTROL_PAUSE

SERVICE_CONTROL_CONTINUE

SERVICE_CONTROL_INTERROGATE

SERVICE_CONTROL_SHUTDOWN

NT_StartService serviceHandle [argumentString]

NT_StartService starts the service specified by the serviceHandle (returned from NT_OpenService), and passes the argumentString to the service as startup parameters.