The NetServiceStatus API sets status and code information for a network service.
Restrictions
A call to this API must be issued locally. This API can be called only from an OS/2 workstation.
#include <netcons.h> #include <service.h> NetServiceStatus(buf, ulBuflen); /*32 bit*/Parameters
See Common Parameter Definitions for descriptions of parameters not defined here.
buf
The following table lists the return codes most significant to this API.
(See API Return Codes for a complete
list of return codes.) ┌───────────────────────────┬───────┬──────────────────────────────────────────┐│SYMBOLICCONSTANT
│VALUE│MEANING │
├───────────────────────────┼───────┼──────────────────────────────────────────┤
│ NERR_Success │ 0 │ No errors were encountered. │
├───────────────────────────┼───────┼──────────────────────────────────────────┤
│ NERR_NetNotStarted │ 2102 │ The redirector NETWKSTA.200 has not been
│
│ │ │ started. │
├───────────────────────────┼───────┼──────────────────────────────────────────┤
│ NERR_BufTooSmall │ 2123 │ The buffer is too small for fixed-length
│
│ │ │ data. │
├───────────────────────────┼───────┼──────────────────────────────────────────┤
│ NERR_WkstaNotStarted │ 2138 │ The Requester service has not been
│
│ │ │ started. │
├───────────────────────────┼───────┼──────────────────────────────────────────┤
│ NERR_ServiceTableLocked │ 2180 │ The service does not respond to control
│
│ │ │ actions. │
├───────────────────────────┼───────┼──────────────────────────────────────────┤
│ NERR_ServiceNotInstalled │ 2184 │ The service has not been started.
│
└───────────────────────────┴───────┴──────────────────────────────────────────┘
Other codes could be returned from the following functions:
Service applications must call the NetServiceStatus API to update their status and code tables each time their status changes.
If a nonservice application (one not started by a call to the NetServiceInstall API) calls the NetServiceStatus API, the NetServiceStatus API returns the NERR_ServiceNotInstalled error code.
For information about controlling the operation of a network service, see Services - NetServiceControl.