typedef struct _MONITOR{
BOOL (WINAPI *pfnEnumPorts)(LPWSTR pName, DWORD Level, LPBYTE pPorts,
DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned);
BOOL (WINAPI *pfnOpenPort)(LPWSTR pName, PHANDLE pHandle);
BOOL (WINAPI *pfnOpenPortEx)(LPWSTR pPortName,LPWSTR pPrinterName,
PHANDLE pHandle, struct _MONITOR FAR *pMonitor);
BOOL (WINAPI *pfnStartDocPort)(HANDLE hPort,LPWSTR pPrinterName,DWORD JobId,
DWORD Level,LPBYTE pDocInfo);
BOOL (WINAPI *pfnWritePort)(HANDLE hPort,LPBYTE pBuffer,DWORD cbBuf,
LPDWORD pcbWritten);
BOOL (WINAPI *pfnReadPort)(HANDLE hPort,LPBYTE pBuffer,DWORD cbBuffer,
LPDWORD pcbRead);
BOOL (WINAPI *pfnEndDocPort)(HANDLE hPort);
BOOL (WINAPI *pfnClosePort)(HANDLE hPort);
BOOL (WINAPI *pfnAddPort)(LPWSTR pName, HWND hWnd, LPWSTR pMonitorName);
BOOL (WINAPI *pfnAddPortEx)(LPWSTR pName, DWORD Level, LPBYTE lpBuffer,
LPWSTR lpMonitorName);
BOOL (WINAPI *pfnConfigurePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
BOOL (WINAPI *pfnDeletePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
BOOL (WINAPI *pfnGetPrinterDataFromPort)(HANDLE hPort, DWORD ControlID,
LPWSTR pValueName, LPWSTR lpInBuffer, DWORD cbInBuffer,
LPWSTR lpOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbReturned);
BOOL (WINAPI *pfnSetPortTimeOuts)(HANDLE hPort,LPCOMMTIMEOUTS lpCTO,
DWORD reserved // must be set to 0);
} MONITOR, FAR *LPMONITOR;
MONITOR contains pointers to the functions that implement a print monitor. It is a member of the MONITOREX structure.
A monitor should set pointers for unimplemented routines to null.