When a service is no longer needed, either the application using it or the service itself should call the NetServiceControl API and specify the appropriate shutdown opcode. After receiving a shutdown opcode, a service must again call the NetServiceStatus API to declare SERVICE_UNINSTALL_PENDING status and then perform any other necessary tasks, such as closing open resources. The final step is to call the OS/2 DosExit API. Immediately before doing this, the service again must change its status, this time to SERVICE_UNINSTALLED.
For an application to disable a service from processing any further requests, the service:
To obtain information about services started, an application calls the NetServiceEnum API. To query the state of a service, retrieving its status and code information, an application calls the NetServiceStatus API.
For information about the default LAN Server services and the functions used to control services, see Services Provided with LAN Server.