Creates a port for access to an RT service. Optionally creates a heap object and attaches it to the port.
NTXHANDLE ntxCreateRtPort(
NTXLOCATION hLoc,
LPSTR pServiceName,
WORD wPortNumber,
WORD wMaxTransactions
WORD wFlags
DWORD dwHeapSize
);
Parameters
hLoc
- Location of the RT kernel on which to create the RT port.
pServiceName
- A pointer to a string containing the name of the service into which a port is to be created.
wPortNumber
- The desired ID number for this port. Services may specify values for this parameter which cause the service to allocate the port number automatically.
wMaxTransactions
- The maximum number of outstanding transactions allowed 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 pServiceName
parameter.
wFlags
- The port creation flags. Some of the following values may be combined to form the flags parameter:
NTX_PRIORITY_QUEUING |
Specifies that threads should be queued on a priority basis. |
NTX_FIFO_QUEUING |
Specifies that threads should be queued on a FIFO basis. |
NTX_NO_FRAGMENTATION |
Specifies that fragmentation is not allowed at this port. |
NTX_CREATE_UNBOUND |
Specifies that the port is to be created unbound. No operations are allowed on the port until a call to ntxBindRtPort is made on this port. |
Note that the NTX_PRIORITY_QUEUING and NTX_FIFO_QUEUING flags are mutually exclusive.
dwHeapSize
- Specifies the size of the heap you want to create. You can use 0 (zero) to indicate that no heap should be created.
Return Values
- The handle for the new port.
- Success.
NTX_BAD_NTXHANDLE
- Failure. To determine the status, call ntxGetLastRtError.
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.
E_LOCATION
- The RT client on which the port was created is now invalid.
E_NTX_INTERNAL_ERROR
- The DLL could not contact the RT kernel to complete the request.
Note: Other status values may be generated by the service-specific CreatePort handler.
Requirements
Versions |
Defined in |
Include |
Link to |
INtime 3.0 |
intime/nt/include/ntx.h |
ntx.h |
ntx.lib |
INtime 4.01 (64-bit Windows) |
intime/nt/include/ntx.h |
ntx.h |
ntx64.lib |
See Also
Port system calls, CreatePort