5366dcb6dc0ee70075744013d04284fea24fe4b1
[reactos.git] / reactos / dll / win32 / gdi32 / misc / stubs.c
1 /* $Id$
2 *
3 * reactos/lib/gdi32/misc/stubs.c
4 *
5 * GDI32.DLL Stubs
6 *
7 * When you implement one of these functions,
8 * remove its stub from this file.
9 *
10 */
11
12 #include "precomp.h"
13
14 #define SIZEOF_DEVMODEA_300 124
15 #define SIZEOF_DEVMODEA_400 148
16 #define SIZEOF_DEVMODEA_500 156
17 #define SIZEOF_DEVMODEW_300 188
18 #define SIZEOF_DEVMODEW_400 212
19 #define SIZEOF_DEVMODEW_500 220
20
21 #define UNIMPLEMENTED DbgPrint("GDI32: %s is unimplemented, please try again later.\n", __FUNCTION__);
22
23
24 /*
25 * @unimplemented
26 */
27 BOOL
28 WINAPI
29 PtInRegion(IN HRGN hrgn,
30 int x,
31 int y)
32 {
33 /* FIXME some stuff at user mode need be fixed */
34 return NtGdiPtInRegion(hrgn,x,y);
35 }
36
37 /*
38 * @unimplemented
39 */
40 BOOL
41 WINAPI
42 RectInRegion(HRGN hrgn,
43 LPCRECT prcl)
44 {
45 /* FIXME some stuff at user mode need be fixed */
46 return NtGdiRectInRegion(hrgn, (LPRECT) prcl);
47 }
48
49 /*
50 * @unimplemented
51 */
52 BOOL
53 WINAPI
54 RestoreDC(IN HDC hdc,
55 IN INT iLevel)
56 {
57 /* FIXME Sharememory */
58 return NtGdiRestoreDC(hdc, iLevel);
59 }
60
61 /*
62 * @unimplemented
63 */
64 INT
65 WINAPI
66 SaveDC(IN HDC hdc)
67 {
68 /* FIXME Sharememory */
69 return NtGdiSaveDC(hdc);
70 }
71
72
73
74 /*
75 * @unimplemented
76 */
77 BOOL
78 WINAPI
79 CancelDC(HDC hdc)
80 {
81 UNIMPLEMENTED;
82 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
83 return FALSE;
84 }
85
86
87 /*
88 * @unimplemented
89 */
90 int
91 WINAPI
92 DrawEscape(HDC hdc,
93 int a1,
94 int a2,
95 LPCSTR a3)
96 {
97 UNIMPLEMENTED;
98 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
99 return 0;
100 }
101
102
103 /*
104 * @unimplemented
105 */
106 int
107 WINAPI
108 EnumObjects(HDC hdc,
109 int a1,
110 GOBJENUMPROC a2,
111 LPARAM a3)
112 {
113 UNIMPLEMENTED;
114 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
115 return 0;
116 }
117
118
119
120 /*
121 * @implemented
122 */
123 UINT
124 WINAPI
125 GetBoundsRect(
126 HDC hdc,
127 LPRECT lprcBounds,
128 UINT flags
129 )
130 {
131 return NtGdiGetBoundsRect(hdc,lprcBounds,flags & DCB_RESET);
132 }
133
134
135 /*
136 * @unimplemented
137 */
138 UINT
139 WINAPI
140 GetMetaFileBitsEx(
141 HMETAFILE a0,
142 UINT a1,
143 LPVOID a2
144 )
145 {
146 UNIMPLEMENTED;
147 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
148 return 0;
149 }
150
151 /*
152 * @unimplemented
153 */
154 BOOL
155 WINAPI
156 PlayMetaFile(
157 HDC a0,
158 HMETAFILE a1
159 )
160 {
161 UNIMPLEMENTED;
162 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
163 return FALSE;
164 }
165
166 /*
167 * @implemented
168 */
169 UINT
170 WINAPI
171 SetBoundsRect(HDC hdc,
172 CONST RECT *prc,
173 UINT flags)
174 {
175 /* FIXME add check for validate the flags */
176 return NtGdiSetBoundsRect(hdc, (LPRECT)prc, flags);
177 }
178
179 /*
180 * @unimplemented
181 */
182 HMETAFILE
183 WINAPI
184 SetMetaFileBitsEx(
185 UINT a0,
186 CONST BYTE *a1
187 )
188 {
189 UNIMPLEMENTED;
190 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
191 return 0;
192 }
193
194 /*
195 * @unimplemented
196 */
197 BOOL
198 WINAPI
199 PlayMetaFileRecord(
200 HDC a0,
201 LPHANDLETABLE a1,
202 LPMETARECORD a2,
203 UINT a3
204 )
205 {
206 UNIMPLEMENTED;
207 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
208 return FALSE;
209 }
210
211
212 /*
213 * @unimplemented
214 */
215 BOOL
216 WINAPI
217 EnumMetaFile(
218 HDC a0,
219 HMETAFILE a1,
220 MFENUMPROC a2,
221 LPARAM a3
222 )
223 {
224 UNIMPLEMENTED;
225 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
226 return FALSE;
227 }
228
229 /*
230 * @unimplemented
231 */
232 BOOL
233 WINAPI
234 DeleteEnhMetaFile(
235 HENHMETAFILE a0
236 )
237 {
238 UNIMPLEMENTED;
239 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
240 return FALSE;
241 }
242
243 /*
244 * @unimplemented
245 */
246 BOOL
247 WINAPI
248 EnumEnhMetaFile(
249 HDC a0,
250 HENHMETAFILE a1,
251 ENHMFENUMPROC a2,
252 LPVOID a3,
253 CONST RECT *a4
254 )
255 {
256 UNIMPLEMENTED;
257 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
258 return FALSE;
259 }
260
261 /*
262 * @unimplemented
263 */
264 UINT
265 WINAPI
266 GetEnhMetaFileBits(
267 HENHMETAFILE a0,
268 UINT a1,
269 LPBYTE a2
270 )
271 {
272 UNIMPLEMENTED;
273 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
274 return 0;
275 }
276
277
278 /*
279 * @unimplemented
280 */
281 UINT
282 WINAPI
283 GetEnhMetaFileHeader(
284 HENHMETAFILE a0,
285 UINT a1,
286 LPENHMETAHEADER a2
287 )
288 {
289 UNIMPLEMENTED;
290 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
291 return 0;
292 }
293
294 /*
295 * @unimplemented
296 */
297 UINT
298 WINAPI
299 GetEnhMetaFilePaletteEntries(
300 HENHMETAFILE a0,
301 UINT a1,
302 LPPALETTEENTRY a2
303 )
304 {
305 UNIMPLEMENTED;
306 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
307 return 0;
308 }
309
310 /*
311 * @unimplemented
312 */
313 UINT
314 WINAPI
315 GetWinMetaFileBits(
316 HENHMETAFILE a0,
317 UINT a1,
318 LPBYTE a2,
319 INT a3,
320 HDC a4
321 )
322 {
323 UNIMPLEMENTED;
324 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
325 return 0;
326 }
327
328
329 /*
330 * @unimplemented
331 */
332 BOOL
333 WINAPI
334 PlayEnhMetaFile(
335 HDC a0,
336 HENHMETAFILE a1,
337 CONST RECT *a2
338 )
339 {
340 UNIMPLEMENTED;
341 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
342 return FALSE;
343 }
344
345
346 /*
347 * @unimplemented
348 */
349 BOOL
350 WINAPI
351 PlayEnhMetaFileRecord(
352 HDC a0,
353 LPHANDLETABLE a1,
354 CONST ENHMETARECORD *a2,
355 UINT a3
356 )
357 {
358 UNIMPLEMENTED;
359 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
360 return FALSE;
361 }
362
363
364 /*
365 * @unimplemented
366 */
367 HENHMETAFILE
368 WINAPI
369 SetEnhMetaFileBits(
370 UINT a0,
371 CONST BYTE *a1
372 )
373 {
374 UNIMPLEMENTED;
375 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
376 return 0;
377 }
378
379
380 /*
381 * @unimplemented
382 */
383 HENHMETAFILE
384 WINAPI
385 SetWinMetaFileBits(
386 UINT a0,
387 CONST BYTE *a1,
388 HDC a2,
389 CONST METAFILEPICT *a3)
390 {
391 UNIMPLEMENTED;
392 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
393 return 0;
394 }
395
396
397 /*
398 * @unimplemented
399 */
400 BOOL
401 WINAPI
402 GdiComment(
403 HDC hDC,
404 UINT bytes,
405 CONST BYTE *buffer
406 )
407 {
408 #if 0
409 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_EMF)
410 {
411 PLDC pLDC = GdiGetLDC(hDC);
412 if ( !pLDC )
413 {
414 SetLastError(ERROR_INVALID_HANDLE);
415 return FALSE;
416 }
417 if (pLDC->iType == LDC_EMFLDC)
418 { // Wine port
419 return EMFDRV_GdiComment( hDC, bytes, buffer );
420 }
421 }
422 #endif
423 return FALSE;
424 }
425
426
427 /*
428 * @unimplemented
429 */
430 BOOL
431 WINAPI
432 SetColorAdjustment(
433 HDC hdc,
434 CONST COLORADJUSTMENT *a1
435 )
436 {
437 UNIMPLEMENTED;
438 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
439 return FALSE;
440 }
441
442 /*
443 * @unimplemented
444 */
445 int
446 WINAPI
447 EndDoc(
448 HDC hdc
449 )
450 {
451 UNIMPLEMENTED;
452 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
453 return 0;
454 }
455
456
457 /*
458 * @unimplemented
459 */
460 int
461 WINAPI
462 StartPage(
463 HDC hdc
464 )
465 {
466 UNIMPLEMENTED;
467 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
468 return 0;
469 }
470
471
472 /*
473 * @unimplemented
474 */
475 int
476 WINAPI
477 EndPage(
478 HDC hdc
479 )
480 {
481 UNIMPLEMENTED;
482 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
483 return 0;
484 }
485
486
487 /*
488 * @unimplemented
489 */
490 int
491 WINAPI
492 AbortDoc(
493 HDC hdc
494 )
495 {
496 UNIMPLEMENTED;
497 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
498 return 0;
499 }
500
501
502 /*
503 * @unimplemented
504 */
505 int
506 WINAPI
507 SetAbortProc(
508 HDC hdc,
509 ABORTPROC lpAbortProc)
510 {
511 UNIMPLEMENTED;
512 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
513 return 0;
514 }
515
516 /*
517 * @implemented
518 */
519 BOOL
520 WINAPI
521 UnrealizeObject(HGDIOBJ hgdiobj)
522 {
523 BOOL retValue = TRUE;
524 /*
525 Win 2k Graphics API, Black Book. by coriolis.com
526 Page 62, Note that Steps 3, 5, and 6 are not required for Windows NT(tm)
527 and Windows 2000(tm).
528
529 Step 5. UnrealizeObject(hTrackBrush);
530 */
531 /*
532 msdn.microsoft.com,
533 "Windows 2000/XP: If hgdiobj is a brush, UnrealizeObject does nothing,
534 and the function returns TRUE. Use SetBrushOrgEx to set the origin of
535 a brush."
536 */
537 if (GDI_HANDLE_GET_TYPE(hgdiobj) != GDI_OBJECT_TYPE_BRUSH)
538 {
539 retValue = NtGdiUnrealizeObject(hgdiobj);
540 }
541
542 return retValue;
543 }
544
545
546 /*
547 * @implemented
548 */
549 BOOL
550 WINAPI
551 GdiFlush()
552 {
553 NtGdiFlush();
554 return TRUE;
555 }
556
557
558 /*
559 * @unimplemented
560 */
561 int
562 WINAPI
563 SetICMMode(
564 HDC a0,
565 int a1
566 )
567 {
568 UNIMPLEMENTED;
569 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
570 return 0;
571 }
572
573
574 /*
575 * @unimplemented
576 */
577 BOOL
578 WINAPI
579 CheckColorsInGamut(
580 HDC a0,
581 LPVOID a1,
582 LPVOID a2,
583 DWORD a3
584 )
585 {
586 UNIMPLEMENTED;
587 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
588 return FALSE;
589 }
590
591
592 /*
593 * @implemented
594 */
595 BOOL
596 WINAPI
597 GetDeviceGammaRamp( HDC hdc,
598 LPVOID lpGammaRamp)
599 {
600 BOOL retValue = FALSE;
601 if (lpGammaRamp == NULL)
602 {
603 SetLastError(ERROR_INVALID_PARAMETER);
604 }
605 else
606 {
607 retValue = NtGdiGetDeviceGammaRamp(hdc,lpGammaRamp);
608 }
609
610 return retValue;
611 }
612
613 /*
614 * @implemented
615 */
616 BOOL
617 WINAPI
618 SetDeviceGammaRamp(HDC hdc,
619 LPVOID lpGammaRamp)
620 {
621 BOOL retValue = FALSE;
622
623 if (lpGammaRamp)
624 {
625 retValue = NtGdiSetDeviceGammaRamp(hdc, lpGammaRamp);
626 }
627 else
628 {
629 SetLastError(ERROR_INVALID_PARAMETER);
630 }
631
632 return retValue;
633 }
634
635
636 /*
637 * @unimplemented
638 */
639 BOOL
640 WINAPI
641 ColorMatchToTarget(
642 HDC a0,
643 HDC a1,
644 DWORD a2
645 )
646 {
647 UNIMPLEMENTED;
648 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
649 return FALSE;
650 }
651
652
653 /*
654 * @unimplemented
655 */
656 BOOL
657 WINAPI
658 wglCopyContext(
659 HGLRC a0,
660 HGLRC a1,
661 UINT a2
662 )
663 {
664 UNIMPLEMENTED;
665 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
666 return FALSE;
667 }
668
669
670 /*
671 * @unimplemented
672 */
673 HGLRC
674 WINAPI
675 wglCreateContext(
676 HDC hDc
677 )
678 {
679 UNIMPLEMENTED;
680 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
681 return 0;
682 }
683
684
685 /*
686 * @unimplemented
687 */
688 HGLRC
689 WINAPI
690 wglCreateLayerContext(
691 HDC hDc,
692 int a1
693 )
694 {
695 UNIMPLEMENTED;
696 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
697 return 0;
698 }
699
700
701 /*
702 * @unimplemented
703 */
704 BOOL
705 WINAPI
706 wglDeleteContext(
707 HGLRC a
708 )
709 {
710 UNIMPLEMENTED;
711 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
712 return FALSE;
713 }
714
715
716 /*
717 * @unimplemented
718 */
719 HGLRC
720 WINAPI
721 wglGetCurrentContext(VOID)
722 {
723 UNIMPLEMENTED;
724 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
725 return 0;
726 }
727
728
729 /*
730 * @unimplemented
731 */
732 HDC
733 WINAPI
734 wglGetCurrentDC(VOID)
735 {
736 UNIMPLEMENTED;
737 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
738 return 0;
739 }
740
741
742 /*
743 * @unimplemented
744 */
745 PROC
746 WINAPI
747 wglGetProcAddress(
748 LPCSTR a0
749 )
750 {
751 UNIMPLEMENTED;
752 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
753 return 0;
754 }
755
756
757 /*
758 * @unimplemented
759 */
760 BOOL
761 WINAPI
762 wglMakeCurrent(
763 HDC a0,
764 HGLRC a1
765 )
766 {
767 UNIMPLEMENTED;
768 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
769 return FALSE;
770 }
771
772
773 /*
774 * @unimplemented
775 */
776 BOOL
777 WINAPI
778 wglShareLists(
779 HGLRC a0,
780 HGLRC a1
781 )
782 {
783 UNIMPLEMENTED;
784 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
785 return FALSE;
786 }
787
788
789 /*
790 * @unimplemented
791 */
792 BOOL
793 WINAPI
794 wglDescribeLayerPlane(
795 HDC a0,
796 int a1,
797 int a2,
798 UINT a3,
799 LPLAYERPLANEDESCRIPTOR a4
800 )
801 {
802 UNIMPLEMENTED;
803 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
804 return FALSE;
805 }
806
807
808 /*
809 * @unimplemented
810 */
811 int
812 WINAPI
813 wglSetLayerPaletteEntries(
814 HDC a0,
815 int a1,
816 int a2,
817 int a3,
818 CONST COLORREF *a4
819 )
820 {
821 UNIMPLEMENTED;
822 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
823 return 0;
824 }
825
826
827 /*
828 * @unimplemented
829 */
830 int
831 WINAPI
832 wglGetLayerPaletteEntries(
833 HDC a0,
834 int a1,
835 int a2,
836 int a3,
837 COLORREF *a4
838 )
839 {
840 UNIMPLEMENTED;
841 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
842 return 0;
843 }
844
845
846 /*
847 * @unimplemented
848 */
849 BOOL
850 WINAPI
851 wglRealizeLayerPalette(
852 HDC a0,
853 int a1,
854 BOOL a2
855 )
856 {
857 UNIMPLEMENTED;
858 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
859 return FALSE;
860 }
861
862
863 /*
864 * @unimplemented
865 */
866 BOOL
867 WINAPI
868 wglSwapLayerBuffers(
869 HDC a0,
870 UINT a1
871 )
872 {
873 UNIMPLEMENTED;
874 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
875 return FALSE;
876 }
877
878
879 /* === AFTER THIS POINT I GUESS... =========
880 * (based on stack size in Norlander's .def)
881 * === WHERE ARE THEY DEFINED? =============
882 */
883
884 /*
885 * @unimplemented
886 */
887 DWORD
888 WINAPI
889 IsValidEnhMetaRecord(
890 DWORD a0,
891 DWORD a1
892 )
893 {
894 UNIMPLEMENTED;
895 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
896 return 0;
897
898 }
899
900 /*
901 * @unimplemented
902 */
903 DWORD
904 WINAPI
905 IsValidEnhMetaRecordOffExt(
906 DWORD a0,
907 DWORD a1,
908 DWORD a2,
909 DWORD a3
910 )
911 {
912 UNIMPLEMENTED;
913 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
914 return 0;
915
916 }
917
918 /*
919 * @unimplemented
920 */
921 DWORD
922 WINAPI
923 GetGlyphOutlineWow(
924 DWORD a0,
925 DWORD a1,
926 DWORD a2,
927 DWORD a3,
928 DWORD a4,
929 DWORD a5,
930 DWORD a6
931 )
932 {
933 UNIMPLEMENTED;
934 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
935 return 0;
936 }
937
938 /*
939 * @unimplemented
940 */
941 DWORD
942 WINAPI
943 gdiPlaySpoolStream(
944 DWORD a0,
945 DWORD a1,
946 DWORD a2,
947 DWORD a3,
948 DWORD a4,
949 DWORD a5
950 )
951 {
952 UNIMPLEMENTED;
953 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
954 return 0;
955 }
956
957 /*
958 * @implemented
959 */
960 HANDLE
961 WINAPI
962 AddFontMemResourceEx(
963 PVOID pbFont,
964 DWORD cbFont,
965 PVOID pdv,
966 DWORD *pcFonts
967 )
968 {
969 if ( pbFont && cbFont && pcFonts)
970 {
971 return NtGdiAddFontMemResourceEx(pbFont, cbFont, NULL, 0, pcFonts);
972 }
973 SetLastError(ERROR_INVALID_PARAMETER);
974 return NULL;
975 }
976
977 /*
978 * @unimplemented
979 */
980 int
981 WINAPI
982 AddFontResourceTracking(
983 LPCSTR lpString,
984 int unknown
985 )
986 {
987 UNIMPLEMENTED;
988 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
989 return 0;
990 }
991
992
993
994 /*
995 * @unimplemented
996 */
997 HBITMAP
998 WINAPI
999 ClearBitmapAttributes(HBITMAP hbm, DWORD dwFlags)
1000 {
1001 UNIMPLEMENTED;
1002 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1003 return 0;
1004 }
1005
1006 /*
1007 * @unimplemented
1008 */
1009 HBRUSH
1010 WINAPI
1011 ClearBrushAttributes(HBRUSH hbm, DWORD dwFlags)
1012 {
1013 UNIMPLEMENTED;
1014 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1015 return 0;
1016 }
1017
1018 /*
1019 * @unimplemented
1020 */
1021 BOOL
1022 WINAPI
1023 ColorCorrectPalette(HDC hDC,HPALETTE hPalette,DWORD dwFirstEntry,DWORD dwNumOfEntries)
1024 {
1025 UNIMPLEMENTED;
1026 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1027 return 0;
1028 }
1029
1030 /*
1031 * @unimplemented
1032 */
1033 int
1034 WINAPI
1035 EndFormPage(HDC hdc)
1036 {
1037 UNIMPLEMENTED;
1038 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1039 return 0;
1040 }
1041
1042 /*
1043 * @unimplemented
1044 */
1045 BOOL
1046 WINAPI
1047 GdiArtificialDecrementDriver(LPWSTR pDriverName,BOOL unknown)
1048 {
1049 UNIMPLEMENTED;
1050 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1051 return 0;
1052 }
1053
1054 /*
1055 * @unimplemented
1056 */
1057 BOOL
1058 WINAPI
1059 GdiCleanCacheDC(HDC hdc)
1060 {
1061 UNIMPLEMENTED;
1062 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1063 return 0;
1064 }
1065
1066 /*
1067 * @unimplemented
1068 */
1069 HDC
1070 WINAPI
1071 GdiConvertAndCheckDC(HDC hdc)
1072 {
1073 UNIMPLEMENTED;
1074 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1075 return 0;
1076 }
1077
1078 /*
1079 * @unimplemented
1080 */
1081 HENHMETAFILE
1082 WINAPI
1083 GdiConvertEnhMetaFile(HENHMETAFILE hmf)
1084 {
1085 UNIMPLEMENTED;
1086 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1087 return 0;
1088 }
1089
1090 /*
1091 * @unimplemented
1092 */
1093 BOOL
1094 WINAPI
1095 GdiDrawStream(HDC dc, ULONG l, VOID *v)
1096 {
1097 UNIMPLEMENTED;
1098 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1099 return 0;
1100 }
1101
1102 /*
1103 * @implemented
1104 */
1105 BOOL
1106 WINAPI
1107 GdiIsMetaFileDC(HDC hDC)
1108 {
1109 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
1110 {
1111 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
1112 return TRUE;
1113 else
1114 {
1115 PLDC pLDC = GdiGetLDC(hDC);
1116 if ( !pLDC )
1117 {
1118 SetLastError(ERROR_INVALID_HANDLE);
1119 return FALSE;
1120 }
1121 if ( pLDC->iType == LDC_EMFLDC) return TRUE;
1122 }
1123 }
1124 return FALSE;
1125 }
1126
1127 /*
1128 * @implemented
1129 */
1130 BOOL
1131 WINAPI
1132 GdiIsMetaPrintDC(HDC hDC)
1133 {
1134
1135 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
1136 {
1137 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
1138 return FALSE;
1139 else
1140 {
1141 PLDC pLDC = GdiGetLDC(hDC);
1142 if ( !pLDC )
1143 {
1144 SetLastError(ERROR_INVALID_HANDLE);
1145 return FALSE;
1146 }
1147 if ( pLDC->Flags & LDC_META_PRINT) return TRUE;
1148 }
1149 }
1150 return FALSE;
1151 }
1152
1153 /*
1154 * @implemented
1155 */
1156 BOOL
1157 WINAPI
1158 GdiIsPlayMetafileDC(HDC hDC)
1159 {
1160 PDC_ATTR Dc_Attr;
1161 PLDC pLDC;
1162
1163 GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr);
1164 if ( Dc_Attr )
1165 {
1166 pLDC = Dc_Attr->pvLDC;
1167 if ( pLDC )
1168 {
1169 if ( pLDC->Flags & LDC_PLAY_MFDC ) return TRUE;
1170 }
1171 }
1172 return FALSE;
1173 }
1174
1175 /*
1176 * @unimplemented
1177 */
1178 BOOL
1179 WINAPI
1180 GdiValidateHandle(HGDIOBJ hobj)
1181 {
1182 UNIMPLEMENTED;
1183 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1184 return 0;
1185 }
1186
1187 /*
1188 * @unimplemented
1189 */
1190 DWORD
1191 WINAPI
1192 GetBitmapAttributes(HBITMAP hbm)
1193 {
1194 UNIMPLEMENTED;
1195 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1196 return 0;
1197 }
1198
1199 /*
1200 * @unimplemented
1201 */
1202 DWORD
1203 WINAPI
1204 GetBrushAttributes(HBRUSH hbr)
1205 {
1206 UNIMPLEMENTED;
1207 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1208 return 0;
1209 }
1210
1211 /*
1212 * @implemented
1213 */
1214 ULONG
1215 WINAPI
1216 GetEUDCTimeStamp(VOID)
1217 {
1218 return NtGdiGetEudcTimeStampEx(NULL,0,TRUE);
1219 }
1220
1221 /*
1222 * @implemented
1223 */
1224 ULONG
1225 WINAPI
1226 GetFontAssocStatus(HDC hdc)
1227 {
1228 ULONG retValue = 0;
1229
1230 if (hdc)
1231 {
1232 retValue = NtGdiQueryFontAssocInfo(hdc);
1233 }
1234
1235 return retValue;
1236 }
1237
1238 /*
1239 * @implemented
1240 */
1241 BOOL
1242 WINAPI
1243 GetTextExtentExPointWPri(HDC hdc,
1244 LPWSTR lpwsz,
1245 ULONG cwc,
1246 ULONG dxMax,
1247 ULONG *pcCh,
1248 PULONG pdxOut,
1249 LPSIZE psize)
1250 {
1251 return NtGdiGetTextExtentExW(hdc,lpwsz,cwc,dxMax,pcCh,pdxOut,psize,0);
1252 }
1253
1254 /*
1255 * @unimplemented
1256 */
1257 DWORD
1258 WINAPI
1259 QueryFontAssocStatus(VOID)
1260 {
1261 UNIMPLEMENTED;
1262 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1263 return 0;
1264 }
1265
1266 /*
1267 * @implemented
1268 */
1269 BOOL
1270 WINAPI
1271 RemoveFontMemResourceEx(HANDLE fh)
1272 {
1273 if (fh)
1274 {
1275 return NtGdiRemoveFontMemResourceEx(fh);
1276 }
1277 SetLastError(ERROR_INVALID_PARAMETER);
1278 return FALSE;
1279 }
1280
1281 /*
1282 * @unimplemented
1283 */
1284 int
1285 WINAPI
1286 RemoveFontResourceTracking(LPCSTR lpString,int unknown)
1287 {
1288 UNIMPLEMENTED;
1289 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1290 return 0;
1291 }
1292
1293 /*
1294 * @unimplemented
1295 */
1296 HBITMAP
1297 WINAPI
1298 SetBitmapAttributes(HBITMAP hbm, DWORD dwFlags)
1299 {
1300 UNIMPLEMENTED;
1301 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1302 return 0;
1303 }
1304
1305 /*
1306 * @unimplemented
1307 */
1308 HBRUSH
1309 WINAPI
1310 SetBrushAttributes(HBRUSH hbm, DWORD dwFlags)
1311 {
1312 UNIMPLEMENTED;
1313 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1314 return 0;
1315 }
1316
1317 /*
1318 * @implemented
1319 */
1320 int
1321 WINAPI
1322 StartFormPage(HDC hdc)
1323 {
1324 return StartPage(hdc);
1325 }
1326
1327 /*
1328 * @unimplemented
1329 */
1330 VOID
1331 WINAPI
1332 UnloadNetworkFonts(DWORD unknown)
1333 {
1334 UNIMPLEMENTED;
1335 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1336 }
1337
1338 /*
1339 * @unimplemented
1340 */
1341 BOOL
1342 WINAPI
1343 GdiRealizationInfo(HDC hdc,
1344 PREALIZATION_INFO pri)
1345 {
1346 // ATM we do not support local font data and Language Pack.
1347 return NtGdiGetRealizationInfo(hdc, pri, (HFONT) NULL);
1348 }
1349
1350 /*
1351 * @implemented
1352 */
1353 BOOL
1354 WINAPI
1355 GetETM(HDC hdc,
1356 EXTTEXTMETRIC *petm)
1357 {
1358 BOOL Ret = NtGdiGetETM(hdc, petm);
1359
1360 if (Ret && petm)
1361 petm->emKernPairs = GetKerningPairsA(hdc, 0, 0);
1362
1363 return Ret;
1364 }
1365
1366 /*
1367 * @unimplemented
1368 */
1369 int
1370 WINAPI
1371 Escape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpvInData, LPVOID lpvOutData)
1372 {
1373 int retValue = SP_ERROR;
1374 HGDIOBJ hObject = hdc;
1375 UINT Type = 0;
1376 LPVOID pUserData = NULL;
1377
1378 Type = GDI_HANDLE_GET_TYPE(hObject);
1379
1380 if (Type == GDI_OBJECT_TYPE_METADC)
1381 {
1382 /* FIXME we do not support metafile */
1383 UNIMPLEMENTED;
1384 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1385 }
1386 else
1387 {
1388 switch (nEscape)
1389 {
1390 case ABORTDOC:
1391 /* Note Winodws check see if the handle have any user data for ABORTDOC command
1392 * ReactOS copy this behavior to be compatible with windows 2003
1393 */
1394 if ( (!GdiGetHandleUserData(hObject, (DWORD)Type, (PVOID) &pUserData)) ||
1395 (pUserData == NULL) )
1396 {
1397 GdiSetLastError(ERROR_INVALID_HANDLE);
1398 retValue = FALSE;
1399 }
1400 else
1401 {
1402 retValue = AbortDoc(hdc);
1403 }
1404 break;
1405
1406 case DRAFTMODE:
1407 case FLUSHOUTPUT:
1408 case SETCOLORTABLE:
1409 /* Note 1: DRAFTMODE, FLUSHOUTPUT, SETCOLORTABLE is outdated and been replace with other api */
1410 /* Note 2: Winodws check see if the handle have any user data for DRAFTMODE, FLUSHOUTPUT, SETCOLORTABLE command
1411 * ReactOS copy this behavior to be compatible with windows 2003
1412 */
1413 if ( (!GdiGetHandleUserData(hObject, (DWORD)Type, (PVOID) &pUserData)) ||
1414 (pUserData == NULL) )
1415 {
1416 GdiSetLastError(ERROR_INVALID_HANDLE);
1417 }
1418 retValue = FALSE;
1419 break;
1420
1421 case SETABORTPROC:
1422 /* Note : Winodws check see if the handle have any user data for DRAFTMODE, FLUSHOUTPUT, SETCOLORTABLE command
1423 * ReactOS copy this behavior to be compatible with windows 2003
1424 */
1425 if ( (!GdiGetHandleUserData(hObject, (DWORD)Type, (PVOID) &pUserData)) ||
1426 (pUserData == NULL) )
1427 {
1428 GdiSetLastError(ERROR_INVALID_HANDLE);
1429 retValue = FALSE;
1430 }
1431 retValue = SetAbortProc(hdc, (ABORTPROC)lpvInData);
1432 break;
1433
1434 case GETCOLORTABLE:
1435 retValue = GetSystemPaletteEntries(hdc, (UINT)*lpvInData, 1, (LPPALETTEENTRY)lpvOutData);
1436 if ( !retValue )
1437 {
1438 retValue = SP_ERROR;
1439 }
1440 break;
1441
1442 case ENDDOC:
1443 /* Note : Winodws check see if the handle have any user data for DRAFTMODE, FLUSHOUTPUT, SETCOLORTABLE command
1444 * ReactOS copy this behavior to be compatible with windows 2003
1445 */
1446 if ( (!GdiGetHandleUserData(hObject, (DWORD)Type, (PVOID) &pUserData)) ||
1447 (pUserData == NULL) )
1448 {
1449 GdiSetLastError(ERROR_INVALID_HANDLE);
1450 retValue = FALSE;
1451 }
1452 retValue = EndDoc(hdc);
1453 break;
1454
1455
1456 case GETSCALINGFACTOR:
1457 /* Note GETSCALINGFACTOR is outdated have been replace by GetDeviceCaps */
1458 if ( Type == GDI_OBJECT_TYPE_DC )
1459 {
1460 if ( lpvOutData )
1461 {
1462 PPOINT ptr = (PPOINT) lpvOutData;
1463 ptr->x = 0;
1464 ptr->y = 0;
1465 }
1466 }
1467 retValue = FALSE;
1468 break;
1469
1470 case GETEXTENDEDTEXTMETRICS:
1471 retValue = (int) GetETM( hdc, (EXTTEXTMETRIC *) lpvOutData) != 0;
1472 break;
1473
1474 case STARTDOC:
1475 {
1476 DOCINFOA *pUserDatalpdi;
1477 DOCINFOA lpdi;
1478
1479 /* Note : Winodws check see if the handle have any user data for STARTDOC command
1480 * ReactOS copy this behavior to be compatible with windows 2003
1481 */
1482 if ( (!GdiGetHandleUserData(hObject, (DWORD)Type, (PVOID) &pUserDatalpdi)) ||
1483 (pUserData == NULL) )
1484 {
1485 GdiSetLastError(ERROR_INVALID_HANDLE);
1486 retValue = FALSE;
1487 }
1488
1489 lpdi.cbSize = sizeof(DOCINFOA);
1490
1491 /* NOTE lpszOutput will be store in handle userdata */
1492 lpdi.lpszOutput = 0;
1493
1494 lpdi.lpszDatatype = 0;
1495 lpdi.fwType = 0;
1496 lpdi.lpszDocName = lpvInData;
1497
1498 /* NOTE : doc for StartDocA/W at msdn http://msdn2.microsoft.com/en-us/library/ms535793(VS.85).aspx */
1499 retValue = StartDocA(hdc, &lpdi);
1500
1501 /* StartDocA fail */
1502 if (retValue < 0)
1503 {
1504 /* check see if outbuffer contain any data, if it does abort */
1505 if ( (pUserDatalpdi->lpszOutput != 0) &&
1506 ( (*(WCHAR *)pUserDatalpdi->lpszOutput) != UNICODE_NULL) )
1507 {
1508 retValue = SP_APPABORT;
1509 }
1510 else
1511 {
1512 retValue = GetLastError();
1513
1514 /* Translate StartDocA error code to STARTDOC error code
1515 * see msdn http://msdn2.microsoft.com/en-us/library/ms535472.aspx
1516 */
1517 switch(retValue)
1518 {
1519 case ERROR_NOT_ENOUGH_MEMORY:
1520 retValue = SP_OUTOFMEMORY;
1521 break;
1522
1523 case ERROR_PRINT_CANCELLED:
1524 retValue = SP_USERABORT;
1525 break;
1526
1527 case ERROR_DISK_FULL:
1528 retValue = SP_OUTOFDISK;
1529 break;
1530
1531 default:
1532 retValue = SP_ERROR;
1533 break;
1534 }
1535 }
1536 }
1537 }
1538 break;
1539
1540
1541
1542
1543 default:
1544 UNIMPLEMENTED;
1545 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1546 }
1547 }
1548
1549 return retValue;
1550 }
1551
1552 /*
1553 * @unimplemented
1554 */
1555 BOOL
1556 WINAPI
1557 GdiAddGlsRecord(HDC hdc,
1558 DWORD unknown1,
1559 LPCSTR unknown2,
1560 LPRECT unknown3)
1561 {
1562 UNIMPLEMENTED;
1563 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1564 return 0;
1565 }
1566
1567 /*
1568 * @unimplemented
1569 */
1570 HANDLE
1571 WINAPI
1572 GdiConvertMetaFilePict(HGLOBAL hMem)
1573 {
1574 UNIMPLEMENTED;
1575 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1576 return 0;
1577 }
1578
1579 /*
1580 * @implemented
1581 */
1582 DEVMODEW *
1583 WINAPI
1584 GdiConvertToDevmodeW(DEVMODEA *dmA)
1585 {
1586 DEVMODEW *dmW;
1587 WORD dmW_size, dmA_size;
1588
1589 dmA_size = dmA->dmSize;
1590
1591 /* this is the minimal dmSize that XP accepts */
1592 if (dmA_size < FIELD_OFFSET(DEVMODEA, dmFields))
1593 return NULL;
1594
1595 if (dmA_size > sizeof(DEVMODEA))
1596 dmA_size = sizeof(DEVMODEA);
1597
1598 dmW_size = dmA_size + CCHDEVICENAME;
1599 if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
1600 dmW_size += CCHFORMNAME;
1601
1602 dmW = HeapAlloc(GetProcessHeap(), 0, dmW_size + dmA->dmDriverExtra);
1603 if (!dmW) return NULL;
1604
1605 MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmDeviceName, CCHDEVICENAME,
1606 dmW->dmDeviceName, CCHDEVICENAME);
1607 /* copy slightly more, to avoid long computations */
1608 memcpy(&dmW->dmSpecVersion, &dmA->dmSpecVersion, dmA_size - CCHDEVICENAME);
1609
1610 if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
1611 {
1612 MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmFormName, CCHFORMNAME,
1613 dmW->dmFormName, CCHFORMNAME);
1614 if (dmA_size > FIELD_OFFSET(DEVMODEA, dmLogPixels))
1615 memcpy(&dmW->dmLogPixels, &dmA->dmLogPixels, dmA_size - FIELD_OFFSET(DEVMODEA, dmLogPixels));
1616 }
1617
1618 if (dmA->dmDriverExtra)
1619 memcpy((char *)dmW + dmW_size, (const char *)dmA + dmA_size, dmA->dmDriverExtra);
1620
1621 dmW->dmSize = dmW_size;
1622
1623 return dmW;
1624 }
1625
1626 /*
1627 * @unimplemented
1628 */
1629 HENHMETAFILE
1630 WINAPI
1631 GdiCreateLocalEnhMetaFile(HENHMETAFILE hmo)
1632 {
1633 UNIMPLEMENTED;
1634 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1635 return 0;
1636 }
1637
1638 /*
1639 * @unimplemented
1640 */
1641 METAFILEPICT *
1642 WINAPI
1643 GdiCreateLocalMetaFilePict(HENHMETAFILE hmo)
1644 {
1645 UNIMPLEMENTED;
1646 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1647 return 0;
1648 }
1649
1650
1651 /*
1652 * @unimplemented
1653 */
1654 HANDLE
1655 WINAPI
1656 GdiGetSpoolFileHandle(LPWSTR pwszPrinterName,
1657 LPDEVMODEW pDevmode,
1658 LPWSTR pwszDocName)
1659 {
1660 UNIMPLEMENTED;
1661 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1662 return 0;
1663 }
1664
1665 /*
1666 * @unimplemented
1667 */
1668 BOOL
1669 WINAPI
1670 GdiDeleteSpoolFileHandle(HANDLE SpoolFileHandle)
1671 {
1672 UNIMPLEMENTED;
1673 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1674 return 0;
1675 }
1676
1677 /*
1678 * @unimplemented
1679 */
1680 DWORD
1681 WINAPI
1682 GdiGetPageCount(HANDLE SpoolFileHandle)
1683 {
1684 UNIMPLEMENTED;
1685 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1686 return 0;
1687 }
1688
1689 /*
1690 * @unimplemented
1691 */
1692 HDC
1693 WINAPI
1694 GdiGetDC(HANDLE SpoolFileHandle)
1695 {
1696 UNIMPLEMENTED;
1697 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1698 return 0;
1699 }
1700
1701 /*
1702 * @unimplemented
1703 */
1704 HANDLE
1705 WINAPI
1706 GdiGetPageHandle(HANDLE SpoolFileHandle,
1707 DWORD Page,
1708 LPDWORD pdwPageType)
1709 {
1710 UNIMPLEMENTED;
1711 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1712 return 0;
1713 }
1714
1715 /*
1716 * @unimplemented
1717 */
1718 BOOL
1719 WINAPI
1720 GdiStartDocEMF(HANDLE SpoolFileHandle,
1721 DOCINFOW *pDocInfo)
1722 {
1723 UNIMPLEMENTED;
1724 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1725 return 0;
1726 }
1727
1728 /*
1729 * @unimplemented
1730 */
1731 BOOL
1732 WINAPI
1733 GdiStartPageEMF(HANDLE SpoolFileHandle)
1734 {
1735 UNIMPLEMENTED;
1736 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1737 return 0;
1738 }
1739
1740 /*
1741 * @unimplemented
1742 */
1743 BOOL
1744 WINAPI
1745 GdiPlayPageEMF(HANDLE SpoolFileHandle,
1746 HANDLE hemf,
1747 RECT *prectDocument,
1748 RECT *prectBorder,
1749 RECT *prectClip)
1750 {
1751 UNIMPLEMENTED;
1752 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1753 return 0;
1754 }
1755
1756 /*
1757 * @unimplemented
1758 */
1759 BOOL
1760 WINAPI
1761 GdiEndPageEMF(HANDLE SpoolFileHandle,
1762 DWORD dwOptimization)
1763 {
1764 UNIMPLEMENTED;
1765 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1766 return 0;
1767 }
1768
1769 /*
1770 * @unimplemented
1771 */
1772 BOOL
1773 WINAPI
1774 GdiEndDocEMF(HANDLE SpoolFileHandle)
1775 {
1776 UNIMPLEMENTED;
1777 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1778 return 0;
1779 }
1780
1781 /*
1782 * @unimplemented
1783 */
1784 BOOL
1785 WINAPI
1786 GdiGetDevmodeForPage(HANDLE SpoolFileHandle,
1787 DWORD dwPageNumber,
1788 PDEVMODEW *pCurrDM,
1789 PDEVMODEW *pLastDM)
1790 {
1791 UNIMPLEMENTED;
1792 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1793 return 0;
1794 }
1795
1796 /*
1797 * @unimplemented
1798 */
1799 BOOL
1800 WINAPI
1801 GdiResetDCEMF(HANDLE SpoolFileHandle,
1802 PDEVMODEW pCurrDM)
1803 {
1804 UNIMPLEMENTED;
1805 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1806 return 0;
1807 }
1808
1809
1810 /*
1811 * @unimplemented
1812 */
1813 INT
1814 WINAPI
1815 CombineRgn(HRGN hDest,
1816 HRGN hSrc1,
1817 HRGN hSrc2,
1818 INT CombineMode)
1819 {
1820 /* FIXME some part should be done in user mode */
1821 return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode);
1822 }
1823
1824 /*
1825 * @unimplemented
1826 */
1827 ULONG WINAPI
1828 XLATEOBJ_iXlate(XLATEOBJ *XlateObj,
1829 ULONG Color)
1830 {
1831 UNIMPLEMENTED;
1832 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1833 return 0;
1834 }
1835
1836 /*
1837 * @unimplemented
1838 */
1839 ULONG *
1840 WINAPI
1841 XLATEOBJ_piVector(XLATEOBJ *XlateObj)
1842 {
1843 return XlateObj->pulXlate;
1844 }
1845
1846 /*
1847 * @unimplemented
1848 */
1849 BOOL
1850 WINAPI
1851 GdiPlayEMF(LPWSTR pwszPrinterName,
1852 LPDEVMODEW pDevmode,
1853 LPWSTR pwszDocName,
1854 EMFPLAYPROC pfnEMFPlayFn,
1855 HANDLE hPageQuery
1856 )
1857 {
1858 UNIMPLEMENTED;
1859 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1860 return 0;
1861 }
1862
1863
1864
1865 /*
1866 * @unimplemented
1867 */
1868 BOOL
1869 WINAPI
1870 GdiPlayPrivatePageEMF(HANDLE SpoolFileHandle,
1871 DWORD unknown,
1872 RECT *prectDocument)
1873 {
1874 UNIMPLEMENTED;
1875 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1876 return 0;
1877 }
1878
1879 /*
1880 * @unimplemented
1881 */
1882 VOID WINAPI GdiInitializeLanguagePack(DWORD InitParam)
1883 {
1884 UNIMPLEMENTED;
1885 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1886 }
1887
1888
1889 /*
1890 * @implemented
1891 */
1892 INT
1893 WINAPI
1894 ExcludeClipRect(IN HDC hdc, IN INT xLeft, IN INT yTop, IN INT xRight, IN INT yBottom)
1895 {
1896 /* FIXME some part need be done on user mode size */
1897 return NtGdiExcludeClipRect(hdc, xLeft, yTop, xRight, yBottom);
1898 }
1899
1900 /*
1901 * @implemented
1902 */
1903 INT
1904 WINAPI
1905 ExtSelectClipRgn( IN HDC hdc, IN HRGN hrgn, IN INT iMode)
1906 {
1907 /* FIXME some part need be done on user mode size */
1908 return NtGdiExtSelectClipRgn(hdc,hrgn, iMode);
1909 }
1910
1911 /*
1912 * @implemented
1913 */
1914 BOOL
1915 WINAPI
1916 GdiGradientFill(
1917 IN HDC hdc,
1918 IN PTRIVERTEX pVertex,
1919 IN ULONG nVertex,
1920 IN PVOID pMesh,
1921 IN ULONG nMesh,
1922 IN ULONG ulMode)
1923 {
1924 /* FIXME some part need be done in user mode */
1925 return NtGdiGradientFill(hdc, pVertex, nVertex, pMesh, nMesh, ulMode);
1926 }
1927
1928
1929 /*
1930 * @implemented
1931 */
1932 BOOL
1933 WINAPI
1934 GdiTransparentBlt(IN HDC hdcDst,
1935 IN INT xDst,
1936 IN INT yDst,
1937 IN INT cxDst,
1938 IN INT cyDst,
1939 IN HDC hdcSrc,
1940 IN INT xSrc,
1941 IN INT ySrc,
1942 IN INT cxSrc,
1943 IN INT cySrc,
1944 IN COLORREF TransColor
1945 )
1946 {
1947 /* FIXME some part need be done in user mode */
1948 return NtGdiTransparentBlt(hdcDst, xDst, yDst, cxDst, cyDst, hdcSrc, xSrc, ySrc, cxSrc, cySrc, TransColor);
1949 }
1950
1951 /*
1952 * @unimplemented
1953 */
1954 BOOL
1955 WINAPI
1956 GdiPrinterThunk(
1957 IN HUMPD humpd,
1958 DWORD *status,
1959 DWORD unuse)
1960 {
1961 /* FIXME figout the protypes, the HUMPD are a STRUCT or COM object */
1962 /* status contain some form of return value that being save, what it is I do not known */
1963 /* unsue seam have zero effect, what it is for I do not known */
1964
1965 // ? return NtGdiSetPUMPDOBJ(humpd->0x10,TRUE, humpd, ?) <- blackbox, OpenRCE info, and api hooks for anylaysing;
1966 return FALSE;
1967 }
1968
1969 /*
1970 * @unimplemented
1971 *
1972 */
1973 HBITMAP
1974 WINAPI
1975 GdiConvertBitmapV5(
1976 HBITMAP in_format_BitMap,
1977 HBITMAP src_BitMap,
1978 INT bpp,
1979 INT unuse)
1980 {
1981 /* FIXME guessing the prototypes */
1982
1983 /*
1984 * it have create a new bitmap with desired in format,
1985 * then convert it src_bitmap to new format
1986 * and return it as HBITMAP
1987 */
1988
1989 return FALSE;
1990 }
1991
1992 /*
1993 * @implemented
1994 *
1995 */
1996 int
1997 WINAPI
1998 GetClipBox(HDC hdc,
1999 LPRECT lprc)
2000 {
2001 return NtGdiGetAppClipBox(hdc, lprc);
2002 }
2003
2004 /*
2005 * @implemented
2006 *
2007 */
2008 DWORD
2009 WINAPI
2010 GetFontData(HDC hdc,
2011 DWORD dwTable,
2012 DWORD dwOffset,
2013 LPVOID lpvBuffer,
2014 DWORD cbData)
2015 {
2016 if (!lpvBuffer)
2017 {
2018 cbData = 0;
2019 }
2020 return NtGdiGetFontData(hdc, dwTable, dwOffset, lpvBuffer, cbData);
2021 }
2022
2023
2024 /*
2025 * @implemented
2026 *
2027 */
2028 DWORD
2029 WINAPI
2030 GetRegionData(HRGN hrgn,
2031 DWORD nCount,
2032 LPRGNDATA lpRgnData)
2033 {
2034 if (!lpRgnData)
2035 {
2036 nCount = 0;
2037 }
2038
2039 return NtGdiGetRegionData(hrgn,nCount,lpRgnData);
2040 }
2041
2042
2043 /*
2044 * @implemented
2045 *
2046 */
2047 INT
2048 WINAPI
2049 GetRgnBox(HRGN hrgn,
2050 LPRECT prcOut)
2051 {
2052 #if 0
2053 PRGN_ATTR Rgn_Attr;
2054 if (!GdiGetHandleUserData((HGDIOBJ) hRgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr))
2055 return NtGdiGetRgnBox(hrgn, prcOut);
2056 if (Rgn_Attr->Flags == NULLREGION)
2057 {
2058 prcOut->left = 0;
2059 prcOut->top = 0;
2060 prcOut->right = 0;
2061 prcOut->bottom = 0;
2062 }
2063 else
2064 {
2065 if (Rgn_Attr->Flags != SIMPLEREGION) return NtGdiGetRgnBox(hrgn, prcOut);
2066 *prcOut = Rgn_Attr->Rect;
2067 }
2068 return Rgn_Attr->Flags;
2069 #endif
2070 return NtGdiGetRgnBox(hrgn, prcOut);
2071 }
2072
2073
2074 /*
2075 * @implemented
2076 *
2077 */
2078 INT
2079 WINAPI
2080 OffsetRgn( HRGN hrgn,
2081 int nXOffset,
2082 int nYOffset)
2083 {
2084 /* FIXME some part are done in user mode */
2085 return NtGdiOffsetRgn(hrgn,nXOffset,nYOffset);
2086 }
2087
2088 /*
2089 * @implemented
2090 */
2091 INT
2092 WINAPI
2093 IntersectClipRect(HDC hdc,
2094 int nLeftRect,
2095 int nTopRect,
2096 int nRightRect,
2097 int nBottomRect)
2098 {
2099 #if 0
2100 // Handle something other than a normal dc object.
2101 if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
2102 {
2103 if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC)
2104 return MFDRV_IntersectClipRect( hdc, nLeftRect, nTopRect, nRightRect, nBottomRect);
2105 else
2106 {
2107 PLDC pLDC = GdiGetLDC(hdc);
2108 if ( pLDC )
2109 {
2110 if (pLDC->iType != LDC_EMFLDC || EMFDRV_IntersectClipRect( hdc, nLeftRect, nTopRect, nRightRect, nBottomRect))
2111 return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect);
2112 }
2113 else
2114 SetLastError(ERROR_INVALID_HANDLE);
2115 return 0;
2116 }
2117 }
2118 #endif
2119 return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect);
2120 }
2121
2122 /*
2123 * @implemented
2124 */
2125 INT
2126 WINAPI
2127 OffsetClipRgn(HDC hdc,
2128 int nXOffset,
2129 int nYOffset)
2130 {
2131 #if 0
2132 // Handle something other than a normal dc object.
2133 if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
2134 {
2135 if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC)
2136 return MFDRV_OffsetClipRgn( hdc, nXOffset, nYOffset );
2137 else
2138 {
2139 PLDC pLDC = GdiGetLDC(hdc);
2140 if ( !pLDC )
2141 {
2142 SetLastError(ERROR_INVALID_HANDLE);
2143 return 0;
2144 }
2145 if (pLDC->iType == LDC_EMFLDC && !EMFDRV_OffsetClipRgn( hdc, nXOffset, nYOffset ))
2146 return 0;
2147 return NtGdiOffsetClipRgn( hdc, nXOffset, nYOffset);
2148 }
2149 }
2150 #endif
2151 return NtGdiOffsetClipRgn( hdc, nXOffset, nYOffset);
2152 }
2153
2154
2155 INT
2156 WINAPI
2157 NamedEscape(HDC hdc,
2158 PWCHAR pDriver,
2159 INT iEsc,
2160 INT cjIn,
2161 LPSTR pjIn,
2162 INT cjOut,
2163 LPSTR pjOut)
2164 {
2165 /* FIXME metadc, metadc are done most in user mode, and we do not support it
2166 * Windows 2000/XP/Vista ignore the current hdc, that are being pass and always set hdc to NULL
2167 * when it calls to NtGdiExtEscape from NamedEscape
2168 */
2169 return NtGdiExtEscape(NULL,pDriver,wcslen(pDriver),iEsc,cjIn,pjIn,cjOut,pjOut);
2170 }
2171
2172
2173
2174 /*
2175 * @unimplemented
2176 */
2177
2178 /* FIXME wrong protypes, it is a fastcall api */
2179 DWORD
2180 WINAPI
2181 cGetTTFFromFOT(DWORD x1 ,DWORD x2 ,DWORD x3, DWORD x4, DWORD x5, DWORD x6, DWORD x7)
2182 {
2183 UNIMPLEMENTED;
2184 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
2185 return 0;
2186 }
2187