BOOL (WINAPI *pfnOpenPortEx)(
LPWSTR pPortName, | |
LPWSTR pPrinterName, | |
PHANDLE pHandle, | |
struct _MONITOR FAR *pMonitor | |
); |
OpenPortEx provides a port on which a language monitor and its associated bidirectional printer can communicate.
The return value is TRUE if the function is successful, FALSE if it fails.
All language monitors must implement OpenPortEx, whereas port monitors implement OpenPort. Monitors that combine both port and language monitor capabilities in one DLL need to implement both OpenPort and OpenPortEx.
OpenPortEx is called by the spooler whenever a port is assigned to the printer identified by pPrinterName. OpenPortEx returns a handle to the port identified by pPortName; this handle is used in subsequent calls to the language monitor’s StartDocPort, WritePort, ReadPort, and EndDocPort routines.
OpenPortEx should validate the port monitor identified by pMonitor before calling its OpenPort function to establish a port connection.
Note that the parameter lists for OpenPort and the language monitor’s OpenPortEx function differ in that OpenPortEx also receives the printer name and a port monitor’s function table.
All language monitors must implement OpenPortEx.