The NetServiceGetInfo API retrieves information about a particular network service that is started.
Restrictions
This API can be called from DLS and OS/2 workstations. This API does not have any access authority requirements.
#include <netcons.h> #include <service.h> NetServiceGetInfo(pszServername, service, sLevel, buf, usBuflen, pusBytesAvail); /* 16 bit*/ Net32ServiceGetInfo(pszServername, service, ulLevel, buf, ulBuflen, pulBytesAvail); /* 32 bit*/Parameters
See Common Parameter Definitions for descriptions of parameters not defined here.
service
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. і
ГДДДДДДДДДДДДДДДДДДДДДДДДДДДДДЕДДДДДДДЕДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДґ
і ERROR_BAD_NETPATH і 53 і The network path cannot be found. і
ГДДДДДДДДДДДДДДДДДДДДДДДДДДДДДЕДДДДДДДЕДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДґ
і ERROR_INVALID_LEVEL і 124 і The sLevel parameter is not valid. і
ГДДДДДДДДДДДДДДДДДДДДДДДДДДДДДЕДДДДДДДЕДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДґ
і ERROR_MORE_DATA і 234 і Additional data is available, but the і
і і і buffer is too small. і
ГДДДДДДДДДДДДДДДДДДДДДДДДДДДДДЕДДДДДДДЕДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДґ
і 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_InternalError і 2140 і An internal error has occurred. і
ГДДДДДДДДДДДДДДДДДДДДДДДДДДДДДЕДДДДДДДЕДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДґ
і NERR_BadTransactConfig і 2141 і The server is not configured for
і
і і і transactions. і
ГДДДДДДДДДДДДДДДДДДДДДДДДДДДДДЕДДДДДДДЕДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДґ
і NERR_InvalidAPI і 2142 і The requested API is not supported on
і
і і і the remote server. і
ГДДДДДДДДДДДДДДДДДДДДДДДДДДДДДЕДДДДДДДЕДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДґ
і NERR_ServiceTableLocked і 2180 і The service does not respond to
і
і і і control actions. і
ГДДДДДДДДДДДДДДДДДДДДДДДДДДДДДЕДДДДДДДЕДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДґ
і NERR_ServiceNotInstalled і 2184 і The service has not been started.
і
ГДДДДДДДДДДДДДДДДДДДДДДДДДДДДДЕДДДДДДДЕДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДґ
і NERR_InvalidComputer і 2351 і The specified computer name is not
і
і і і valid. і
АДДДДДДДДДДДДДДДДДДДДДДДДДДДДДБДДДДДДДБДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДЩ
Other codes could be returned from the following functions:
If you call this API with the buffer length parameter equal to zero, the API returns a value for total bytes available. This technique is useful if you do not know the exact buffer size required.
The NetServiceGetInfo API returns the NERR_Success code for services that are not started (SERVICE_UNINSTALLED). If a service is stopped, an application can examine the available data of a server using the NetServiceControl API.
The NetServiceGetInfo API is similar to the NetServiceControl API passed with the INTERROGATE opcode. The NetServiceGetInfo API, however, does not interrogate the service; it only retrieves the status that the service last posted.
For information about controlling the operations of a network service, see Services - NetServiceControl.