The NetConfigGetAll2 API retrieves all configuration information for a given network component in the IBMLAN.INI file of a local computer or a remote server.
The NetConfigGetAll2 API replaces the NetConfigGetAll API, which is now obsolete.
Restrictions
This API can be called from DLS and OS/2 workstations. (A local call on a DLS workstation retrieves information from the local NETWORK.INI file.) Administrative authority is required to call this API at a remote server.
#include <netcons.h> #include <config.h> NetConfigGetAll2(pszServername, reserved, component, buf, usBuflen, pusBytesReturned, pusBytesAvail); /* 16 bit */ Net32ConfigGetAll2(pszServername, reserved, component, buf, ulBuflen, pulBytesReturned, pulBytesAvail); /* 32 bit */Parameters
See Common Parameter Definitions for descriptions of parameters not defined here.
reserved
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_FILE_NOT_FOUND │ 2 │ The file was not found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_PATH_NOT_FOUND │ 3 │ The path was not found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_ACCESS_DENIED │ 5 │ Administrator privilege is required. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_SHARING_VIOLATION │ 32 │ A sharing violation occurred. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_BAD_NETPATH │ 53 │ The network path cannot be found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_INVALID_PARAMETER │ 87 │ At least one parameter value 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_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_CfgCompNotFound │ 2146 │ The program could not find the speci-
│
│ │ │ fied component in the IBMLAN.INI file. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InvalidComputer │ 2351 │ The specified computer name is not
│
│ │ │ valid. │
└─────────────────────────────┴───────┴────────────────────────────────────────┘
Other codes could be returned from the following functions:
NetConfigGetAll2 returns in buf a set of concatenated ASCIIZ strings that represent configuration information for the specified component. Each string is ended by NULL (ASCII 0), and the whole buffer is ended by a null string. Information is returned in the form parm=value. The parameter name, which appears to the left of the equals sign (=), is in uppercase. The pusBytesReturned and pusBytesAvail values are filled in as they are for GetInfo calls.
For example,
" foo = Bar,1,long comment string "
in the IBMLAN.INI file is returned as:
"FOO=Bar,1,long comment string"