ReactOS 0.4.16-dev-319-g6cf4263
printdrv.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Kernel
4 * PURPOSE: GDI Printing Support
5 * FILE: dll/win32/gdi32/objects/printdrv.c
6 * PROGRAMER:
7 *
8 */
9
10// For the wine code:
11/*
12 * Implementation of some printer driver bits
13 *
14 * Copyright 1996 John Harvey
15 * Copyright 1998 Huw Davies
16 * Copyright 1998 Andreas Mohr
17 * Copyright 1999 Klaas van Gend
18 *
19 * This library is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU Lesser General Public
21 * License as published by the Free Software Foundation; either
22 * version 2.1 of the License, or (at your option) any later version.
23 *
24 * This library is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * Lesser General Public License for more details.
28 *
29 * You should have received a copy of the GNU Lesser General Public
30 * License along with this library; if not, write to the Free Software
31 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
32 */
33
34#include <precomp.h>
35
36#define NDEBUG
37#include <debug.h>
38
39/* GLOBALS *******************************************************************/
41
46//static fpConnectToLd64In32Server;
67
68/* PRIVATE FUNCTIONS *********************************************************/
69
70static
71int
74 HDC hdc,
75 BOOL Form
76)
77{
78 PLDC pldc;
79 int Ret = SP_ERROR;
81
83 {
85 return SP_ERROR;
86 }
87
88 pldc = GdiGetLDC(hdc);
89 if ( !pldc )
90 {
92 return SP_ERROR;
93 }
94
95 if (pldc->Flags & LDC_ATENDPAGE) return 1;
96
97 if (pldc->Flags & LDC_META_PRINT)
98 {
99 if ( Form )
100 {
101 // Do MF EndPageForm
102 }
103 else
104 {
105 // Do MF EndPage
106 }
107 return Ret;
108 }
109
110 if (pldc->Flags & LDC_KILL_DOCUMENT || pldc->Flags & LDC_INIT_PAGE)
111 {
113 return SP_ERROR;
114 }
115
116 if (pldc->Flags & LDC_SAPCALLBACK) GdiSAPCallback(pldc);
117
118 pldc->Flags &= ~LDC_INIT_PAGE;
119
121
122 ((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
123
124 if ( NtGdiEndPage(hdc) )
125 {
126 BOOL Good;
127// if (pldc->pUMPDev)
128 Good = EndPagePrinterEx(NULL,pldc->hPrinter);
129
130 if (Good) pldc->Flags |= LDC_STARTPAGE;
131 Ret = 1;
132 }
133 else
135 return Ret;
136}
137
138/* FUNCTIONS *****************************************************************/
139
140BOOL
143 PVOID pvUMPDev,
144 HANDLE hPrinter
145)
146{
147 return fpAbortPrinter(hPrinter);
148}
149
150int
153 PVOID pvUMPDev,
154 HANDLE hPrinter,
155 HDC hdc,
156 int iEsc,
157 ULONG cbIn,
158 PVOID pvIn,
159 ULONG cbOut,
160 PVOID pvOut
161)
162{
163 return fpDocumentEvent(hPrinter,hdc,iEsc,cbIn,pvIn,cbOut,pvOut);
164}
165
166BOOL
169 PVOID pvUMPDev,
170 HANDLE hPrinter
171)
172{
173 return fpEndDocPrinter(hPrinter);
174}
175
176BOOL
179 PVOID pvUMPDev,
180 HANDLE hPrinter
181)
182{
183 return fpEndPagePrinter(hPrinter);
184}
185
186BOOL
189{
190 HMODULE hModWinSpoolDrv;
191
192 if ( !ghSpooler )
193 {
195
196 hModWinSpoolDrv = LoadLibraryW(L"WINSPOOL.DRV");
197
198 if (hModWinSpoolDrv)
199 {
200 fpAbortPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "AbortPrinter");
201 fpClosePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "ClosePrinter");
202 fpCloseSpoolFileHandle = (PVOID)GetProcAddress(hModWinSpoolDrv, "CloseSpoolFileHandle");
203 fpCommitSpoolData = (PVOID)GetProcAddress(hModWinSpoolDrv, "CommitSpoolData");
204 // fpConnectToLd64In32Server = (PVOID)GetProcAddress(hModWinSpoolDrv, (LPCSTR)224);
205 fpDocumentEvent = (PVOID)GetProcAddress(hModWinSpoolDrv,"DocumentEvent");
206 fpDocumentPropertiesW = (PVOID)GetProcAddress(hModWinSpoolDrv, "DocumentPropertiesW");
207 fpEndDocPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "EndDocPrinter");
208 fpEndPagePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "EndPagePrinter");
209 fpGetPrinterW = (PVOID)GetProcAddress( hModWinSpoolDrv,"GetPrinterW");
210 fpGetPrinterDriverW = (PVOID)GetProcAddress(hModWinSpoolDrv,"GetPrinterDriverW");
211 fpGetSpoolFileHandle = (PVOID)GetProcAddress(hModWinSpoolDrv, "GetSpoolFileHandle");
212 fpIsValidDevmodeW = (PVOID)GetProcAddress(hModWinSpoolDrv, "IsValidDevmodeW");
213 fpOpenPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "OpenPrinterW");
214 fpQueryColorProfile = (PVOID)GetProcAddress(hModWinSpoolDrv,"QueryColorProfile");
215 fpQueryRemoteFonts = (PVOID)GetProcAddress(hModWinSpoolDrv, "QueryRemoteFonts");
216 fpQuerySpoolMode = (PVOID)GetProcAddress(hModWinSpoolDrv, "QuerySpoolMode");
217 fpReadPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "ReadPrinter");
218 fpResetPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "ResetPrinterW");
219 fpSeekPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "SeekPrinter");
220 fpSplDriverUnloadComplete = (PVOID)GetProcAddress(hModWinSpoolDrv, "SplDriverUnloadComplete");
221 fpSplReadPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, (LPCSTR)205);
222 fpStartDocDlgW = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartDocDlgW");
223 fpStartDocPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartDocPrinterW");
224 fpStartPagePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartPagePrinter");
225
226 if ( !fpAbortPrinter ||
234 !fpGetPrinterW ||
242 !fpReadPrinter ||
244 !fpSeekPrinter ||
250 {
251 FreeLibrary(hModWinSpoolDrv);
252 hModWinSpoolDrv = NULL;
253 }
254 ghSpooler = hModWinSpoolDrv;
255 }
257 }
258 else
259 return TRUE;
260
262
263 return (ghSpooler != NULL);
264}
265
266/*
267 Note from msdn:
268
269 The sequence for a print job is as follows:
270
271 1. To begin a print job, call StartDocPrinter.
272 2. To begin each page, call StartPagePrinter.
273 3. To write data to a page, call WritePrinter.
274 4. To end each page, call EndPagePrinter.
275 5. Repeat 2, 3, and 4 for as many pages as necessary.
276 6. To end the print job, call EndDocPrinter.
277
278 */
279DWORD
282 PVOID pvUMPDev,
283 HANDLE hPrinter,
284 DWORD Level,
285 LPBYTE pDocInfo
286)
287{
288 return fpStartDocPrinterW(hPrinter,Level,pDocInfo);
289}
290
291BOOL
294 PVOID pvUMPDev,
295 HANDLE hPrinter
296)
297{
298 return fpStartPagePrinter(hPrinter);
299}
300
301/* SYSCALLS ******************************************************************/
302
303/*
304 * @unimplemented
305 */
306int
307WINAPI
309 HDC hdc
310)
311{
312 PLDC pldc;
313 int Ret = SP_ERROR;
315
317 {
319 return SP_ERROR;
320 }
321
322 pldc = GdiGetLDC(hdc);
323 if ( !pldc )
324 {
326 return SP_ERROR;
327 }
328
329 if ( !(pldc->Flags & LDC_INIT_DOCUMENT) ) return 1;
330
332
333 ((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
334
335 if ( pldc->Flags & LDC_META_PRINT)
336 {
339 return Ret;
340 }
341
342 if (NtGdiAbortDoc(hdc))
343 {
344 if (fpAbortPrinter(pldc->hPrinter)) Ret = 1;
345 }
346 else
347 Ret = SP_ERROR;
348
350
351 return Ret;
352}
353
354/*
355 * @unimplemented
356 */
357int
358WINAPI
360 HDC hdc
361)
362{
363 PLDC pldc;
364 int Ret = SP_ERROR;
366
368 {
370 return SP_ERROR;
371 }
372
373 pldc = GdiGetLDC(hdc);
374 if ( !pldc )
375 {
377 return SP_ERROR;
378 }
379
380 if (pldc->Flags & LDC_META_PRINT)
381 {
384 return Ret;
385 }
386
387 if (pldc->Flags & LDC_INIT_DOCUMENT)
388 {
389 BOOL Good;
390 if (pldc->Flags & LDC_INIT_PAGE) EndPage(hdc);
391
393
394 ((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
395
396 Good = NtGdiEndDoc(hdc);
397
398// if (pldc->pUMPDev)
399 Good = EndDocPrinterEx(NULL,pldc->hPrinter);
400
401 if (Good)
402 {
404 Ret = 1;
405 }
407 }
408 return Ret;
409}
410
411/*
412 * @implemented
413 */
414int
415WINAPI
417{
418 return IntEndPage(hdc,TRUE);
419}
420
421/*
422 * @implemented
423 */
424int
425WINAPI
427{
428 return IntEndPage(hdc,FALSE);
429}
430
431/*
432 * @unimplemented
433 */
434HANDLE
435WINAPI
437 LPDEVMODEW pDevmode,
439{
442 return 0;
443}
444
445/*
446 * @unimplemented
447 */
448BOOL
449WINAPI
451{
454 return 0;
455}
456
457/*
458 * @unimplemented
459 */
460DWORD
461WINAPI
462GdiGetPageCount(HANDLE SpoolFileHandle)
463{
466 return 0;
467}
468
469/*
470 * @unimplemented
471 */
472int
473WINAPI
475 HDC hdc,
476 CONST DOCINFOW *lpdi
477)
478{
479 PLDC pldc;
480 DOCINFOW diW;
481 DOC_INFO_1W di1W;
482 LPWSTR lpwstrRet = NULL;
483 BOOL Banding;
484 int PrnJobNo, Ret = SP_ERROR;
486
488 return SP_ERROR;
489
490 pldc = GdiGetLDC(hdc);
491 if ( !pldc || pldc->Flags & LDC_ATENDPAGE)
492 {
494 return SP_ERROR;
495 }
496
497 if (!pldc->hPrinter) return SP_ERROR;
498
499 pldc->Flags &= ~LDC_KILL_DOCUMENT;
500
501 if (lpdi)
502 RtlCopyMemory(&diW, lpdi, sizeof(DOCINFOW));
503 else
504 {
505 diW.cbSize = sizeof(DOCINFOW);
506 diW.lpszDocName = NULL;
507 diW.lpszOutput = NULL;
508 diW.lpszDatatype = NULL;
509 diW.fwType = 0;
510 }
511
512 if (!diW.lpszOutput)
513 if (pldc->pwszPort) diW.lpszOutput = pldc->pwszPort;
514
515 lpwstrRet = fpStartDocDlgW(pldc->hPrinter, &diW);
516 if (lpwstrRet == (LPWSTR)SP_APPABORT)
517 {
518 pldc->Flags |= LDC_KILL_DOCUMENT;
519 return SP_ERROR;
520 }
521 if (lpwstrRet == (LPWSTR)SP_ERROR) return SP_ERROR;
522
523 if (lpwstrRet != 0) diW.lpszOutput = lpwstrRet;
524
525 Ret = DocumentEventEx( NULL,
526 pldc->hPrinter,
527 hdc,
529 sizeof(ULONG),
530 &diW,
531 0,
532 NULL);
533
534 if (Ret == SP_APPABORT)
535 {
536 pldc->Flags |= LDC_KILL_DOCUMENT;
537 Ret = SP_ERROR;
538 }
539 if (Ret == SP_ERROR)
540 {
541 if (lpwstrRet) LocalFree(lpwstrRet);
542 return Ret;
543 }
544
545 di1W.pDocName = (LPWSTR)diW.lpszDocName;
546 di1W.pOutputFile = (LPWSTR)diW.lpszOutput;
547 di1W.pDatatype = (LPWSTR)diW.lpszDatatype;
548
549 Ret = SP_ERROR;
550
551 PrnJobNo = StartDocPrinterWEx(NULL, pldc->hPrinter, 1, (LPBYTE)&di1W);
552 if (PrnJobNo <= 0)
553 {
554 Ret = NtGdiStartDoc( hdc, &diW, &Banding, PrnJobNo);
555 if (Ret)
556 {
557 if (pldc->pAbortProc)
558 {
559 GdiSAPCallback(pldc);
560 pldc->Flags |= LDC_SAPCALLBACK;
561 pldc->CallBackTick = GetTickCount();
562 }
563 pldc->Flags |= LDC_INIT_DOCUMENT;
564 if (!Banding) pldc->Flags |= LDC_STARTPAGE;
565 }
566 }
567 if (Ret == SP_ERROR)
568 {
569 //if ( pldc->pUMPDev )
571 DPRINT1("StartDoc Died!!!\n");
572 }
573 else
574 {
575 if ( DocumentEventEx( NULL,
576 pldc->hPrinter,
577 hdc,
579 sizeof(ULONG),
580 &Ret,
581 0,
582 NULL) == SP_ERROR)
583 {
584 AbortDoc(hdc);
585 Ret = SP_ERROR;
586 }
587 }
588 if (lpwstrRet) LocalFree(lpwstrRet);
589 return Ret;
590}
591
592/*
593 * @implemented
594 */
595int
596WINAPI
598 HDC hdc,
599 CONST DOCINFOA *lpdi
600)
601{
602 LPWSTR szDocName = NULL, szOutput = NULL, szDatatype = NULL;
604 INT ret, len;
605
606 docW.cbSize = lpdi->cbSize;
607 if (lpdi->lpszDocName)
608 {
609 len = MultiByteToWideChar(CP_ACP,0,lpdi->lpszDocName,-1,NULL,0);
610 szDocName = HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR));
611 MultiByteToWideChar(CP_ACP,0,lpdi->lpszDocName,-1,szDocName,len);
612 }
613 if (lpdi->lpszOutput)
614 {
615 len = MultiByteToWideChar(CP_ACP,0,lpdi->lpszOutput,-1,NULL,0);
616 szOutput = HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR));
617 MultiByteToWideChar(CP_ACP,0,lpdi->lpszOutput,-1,szOutput,len);
618 }
619 if (lpdi->lpszDatatype)
620 {
621 len = MultiByteToWideChar(CP_ACP,0,lpdi->lpszDatatype,-1,NULL,0);
622 szDatatype = HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR));
623 MultiByteToWideChar(CP_ACP,0,lpdi->lpszDatatype,-1,szDatatype,len);
624 }
625
626 docW.lpszDocName = szDocName;
627 docW.lpszOutput = szOutput;
628 docW.lpszDatatype = szDatatype;
629 docW.fwType = lpdi->fwType;
630
631 ret = StartDocW(hdc, &docW);
632
633 HeapFree( GetProcessHeap(), 0, szDocName );
634 HeapFree( GetProcessHeap(), 0, szOutput );
635 HeapFree( GetProcessHeap(), 0, szDatatype );
636
637 return ret;
638}
639
640/*
641 * @unimplemented
642 */
643int
644WINAPI
646 HDC hdc
647)
648{
649 PLDC pldc;
651
653 {
655 return SP_ERROR;
656 }
657
658 pldc = GdiGetLDC(hdc);
659 if ( !pldc )
660 {
662 return SP_ERROR;
663 }
664
665 if (pldc->Flags & LDC_META_PRINT)
666 {
669 return SP_ERROR;
670 }
671
673
674 if (pldc->Flags & LDC_INIT_PAGE) return 1;
675
677 {
678 pldc->Flags |= LDC_INIT_PAGE;
679
680 ((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
681
682 if (StartPagePrinterEx(NULL, pldc->hPrinter))
683 {
684 if (NtGdiStartPage(hdc)) return 1;
685 }
686
687 pldc->Flags &= ~(LDC_INIT_PAGE);
688 EndDoc(hdc);
690 }
691 return SP_ERROR;
692}
693
694/*
695 * @implemented
696 */
697int
698WINAPI
700{
701 return StartPage(hdc);
702}
703
704
705/*
706 * @implemented
707 */
708int
709WINAPI
711 HDC hdc,
712 ABORTPROC lpAbortProc)
713{
714 PLDC pldc;
716
718 return SP_ERROR;
719
720 pldc = GdiGetLDC(hdc);
721 if ( pldc )
722 {
723 if ( lpAbortProc )
724 {
725 if ( pldc->Flags & LDC_INIT_DOCUMENT )
726 {
727 pldc->Flags |= LDC_SAPCALLBACK;
728 pldc->CallBackTick = GetTickCount();
729 }
730 }
731 else
732 {
733 pldc->Flags &= ~LDC_SAPCALLBACK;
734 }
735 pldc->pAbortProc = lpAbortProc;
736 return 1;
737 }
738 else
739 {
741 }
742 return SP_ERROR;
743}
744
745/*
746 * @unimplemented
747 */
748DWORD
749WINAPI
751 DWORD a0,
752 DWORD a1,
753 DWORD a2,
754 DWORD a3,
755 DWORD a4,
756 DWORD a5
757)
758{
761 return 0;
762}
763
764/*
765 * @unimplemented
766 */
767HDC
768WINAPI
769GdiGetDC(HANDLE SpoolFileHandle)
770{
773 return 0;
774}
775
776/*
777 * @unimplemented
778 */
779HANDLE
780WINAPI
781GdiGetPageHandle(HANDLE SpoolFileHandle,
782 DWORD Page,
783 LPDWORD pdwPageType)
784{
787 return 0;
788}
789
790/*
791 * @unimplemented
792 */
793BOOL
794WINAPI
795GdiStartDocEMF(HANDLE SpoolFileHandle,
796 DOCINFOW *pDocInfo)
797{
800 return 0;
801}
802
803/*
804 * @unimplemented
805 */
806BOOL
807WINAPI
808GdiStartPageEMF(HANDLE SpoolFileHandle)
809{
812 return 0;
813}
814
815/*
816 * @unimplemented
817 */
818BOOL
819WINAPI
820GdiPlayPageEMF(HANDLE SpoolFileHandle,
821 HANDLE hemf,
822 RECT *prectDocument,
823 RECT *prectBorder,
824 RECT *prectClip)
825{
828 return 0;
829}
830
831/*
832 * @unimplemented
833 */
834BOOL
835WINAPI
836GdiEndPageEMF(HANDLE SpoolFileHandle,
837 DWORD dwOptimization)
838{
841 return 0;
842}
843
844/*
845 * @unimplemented
846 */
847BOOL
848WINAPI
849GdiEndDocEMF(HANDLE SpoolFileHandle)
850{
853 return 0;
854}
855
856/*
857 * @unimplemented
858 */
859BOOL
860WINAPI
862 DWORD dwPageNumber,
863 PDEVMODEW *pCurrDM,
864 PDEVMODEW *pLastDM)
865{
868 return 0;
869}
870
871/*
872 * @unimplemented
873 */
874BOOL
875WINAPI
876GdiResetDCEMF(HANDLE SpoolFileHandle,
877 PDEVMODEW pCurrDM)
878{
881 return 0;
882}
883
884
885/*
886 * @unimplemented
887 */
888BOOL
889WINAPI
890GdiPlayEMF(LPWSTR pwszPrinterName,
891 LPDEVMODEW pDevmode,
893 EMFPLAYPROC pfnEMFPlayFn,
894 HANDLE hPageQuery
895 )
896{
899 return 0;
900}
901
902/*
903 * @unimplemented
904 */
905BOOL
906WINAPI
909 RECT *prectDocument)
910{
913 return 0;
914}
915
916/*
917 * @unimplemented
918 */
919BOOL
920WINAPI
922 IN HUMPD humpd,
923 DWORD *status,
924 DWORD unuse)
925{
926 /* FIXME figout the protypes, the HUMPD are a STRUCT or COM object */
927 /* status contain some form of return value that being save, what it is I do not known */
928 /* unsue seam have zero effect, what it is for I do not known */
929
930 // ? return NtGdiSetPUMPDOBJ(humpd->0x10,TRUE, humpd, ?) <- blackbox, OpenRCE info, and api hooks for anylaysing;
931 return FALSE;
932}
933
934/*
935 * @unimplemented
936 */
937BOOL
938WINAPI
940{
943 return 0;
944}
#define DPRINT1
Definition: precomp.h:8
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:109
#define SetLastError(x)
Definition: compat.h:752
#define GetProcAddress(x, y)
Definition: compat.h:753
#define HeapAlloc
Definition: compat.h:733
#define FreeLibrary(x)
Definition: compat.h:748
#define HeapFree(x, y, z)
Definition: compat.h:735
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define MultiByteToWideChar
Definition: compat.h:110
#define LoadLibraryW(x)
Definition: compat.h:747
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL(WINAPI * OPENPRINTERW)(LPWSTR, PHANDLE, LPPRINTER_DEFAULTSW)
Definition: gdi32p.h:189
BOOL(WINAPI * QUERYCOLORPROFILE)(HANDLE, PDEVMODEW, ULONG, VOID *, ULONG, FLONG)
Definition: gdi32p.h:204
BOOL(WINAPI * GETPRINTERDRIVERW)(HANDLE, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD)
Definition: gdi32p.h:186
VOID GdiSAPCallback(PLDC pldc)
Definition: misc.c:819
RTL_CRITICAL_SECTION semLocal
Definition: dllmain.c:13
DWORD(WINAPI * STARTDOCPRINTERW)(HANDLE, DWORD, PBYTE)
Definition: gdi32p.h:193
BOOL(WINAPI * RESETPRINTERW)(HANDLE, LPPRINTER_DEFAULTSW)
Definition: gdi32p.h:191
BOOL(WINAPI * SPLREADPRINTER)(HANDLE, LPBYTE *, DWORD)
Definition: gdi32p.h:197
LONG(WINAPI * DOCUMENTPROPERTIESW)(HWND, HANDLE, LPWSTR, PDEVMODEW, PDEVMODEW, DWORD)
Definition: gdi32p.h:182
BOOL(WINAPI * ENDPAGEPRINTER)(HANDLE)
Definition: gdi32p.h:184
HANDLE(WINAPI * GETSPOOLFILEHANDLE)(HANDLE)
Definition: gdi32p.h:187
INT(WINAPI * DOCUMENTEVENT)(HANDLE, HDC, INT, ULONG, PVOID, ULONG, PVOID)
Definition: gdi32p.h:202
BOOL(WINAPI * SPLDRIVERUNLOADCOMPLETE)(LPWSTR)
Definition: gdi32p.h:199
BOOL(WINAPI * SEEKPRINTER)(HANDLE, LARGE_INTEGER, PLARGE_INTEGER, DWORD, BOOL)
Definition: gdi32p.h:196
DWORD(WINAPI * QUERYREMOTEFONTS)(DWORD, DWORD, DWORD)
Definition: gdi32p.h:207
INT(CALLBACK * EMFPLAYPROC)(HDC hdc, INT iFunction, HANDLE hPageQuery)
Definition: gdi32p.h:24
LPWSTR(WINAPI * STARTDOCDLGW)(HANDLE, DOCINFOW *)
Definition: gdi32p.h:192
BOOL(WINAPI * READPRINTER)(HANDLE, PVOID, DWORD, PDWORD)
Definition: gdi32p.h:190
BOOL(WINAPI * ABORTPRINTER)(HANDLE)
Definition: gdi32p.h:178
BOOL(WINAPI * STARTPAGEPRINTER)(HANDLE)
Definition: gdi32p.h:194
BOOL(WINAPI * GETPRINTERW)(HANDLE, DWORD, LPBYTE, DWORD, LPDWORD)
Definition: gdi32p.h:185
DWORD(WINAPI * QUERYSPOOLMODE)(HANDLE, DWORD, DWORD)
Definition: gdi32p.h:206
BOOL(WINAPI * CLOSESPOOLFILEHANDLE)(HANDLE, HANDLE)
Definition: gdi32p.h:180
BOOL(WINAPI * ISVALIDDEVMODEW)(PDEVMODEW, size_t)
Definition: gdi32p.h:188
BOOL(WINAPI * ENDDOCPRINTER)(HANDLE)
Definition: gdi32p.h:183
HANDLE(WINAPI * COMMITSPOOLDATA)(HANDLE, HANDLE, DWORD)
Definition: gdi32p.h:181
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:785
BOOL(WINAPI * CLOSEPRINTER)(HANDLE)
Definition: gdi32p.h:179
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
@ GDILoObjType_LO_METADC16_TYPE
Definition: gdi_private.h:49
@ GDILoObjType_LO_DC_TYPE
Definition: gdi_private.h:34
GLenum GLsizei len
Definition: glext.h:6722
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define NtCurrentTeb
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static const struct update_accum a1
Definition: msg.c:578
static const struct update_accum a2
Definition: msg.c:586
static const struct update_accum a3
Definition: msg.c:600
static const struct update_accum a4
Definition: msg.c:2285
static const WCHAR docW[]
Definition: setupcab.c:45
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define FASTCALL
Definition: nt_native.h:50
__kernel_entry W32KAPI BOOL APIENTRY NtGdiEndPage(_In_ HDC hdc)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiStartPage(_In_ HDC hdc)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiEndDoc(_In_ HDC hdc)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiAbortDoc(_In_ HDC hdc)
__kernel_entry W32KAPI INT APIENTRY NtGdiStartDoc(_In_ HDC hdc, _In_ DOCINFOW *pdi, _Out_ BOOL *pbBanding, _In_ INT iJob)
#define LDC_INIT_DOCUMENT
Definition: ntgdihdl.h:151
#define LDC_KILL_DOCUMENT
Definition: ntgdihdl.h:158
#define LDC_INIT_PAGE
Definition: ntgdihdl.h:152
#define LDC_SAPCALLBACK
Definition: ntgdihdl.h:150
#define LDC_STARTPAGE
Definition: ntgdihdl.h:153
#define LDC_ATENDPAGE
Definition: ntgdihdl.h:168
#define LDC_META_PRINT
Definition: ntgdihdl.h:159
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
Definition: mm.h:1306
#define L(x)
Definition: ntvdm.h:50
struct _W32CLIENTINFO * PW32CLIENTINFO
#define CONST
Definition: pedump.c:81
OPENPRINTERW fpOpenPrinterW
Definition: printdrv.c:55
BOOL WINAPI GdiResetDCEMF(HANDLE SpoolFileHandle, PDEVMODEW pCurrDM)
Definition: printdrv.c:876
static ABORTPRINTER fpAbortPrinter
Definition: printdrv.c:42
static ENDPAGEPRINTER fpEndPagePrinter
Definition: printdrv.c:50
static CLOSESPOOLFILEHANDLE fpCloseSpoolFileHandle
Definition: printdrv.c:44
static ENDDOCPRINTER fpEndDocPrinter
Definition: printdrv.c:49
static QUERYSPOOLMODE fpQuerySpoolMode
Definition: printdrv.c:56
BOOL WINAPI GdiPlayPageEMF(HANDLE SpoolFileHandle, HANDLE hemf, RECT *prectDocument, RECT *prectBorder, RECT *prectClip)
Definition: printdrv.c:820
BOOL WINAPI GdiEndPageEMF(HANDLE SpoolFileHandle, DWORD dwOptimization)
Definition: printdrv.c:836
int WINAPI StartDocW(HDC hdc, CONST DOCINFOW *lpdi)
Definition: printdrv.c:474
BOOL WINAPI GdiEndDocEMF(HANDLE SpoolFileHandle)
Definition: printdrv.c:849
static RESETPRINTERW fpResetPrinterW
Definition: printdrv.c:60
BOOL WINAPI GdiPlayEMF(LPWSTR pwszPrinterName, LPDEVMODEW pDevmode, LPWSTR pwszDocName, EMFPLAYPROC pfnEMFPlayFn, HANDLE hPageQuery)
Definition: printdrv.c:890
int WINAPI StartPage(HDC hdc)
Definition: printdrv.c:645
static int FASTCALL IntEndPage(HDC hdc, BOOL Form)
Definition: printdrv.c:73
int WINAPI EndPage(HDC hdc)
Definition: printdrv.c:426
static COMMITSPOOLDATA fpCommitSpoolData
Definition: printdrv.c:45
BOOL WINAPI GdiPlayPrivatePageEMF(HANDLE SpoolFileHandle, DWORD unknown, RECT *prectDocument)
Definition: printdrv.c:907
int WINAPI StartFormPage(HDC hdc)
Definition: printdrv.c:699
BOOL WINAPI GdiStartPageEMF(HANDLE SpoolFileHandle)
Definition: printdrv.c:808
static SPLREADPRINTER fpSplReadPrinter
Definition: printdrv.c:63
BOOL WINAPI GdiPrinterThunk(IN HUMPD humpd, DWORD *status, DWORD unuse)
Definition: printdrv.c:921
CLOSEPRINTER fpClosePrinter
Definition: printdrv.c:43
static QUERYCOLORPROFILE fpQueryColorProfile
Definition: printdrv.c:58
BOOL FASTCALL EndPagePrinterEx(PVOID pvUMPDev, HANDLE hPrinter)
Definition: printdrv.c:178
static DOCUMENTEVENT fpDocumentEvent
Definition: printdrv.c:47
BOOL FASTCALL StartPagePrinterEx(PVOID pvUMPDev, HANDLE hPrinter)
Definition: printdrv.c:293
int WINAPI EndFormPage(HDC hdc)
Definition: printdrv.c:416
BOOL WINAPI GdiDeleteSpoolFileHandle(HANDLE SpoolFileHandle)
Definition: printdrv.c:450
static ISVALIDDEVMODEW fpIsValidDevmodeW
Definition: printdrv.c:54
int WINAPI SetAbortProc(HDC hdc, ABORTPROC lpAbortProc)
Definition: printdrv.c:710
static GETSPOOLFILEHANDLE fpGetSpoolFileHandle
Definition: printdrv.c:51
HANDLE WINAPI GdiGetPageHandle(HANDLE SpoolFileHandle, DWORD Page, LPDWORD pdwPageType)
Definition: printdrv.c:781
DWORD WINAPI gdiPlaySpoolStream(DWORD a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4, DWORD a5)
Definition: printdrv.c:750
BOOL WINAPI GdiGetDevmodeForPage(HANDLE SpoolFileHandle, DWORD dwPageNumber, PDEVMODEW *pCurrDM, PDEVMODEW *pLastDM)
Definition: printdrv.c:861
static DOCUMENTPROPERTIESW fpDocumentPropertiesW
Definition: printdrv.c:48
int WINAPI AbortDoc(HDC hdc)
Definition: printdrv.c:308
static SEEKPRINTER fpSeekPrinter
Definition: printdrv.c:61
DWORD FASTCALL StartDocPrinterWEx(PVOID pvUMPDev, HANDLE hPrinter, DWORD Level, LPBYTE pDocInfo)
Definition: printdrv.c:281
static SPLDRIVERUNLOADCOMPLETE fpSplDriverUnloadComplete
Definition: printdrv.c:62
BOOL WINAPI GdiStartDocEMF(HANDLE SpoolFileHandle, DOCINFOW *pDocInfo)
Definition: printdrv.c:795
int WINAPI EndDoc(HDC hdc)
Definition: printdrv.c:359
int WINAPI StartDocA(HDC hdc, CONST DOCINFOA *lpdi)
Definition: printdrv.c:597
static QUERYREMOTEFONTS fpQueryRemoteFonts
Definition: printdrv.c:57
static STARTPAGEPRINTER fpStartPagePrinter
Definition: printdrv.c:66
BOOL WINAPI GdiArtificialDecrementDriver(LPWSTR pDriverName, BOOL unknown)
Definition: printdrv.c:939
static GETPRINTERDRIVERW fpGetPrinterDriverW
Definition: printdrv.c:53
BOOL FASTCALL AbortPrinterEx(PVOID pvUMPDev, HANDLE hPrinter)
Definition: printdrv.c:142
HDC WINAPI GdiGetDC(HANDLE SpoolFileHandle)
Definition: printdrv.c:769
BOOL FASTCALL EndDocPrinterEx(PVOID pvUMPDev, HANDLE hPrinter)
Definition: printdrv.c:168
HANDLE ghSpooler
Definition: printdrv.c:40
static STARTDOCDLGW fpStartDocDlgW
Definition: printdrv.c:64
int FASTCALL DocumentEventEx(PVOID pvUMPDev, HANDLE hPrinter, HDC hdc, int iEsc, ULONG cbIn, PVOID pvIn, ULONG cbOut, PVOID pvOut)
Definition: printdrv.c:152
DWORD WINAPI GdiGetPageCount(HANDLE SpoolFileHandle)
Definition: printdrv.c:462
static READPRINTER fpReadPrinter
Definition: printdrv.c:59
static STARTDOCPRINTERW fpStartDocPrinterW
Definition: printdrv.c:65
BOOL FASTCALL LoadTheSpoolerDrv(VOID)
Definition: printdrv.c:188
static GETPRINTERW fpGetPrinterW
Definition: printdrv.c:52
HANDLE WINAPI GdiGetSpoolFileHandle(LPWSTR pwszPrinterName, LPDEVMODEW pDevmode, LPWSTR pwszDocName)
Definition: printdrv.c:436
#define DOCUMENTEVENT_STARTDOCPOST
Definition: winddiui.h:65
#define DOCUMENTEVENT_STARTPAGE
Definition: winddiui.h:57
#define DOCUMENTEVENT_STARTDOC
Definition: winddiui.h:55
#define DOCUMENTEVENT_ENDPAGE
Definition: winddiui.h:58
#define DOCUMENTEVENT_ENDDOC
Definition: winddiui.h:59
#define DOCUMENTEVENT_ABORTDOC
Definition: winddiui.h:61
#define DOCUMENTEVENT_ENDDOCPOST
Definition: winddiui.h:64
LPCWSTR lpszDocName
Definition: wingdi.h:1684
int cbSize
Definition: wingdi.h:1683
DWORD fwType
Definition: wingdi.h:1687
LPCWSTR lpszOutput
Definition: wingdi.h:1685
LPCWSTR lpszDatatype
Definition: wingdi.h:1686
LPWSTR pOutputFile
Definition: winspool.h:617
LPWSTR pDatatype
Definition: winspool.h:618
LPWSTR pDocName
Definition: winspool.h:616
Definition: ntgdihdl.h:263
HANDLE hPrinter
Definition: ntgdihdl.h:271
DWORD CallBackTick
Definition: ntgdihdl.h:270
ABORTPROC pAbortProc
Definition: ntgdihdl.h:269
LPWSTR pwszPort
Definition: ntgdihdl.h:268
ULONG Flags
Definition: ntgdihdl.h:265
Definition: ps.c:97
unsigned char * LPBYTE
Definition: typedefs.h:53
void * PVOID
Definition: typedefs.h:50
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
int ret
_In_ LPWSTR pwszDocName
Definition: winddi.h:4071
_In_ ULONG iEsc
Definition: winddi.h:3529
#define WINAPI
Definition: msvc.h:6
BOOL(CALLBACK * ABORTPROC)(HDC, int)
Definition: wingdi.h:2911
struct _DOCINFOW DOCINFOW
#define SP_ERROR
Definition: wingdi.h:318
#define SP_APPABORT
Definition: wingdi.h:322
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:56
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184