The PRINTPROVIDOR structure is used as a parameter to a print provider's InitializePrintProvidor function. All structure member values are supplied by the provider.
typedef struct _PRINTPROVIDOR {
BOOL (*fpOpenPrinter)(LPWSTR pPrinterName,
LPHANDLE phPrinter,
LPPRINTER_DEFAULTS pDefault);
BOOL (*fpSetJob)(HANDLE hPrinter,
DWORD JobId,
DWORD Level,
LPBYTE pJob,
DWORD Command);
BOOL (*fpGetJob)(HANDLE hPrinter,
DWORD JobId,
DWORD Level,
LPBYTE pJob,
DWORD cbBuf,
LPDWORD pcbNeeded);
BOOL (*fpEnumJobs)(HANDLE hPrinter,
DWORD FirstJob,
DWORD NoJobs,
DWORD Level,
LPBYTE pJob,
DWORD cbBuf,
LPDWORD pcbNeeded,
LPDWORD pcReturned);
HANDLE (*fpAddPrinter)(LPWSTR pName,
DWORD Level,
LPBYTE pPrinter);
BOOL (*fpDeletePrinter)(HANDLE hPrinter);
BOOL (*fpSetPrinter)(HANDLE hPrinter,
DWORD Level,
LPBYTE pPrinter,
DWORD Command);
BOOL (*fpGetPrinter)(HANDLE hPrinter,
DWORD Level,
LPBYTE pPrinter,
DWORD cbBuf,
LPDWORD pcbNeeded);
BOOL (*fpEnumPrinters)(DWORD Flags,
LPWSTR Name,
DWORD Level,
LPBYTE pPrinterEnum,
DWORD cbBuf,
LPDWORD pcbNeeded,
LPDWORD pcReturned);
BOOL (*fpAddPrinterDriver)(LPWSTR pName,
DWORD Level,
LPBYTE pDriverInfo);
BOOL (*fpEnumPrinterDrivers)(LPWSTR pName,
LPWSTR pEnvironment,
DWORD Level,
LPBYTE pDriverInfo,
DWORD cbBuf,
LPDWORD pcbNeeded,
LPDWORD pcReturned);
BOOL (*fpGetPrinterDriver)(HANDLE hPrinter,
LPWSTR pEnvironment,
DWORD Level,
LPBYTE pDriverInfo,
DWORD cbBuf,
LPDWORD pcbNeeded);
BOOL (*fpGetPrinterDriverDirectory)(LPWSTR pName,
LPWSTR pEnvironment,
DWORD Level,
LPBYTE pDriverDirectory,
DWORD cbBuf,
LPDWORD pcbNeeded);
BOOL (*fpDeletePrinterDriver)(LPWSTR pName,
LPWSTR pEnvironment,
LPWSTR pDriverName);
BOOL (*fpAddPrintProcessor)(LPWSTR pName,
LPWSTR pEnvironment,
LPWSTR pPathName,
LPWSTR pPrintProcessorName);
BOOL (*fpEnumPrintProcessors)(LPWSTR pName,
LPWSTR pEnvironment,
DWORD Level,
LPBYTE pPrintProcessorInfo,
DWORD cbBuf,
LPDWORD pcbNeeded,
LPDWORD pcReturned);
BOOL (*fpGetPrintProcessorDirectory)(LPWSTR pName,
LPWSTR pEnvironment,
DWORD Level,
LPBYTE pPrintProcessorInfo,
DWORD cbBuf,
LPDWORD pcbNeeded);
BOOL (*fpDeletePrintProcessor)(LPWSTR pName,
LPWSTR pEnvironment,
LPWSTR pPrintProcessorName);
BOOL (*fpEnumPrintProcessorDatatypes)(LPWSTR pName,
LPWSTR pPrintProcessorName,
DWORD Level,
LPBYTE pDataypes,
DWORD cbBuf,
LPDWORD pcbNeeded,
LPDWORD pcReturned);
DWORD (*fpStartDocPrinter)(HANDLE hPrinter,
DWORD Level,
LPBYTE pDocInfo);
BOOL (*fpStartPagePrinter)(HANDLE hPrinter);
BOOL (*fpWritePrinter)(HANDLE hPrinter,
LPVOID pBuf,
DWORD cbBuf,
LPDWORD pcWritten);
BOOL (*fpEndPagePrinter)(HANDLE hPrinter);
BOOL (*fpAbortPrinter)(HANDLE hPrinter);
BOOL (*fpReadPrinter)(HANDLE hPrinter,
LPVOID pBuf,
DWORD cbBuf,
LPDWORD pNoBytesRead);
BOOL (*fpEndDocPrinter)(HANDLE hPrinter);
BOOL (*fpAddJob)(HANDLE hPrinter,
DWORD Level,
LPBYTE pData,
DWORD cbBuf,
LPDWORD pcbNeeded);
BOOL (*fpScheduleJob)(HANDLE hPrinter,
DWORD JobId);
DWORD (*fpGetPrinterData)(HANDLE hPrinter,
LPWSTR pValueName,
LPDWORD pType,
LPBYTE pData,
DWORD nSize,
LPDWORD pcbNeeded);
DWORD (*fpSetPrinterData)(HANDLE hPrinter,
LPWSTR pValueName,
DWORD Type,
LPBYTE pData,
DWORD cbData);
DWORD (*fpWaitForPrinterChange)(HANDLE hPrinter,
DWORD Flags);
BOOL (*fpClosePrinter)(HANDLE hPrinter);
BOOL (*fpAddForm)(HANDLE hPrinter,
DWORD Level,
LPBYTE pForm);
BOOL (*fpDeleteForm)(HANDLE hPrinter,
LPWSTR pFormName);
BOOL (*fpGetForm)(HANDLE hPrinter,
LPWSTR pFormName,
DWORD Level,
LPBYTE pForm,
DWORD cbBuf,
LPDWORD pcbNeeded);
BOOL (*fpSetForm)(HANDLE hPrinter,
LPWSTR pFormName,
DWORD Level,
LPBYTE pForm);
BOOL (*fpEnumForms)(HANDLE hPrinter,
DWORD Level,
LPBYTE pForm,
DWORD cbBuf,
LPDWORD pcbNeeded,
LPDWORD pcReturned);
BOOL (*fpEnumMonitors)(LPWSTR pName,
DWORD Level,
LPBYTE pMonitors,
DWORD cbBuf,
LPDWORD pcbNeeded,
LPDWORD pcReturned);
BOOL (*fpEnumPorts)(LPWSTR pName,
DWORD Level,
LPBYTE pPorts,
DWORD cbBuf,
LPDWORD pcbNeeded,
LPDWORD pcReturned);
BOOL (*fpAddPort)(LPWSTR pName,
HWND hWnd,
LPWSTR pMonitorName);
BOOL (*fpConfigurePort)(LPWSTR pName,
HWND hWnd,
LPWSTR pPortName);
BOOL (*fpDeletePort)(LPWSTR pName,
HWND hWnd,
LPWSTR pPortName);
HANDLE (*fpCreatePrinterIC)(HANDLE hPrinter,
LPDEVMODEW pDevMode);
BOOL (*fpPlayGdiScriptOnPrinterIC)(HANDLE hPrinterIC,
LPBYTE pIn,
DWORD cIn,
LPBYTE pOut,
DWORD cOut,
DWORD ul);
BOOL (*fpDeletePrinterIC)(HANDLE hPrinterIC);
BOOL (*fpAddPrinterConnection)(LPWSTR pName);
BOOL (*fpDeletePrinterConnection)(LPWSTR pName);
DWORD (*fpPrinterMessageBox)(HANDLE hPrinter,
DWORD Error,
HWND hWnd,
LPWSTR pText,
LPWSTR pCaption,
DWORD dwType);
BOOL (*fpAddMonitor)(LPWSTR pName,
DWORD Level,
LPBYTE pMonitorInfo);
BOOL (*fpDeleteMonitor)(LPWSTR pName,
LPWSTR pEnvironment,
LPWSTR pMonitorName);
BOOL (*fpResetPrinter)(HANDLE hPrinter,
LPPRINTER_DEFAULTS pDefault);
BOOL (*fpGetPrinterDriverEx)(HANDLE hPrinter,
LPWSTR pEnvironment,
DWORD Level,
LPBYTE pDriverInfo,
DWORD cbBuf,
LPDWORD pcbNeeded,
DWORD dwClientMajorVersion,
DWORD dwClientMinorVersion,
PDWORD pdwServerMajorVersion,
PDWORD pdwServerMinorVersion);
BOOL (*fpFindFirstPrinterChangeNotification)(
HANDLE hPrinter,
DWORD fdwFlags,
DWORD fdwOptions,
HANDLE hNotify,
PDWORD pfdwStatus,
PVOID pPrinterNotifyOptions,
PVOID pPrinterNotifyInit);
BOOL (*fpFindClosePrinterChangeNotification)(HANDLE hPrinter);
BOOL (*fpAddPortEx)(LPWSTR pName,
DWORD Level,
LPBYTE lpBuffer,
LPWSTR lpMonitorName);
BOOL (*fpShutDown)(LPVOID pvReserved);
BOOL (*fpRefreshPrinterChangeNotification)(
HANDLE hPrinter,
DWORD Reserved,
PVOID pvReserved,
PVOID pPrinterNotifyInfo);
BOOL (*fpOpenPrinterEx)(LPWSTR pPrinterName,
LPHANDLE phPrinter,
LPPRINTER_DEFAULTS pDefault,
LPBYTE pClientInfo,
DWORD Level);
HANDLE (*fpAddPrinterEx)(LPWSTR pName,
DWORD Level,
LPBYTE pPrinter,
LPBYTE pClientInfo,
DWORD ClientInfoLevel);
BOOL (*fpSetPort)(LPWSTR pName,
LPWSTR pPortName,
DWORD Level,
LPBYTE pPortInfo);
DWORD (*fpEnumPrinterData)(HANDLE hPrinter,
DWORD dwIndex,
LPWSTR pValueName,
DWORD cbValueName,
LPDWORD pcbValueName,
LPDWORD pType,
LPBYTE pData,
DWORD cbData,
LPDWORD pcbData);
DWORD (*fpDeletePrinterData)(HANDLE hPrinter,
LPWSTR pValueName);
DWORD (*fpClusterSplOpen)(LPCTSTR pszServer,
LPCTSTR pszResource,
PHANDLE phSpooler,
LPCTSTR pszName,
LPCTSTR pszAddress );
DWORD (*fpClusterSplClose)(HANDLE hSpooler);
DWORD (*fpClusterSplIsAlive)(HANDLE hSpooler);
DWORD (*fpSetPrinterDataEx)(HANDLE hPrinter,
LPCWSTR pKeyName,
LPCWSTR pValueName,
DWORD Type,
LPBYTE pData,
DWORD cbData);
DWORD (*fpGetPrinterDataEx)(HANDLE hPrinter,
LPCWSTR pKeyName,
LPCWSTR pValueName,
LPDWORD pType,
LPBYTE pData,
DWORD nSize,
LPDWORD pcbNeeded);
DWORD (*fpEnumPrinterDataEx)(HANDLE hPrinter,
LPCWSTR pKeyName,
LPBYTE pEnumValues,
DWORD cbEnumValues,
LPDWORD pcbEnumValues,
LPDWORD pnEnumValues);
DWORD (*fpEnumPrinterKey)(HANDLE hPrinter,
LPCWSTR pKeyName,
LPWSTR pSubkey,
DWORD cbSubkey,
LPDWORD pcbSubkey);
DWORD (*fpDeletePrinterDataEx)(HANDLE hPrinter,
LPCWSTR pKeyName,
LPCWSTR pValueName);
DWORD (*fpDeletePrinterKey)(HANDLE hPrinter,
LPCWSTR pKeyName);
BOOL (*fpSeekPrinter)(HANDLE hPrinter,
LARGE_INTEGER liDistanceToMove,
PLARGE_INTEGER pliNewPointer,
DWORD dwMoveMethod,
BOOL bWrite);
BOOL (*fpDeletePrinterDriverEx)(LPWSTR pName,
LPWSTR pEnvironment,
LPWSTR pDriverName,
DWORD dwDeleteFlag,
DWORD dwVersionNum);
BOOL (*fpAddPerMachineConnection)(LPCWSTR pServer,
LPCWSTR pPrinterName,
LPCWSTR pPrintServer,
LPCWSTR pProvider);
BOOL (*fpDeletePerMachineConnection)(LPCWSTR pServer,
LPCWSTR pPrinterName);
BOOL (*fpEnumPerMachineConnections)(LPCWSTR pServer,
LPBYTE pPrinterEnum,
DWORD cbBuf,
LPDWORD pcbNeeded,
LPDWORD pcReturned);
BOOL (*fpXcvData)(HANDLE hXcv,
LPCWSTR pszDataName,
PBYTE pInputData,
DWORD cbInputData,
PBYTE pOutputData,
DWORD cbOutputData,
PDWORD pcbOutputNeeded,
PDWORD pdwStatus);
BOOL (*fpAddPrinterDriverEx)(LPWSTR pName,
DWORD Level,
LPBYTE pDriverInfo,
DWORD dwFileCopyFlags);
BOOL (*fpSplReadPrinter)(HANDLE hPrinter,
LPBYTE *pBuf,
DWORD cbBuf);
BOOL (*fpDriverUnloadComplete)(LPWSTR pDriverFile);
BOOL (*fpGetSpoolFileInfo)(HANDLE hPrinter,
LPWSTR *pSpoolDir,
LPHANDLE phFile,
HANDLE hSpoolerProcess,
HANDLE hAppProcess);
BOOL (*fpCommitSpoolData)(HANDLE hPrinter,
DWORD cbCommit);
BOOL (*fpCloseSpoolFileHandle)(HANDLE hPrinter);
BOOL (*fpFlushPrinter)(HANDLE hPrinter,
LPBYTE pBuf,
DWORD cbBuf,
LPDWORD pcWritten,
DWORD cSleep);
DWORD (*fpSendRecvBidiData)(HANDLE hPort,
LPCWSTR pAction,
PBIDI_REQUEST_CONTAINER pReqData,
PBIDI_RESPONSE_CONTAINER *ppResData);
BOOL (*fpAddDriverCatalog)(HANDLE hPrinter,
DWORD dwLevel,
VOID *pvDriverInfCatInfo,
DWORD dwCatalogCopyFlags);
} PRINTPROVIDOR, *LPPRINTPROVIDOR;
In the following Members section, function pointers are listed in the order they are specified within the PRINTPROVIDOR structure. To see function descriptions grouped by related capabilities, see Functions Defined by Print Providers.
| Return Value | Definition |
|---|---|
| ROUTER_SUCCESS | The provider supports the specified printer and has opened it. |
| ROUTER_STOP_ROUTING | The provider supports the specified printer, but an error occurred and the printer could not be opened. It is assumed that no other provider can support the printer. The function must call SetLastError. |
| ROUTER_UNKNOWN | The provider does not support the specified printer. The function must call SetLastError and specify ERROR_INVALID_NAME. |
The router calls each provider until one of them returns ROUTER_SUCCESS or ROUTER_STOP_ROUTING. If the provider returns ROUTER_SUCCESS, it must also return a unique handle. (For more information, see Introduction to Print Providers.) The router first attempts to call the provider's OpenPrinterEx function. If that function is not supported, the router calls OpenPrinter.
| Return Value | Definition |
|---|---|
| ROUTER_SUCCESS | The provider has enumerated the monitors on the specified server. |
| ROUTER_UNKNOWN | The provider does not support the specified server. |
| ROUTER_STOP_ROUTING | The provider has enumerated the monitors on the specified server, and the router should not call other providers. |
| Return Value | Definition |
|---|---|
| ROUTER_SUCCESS | The provider has enumerated the ports on the specified server. |
| ROUTER_STOP_ROUTING | The provider has enumerated the ports on the specified server, and the router should not call other providers. |
| ROUTER_UNKNOWN | The provider does not support the specified server. |
Declared in winsplp.h. Include winsplp.h.
InitializePrintProvidor, FindFirstPrinterChangeNotification, RefreshPrinterChangeNotification, XcvData, SendRecvBidiData