1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
|
/*++
Copyright (c) 1990 Microsoft Corporation
Module Name:
WinSplp.h
Abstract:
Internal Header file for Print APIs
Author:
Dave Snipp (DaveSn) 15-Mar-1991
Revision History:
--*/
#ifndef _WINSPLP_
#define _WINSPLP_
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define PRINTER_NOTIFY_STATUS_ENDPOINT 1
#define PRINTER_NOTIFY_STATUS_POLL 2
#define PRINTER_NOTIFY_STATUS_INFO 4
#define ROUTER_UNKNOWN 0
#define ROUTER_SUCCESS 1
#define ROUTER_STOP_ROUTING 2
typedef struct _PRINTER_NOTIFY_INIT {
DWORD Size;
DWORD Reserved;
DWORD PollTime;
} PRINTER_NOTIFY_INIT, *PPRINTER_NOTIFY_INIT, *LPPRINTER_NOTIFY_INIT;
typedef struct _SPLCLIENT_INFO_1{
DWORD dwSize;
LPWSTR pMachineName;
LPWSTR pUserName;
DWORD dwBuildNum;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
WORD wProcessorArchitecture;
} SPLCLIENT_INFO_1, *PSPLCLIENT_INFO_1, *LPSPLCLIENT_INFO_1;
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);
} PRINTPROVIDOR, *LPPRINTPROVIDOR;
BOOL
InitializePrintProvidor(
LPPRINTPROVIDOR pPrintProvidor,
DWORD cbPrintProvidor,
LPWSTR pFullRegistryPath
);
typedef struct _PRINTPROCESSOROPENDATA {
PDEVMODE pDevMode;
LPWSTR pDatatype;
LPWSTR pParameters;
LPWSTR pDocumentName;
DWORD JobId;
LPWSTR pOutputFile;
LPWSTR pPrinterName;
} PRINTPROCESSOROPENDATA, *PPRINTPROCESSOROPENDATA, *LPPRINTPROCESSOROPENDATA;
HANDLE
OpenPrintProcessor(
LPWSTR pPrinterName,
PPRINTPROCESSOROPENDATA pPrintProcessorOpenData
);
BOOL
PrintDocumentOnPrintProcessor(
HANDLE hPrintProcessor,
LPWSTR pDocumentName
);
BOOL
ClosePrintProcessor(
HANDLE hPrintProcessor
);
BOOL
ControlPrintProcessor(
HANDLE hPrintProcessor,
DWORD Command
);
BOOL
InstallPrintProcessor(
HWND hWnd
);
BOOL
InitializeMonitor(
LPWSTR pRegistryRoot
);
BOOL
OpenPort(
LPWSTR pName,
PHANDLE pHandle
);
BOOL
WritePort(
HANDLE hPort,
LPBYTE pBuffer,
DWORD cbBuf,
LPDWORD pcbWritten
);
BOOL
ReadPort(
HANDLE hPort,
LPBYTE pBuffer,
DWORD cbBuffer,
LPDWORD pcbRead
);
BOOL
ClosePort(
HANDLE hPort
);
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;
typedef struct _MONITOREX
{
DWORD dwMonitorSize;
MONITOR Monitor;
} MONITOREX, FAR *LPMONITOREX;
HANDLE
CreatePrinterIC(
HANDLE hPrinter,
LPDEVMODEW pDevMode
);
BOOL
PlayGdiScriptOnPrinterIC(
HANDLE hPrinterIC,
LPBYTE pIn,
DWORD cIn,
LPBYTE pOut,
DWORD cOut,
DWORD ul
);
BOOL
DeletePrinterIC(
HANDLE hPrinterIC
);
BOOL
DevQueryPrint(
HANDLE hPrinter,
LPDEVMODE pDevMode,
DWORD *pResID
);
HANDLE
RevertToPrinterSelf(
VOID
);
BOOL
ImpersonatePrinterClient(
HANDLE hToken
);
BOOL
OpenPrinterToken(
PHANDLE phToken
);
BOOL
SetPrinterToken(
HANDLE hToken
);
BOOL
ClosePrinterToken(
HANDLE hToken
);
BOOL
ReplyPrinterChangeNotification(
HANDLE hNotify,
DWORD fdwFlags,
PDWORD pdwResult,
PVOID pPrinterNotifyInfo
);
BOOL
PartialReplyPrinterChangeNotification(
HANDLE hNotify,
PPRINTER_NOTIFY_INFO_DATA pInfoDataSrc
);
PPRINTER_NOTIFY_INFO
RouterAllocPrinterNotifyInfo(
DWORD cPrinterNotifyInfoData
);
BOOL
RouterFreePrinterNotifyInfo(
PPRINTER_NOTIFY_INFO pInfo
);
#define PRINTER_NOTIFY_INFO_DATA_COMPACT 1
BOOL
AppendPrinterNotifyInfoData(
PPRINTER_NOTIFY_INFO pInfoDest,
PPRINTER_NOTIFY_INFO_DATA pInfoDataSrc,
DWORD fdwFlags
);
DWORD
CallRouterFindFirstPrinterChangeNotification(
HANDLE hPrinter,
DWORD fdwFlags,
DWORD fdwOptions,
HANDLE hNotify,
PVOID pvReserved);
BOOL
ProvidorFindFirstPrinterChangeNotification(
HANDLE hPrinter,
DWORD fdwFlags,
DWORD fdwOptions,
HANDLE hNotify,
PVOID pvReserved0,
PVOID pvReserved1);
BOOL
ProvidorFindClosePrinterChangeNotification(
HANDLE hPrinter);
BOOL
SpoolerFindFirstPrinterChangeNotification(
HANDLE hPrinter,
DWORD fdwFlags,
DWORD fdwOptions,
PHANDLE phEvent,
PVOID pPrinterNotifyOptions,
PVOID pvReserved);
BOOL
SpoolerFindNextPrinterChangeNotification(
HANDLE hPrinter,
LPDWORD pfdwChange,
PVOID pvReserved0,
PVOID ppPrinterNotifyInfo);
VOID
SpoolerFreePrinterNotifyInfo(
PPRINTER_NOTIFY_INFO pInfo);
BOOL
SpoolerFindClosePrinterChangeNotification(
HANDLE hPrinter);
BOOL
WINAPI
InitializeMonitorEx(
LPWSTR pRegistryRoot,
LPMONITOR pMonitor
);
LPMONITOREX
WINAPI
InitializePrintMonitor(
LPWSTR pRegistryRoot
);
#ifdef __cplusplus
} /* End of extern "C" { */
#endif /* __cplusplus */
#endif // _WINSPLP_
|