A complete set of service functions are provided in the Win32 API. These should be used in place of the NetService functions, unless you need to control services on a LAN Manager 2.x server.
The service functions control services. A service is an application that an administrator can control using the Service Controller interfaces. The service functions are:
NetServiceControl
NetServiceEnum
NetServiceGetInfo
NetServiceInstall
Services allow administrators to control applications on the network and maintain the integrity of users' data. On a typical network, applications are shared by many users. If an administrator terminates an application running on a server, a user who has not finished working with that application can lose important data. When an application is implemented as a service, the service controller checks the status before changing the state of the service. Windows NT Networking provides several standard services, such as the Workstation, Server, and Messenger services.
A service can be started using the service functions. At startup time, the service defines whether it can be stopped, paused, and continued.
The NetServiceControl function controls the operations of network services, and it can provide time hints to controlling applications. The NetServiceEnum function retrieves information about all started services. The NetServiceGetInfo function retrieves information about a particular started service. The NetServiceInstall function starts a network service.
The service functions provide service information at three levels: