IPCListPortsSync
IPCListPorts Generate list of existing ports (w/o dialog box)
#include <PPCToolbox.h> PPC Toolbox
OSErr IPCListPorts(pb, async);
IPCListPortsPBPtr pb; Pointer to PPC parameter block
Boolean async; if TRUE, use asynchronous communications
returns Error Code; 0=no error
On entry A0: pointer to a parameter block
D0: selector (10)
On exit D0: result code
Parameter block
Æ 12 ioCompletion long address of a completion routine
¨ 16 ioResult short result code
Æ 40 startIndex short index to the port entry list
Æ 42 requestCount short number of port names requested
Æ 44 actualCount short number of port names returned
Æ 46 portName long pointer to PPCPortRec
Æ 50 locationName long pointer to LocationNameRec
Æ 54 bufferPtr long pointer to array of PortInfoRec
If your application calls this function asynchronously, you must specify in
the ioCompletion field either the address of a completion routine or NIL. If
ioCompletion is NIL, you should poll the ioResult field of the
PPC parameter block (from your application's main event loop) to determine
whether the PPC Toolbox has completed the requested operation. A value in
the ioResult field other than 1 indicates that the call is complete. Note that it is
unsafe to poll the ioResult field at interrupt time since the PPC Toolbox may
be in the process of completing a call.
See PPC Toolbox Calling Conventions" for detailed information.
If you call the IPCListPorts function asynchronously, you must not change
any of the fields in the parameter block until the call completes. The
port name, location name, and buffer pointed to by IPCListPortsPBRec are
owned by the PPC Toolbox until the call completes. These objects must not be
de allocated or moved in memory while the call is in progress.
The startIndex field specifies the index to the list of ports on the remote
machine from which the PPC Toolbox begins to get the list. In most cases,
you'll want to start at the beginning, so set the startIndex field to 0. The
requestCount field specifies the maximum number of port information
records that can fit into your buffer.
The actualCount field returns the actual number of entries returned. Your
program can use the IPCListPorts function repeatedly to obtain the entire
list of ports. Ports that are not visible to the network are not included in the
ports listing on a remote machine. (If you specify FALSE for the
networkVisible field in the PPCOpen function, the port is not included in the
listing of available ports across a network.)
The portName field must contain a pointer to a PPCPortRec that specifies
which PPC ports to list. You can specify particular values in the
PPCPortRec or you can use an equal sign (=) in the name or the
portTypeStr fields as a wildcard to match all port names or port types.
The locationName field should contain a pointer to a location name record that
designates the computer that contains the PPC ports you want returned. If the
locationKindSelector field in the location name record is ppcNoLocation or if
the locationName pointer is NIL, then the location is the local machine. If the
locationKindSelector field in the location name record is ppcNBPLocation,
then the location is a remote machine designated by the location name record's
nbpEntity field.
Use the IPCListPorts function to generate a list of existing ports without
displaying a dialog box. The IPCListPortsPBRec data type defines the parameter
block used by the IPCListPorts function.
The pb parameter should point to a PPC parameter block. The async
parameter is TRUE if the function is to be executed asynchronously.
The IPCListPorts function returns an array (list) of port information
records in the area of memory pointed to by bufferPtr. Make sure that the
buffer pointed to by the bufferPtr field is at least sizeof(PortInfoRec) *
requestCount.
Returns: an operating system Error Code.
noErr (0) No error
notInitErr (-900) PPC Toolbox has not been initialized yet
nameTypeErr (-902) Invalid or inappropriate locationKindSelector in
location name
noGlobalsErr (-904) System unable to allocate memory, critical error
localOnlyErr (-905) Network activity is currently disabled
sessTableErr (-907) PPC Toolbox is unable to create a session
noResponseErr (-915) Unable to contact application
badPortNameErr (-919) PPC port record is invalid
networkErr (-925) An error has occurred in the network
badLocNameErr (-931) Location name is invalid