INtime SDK Help
CreateRtPort
INtime SDK v6 > About INtime > INtime Kernel > Ports > CreateRtPort

From INtime 6.0 the INtime Service and Port objects have been deprecated.

New projects should not be started using these features, and existing projects will not work with XM mode. You will receive a compiler warning by default if you use these calls.

Creates a message port for access to a given service.

RTHANDLE CreateRtPort(
    LPSTR lpszServiceName,
    WORD wPortNumber,
    WORD wMaxTransactions,
    WORD wPortFlags
);

Parameters

lpszServiceName
A pointer to a string containing the name of the service into which a port is to be created. If a value of NULL is specified, the port created can be used only as a sink port.
wPortNumber
A WORD value for the port number for the port to be created. If this value is a null port number (the value of which is defined by the service) then the service allocates a port number from the range of numbers defined for this purpose by the service implementer.
wMaxTransactions
Specifies the maximum number of simultaneous transactions allowed at this port. Internally determines the size of the transaction table on this port. If 0 (zero) is specified, the value is assigned from the wPortCreationMask parameter in the SERVICEDESC structure used to create the service named in lpszServiceName parameter.
wPortFlags
The port creation flags. Some of the following values may be combined to form the flags parameter:
PRIORITY_QUEUING Specifies that threads should be queued on a priority basis.
FIFO_QUEUING Specifies that threads should be queued on a FIFO basis.
NO_FRAGMENTATION Specifies that fragmentation is not allowed at this port.
CREATE_UNBOUND Specifies that the port is to be created unbound. No operations are allowed on the port until a call to BindRtPort is made on this port.
Note that the PRIORITY_QUEUING and FIFO_QUEUING flags are mutually exclusive.

Return Values

An RTHANDLE for the newly-created message port object.
Success.
BAD_RTHANDLE
Failure. To determine the status, call GetLastRtError.

Status

E_OK 0x0000
No exceptional conditions occurred.
E_MEM 0x0002
Insufficient physical memory is available to the calling thread's process.
E_LIMIT 0x0004
The port ID table for this service is full.
E_CONTEXT 0x0005
The service with the name supplied can not be found.
E_PARAM 0x8004
One of these conditions exist:
  • The contents of the name string are invalid.
  • The given port ID is out of range for this service.
E_PORT_ID_USED 0x80E1
A port with the given port ID already exists.
E_NUC_BAD_BUF 0x80E2
An invalid name pointer was supplied.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/rtbase.h rt.h rt.lib

See Also

Port system calls, BindRtPort, SERVICEDESC