REXXNET.DLL

Description
RexxNet.DLL is a DLL that supports the Lan Server APIs from Rexx.  The APIs are replicated to match 
the standard 'C' call interface (with a few exceptions, enhancements).  It can be used from OS/2 1.3 or 
OS/2 2.x and Lan Server 3.0.

DLL Usage
The DLL is used by registering and calling the function NetLoadFuncs.  When completed, then functions 
can be dropped by calling NetDropFuncs.

/* REXX */

call rxfuncadd 'NetLoadFuncs', 'RexxNet', 'NetLoadFuncs'
call NetLoadFuncs

...

call NetDropFuncs
exit

API Function Usage
All the APIs callable use the standard 'C' call interface with the following exceptions:
Any 'buflen' parameter is ignored (and should be omitted if other fields follow) as the REXX 
interface has no length limit.
The 'entriesread' parameter is returned as 'Buf.Entries' and any variable passed is ignored.
The 'totalavail' parameter is ignored and never returned, as the REXX functions always return 
the total amount (ie totalavail == entriesread and Error 234 should never happen)
All 'reserved' parameter are ignored, but leading reserved parameters must still be passed.
The 'buf' parameter should be the name of a stem variable.  The values passed in and returned as the 
structure field names (ignoring the leading structure-level identifing code).
If the function called is an Enum function, then Buf.Entries will contain how many structures were 
returned and Buf.0.xxx to Buf.n.xxx will contain the returned structures


ie the use_info_0 structure is as follows:
	struct use_info_0 {	REXX
		ui0_local[DEVLEN + 1]	stem.Local
		ui0_pad	not returned
		ui0_remote	stem.Remote
	}

/* REXX */

call rxfuncadd 'NetLoadFuncs', 'RexxNet', 'NetLoadFuncs'
call NetLoadFuncs

retc = NetUseGetInfo('', 'H:', 1, 'Buf')

say Buf.Local '-->' Buf.Remote

Buf.Local = 'Z:'
Buf.Remote = '\\Server\Sharename'
Buf.AsgType = 0
Buf.Password = ''

retc = NetUseAdd('', 1, 'Buf')
if retc \= 0 then
	say 'Error:' retc NetGetMessage(retc, "NET.MSG")

retc = NetUseEnum('', 0, 'Info')

do i = 0 to Info.Entries - 1
	say Info.i.Local '-->' Info.i.Remote
end

Additional Functions Supplied
For each group of Lan Server APIs there is an additional Info function that returns a stem variable 
containing all the field names for the given level of structure.

	NetxxxInfo(level, stem)

ie call NetUseInfo(1, 'Info')
would return the following
	Info.0 = 7
	Info.1 = 'Local'
	Info.2 = 'Remote'
	Info.3 = 'Password'
	Info.4 = 'Status'
	Info.5 = 'Asg_Type'
	Info.6 = 'RefCount'
	Info.7 = 'UseCount'

Also the function:
	int NetGetMessage(errcode, Messagefile)

is supplied.  This is the DosGetMessage API from OS/2 and will return the String message associated 
with the errcode from the given message file.  If no messagefile is given then OSO001.MSG is used.  The 
Net functions will return an error code >2100 if a network error occured, and if so 'NET.MSG' can be 
used as the messagefile for the standard error message.

Supported APIs
The following is the list of API groups currently supported:

	NetUse
	NetUser
	NetGroup
	NetAlias
	NetDomain	(NetGetDCName and NetLogonEnum)
	NetWksta	(All except NetWkstaSetUID2)
	NetErrorLog
	NetAccess
	NetShare
	NetApp
	NetService
	upmeulgn and upmeulgn
	NetGetMessage	(variation on DosGetMessage)

This version fixes a number of bugs, including trap errors when calling NetUserGetInfo with level 2 or 
11.

