38a98ed926c1eb42a517b7777a29a0981f17b0cb
[reactos.git] / include / psdk / winsplp.h
1 #pragma once
2
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6
7 #if (STRICT && (NTDDI_VERSION >= NTDDI_VISTA))
8 #define HKEYMONITOR HKEY
9 #else
10 #define HKEYMONITOR HANDLE
11 #endif
12
13 #define PRINTER_NOTIFY_STATUS_ENDPOINT 1
14 #define PRINTER_NOTIFY_STATUS_POLL 2
15 #define PRINTER_NOTIFY_STATUS_INFO 4
16
17 #define ROUTER_UNKNOWN 0
18 #define ROUTER_SUCCESS 1
19 #define ROUTER_STOP_ROUTING 2
20
21 #if (NTDDI_VERSION >= NTDDI_WINXP)
22 #define MONITOR2_SIZE_WIN2K (sizeof(DWORD) + (sizeof(PVOID)*18))
23 #endif
24
25 #define COPYFILE_EVENT_SET_PRINTER_DATAEX 1
26 #define COPYFILE_EVENT_DELETE_PRINTER 2
27 #define COPYFILE_EVENT_ADD_PRINTER_CONNECTION 3
28 #define COPYFILE_EVENT_DELETE_PRINTER_CONNECTION 4
29 #define COPYFILE_EVENT_FILES_CHANGED 5
30
31 #define COPYFILE_FLAG_CLIENT_SPOOLER 0x00000001
32 #define COPYFILE_FLAG_SERVER_SPOOLER 0x00000002
33
34 #define PRINTER_NOTIFY_INFO_DATA_COMPACT 1
35
36 typedef struct _PRINTER_NOTIFY_INIT {
37 DWORD Size;
38 DWORD Reserved;
39 DWORD PollTime;
40 } PRINTER_NOTIFY_INIT, *LPPRINTER_NOTIFY_INIT, *PPRINTER_NOTIFY_INIT;
41
42 typedef struct _SPLCLIENT_INFO_1 {
43 DWORD dwSize;
44 LPWSTR pMachineName;
45 LPWSTR pUserName;
46 DWORD dwBuildNum;
47 DWORD dwMajorVersion;
48 DWORD dwMinorVersion;
49 WORD wProcessorArchitecture;
50 } SPLCLIENT_INFO_1, *LPSPLCLIENT_INFO_1, *PSPLCLIENT_INFO_1;
51
52 typedef struct _SPLCLIENT_INFO_2_V1{
53 ULONG_PTR hSplPrinter;
54 } SPLCLIENT_INFO_2_W2K;
55
56 typedef struct _SPLCLIENT_INFO_2_V2{
57 #ifdef _WIN64
58 DWORD64 hSplPrinter;
59 #else
60 DWORD32 hSplPrinter;
61 #endif
62 } SPLCLIENT_INFO_2_WINXP;
63
64 typedef struct _SPLCLIENT_INFO_2_V3{
65 UINT64 hSplPrinter;
66 } SPLCLIENT_INFO_2_LONGHORN;
67
68 typedef struct _PRINTPROVIDOR {
69 BOOL (WINAPI *fpOpenPrinter)(PWSTR lpPrinterName, HANDLE *phPrinter,
70 PPRINTER_DEFAULTSW pDefault);
71 BOOL (WINAPI *fpSetJob)(HANDLE hPrinter, DWORD JobID, DWORD Level,
72 LPBYTE pJob, DWORD Command);
73 BOOL (WINAPI *fpGetJob)(HANDLE hPrinter, DWORD JobID, DWORD Level,
74 LPBYTE pJob, DWORD cbBuf, LPDWORD pcbNeeded);
75 BOOL (WINAPI *fpEnumJobs)(HANDLE hPrinter, DWORD FirstJob, DWORD NoJobs,
76 DWORD Level, LPBYTE pJob, DWORD cbBuf, LPDWORD pcbNeeded,
77 LPDWORD pcReturned);
78 HANDLE (WINAPI *fpAddPrinter)(LPWSTR pName, DWORD Level, LPBYTE pPrinter);
79 BOOL (WINAPI *fpDeletePrinter)(HANDLE hPrinter);
80 BOOL (WINAPI *fpSetPrinter)(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter,
81 DWORD Command);
82 BOOL (WINAPI *fpGetPrinter)(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter,
83 DWORD cbBuf, LPDWORD pcbNeeded);
84 BOOL (WINAPI *fpEnumPrinters)(DWORD dwType, LPWSTR lpszName, DWORD dwLevel,
85 LPBYTE lpbPrinters, DWORD cbBuf, LPDWORD lpdwNeeded,
86 LPDWORD lpdwReturned);
87 BOOL (WINAPI *fpAddPrinterDriver)(LPWSTR pName, DWORD Level, LPBYTE pDriverInfo);
88 BOOL (WINAPI *fpEnumPrinterDrivers)(LPWSTR pName, LPWSTR pEnvironment,
89 DWORD Level, LPBYTE pDriverInfo, DWORD cbBuf,
90 LPDWORD pcbNeeded, LPDWORD pcbReturned);
91 BOOL (WINAPI *fpGetPrinterDriver)(HANDLE hPrinter, LPWSTR pEnvironment,
92 DWORD Level, LPBYTE pDriverInfo, DWORD cbBuf,
93 LPDWORD pcbNeeded);
94 BOOL (WINAPI *fpGetPrinterDriverDirectory)(LPWSTR pName, LPWSTR pEnvironment,
95 DWORD Level, LPBYTE pDriverDirectory,
96 DWORD cbBuf, LPDWORD pcbNeeded);
97 BOOL (WINAPI *fpDeletePrinterDriver)(LPWSTR pName, LPWSTR pEnvironment,
98 LPWSTR pDriverName);
99 BOOL (WINAPI *fpAddPrintProcessor)(LPWSTR pName, LPWSTR pEnvironment,
100 LPWSTR pPathName, LPWSTR pPrintProcessorName);
101 BOOL (WINAPI *fpEnumPrintProcessors)(LPWSTR pName, LPWSTR pEnvironment,
102 DWORD Level, LPBYTE pPrintProcessorInfo,
103 DWORD cbBuf, LPDWORD pcbNeeded,
104 LPDWORD pcbReturned);
105 BOOL (WINAPI *fpGetPrintProcessorDirectory)(LPWSTR pName, LPWSTR pEnvironment,
106 DWORD Level, LPBYTE pPrintProcessorInfo,
107 DWORD cbBuf, LPDWORD pcbNeeded);
108 BOOL (WINAPI *fpDeletePrintProcessor)(LPWSTR pName, LPWSTR pEnvironment,
109 LPWSTR pPrintProcessorName);
110 BOOL (WINAPI *fpEnumPrintProcessorDatatypes)(LPWSTR pName,
111 LPWSTR pPrintProcessorName,
112 DWORD Level, LPBYTE pDatatypes,
113 DWORD cbBuf, LPDWORD pcbNeeded,
114 LPDWORD pcbReturned);
115 DWORD (WINAPI *fpStartDocPrinter)(HANDLE hPrinter, DWORD Level, LPBYTE pDocInfo);
116 BOOL (WINAPI *fpStartPagePrinter)(HANDLE hPrinter);
117 BOOL (WINAPI *fpWritePrinter)(HANDLE hPrinter, LPVOID pBuf, DWORD cbBuf,
118 LPDWORD pcWritten);
119 BOOL (WINAPI *fpEndPagePrinter)(HANDLE hPrinter);
120 BOOL (WINAPI *fpAbortPrinter)(HANDLE hPrinter);
121 BOOL (WINAPI *fpReadPrinter)(HANDLE hPrinter, LPVOID pBuf, DWORD cbBuf,
122 LPDWORD pNoBytesRead);
123 BOOL (WINAPI *fpEndDocPrinter)(HANDLE hPrinter);
124 BOOL (WINAPI *fpAddJob)(HANDLE hPrinter, DWORD Level, LPBYTE pData,
125 DWORD cbBuf, LPDWORD pcbNeeded);
126 BOOL (WINAPI *fpScheduleJob)(HANDLE hPrinter, DWORD JobID);
127 DWORD (WINAPI *fpGetPrinterData)(HANDLE hPrinter, LPWSTR pValueName,
128 LPDWORD pType, LPBYTE pData, DWORD nSize,
129 LPDWORD pcbNeeded);
130 DWORD (WINAPI *fpSetPrinterData)(HANDLE hPrinter, LPWSTR pValueName,
131 DWORD Type, LPBYTE pData, DWORD cbData);
132 DWORD (WINAPI *fpWaitForPrinterChange)(HANDLE hPrinter, DWORD Flags);
133 BOOL (WINAPI *fpClosePrinter)(HANDLE phPrinter);
134 BOOL (WINAPI *fpAddForm)(HANDLE hPrinter, DWORD Level, LPBYTE pForm);
135 BOOL (WINAPI *fpDeleteForm)(HANDLE hPrinter, LPWSTR pFormName);
136 BOOL (WINAPI *fpGetForm)(HANDLE hPrinter, LPWSTR pFormName, DWORD Level,
137 LPBYTE pForm, DWORD cbBuf, LPDWORD pcbNeeded);
138 BOOL (WINAPI *fpSetForm)(HANDLE hPrinter, LPWSTR pFormName, DWORD Level,
139 LPBYTE pForm);
140 BOOL (WINAPI *fpEnumForms)(HANDLE hPrinter, DWORD Level, LPBYTE pForm,
141 DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned);
142 BOOL (WINAPI *fpEnumMonitors)(LPWSTR pName, DWORD Level, LPBYTE pMonitors,
143 DWORD cbBuf, LPDWORD pcbNeeded,
144 LPDWORD pcReturned);
145 BOOL (WINAPI *fpEnumPorts)(LPWSTR pName, DWORD Level, LPBYTE pPorts,
146 DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned);
147 BOOL (WINAPI *fpAddPort)(LPWSTR pName, HWND hWnd, LPWSTR pMonitorName);
148 BOOL (WINAPI *fpConfigurePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
149 BOOL (WINAPI *fpDeletePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
150 HANDLE (WINAPI *fpCreatePrinterIC)(HANDLE hPrinter, LPDEVMODEW pDevMode);
151 BOOL (WINAPI *fpPlayGdiScriptOnPrinterIC)(HANDLE hPrinterIC, LPBYTE pIn,
152 DWORD cIn, LPBYTE pOut, DWORD cOut,
153 DWORD ul);
154 BOOL (WINAPI *fpDeletePrinterIC)(HANDLE hPrinterIC);
155 BOOL (WINAPI *fpAddPrinterConnection)(LPWSTR pName);
156 BOOL (WINAPI *fpDeletePrinterConnection)(LPWSTR pName);
157 DWORD (WINAPI *fpPrinterMessageBox)(HANDLE hPrinter, DWORD Error, HWND hWnd,
158 LPWSTR pText, LPWSTR pCaption,
159 DWORD dwType);
160 BOOL (WINAPI *fpAddMonitor)(LPWSTR pName, DWORD Level, LPBYTE pMonitors);
161 BOOL (WINAPI *fpDeleteMonitor)(LPWSTR pName, LPWSTR pEnvironment,
162 LPWSTR pMonitorName);
163 BOOL (WINAPI *fpResetPrinter)(HANDLE hPrinter, LPPRINTER_DEFAULTSW pDefault);
164 BOOL (WINAPI *fpGetPrinterDriverEx)(HANDLE hPrinter, LPWSTR pEnvironment,
165 DWORD Level, LPBYTE pDriverInfo,
166 DWORD cbBuf, LPDWORD pcbNeeded,
167 DWORD dwClientMajorVersion,
168 DWORD dwClientMinorVersion,
169 PDWORD pdwServerMajorVersion,
170 PDWORD pdwServerMinorVersion);
171 HANDLE (WINAPI *fpFindFirstPrinterChangeNotification)(HANDLE hPrinter,
172 DWORD fdwFlags,
173 DWORD fdwOptions,
174 LPVOID pPrinterNotifyOptions);
175 BOOL (WINAPI *fpFindClosePrinterChangeNotification)(HANDLE hChange);
176 BOOL (WINAPI *fpAddPortEx)(HANDLE hMonitor, LPWSTR pName, DWORD Level,
177 LPBYTE lpBuffer, LPWSTR lpMonitorName);
178 BOOL (WINAPI *fpShutDown)(LPVOID pvReserved);
179 BOOL (WINAPI *fpRefreshPrinterChangeNotification)(HANDLE hPrinter,
180 DWORD Reserved,
181 PVOID pvReserved,
182 PVOID pPrinterNotifyInfo);
183 BOOL (WINAPI *fpOpenPrinterEx)(LPWSTR pPrinterName, LPHANDLE phPrinter,
184 LPPRINTER_DEFAULTSW pDefault, LPBYTE pClientInfo,
185 DWORD Level);
186 HANDLE (WINAPI *fpAddPrinterEx)(LPWSTR pName, DWORD Level, LPBYTE pPrinter,
187 LPBYTE pClientInfo, DWORD ClientInfoLevel);
188 BOOL (WINAPI *fpSetPort)(LPWSTR pName, LPWSTR pPortName, DWORD dwLevel,
189 LPBYTE pPortInfo);
190 DWORD (WINAPI *fpEnumPrinterData)(HANDLE hPrinter, DWORD dwIndex,
191 LPWSTR pValueName, DWORD cbValueName,
192 LPDWORD pcbValueName, LPDWORD pType,
193 LPBYTE pData, DWORD cbData, LPDWORD pcbData);
194 DWORD (WINAPI *fpDeletePrinterData)(HANDLE hPrinter, LPWSTR pValueName);
195 DWORD (WINAPI *fpClusterSplOpen)(LPCWSTR pszServer, LPCWSTR pszResource,
196 PHANDLE phSpooler, LPCWSTR pszName,
197 LPCWSTR pszAddress);
198 DWORD (WINAPI *fpClusterSplClose)(HANDLE hSpooler);
199 DWORD (WINAPI *fpClusterSplIsAlive)(HANDLE hSpooler);
200 DWORD (WINAPI *fpSetPrinterDataEx)(HANDLE hPrinter, LPCWSTR pKeyName,
201 LPCWSTR pValueName, DWORD Type,
202 LPBYTE pData, DWORD cbData);
203 DWORD (WINAPI *fpGetPrinterDataEx)(HANDLE hPrinter, LPCWSTR pKeyName,
204 LPCWSTR pValueName, LPDWORD pType,
205 LPBYTE pData, DWORD nSize, LPDWORD pcbNeeded);
206 DWORD (WINAPI *fpEnumPrinterDataEx)(HANDLE hPrinter, LPCWSTR pKeyName,
207 LPBYTE pEnumValues, DWORD cbEnumValues,
208 LPDWORD pcbEnumValues, LPDWORD pnEnumValues);
209 DWORD (WINAPI *fpEnumPrinterKey)(HANDLE hPrinter, LPCWSTR pKeyName,
210 LPWSTR pSubkey, DWORD cbSubkey, LPDWORD pcbSubkey);
211 DWORD (WINAPI *fpDeletePrinterDataEx)(HANDLE hPrinter, LPCWSTR pKeyName,
212 LPCWSTR pValueName);
213 DWORD (WINAPI *fpDeletePrinterKey)(HANDLE hPrinter, LPCWSTR pKeyName);
214 BOOL (WINAPI *fpSeekPrinter)(HANDLE hPrinter, LARGE_INTEGER liDistanceToMove,
215 PLARGE_INTEGER pliNewPointer, DWORD dwMoveMethod,
216 BOOL bWrite);
217 BOOL (WINAPI *fpDeletePrinterDriverEx)(LPWSTR pName, LPWSTR pEnvironment,
218 LPWSTR pDriverName, DWORD dwDeleteFlag,
219 DWORD dwVersionNum);
220 BOOL (WINAPI *fpAddPerMachineConnection)(LPCWSTR pServer,
221 LPCWSTR pPrinterName, LPCWSTR pPrintServer,
222 LPCWSTR pProvider);
223 BOOL (WINAPI *fpDeletePerMachineConnection)(LPCWSTR pServer,
224 LPCWSTR pPrinterName);
225 BOOL (WINAPI *fpEnumPerMachineConnections)(LPCWSTR pServer,
226 LPBYTE pPrinterEnum, DWORD cbBuf,
227 LPDWORD pcbNeeded,
228 LPDWORD pcReturned);
229 BOOL (WINAPI *fpXcvData)(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInputData,
230 DWORD cbInputData, PBYTE pOutputData, DWORD cbOutputData,
231 PDWORD pcbOutputNeeded, PDWORD pdwStatus);
232 BOOL (WINAPI *fpAddPrinterDriverEx)(LPWSTR pName, DWORD Level,
233 LPBYTE pDriverInfo, DWORD dwFileCopyFlags);
234 BOOL (WINAPI *fpSplReadPrinter)(HANDLE hPrinter, LPBYTE *pBuf, DWORD cbBuf);
235 BOOL (WINAPI *fpDriverUnloadComplete)(LPWSTR pDriverFile);
236 BOOL (WINAPI *fpGetSpoolFileInfo)(HANDLE hPrinter, LPWSTR *pSpoolDir,
237 LPHANDLE phFile, HANDLE hSpoolerProcess,
238 HANDLE hAppProcess);
239 BOOL (WINAPI *fpCommitSpoolData)(HANDLE hPrinter, DWORD cbCommit);
240 BOOL (WINAPI *fpCloseSpoolFileHandle)(HANDLE hPrinter);
241 BOOL (WINAPI *fpFlushPrinter)(HANDLE hPrinter, LPBYTE pBuf, DWORD cbBuf,
242 LPDWORD pcWritten, DWORD cSleep);
243 DWORD (WINAPI *fpSendRecvBidiData)(HANDLE hPort, LPCWSTR pAction,
244 LPBIDI_REQUEST_CONTAINER pReqData,
245 LPBIDI_RESPONSE_CONTAINER *ppResData);
246 BOOL (WINAPI *fpAddDriverCatalog)(HANDLE hPrinter, DWORD dwLevel,
247 VOID *pvDriverInfCatInfo, DWORD dwCatalogCopyFlags);
248 } PRINTPROVIDOR, *LPPRINTPROVIDOR;
249
250 typedef struct _PRINTPROCESSOROPENDATA {
251 PDEVMODEW pDevMode;
252 LPWSTR pDatatype;
253 LPWSTR pParameters;
254 LPWSTR pDocumentName;
255 DWORD JobId;
256 LPWSTR pOutputFile;
257 LPWSTR pPrinterName;
258 } PRINTPROCESSOROPENDATA, *LPPRINTPROCESSOROPENDATA, *PPRINTPROCESSOROPENDATA;
259
260 typedef struct _MONITORREG {
261 DWORD cbSize;
262 LONG (WINAPI *fpCreateKey)(HANDLE hcKey, LPCWSTR pszSubKey, DWORD dwOptions,
263 REGSAM samDesired,
264 PSECURITY_ATTRIBUTES pSecurityAttributes,
265 PHANDLE phckResult, PDWORD pdwDisposition,
266 HANDLE hSpooler);
267 LONG (WINAPI *fpOpenKey)(HANDLE hcKey, LPCWSTR pszSubKey, REGSAM samDesired,
268 PHANDLE phkResult, HANDLE hSpooler);
269 LONG (WINAPI *fpCloseKey)(HANDLE hcKey, HANDLE hSpooler);
270 LONG (WINAPI *fpDeleteKey)(HANDLE hcKey, LPCWSTR pszSubKey, HANDLE hSpooler);
271 LONG (WINAPI *fpEnumKey)(HANDLE hcKey, DWORD dwIndex, LPWSTR pszName,
272 PDWORD pcchName, PFILETIME pftLastWriteTime,
273 HANDLE hSpooler);
274 LONG (WINAPI *fpQueryInfoKey)(HANDLE hcKey, PDWORD pcSubKeys, PDWORD pcbKey,
275 PDWORD pcValues, PDWORD pcbValue, PDWORD pcbData,
276 PDWORD pcbSecurityDescriptor,
277 PFILETIME pftLastWriteTime,
278 HANDLE hSpooler);
279 LONG (WINAPI *fpSetValue)(HANDLE hcKey, LPCWSTR pszValue, DWORD dwType,
280 const BYTE* pData, DWORD cbData, HANDLE hSpooler);
281 LONG (WINAPI *fpDeleteValue)(HANDLE hcKey, LPCWSTR pszValue, HANDLE hSpooler);
282 LONG (WINAPI *fpEnumValue)(HANDLE hcKey, DWORD dwIndex, LPWSTR pszValue,
283 PDWORD pcbValue, PDWORD pType, PBYTE pData, PDWORD pcbData,
284 HANDLE hSpooler);
285 LONG (WINAPI *fpQueryValue)(HANDLE hcKey, LPCWSTR pszValue, PDWORD pType,
286 PBYTE pData, PDWORD pcbData, HANDLE hSpooler);
287 } MONITORREG, *PMONITORREG;
288
289 typedef struct _MONITORINIT {
290 DWORD cbSize;
291 HANDLE hSpooler;
292 HKEYMONITOR hckRegistryRoot;
293 PMONITORREG pMonitorReg;
294 BOOL bLocal;
295 LPCWSTR pszServerName;
296 } MONITORINIT, *PMONITORINIT;
297
298 typedef struct _MONITOR {
299 BOOL (WINAPI *pfnEnumPorts)(LPWSTR pName, DWORD Level, LPBYTE pPorts,
300 DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned);
301 BOOL (WINAPI *pfnOpenPort)(LPWSTR pName, PHANDLE pHandle);
302 BOOL (WINAPI *pfnOpenPortEx)(LPWSTR pPortName, LPWSTR pPrinterName,
303 PHANDLE pHandle, struct _MONITOR *pMonitor);
304 BOOL (WINAPI *pfnStartDocPort)(HANDLE hPort, LPWSTR pPrinterName,
305 DWORD JobId, DWORD Level, LPBYTE pDocInfo);
306 BOOL (WINAPI *pfnWritePort)(HANDLE hPort, LPBYTE pBuffer, DWORD cbBuf,
307 LPDWORD pcbWritten);
308 BOOL (WINAPI *pfnReadPort)(HANDLE hPort, LPBYTE pBuffer, DWORD cbBuffer,
309 LPDWORD pcbRead);
310 BOOL (WINAPI *pfnEndDocPort)(HANDLE hPort);
311 BOOL (WINAPI *pfnClosePort)(HANDLE hPort);
312 BOOL (WINAPI *pfnAddPort)(LPWSTR pName, HWND hWnd, LPWSTR pMonitorName);
313 BOOL (WINAPI *pfnAddPortEx)(LPWSTR pName, DWORD Level, LPBYTE lpBuffer,
314 LPWSTR lpMonitorName);
315 BOOL (WINAPI *pfnConfigurePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
316 BOOL (WINAPI *pfnDeletePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
317 BOOL (WINAPI *pfnGetPrinterDataFromPort)(HANDLE hPort, DWORD ControlID,
318 LPWSTR pValueName, LPWSTR lpInBuffer,
319 DWORD cbInBuffer, LPWSTR lpOutBuffer,
320 DWORD cbOutBuffer, LPDWORD lpcbReturned);
321 BOOL (WINAPI *pfnSetPortTimeOuts)(HANDLE hPort, LPCOMMTIMEOUTS lpCTO,
322 DWORD reserved);
323 BOOL (WINAPI *pfnXcvOpenPort)(LPCWSTR pszObject, ACCESS_MASK GrantedAccess, PHANDLE phXcv);
324 DWORD (WINAPI *pfnXcvDataPort)(HANDLE hXcv, LPCWSTR pszDataName,
325 PBYTE pInputData, DWORD cbInputData,
326 PBYTE pOutputData, DWORD cbOutputData,
327 PDWORD pcbOutputNeeded);
328 BOOL (WINAPI *pfnXcvClosePort)(HANDLE hXcv);
329 } MONITOR, *LPMONITOR;
330
331 typedef struct _MONITOREX {
332 DWORD dwMonitorSize;
333 MONITOR Monitor;
334 } MONITOREX, *LPMONITOREX;
335
336 typedef struct _MONITOR2 {
337 DWORD cbSize;
338 BOOL (WINAPI *pfnEnumPorts)(LPWSTR pName, DWORD Level, LPBYTE pPorts,
339 DWORD cbBuf, LPDWORD pcbNeeded,
340 LPDWORD pcReturned);
341 BOOL (WINAPI *pfnOpenPort)(LPWSTR pName, PHANDLE pHandle);
342 BOOL (WINAPI *pfnOpenPortEx)(LPWSTR pPortName, LPWSTR pPrinterName,
343 PHANDLE pHandle, struct _MONITOR2 *pMonitor2);
344 BOOL (WINAPI *pfnStartDocPort)(HANDLE hPort, LPWSTR pPrinterName,
345 DWORD JobId, DWORD Level, LPBYTE pDocInfo);
346 BOOL (WINAPI *pfnWritePort)(HANDLE hPort, LPBYTE pBuffer, DWORD cbBuf,
347 LPDWORD pcbWritten);
348 BOOL (WINAPI *pfnReadPort)(HANDLE hPort, LPBYTE pBuffer, DWORD cbBuffer,
349 LPDWORD pcbRead);
350 BOOL (WINAPI *pfnEndDocPort)(HANDLE hPort);
351 BOOL (WINAPI *pfnClosePort)(HANDLE hPort);
352 BOOL (WINAPI *pfnAddPort)(LPWSTR pName, HWND hWnd, LPWSTR pMonitorName);
353 BOOL (WINAPI *pfnAddPortEx)(LPWSTR pName, DWORD Level, LPBYTE lpBuffer,
354 LPWSTR lpMonitorName);
355 BOOL (WINAPI *pfnConfigurePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
356 BOOL (WINAPI *pfnDeletePort)(LPWSTR pName, HWND hWnd, LPWSTR pPortName);
357 BOOL (WINAPI *pfnGetPrinterDataFromPort)(HANDLE hPort, DWORD ControlID,
358 LPWSTR pValueName, LPWSTR lpInBuffer,
359 DWORD cbInBuffer, LPWSTR lpOutBuffer,
360 DWORD cbOutBuffer, LPDWORD lpcbReturned);
361 BOOL (WINAPI *pfnSetPortTimeOuts)(HANDLE hPort, LPCOMMTIMEOUTS lpCTO,
362 DWORD reserved);
363 BOOL (WINAPI *pfnXcvOpenPort)(HANDLE hMonitor, LPCWSTR pszObject,
364 ACCESS_MASK GrantedAccess, PHANDLE phXcv);
365 DWORD (WINAPI *pfnXcvDataPort)(HANDLE hXcv, LPCWSTR pszDataName,
366 PBYTE pInputData, DWORD cbInputData,
367 PBYTE pOutputData, DWORD cbOutputData,
368 PDWORD pcbOutputNeeded);
369 BOOL (WINAPI *pfnXcvClosePort)(HANDLE hXcv);
370 VOID (WINAPI *pfnShutdown)(HANDLE hMonitor);
371 #if (NTDDI_VERSION >= NTDDI_WINXP)
372 DWORD (WINAPI *pfnSendRecvBidiDataFromPort)(HANDLE hPort, DWORD dwAccessBit,
373 LPCWSTR pAction,
374 PBIDI_REQUEST_CONTAINER pReqData,
375 PBIDI_RESPONSE_CONTAINER *ppResData);
376 #endif
377 #if (NTDDI_VERSION >= NTDDI_WIN7)
378 DWORD (WINAPI *pfnNotifyUsedPorts)(HANDLE hMonitor, DWORD cPorts,
379 PCWSTR *ppszPorts);
380
381 DWORD (WINAPI *pfnNotifyUnusedPorts)(HANDLE hMonitor, DWORD cPorts,
382 PCWSTR *ppszPorts);
383 #endif
384 } MONITOR2, *LPMONITOR2, *PMONITOR2;
385
386 typedef struct _MONITORUI {
387 DWORD dwMonitorUISize;
388 BOOL (WINAPI *pfnAddPortUI)(PCWSTR pszServer, HWND hWnd,
389 PCWSTR pszPortNameIn, PWSTR *ppszPortNameOut);
390 BOOL (WINAPI *pfnConfigurePortUI)(PCWSTR pName, HWND hWnd, PCWSTR pPortName);
391 BOOL (WINAPI *pfnDeletePortUI)(PCWSTR pszServer, HWND hWnd, PCWSTR pszPortName);
392 } MONITORUI, *PMONITORUI;
393
394 #if (NTDDI_VERSION >= NTDDI_WINXP)
395
396 typedef enum {
397 kMessageBox = 0
398 } UI_TYPE;
399
400 typedef struct {
401 DWORD cbSize;
402 LPWSTR pTitle;
403 LPWSTR pMessage;
404 DWORD Style;
405 DWORD dwTimeout;
406 BOOL bWait;
407 } MESSAGEBOX_PARAMS, *PMESSAGEBOX_PARAMS;
408
409 typedef struct {
410 UI_TYPE UIType;
411 MESSAGEBOX_PARAMS MessageBoxParams;
412 } SHOWUIPARAMS, *PSHOWUIPARAMS;
413
414 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
415
416 #if (NTDDI_VERSION >= NTDDI_WS03)
417 #ifndef __ATTRIBUTE_INFO_3__
418 #define __ATTRIBUTE_INFO_3__
419 typedef struct _ATTRIBUTE_INFO_3 {
420 DWORD dwJobNumberOfPagesPerSide;
421 DWORD dwDrvNumberOfPagesPerSide;
422 DWORD dwNupBorderFlags;
423 DWORD dwJobPageOrderFlags;
424 DWORD dwDrvPageOrderFlags;
425 DWORD dwJobNumberOfCopies;
426 DWORD dwDrvNumberOfCopies;
427 DWORD dwColorOptimization;
428 short dmPrintQuality;
429 short dmYResolution;
430 } ATTRIBUTE_INFO_3, *PATTRIBUTE_INFO_3;
431 #endif /* __ATTRIBUTE_INFO_3__ */
432 #endif /* (NTDDI_VERSION >= NTDDI_WS03) */
433
434 #if (NTDDI_VERSION >= NTDDI_VISTA)
435
436 typedef BOOL
437 (CALLBACK *ROUTER_NOTIFY_CALLBACK)(
438 IN DWORD dwCommand,
439 IN PVOID pContext,
440 IN DWORD dwColor,
441 IN PPRINTER_NOTIFY_INFO pNofityInfo,
442 IN DWORD fdwFlags,
443 OUT PDWORD pdwResult);
444
445 typedef enum _NOTIFICATION_CALLBACK_COMMANDS {
446 NOTIFICATION_COMMAND_NOTIFY,
447 NOTIFICATION_COMMAND_CONTEXT_ACQUIRE,
448 NOTIFICATION_COMMAND_CONTEXT_RELEASE
449 } NOTIFICATION_CALLBACK_COMMANDS;
450
451 typedef struct _NOTIFICATION_CONFIG_1 {
452 UINT cbSize;
453 DWORD fdwFlags;
454 ROUTER_NOTIFY_CALLBACK pfnNotifyCallback;
455 PVOID pContext;
456 } NOTIFICATION_CONFIG_1, *PNOTIFICATION_CONFIG_1;
457
458 typedef enum _NOTIFICATION_CONFIG_FLAGS {
459 NOTIFICATION_CONFIG_CREATE_EVENT = 1 << 0,
460 NOTIFICATION_CONFIG_REGISTER_CALLBACK = 1 << 1,
461 NOTIFICATION_CONFIG_EVENT_TRIGGER = 1 << 2,
462 NOTIFICATION_CONFIG_ASYNC_CHANNEL = 1 << 3
463 } NOTIFICATION_CONFIG_FLAGS;
464
465 typedef struct _SPLCLIENT_INFO_3 {
466 UINT cbSize;
467 DWORD dwFlags;
468 DWORD dwSize;
469 PWSTR pMachineName;
470 PWSTR pUserName;
471 DWORD dwBuildNum;
472 DWORD dwMajorVersion;
473 DWORD dwMinorVersion;
474 WORD wProcessorArchitecture;
475 UINT64 hSplPrinter;
476 } SPLCLIENT_INFO_3, *PSPLCLIENT_INFO_3, *LPSPLCLIENT_INFO_3;
477
478 #ifndef __ATTRIBUTE_INFO_4__
479 #define __ATTRIBUTE_INFO_4__
480
481 typedef struct _ATTRIBUTE_INFO_4 {
482 DWORD dwJobNumberOfPagesPerSide;
483 DWORD dwDrvNumberOfPagesPerSide;
484 DWORD dwNupBorderFlags;
485 DWORD dwJobPageOrderFlags;
486 DWORD dwDrvPageOrderFlags;
487 DWORD dwJobNumberOfCopies;
488 DWORD dwDrvNumberOfCopies;
489 DWORD dwColorOptimization;
490 short dmPrintQuality;
491 short dmYResolution;
492 DWORD dwDuplexFlags;
493 DWORD dwNupDirection;
494 DWORD dwBookletFlags;
495 DWORD dwScalingPercentX;
496 DWORD dwScalingPercentY;
497 } ATTRIBUTE_INFO_4, *PATTRIBUTE_INFO_4;
498
499 #define REVERSE_PAGES_FOR_REVERSE_DUPLEX (0x00000001)
500 #define DONT_SEND_EXTRA_PAGES_FOR_DUPLEX (0x00000001 << 1)
501
502 #define RIGHT_THEN_DOWN (0x00000001)
503 #define DOWN_THEN_RIGHT (0x00000001 << 1)
504 #define LEFT_THEN_DOWN (0x00000001 << 2)
505 #define DOWN_THEN_LEFT (0x00000001 << 3)
506
507 #define BOOKLET_EDGE_LEFT 0x00000000
508 #define BOOKLET_EDGE_RIGHT 0x00000001
509
510 #endif /* __ATTRIBUTE_INFO_4__ */
511
512 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
513
514 #if (OSVER(NTDDI_VERSION) == NTDDI_W2K)
515 typedef SPLCLIENT_INFO_2_W2K SPLCLIENT_INFO_2, *PSPLCLIENT_INFO_2, *LPSPLCLIENT_INFO_2;
516 #elif ((OSVER(NTDDI_VERSION) == NTDDI_WINXP) || (OSVER(NTDDI_VERSION) == NTDDI_WS03))
517 typedef SPLCLIENT_INFO_2_WINXP SPLCLIENT_INFO_2, *PSPLCLIENT_INFO_2, *LPSPLCLIENT_INFO_2;
518 #else
519 typedef SPLCLIENT_INFO_2_LONGHORN SPLCLIENT_INFO_2, *PSPLCLIENT_INFO_2, *LPSPLCLIENT_INFO_2;
520 #endif /* (OSVER(NTDDI_VERSION) == NTDDI_W2K) */
521
522 BOOL
523 WINAPI
524 InitializePrintProvidor(
525 OUT LPPRINTPROVIDOR pPrintProvidor,
526 IN DWORD cbPrintProvidor,
527 IN LPWSTR pFullRegistryPath OPTIONAL);
528
529 HANDLE
530 WINAPI
531 OpenPrintProcessor(
532 IN LPWSTR pPrinterName,
533 IN PPRINTPROCESSOROPENDATA pPrintProcessorOpenData);
534
535 BOOL
536 WINAPI
537 PrintDocumentOnPrintProcessor(
538 IN HANDLE hPrintProcessor,
539 IN LPWSTR pDocumentName);
540
541 BOOL
542 WINAPI
543 ClosePrintProcessor(
544 IN OUT HANDLE hPrintProcessor);
545
546 BOOL
547 WINAPI
548 ControlPrintProcessor(
549 IN HANDLE hPrintProcessor,
550 IN DWORD Command);
551
552 DWORD
553 WINAPI
554 GetPrintProcessorCapabilities(
555 IN LPTSTR pValueName,
556 IN DWORD dwAttributes,
557 OUT LPBYTE pData,
558 IN DWORD nSize,
559 OUT LPDWORD pcbNeeded);
560
561 BOOL
562 WINAPI
563 InitializeMonitor(
564 IN LPWSTR pRegistryRoot);
565
566 BOOL
567 WINAPI
568 OpenPort(
569 IN LPWSTR pName,
570 OUT PHANDLE pHandle);
571
572 BOOL
573 WINAPI
574 WritePort(
575 HANDLE hPort,
576 LPBYTE pBuffer,
577 DWORD cbBuf,
578 LPDWORD pcbWritten);
579
580 BOOL
581 WINAPI
582 ReadPort(
583 HANDLE hPort,
584 LPBYTE pBuffer,
585 DWORD cbBuffer,
586 LPDWORD pcbRead);
587
588 BOOL
589 WINAPI
590 ClosePort(
591 IN HANDLE hPort);
592
593 BOOL
594 WINAPI
595 XcvOpenPort(
596 LPCWSTR pszObject,
597 ACCESS_MASK GrantedAccess,
598 PHANDLE phXcv);
599
600 DWORD
601 WINAPI
602 XcvDataPort(
603 HANDLE hXcv,
604 LPCWSTR pszDataName,
605 PBYTE pInputData,
606 DWORD cbInputData,
607 PBYTE pOutputData,
608 DWORD cbOutputData,
609 PDWORD pcbOutputNeeded);
610
611 BOOL
612 WINAPI
613 XcvClosePort(
614 IN HANDLE hXcv);
615
616 BOOL
617 WINAPI
618 AddPortUI(
619 IN PCWSTR pszServer OPTIONAL,
620 IN HWND hWnd,
621 IN PCWSTR pszMonitorNameIn,
622 OUT PWSTR *ppszPortNameOut OPTIONAL);
623
624 BOOL
625 WINAPI
626 ConfigurePortUI(
627 IN PCWSTR pszServer,
628 IN HWND hWnd,
629 IN PCWSTR pszPortName);
630
631 BOOL
632 WINAPI
633 DeletePortUI(
634 IN PCWSTR pszServer,
635 IN HWND hWnd,
636 IN PCWSTR pszPortName);
637
638 BOOL
639 WINAPI
640 SplDeleteSpoolerPortStart(
641 IN PCWSTR pPortName);
642
643 BOOL
644 WINAPI
645 SplDeleteSpoolerPortEnd(
646 IN PCWSTR pName,
647 IN BOOL bDeletePort);
648
649 BOOL
650 WINAPI
651 SpoolerCopyFileEvent(
652 IN LPWSTR pszPrinterName,
653 IN LPWSTR pszKey,
654 IN DWORD dwCopyFileEvent);
655
656 DWORD
657 WINAPI
658 GenerateCopyFilePaths(
659 IN LPCWSTR pszPrinterName,
660 IN LPCWSTR pszDirectory,
661 IN LPBYTE pSplClientInfo,
662 IN DWORD dwLevel,
663 IN OUT LPWSTR pszSourceDir,
664 IN OUT LPDWORD pcchSourceDirSize,
665 IN OUT LPWSTR pszTargetDir,
666 IN OUT LPDWORD pcchTargetDirSize,
667 IN DWORD dwFlags);
668
669 HANDLE WINAPI CreatePrinterIC(HANDLE hPrinter, LPDEVMODEW pDevMode);
670 BOOL WINAPI PlayGdiScriptOnPrinterIC(HANDLE hPrinterIC, LPBYTE pIn,
671 DWORD cIn, LPBYTE pOut, DWORD cOut, DWORD ul);
672 BOOL WINAPI DeletePrinterIC(HANDLE hPrinterIC);
673 BOOL WINAPI DevQueryPrint(HANDLE hPrinter, LPDEVMODEW pDevMode, DWORD *pResID);
674 HANDLE WINAPI RevertToPrinterSelf(VOID);
675 BOOL WINAPI ImpersonatePrinterClient(HANDLE hToken);
676 BOOL WINAPI ReplyPrinterChangeNotification(HANDLE hNotify, DWORD fdwFlags,
677 PDWORD pdwResult, PVOID pPrinterNotifyInfo);
678 BOOL WINAPI ReplyPrinterChangeNotificationEx(HANDLE hNotify, DWORD dwColor,
679 DWORD fdwFlags, PDWORD pdwResult,
680 PVOID pPrinterNotifyInfo);
681 BOOL WINAPI PartialReplyPrinterChangeNotification(HANDLE hNotify,
682 PPRINTER_NOTIFY_INFO_DATA pInfoDataSrc);
683 PPRINTER_NOTIFY_INFO WINAPI RouterAllocPrinterNotifyInfo(DWORD cPrinterNotifyInfoData);
684 BOOL WINAPI RouterFreePrinterNotifyInfo(PPRINTER_NOTIFY_INFO pInfo);
685
686 BOOL WINAPI AppendPrinterNotifyInfoData(PPRINTER_NOTIFY_INFO pInfoDest,
687 PPRINTER_NOTIFY_INFO_DATA pInfoDataSrc,
688 DWORD fdwFlags);
689 DWORD WINAPI CallRouterFindFirstPrinterChangeNotification(HANDLE hPrinter,
690 DWORD fdwFlags,
691 DWORD fdwOptions,
692 HANDLE hNotify,
693 PPRINTER_NOTIFY_OPTIONS pPrinterNotifyOptions);
694 BOOL WINAPI ProvidorFindFirstPrinterChangeNotification(HANDLE hPrinter,
695 DWORD fdwFlags,
696 DWORD fdwOptions,
697 HANDLE hNotify,
698 PVOID pvReserved0,
699 PVOID pvReserved1);
700 BOOL WINAPI ProvidorFindClosePrinterChangeNotification(HANDLE hPrinter);
701
702 /* Spooler */
703 BOOL WINAPI SpoolerFindFirstPrinterChangeNotification(HANDLE hPrinter,
704 DWORD fdwFlags,
705 DWORD fdwOptions,
706 PHANDLE phEvent,
707 PVOID pPrinterNotifyOptions,
708 PVOID pvReserved);
709 BOOL WINAPI SpoolerFindNextPrinterChangeNotification(HANDLE hPrinter,
710 LPDWORD pfdwChange,
711 PVOID pvReserved0,
712 PVOID ppPrinterNotifyInfo);
713 VOID WINAPI SpoolerFreePrinterNotifyInfo(PPRINTER_NOTIFY_INFO pInfo);
714 BOOL WINAPI SpoolerFindClosePrinterChangeNotification(HANDLE hPrinter);
715
716 /* Port monitor / Language monitor / Print monitor */
717 LPMONITOR2 WINAPI InitializePrintMonitor2(PMONITORINIT pMonitorInit,
718 PHANDLE phMonitor);
719 PMONITORUI WINAPI InitializePrintMonitorUI(VOID);
720 LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR pRegistryRoot);
721 BOOL WINAPI InitializeMonitorEx(LPWSTR pRegistryRoot, LPMONITOR pMonitor);
722
723 #if (NTDDI_VERSION >= NTDDI_WINXP)
724
725 PBIDI_RESPONSE_CONTAINER WINAPI RouterAllocBidiResponseContainer(DWORD Count);
726 PVOID WINAPI RouterAllocBidiMem(size_t NumBytes);
727 DWORD WINAPI RouterFreeBidiResponseContainer(PBIDI_RESPONSE_CONTAINER pData);
728 VOID WINAPI RouterFreeBidiMem(PVOID pMemPointer);
729
730 BOOL
731 WINAPI
732 SplPromptUIInUsersSession(
733 IN HANDLE hPrinter,
734 IN DWORD JobId,
735 IN PSHOWUIPARAMS pUIParams,
736 OUT DWORD *pResponse);
737
738 DWORD
739 WINAPI
740 SplIsSessionZero(
741 IN HANDLE hPrinter,
742 IN DWORD JobId,
743 OUT BOOL *pIsSessionZero);
744
745 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
746
747 #if (NTDDI_VERSION >= NTDDI_WS03)
748 BOOL
749 WINAPI
750 GetJobAttributes(
751 IN LPWSTR pPrinterName,
752 IN LPDEVMODEW pDevmode,
753 OUT PATTRIBUTE_INFO_3 pAttributeInfo);
754 #endif
755
756 #if (NTDDI_VERSION >= NTDDI_VISTA)
757
758 #define FILL_WITH_DEFAULTS 0x1
759
760 BOOL
761 WINAPI
762 GetJobAttributesEx(
763 IN LPWSTR pPrinterName,
764 IN LPDEVMODEW pDevmode,
765 IN DWORD dwLevel,
766 OUT LPBYTE pAttributeInfo,
767 IN DWORD nSize,
768 IN DWORD dwFlags);
769
770 BOOL WINAPI SpoolerRefreshPrinterChangeNotification(HANDLE hPrinter,
771 DWORD dwColor,
772 PPRINTER_NOTIFY_OPTIONS pOptions,
773 PPRINTER_NOTIFY_INFO *ppInfo);
774
775 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
776
777 /* FIXME : The following declarations are not present in the official header */
778
779 BOOL WINAPI OpenPrinterToken(PHANDLE phToken);
780 BOOL WINAPI SetPrinterToken(HANDLE hToken);
781 BOOL WINAPI ClosePrinterToken(HANDLE hToken);
782 BOOL WINAPI InstallPrintProcessor(HWND hWnd);
783
784 #ifdef __cplusplus
785 }
786 #endif