Jump to content

SplPdInitPort: Difference between revisions

From EDM2
Created page with "SplPdInitPort initializes a port on behalf of the spooler. == Syntax == SplPdInitPort(hfile, pszPortName); == Parameters == ; hfile (HFILE) - input : The handle to an open..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
SplPdInitPort initializes a port on behalf of the spooler.
SplPdInitPort initializes a port on behalf of the spooler.


== Syntax ==  
== Syntax ==
  SplPdInitPort(hfile, pszPortName);
  SplPdInitPort(hfile, pszPortName)


== Parameters ==
== Parameters ==
; hfile (HFILE) - input : The handle to an open file.  
; hfile (HFILE) - input : The handle to an open file.
 
; pszPortName (PSZ) - input : The name of the port to be initialized.
; pszPortName (PSZ) - input : The name of the port to be initialized.  


== Returns ==
== Returns ==
; rc (APIERR) - returns : Return codes.  
; rc (APIERR) - returns : Return codes.
 
This handling routine returns the following errors:
This handling routine returns the following errors:  
* ERROR_INVALID_PARAMETER
* ERROR_INVALID_PARAMETER  
* NO_ERROR
* NO_ERROR  


== Sample ==
== Sample ==
Line 25: Line 23:


rc = SplPdInitPort(hfile, pszPortName);
rc = SplPdInitPort(hfile, pszPortName);
</pre>
</pre>


== Remarks ==
== Remarks ==
The port driver reads the initialization data from the INI file, interprets the data, and issues the appropriate DosDevIOCtl calls to the open port given by the file handle.  
The port driver reads the initialization data from the INI file, interprets the data, and issues the appropriate DosDevIOCtl calls to the open port given by the file handle.


This function is called from the spooler function, PrtOpen, to complete port opening. Note that PrtOpen issues the actual DosOpen first. PrtOpen holds a semaphore for each port in use, and a linked list of threads waiting on the semaphore because, although the spooler serializes output, it is still possible for applications to write directly to the port by using DevOpenDC (OD_DIRECT).  
This function is called from the spooler function, [[PrtOpen]], to complete port opening. Note that PrtOpen issues the actual DosOpen first. PrtOpen holds a semaphore for each port in use, and a linked list of threads waiting on the semaphore because, although the spooler serializes output, it is still possible for applications to write directly to the port by using [[DevOpenDC]] (OD_DIRECT).


[[Category:Spl]]
[[Category:Spl]]

Latest revision as of 18:32, 2 July 2023

SplPdInitPort initializes a port on behalf of the spooler.

Syntax

SplPdInitPort(hfile, pszPortName)

Parameters

hfile (HFILE) - input
The handle to an open file.
pszPortName (PSZ) - input
The name of the port to be initialized.

Returns

rc (APIERR) - returns
Return codes.

This handling routine returns the following errors:

  • ERROR_INVALID_PARAMETER
  • NO_ERROR

Sample

#include <os2.h>

HFILE     hfile;        /*  The handle to an open file. */
PSZ       pszPortName;  /*  The name of the port to be initialized. */
APIERR    rc;           /*  Return codes. */

rc = SplPdInitPort(hfile, pszPortName);

Remarks

The port driver reads the initialization data from the INI file, interprets the data, and issues the appropriate DosDevIOCtl calls to the open port given by the file handle.

This function is called from the spooler function, PrtOpen, to complete port opening. Note that PrtOpen issues the actual DosOpen first. PrtOpen holds a semaphore for each port in use, and a linked list of threads waiting on the semaphore because, although the spooler serializes output, it is still possible for applications to write directly to the port by using DevOpenDC (OD_DIRECT).