The GetDefaultServicesFile method returns the fully
qualified path name of the services file on the local system. The
services
file is used as a database that maps a port number to a service name, and is used by the
GetServiceName and GetServicePort methods. The file is a plain text file, with
each line in the file specifying a record, and each field separated
by spaces or tabs. The format of the file must be as follows:
name port/protocol [alias ...]
For example, one typical entry maps the service name "http"
to port 80, the standard port for the Hypertext Transfer Protocol. This would be entered as:
http 80/tcp www www-http
The hash character (#) may be used to specify a comment in the
file, and all characters after it are ignored up to the end of the
line. Blank lines are ignored, as are any lines which do not follow
the required format.
If the method succeeds, the return value is the number of
characters copied into the string buffer, not including the
terminating null character. A return value of zero indicates that the default
services file
could not be determined for the current platform. To get extended
error information, call GetLastError.