- GdiIsPlayMetafileDC: function GdiGetHandleUserData might fail
[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 PLDC pLDC = GdiGetLDC(hDC);
1161 if ( pLDC )
1162 {
1163 if ( pLDC->Flags & LDC_PLAY_MFDC ) return TRUE;
1164 }
1165 return FALSE;
1166 }
1167
1168 /*
1169 * @unimplemented
1170 */
1171 BOOL
1172 WINAPI
1173 GdiValidateHandle(HGDIOBJ hobj)
1174 {
1175 UNIMPLEMENTED;
1176 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1177 return 0;
1178 }
1179
1180 /*
1181 * @unimplemented
1182 */
1183 DWORD
1184 WINAPI
1185 GetBitmapAttributes(HBITMAP hbm)
1186 {
1187 UNIMPLEMENTED;
1188 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1189 return 0;
1190 }
1191
1192 /*
1193 * @unimplemented
1194 */
1195 DWORD
1196 WINAPI
1197 GetBrushAttributes(HBRUSH hbr)
1198 {
1199 UNIMPLEMENTED;
1200 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1201 return 0;
1202 }
1203
1204 /*
1205 * @implemented
1206 */
1207 ULONG
1208 WINAPI
1209 GetEUDCTimeStamp(VOID)
1210 {
1211 return NtGdiGetEudcTimeStampEx(NULL,0,TRUE);
1212 }
1213
1214 /*
1215 * @implemented
1216 */
1217 ULONG
1218 WINAPI
1219 GetFontAssocStatus(HDC hdc)
1220 {
1221 ULONG retValue = 0;
1222
1223 if (hdc)
1224 {
1225 retValue = NtGdiQueryFontAssocInfo(hdc);
1226 }
1227
1228 return retValue;
1229 }
1230
1231 /*
1232 * @implemented
1233 */
1234 BOOL
1235 WINAPI
1236 GetTextExtentExPointWPri(HDC hdc,
1237 LPWSTR lpwsz,
1238 ULONG cwc,
1239 ULONG dxMax,
1240 ULONG *pcCh,
1241 PULONG pdxOut,
1242 LPSIZE psize)
1243 {
1244 return NtGdiGetTextExtentExW(hdc,lpwsz,cwc,dxMax,pcCh,pdxOut,psize,0);
1245 }
1246
1247 /*
1248 * @unimplemented
1249 */
1250 DWORD
1251 WINAPI
1252 QueryFontAssocStatus(VOID)
1253 {
1254 UNIMPLEMENTED;
1255 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1256 return 0;
1257 }
1258
1259 /*
1260 * @implemented
1261 */
1262 BOOL
1263 WINAPI
1264 RemoveFontMemResourceEx(HANDLE fh)
1265 {
1266 if (fh)
1267 {
1268 return NtGdiRemoveFontMemResourceEx(fh);
1269 }
1270 SetLastError(ERROR_INVALID_PARAMETER);
1271 return FALSE;
1272 }
1273
1274 /*
1275 * @unimplemented
1276 */
1277 int
1278 WINAPI
1279 RemoveFontResourceTracking(LPCSTR lpString,int unknown)
1280 {
1281 UNIMPLEMENTED;
1282 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1283 return 0;
1284 }
1285
1286 /*
1287 * @unimplemented
1288 */
1289 HBITMAP
1290 WINAPI
1291 SetBitmapAttributes(HBITMAP hbm, DWORD dwFlags)
1292 {
1293 UNIMPLEMENTED;
1294 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1295 return 0;
1296 }
1297
1298 /*
1299 * @unimplemented
1300 */
1301 HBRUSH
1302 WINAPI
1303 SetBrushAttributes(HBRUSH hbm, DWORD dwFlags)
1304 {
1305 UNIMPLEMENTED;
1306 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1307 return 0;
1308 }
1309
1310 /*
1311 * @implemented
1312 */
1313 int
1314 WINAPI
1315 StartFormPage(HDC hdc)
1316 {
1317 return StartPage(hdc);
1318 }
1319
1320 /*
1321 * @unimplemented
1322 */
1323 VOID
1324 WINAPI
1325 UnloadNetworkFonts(DWORD unknown)
1326 {
1327 UNIMPLEMENTED;
1328 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1329 }
1330
1331 /*
1332 * @unimplemented
1333 */
1334 BOOL
1335 WINAPI
1336 GdiRealizationInfo(HDC hdc,
1337 PREALIZATION_INFO pri)
1338 {
1339 // ATM we do not support local font data and Language Pack.
1340 return NtGdiGetRealizationInfo(hdc, pri, (HFONT) NULL);
1341 }
1342
1343 /*
1344 * @implemented
1345 */
1346 BOOL
1347 WINAPI
1348 GetETM(HDC hdc,
1349 EXTTEXTMETRIC *petm)
1350 {
1351 BOOL Ret = NtGdiGetETM(hdc, petm);
1352
1353 if (Ret && petm)
1354 petm->emKernPairs = GetKerningPairsA(hdc, 0, 0);
1355
1356 return Ret;
1357 }
1358
1359 /*
1360 * @unimplemented
1361 */
1362 int
1363 WINAPI
1364 Escape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpvInData, LPVOID lpvOutData)
1365 {
1366 int retValue = SP_ERROR;
1367 HGDIOBJ hObject = hdc;
1368 UINT Type = 0;
1369 LPVOID pUserData = NULL;
1370
1371 Type = GDI_HANDLE_GET_TYPE(hObject);
1372
1373 if (Type == GDI_OBJECT_TYPE_METADC)
1374 {
1375 /* FIXME we do not support metafile */
1376 UNIMPLEMENTED;
1377 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1378 }
1379 else
1380 {
1381 switch (nEscape)
1382 {
1383 case ABORTDOC:
1384 /* Note Winodws check see if the handle have any user data for ABORTDOC command
1385 * ReactOS copy this behavior to be compatible with windows 2003
1386 */
1387 if ( (!GdiGetHandleUserData(hObject, (DWORD)Type, (PVOID) &pUserData)) ||
1388 (pUserData == NULL) )
1389 {
1390 GdiSetLastError(ERROR_INVALID_HANDLE);
1391 retValue = FALSE;
1392 }
1393 else
1394 {
1395 retValue = AbortDoc(hdc);
1396 }
1397 break;
1398
1399 case DRAFTMODE:
1400 case FLUSHOUTPUT:
1401 case SETCOLORTABLE:
1402 /* Note 1: DRAFTMODE, FLUSHOUTPUT, SETCOLORTABLE is outdated and been replace with other api */
1403 /* Note 2: Winodws check see if the handle have any user data for DRAFTMODE, FLUSHOUTPUT, SETCOLORTABLE command
1404 * ReactOS copy this behavior to be compatible with windows 2003
1405 */
1406 if ( (!GdiGetHandleUserData(hObject, (DWORD)Type, (PVOID) &pUserData)) ||
1407 (pUserData == NULL) )
1408 {
1409 GdiSetLastError(ERROR_INVALID_HANDLE);
1410 }
1411 retValue = FALSE;
1412 break;
1413
1414 case SETABORTPROC:
1415 /* Note : Winodws check see if the handle have any user data for DRAFTMODE, FLUSHOUTPUT, SETCOLORTABLE command
1416 * ReactOS copy this behavior to be compatible with windows 2003
1417 */
1418 if ( (!GdiGetHandleUserData(hObject, (DWORD)Type, (PVOID) &pUserData)) ||
1419 (pUserData == NULL) )
1420 {
1421 GdiSetLastError(ERROR_INVALID_HANDLE);
1422 retValue = FALSE;
1423 }
1424 retValue = SetAbortProc(hdc, (ABORTPROC)lpvInData);
1425 break;
1426
1427 case GETCOLORTABLE:
1428 retValue = GetSystemPaletteEntries(hdc, (UINT)*lpvInData, 1, (LPPALETTEENTRY)lpvOutData);
1429 if ( !retValue )
1430 {
1431 retValue = SP_ERROR;
1432 }
1433 break;
1434
1435 case ENDDOC:
1436 /* Note : Winodws check see if the handle have any user data for DRAFTMODE, FLUSHOUTPUT, SETCOLORTABLE command
1437 * ReactOS copy this behavior to be compatible with windows 2003
1438 */
1439 if ( (!GdiGetHandleUserData(hObject, (DWORD)Type, (PVOID) &pUserData)) ||
1440 (pUserData == NULL) )
1441 {
1442 GdiSetLastError(ERROR_INVALID_HANDLE);
1443 retValue = FALSE;
1444 }
1445 retValue = EndDoc(hdc);
1446 break;
1447
1448
1449 case GETSCALINGFACTOR:
1450 /* Note GETSCALINGFACTOR is outdated have been replace by GetDeviceCaps */
1451 if ( Type == GDI_OBJECT_TYPE_DC )
1452 {
1453 if ( lpvOutData )
1454 {
1455 PPOINT ptr = (PPOINT) lpvOutData;
1456 ptr->x = 0;
1457 ptr->y = 0;
1458 }
1459 }
1460 retValue = FALSE;
1461 break;
1462
1463 case GETEXTENDEDTEXTMETRICS:
1464 retValue = (int) GetETM( hdc, (EXTTEXTMETRIC *) lpvOutData) != 0;
1465 break;
1466
1467 case STARTDOC:
1468 {
1469 DOCINFOA *pUserDatalpdi;
1470 DOCINFOA lpdi;
1471
1472 /* Note : Winodws check see if the handle have any user data for STARTDOC command
1473 * ReactOS copy this behavior to be compatible with windows 2003
1474 */
1475 if ( (!GdiGetHandleUserData(hObject, (DWORD)Type, (PVOID) &pUserDatalpdi)) ||
1476 (pUserData == NULL) )
1477 {
1478 GdiSetLastError(ERROR_INVALID_HANDLE);
1479 retValue = FALSE;
1480 }
1481
1482 lpdi.cbSize = sizeof(DOCINFOA);
1483
1484 /* NOTE lpszOutput will be store in handle userdata */
1485 lpdi.lpszOutput = 0;
1486
1487 lpdi.lpszDatatype = 0;
1488 lpdi.fwType = 0;
1489 lpdi.lpszDocName = lpvInData;
1490
1491 /* NOTE : doc for StartDocA/W at msdn http://msdn2.microsoft.com/en-us/library/ms535793(VS.85).aspx */
1492 retValue = StartDocA(hdc, &lpdi);
1493
1494 /* StartDocA fail */
1495 if (retValue < 0)
1496 {
1497 /* check see if outbuffer contain any data, if it does abort */
1498 if ( (pUserDatalpdi->lpszOutput != 0) &&
1499 ( (*(WCHAR *)pUserDatalpdi->lpszOutput) != UNICODE_NULL) )
1500 {
1501 retValue = SP_APPABORT;
1502 }
1503 else
1504 {
1505 retValue = GetLastError();
1506
1507 /* Translate StartDocA error code to STARTDOC error code
1508 * see msdn http://msdn2.microsoft.com/en-us/library/ms535472.aspx
1509 */
1510 switch(retValue)
1511 {
1512 case ERROR_NOT_ENOUGH_MEMORY:
1513 retValue = SP_OUTOFMEMORY;
1514 break;
1515
1516 case ERROR_PRINT_CANCELLED:
1517 retValue = SP_USERABORT;
1518 break;
1519
1520 case ERROR_DISK_FULL:
1521 retValue = SP_OUTOFDISK;
1522 break;
1523
1524 default:
1525 retValue = SP_ERROR;
1526 break;
1527 }
1528 }
1529 }
1530 }
1531 break;
1532
1533
1534
1535
1536 default:
1537 UNIMPLEMENTED;
1538 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1539 }
1540 }
1541
1542 return retValue;
1543 }
1544
1545 /*
1546 * @unimplemented
1547 */
1548 BOOL
1549 WINAPI
1550 GdiAddGlsRecord(HDC hdc,
1551 DWORD unknown1,
1552 LPCSTR unknown2,
1553 LPRECT unknown3)
1554 {
1555 UNIMPLEMENTED;
1556 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1557 return 0;
1558 }
1559
1560 /*
1561 * @unimplemented
1562 */
1563 HANDLE
1564 WINAPI
1565 GdiConvertMetaFilePict(HGLOBAL hMem)
1566 {
1567 UNIMPLEMENTED;
1568 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1569 return 0;
1570 }
1571
1572 /*
1573 * @implemented
1574 */
1575 DEVMODEW *
1576 WINAPI
1577 GdiConvertToDevmodeW(DEVMODEA *dmA)
1578 {
1579 DEVMODEW *dmW;
1580 WORD dmW_size, dmA_size;
1581
1582 dmA_size = dmA->dmSize;
1583
1584 /* this is the minimal dmSize that XP accepts */
1585 if (dmA_size < FIELD_OFFSET(DEVMODEA, dmFields))
1586 return NULL;
1587
1588 if (dmA_size > sizeof(DEVMODEA))
1589 dmA_size = sizeof(DEVMODEA);
1590
1591 dmW_size = dmA_size + CCHDEVICENAME;
1592 if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
1593 dmW_size += CCHFORMNAME;
1594
1595 dmW = HeapAlloc(GetProcessHeap(), 0, dmW_size + dmA->dmDriverExtra);
1596 if (!dmW) return NULL;
1597
1598 MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmDeviceName, CCHDEVICENAME,
1599 dmW->dmDeviceName, CCHDEVICENAME);
1600 /* copy slightly more, to avoid long computations */
1601 memcpy(&dmW->dmSpecVersion, &dmA->dmSpecVersion, dmA_size - CCHDEVICENAME);
1602
1603 if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
1604 {
1605 MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmFormName, CCHFORMNAME,
1606 dmW->dmFormName, CCHFORMNAME);
1607 if (dmA_size > FIELD_OFFSET(DEVMODEA, dmLogPixels))
1608 memcpy(&dmW->dmLogPixels, &dmA->dmLogPixels, dmA_size - FIELD_OFFSET(DEVMODEA, dmLogPixels));
1609 }
1610
1611 if (dmA->dmDriverExtra)
1612 memcpy((char *)dmW + dmW_size, (const char *)dmA + dmA_size, dmA->dmDriverExtra);
1613
1614 dmW->dmSize = dmW_size;
1615
1616 return dmW;
1617 }
1618
1619 /*
1620 * @unimplemented
1621 */
1622 HENHMETAFILE
1623 WINAPI
1624 GdiCreateLocalEnhMetaFile(HENHMETAFILE hmo)
1625 {
1626 UNIMPLEMENTED;
1627 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1628 return 0;
1629 }
1630
1631 /*
1632 * @unimplemented
1633 */
1634 METAFILEPICT *
1635 WINAPI
1636 GdiCreateLocalMetaFilePict(HENHMETAFILE hmo)
1637 {
1638 UNIMPLEMENTED;
1639 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1640 return 0;
1641 }
1642
1643
1644 /*
1645 * @unimplemented
1646 */
1647 HANDLE
1648 WINAPI
1649 GdiGetSpoolFileHandle(LPWSTR pwszPrinterName,
1650 LPDEVMODEW pDevmode,
1651 LPWSTR pwszDocName)
1652 {
1653 UNIMPLEMENTED;
1654 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1655 return 0;
1656 }
1657
1658 /*
1659 * @unimplemented
1660 */
1661 BOOL
1662 WINAPI
1663 GdiDeleteSpoolFileHandle(HANDLE SpoolFileHandle)
1664 {
1665 UNIMPLEMENTED;
1666 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1667 return 0;
1668 }
1669
1670 /*
1671 * @unimplemented
1672 */
1673 DWORD
1674 WINAPI
1675 GdiGetPageCount(HANDLE SpoolFileHandle)
1676 {
1677 UNIMPLEMENTED;
1678 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1679 return 0;
1680 }
1681
1682 /*
1683 * @unimplemented
1684 */
1685 HDC
1686 WINAPI
1687 GdiGetDC(HANDLE SpoolFileHandle)
1688 {
1689 UNIMPLEMENTED;
1690 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1691 return 0;
1692 }
1693
1694 /*
1695 * @unimplemented
1696 */
1697 HANDLE
1698 WINAPI
1699 GdiGetPageHandle(HANDLE SpoolFileHandle,
1700 DWORD Page,
1701 LPDWORD pdwPageType)
1702 {
1703 UNIMPLEMENTED;
1704 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1705 return 0;
1706 }
1707
1708 /*
1709 * @unimplemented
1710 */
1711 BOOL
1712 WINAPI
1713 GdiStartDocEMF(HANDLE SpoolFileHandle,
1714 DOCINFOW *pDocInfo)
1715 {
1716 UNIMPLEMENTED;
1717 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1718 return 0;
1719 }
1720
1721 /*
1722 * @unimplemented
1723 */
1724 BOOL
1725 WINAPI
1726 GdiStartPageEMF(HANDLE SpoolFileHandle)
1727 {
1728 UNIMPLEMENTED;
1729 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1730 return 0;
1731 }
1732
1733 /*
1734 * @unimplemented
1735 */
1736 BOOL
1737 WINAPI
1738 GdiPlayPageEMF(HANDLE SpoolFileHandle,
1739 HANDLE hemf,
1740 RECT *prectDocument,
1741 RECT *prectBorder,
1742 RECT *prectClip)
1743 {
1744 UNIMPLEMENTED;
1745 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1746 return 0;
1747 }
1748
1749 /*
1750 * @unimplemented
1751 */
1752 BOOL
1753 WINAPI
1754 GdiEndPageEMF(HANDLE SpoolFileHandle,
1755 DWORD dwOptimization)
1756 {
1757 UNIMPLEMENTED;
1758 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1759 return 0;
1760 }
1761
1762 /*
1763 * @unimplemented
1764 */
1765 BOOL
1766 WINAPI
1767 GdiEndDocEMF(HANDLE SpoolFileHandle)
1768 {
1769 UNIMPLEMENTED;
1770 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1771 return 0;
1772 }
1773
1774 /*
1775 * @unimplemented
1776 */
1777 BOOL
1778 WINAPI
1779 GdiGetDevmodeForPage(HANDLE SpoolFileHandle,
1780 DWORD dwPageNumber,
1781 PDEVMODEW *pCurrDM,
1782 PDEVMODEW *pLastDM)
1783 {
1784 UNIMPLEMENTED;
1785 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1786 return 0;
1787 }
1788
1789 /*
1790 * @unimplemented
1791 */
1792 BOOL
1793 WINAPI
1794 GdiResetDCEMF(HANDLE SpoolFileHandle,
1795 PDEVMODEW pCurrDM)
1796 {
1797 UNIMPLEMENTED;
1798 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1799 return 0;
1800 }
1801
1802
1803 /*
1804 * @unimplemented
1805 */
1806 INT
1807 WINAPI
1808 CombineRgn(HRGN hDest,
1809 HRGN hSrc1,
1810 HRGN hSrc2,
1811 INT CombineMode)
1812 {
1813 /* FIXME some part should be done in user mode */
1814 return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode);
1815 }
1816
1817 /*
1818 * @unimplemented
1819 */
1820 ULONG WINAPI
1821 XLATEOBJ_iXlate(XLATEOBJ *XlateObj,
1822 ULONG Color)
1823 {
1824 UNIMPLEMENTED;
1825 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1826 return 0;
1827 }
1828
1829 /*
1830 * @unimplemented
1831 */
1832 ULONG *
1833 WINAPI
1834 XLATEOBJ_piVector(XLATEOBJ *XlateObj)
1835 {
1836 return XlateObj->pulXlate;
1837 }
1838
1839 /*
1840 * @unimplemented
1841 */
1842 BOOL
1843 WINAPI
1844 GdiPlayEMF(LPWSTR pwszPrinterName,
1845 LPDEVMODEW pDevmode,
1846 LPWSTR pwszDocName,
1847 EMFPLAYPROC pfnEMFPlayFn,
1848 HANDLE hPageQuery
1849 )
1850 {
1851 UNIMPLEMENTED;
1852 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1853 return 0;
1854 }
1855
1856
1857
1858 /*
1859 * @unimplemented
1860 */
1861 BOOL
1862 WINAPI
1863 GdiPlayPrivatePageEMF(HANDLE SpoolFileHandle,
1864 DWORD unknown,
1865 RECT *prectDocument)
1866 {
1867 UNIMPLEMENTED;
1868 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1869 return 0;
1870 }
1871
1872 /*
1873 * @unimplemented
1874 */
1875 VOID WINAPI GdiInitializeLanguagePack(DWORD InitParam)
1876 {
1877 UNIMPLEMENTED;
1878 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1879 }
1880
1881
1882 /*
1883 * @implemented
1884 */
1885 INT
1886 WINAPI
1887 ExcludeClipRect(IN HDC hdc, IN INT xLeft, IN INT yTop, IN INT xRight, IN INT yBottom)
1888 {
1889 /* FIXME some part need be done on user mode size */
1890 return NtGdiExcludeClipRect(hdc, xLeft, yTop, xRight, yBottom);
1891 }
1892
1893 /*
1894 * @implemented
1895 */
1896 INT
1897 WINAPI
1898 ExtSelectClipRgn( IN HDC hdc, IN HRGN hrgn, IN INT iMode)
1899 {
1900 /* FIXME some part need be done on user mode size */
1901 return NtGdiExtSelectClipRgn(hdc,hrgn, iMode);
1902 }
1903
1904 /*
1905 * @implemented
1906 */
1907 BOOL
1908 WINAPI
1909 GdiGradientFill(
1910 IN HDC hdc,
1911 IN PTRIVERTEX pVertex,
1912 IN ULONG nVertex,
1913 IN PVOID pMesh,
1914 IN ULONG nMesh,
1915 IN ULONG ulMode)
1916 {
1917 /* FIXME some part need be done in user mode */
1918 return NtGdiGradientFill(hdc, pVertex, nVertex, pMesh, nMesh, ulMode);
1919 }
1920
1921
1922 /*
1923 * @implemented
1924 */
1925 BOOL
1926 WINAPI
1927 GdiTransparentBlt(IN HDC hdcDst,
1928 IN INT xDst,
1929 IN INT yDst,
1930 IN INT cxDst,
1931 IN INT cyDst,
1932 IN HDC hdcSrc,
1933 IN INT xSrc,
1934 IN INT ySrc,
1935 IN INT cxSrc,
1936 IN INT cySrc,
1937 IN COLORREF TransColor
1938 )
1939 {
1940 /* FIXME some part need be done in user mode */
1941 return NtGdiTransparentBlt(hdcDst, xDst, yDst, cxDst, cyDst, hdcSrc, xSrc, ySrc, cxSrc, cySrc, TransColor);
1942 }
1943
1944 /*
1945 * @unimplemented
1946 */
1947 BOOL
1948 WINAPI
1949 GdiPrinterThunk(
1950 IN HUMPD humpd,
1951 DWORD *status,
1952 DWORD unuse)
1953 {
1954 /* FIXME figout the protypes, the HUMPD are a STRUCT or COM object */
1955 /* status contain some form of return value that being save, what it is I do not known */
1956 /* unsue seam have zero effect, what it is for I do not known */
1957
1958 // ? return NtGdiSetPUMPDOBJ(humpd->0x10,TRUE, humpd, ?) <- blackbox, OpenRCE info, and api hooks for anylaysing;
1959 return FALSE;
1960 }
1961
1962 /*
1963 * @unimplemented
1964 *
1965 */
1966 HBITMAP
1967 WINAPI
1968 GdiConvertBitmapV5(
1969 HBITMAP in_format_BitMap,
1970 HBITMAP src_BitMap,
1971 INT bpp,
1972 INT unuse)
1973 {
1974 /* FIXME guessing the prototypes */
1975
1976 /*
1977 * it have create a new bitmap with desired in format,
1978 * then convert it src_bitmap to new format
1979 * and return it as HBITMAP
1980 */
1981
1982 return FALSE;
1983 }
1984
1985 /*
1986 * @implemented
1987 *
1988 */
1989 int
1990 WINAPI
1991 GetClipBox(HDC hdc,
1992 LPRECT lprc)
1993 {
1994 return NtGdiGetAppClipBox(hdc, lprc);
1995 }
1996
1997 /*
1998 * @implemented
1999 *
2000 */
2001 DWORD
2002 WINAPI
2003 GetFontData(HDC hdc,
2004 DWORD dwTable,
2005 DWORD dwOffset,
2006 LPVOID lpvBuffer,
2007 DWORD cbData)
2008 {
2009 if (!lpvBuffer)
2010 {
2011 cbData = 0;
2012 }
2013 return NtGdiGetFontData(hdc, dwTable, dwOffset, lpvBuffer, cbData);
2014 }
2015
2016
2017 /*
2018 * @implemented
2019 *
2020 */
2021 DWORD
2022 WINAPI
2023 GetRegionData(HRGN hrgn,
2024 DWORD nCount,
2025 LPRGNDATA lpRgnData)
2026 {
2027 if (!lpRgnData)
2028 {
2029 nCount = 0;
2030 }
2031
2032 return NtGdiGetRegionData(hrgn,nCount,lpRgnData);
2033 }
2034
2035
2036 /*
2037 * @implemented
2038 *
2039 */
2040 INT
2041 WINAPI
2042 GetRgnBox(HRGN hrgn,
2043 LPRECT prcOut)
2044 {
2045 #if 0
2046 PRGN_ATTR Rgn_Attr;
2047 if (!GdiGetHandleUserData((HGDIOBJ) hRgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr))
2048 return NtGdiGetRgnBox(hrgn, prcOut);
2049 if (Rgn_Attr->Flags == NULLREGION)
2050 {
2051 prcOut->left = 0;
2052 prcOut->top = 0;
2053 prcOut->right = 0;
2054 prcOut->bottom = 0;
2055 }
2056 else
2057 {
2058 if (Rgn_Attr->Flags != SIMPLEREGION) return NtGdiGetRgnBox(hrgn, prcOut);
2059 *prcOut = Rgn_Attr->Rect;
2060 }
2061 return Rgn_Attr->Flags;
2062 #endif
2063 return NtGdiGetRgnBox(hrgn, prcOut);
2064 }
2065
2066
2067 /*
2068 * @implemented
2069 *
2070 */
2071 INT
2072 WINAPI
2073 OffsetRgn( HRGN hrgn,
2074 int nXOffset,
2075 int nYOffset)
2076 {
2077 /* FIXME some part are done in user mode */
2078 return NtGdiOffsetRgn(hrgn,nXOffset,nYOffset);
2079 }
2080
2081 /*
2082 * @implemented
2083 */
2084 INT
2085 WINAPI
2086 IntersectClipRect(HDC hdc,
2087 int nLeftRect,
2088 int nTopRect,
2089 int nRightRect,
2090 int nBottomRect)
2091 {
2092 #if 0
2093 // Handle something other than a normal dc object.
2094 if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
2095 {
2096 if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC)
2097 return MFDRV_IntersectClipRect( hdc, nLeftRect, nTopRect, nRightRect, nBottomRect);
2098 else
2099 {
2100 PLDC pLDC = GdiGetLDC(hdc);
2101 if ( pLDC )
2102 {
2103 if (pLDC->iType != LDC_EMFLDC || EMFDRV_IntersectClipRect( hdc, nLeftRect, nTopRect, nRightRect, nBottomRect))
2104 return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect);
2105 }
2106 else
2107 SetLastError(ERROR_INVALID_HANDLE);
2108 return 0;
2109 }
2110 }
2111 #endif
2112 return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect);
2113 }
2114
2115 /*
2116 * @implemented
2117 */
2118 INT
2119 WINAPI
2120 OffsetClipRgn(HDC hdc,
2121 int nXOffset,
2122 int nYOffset)
2123 {
2124 #if 0
2125 // Handle something other than a normal dc object.
2126 if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
2127 {
2128 if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC)
2129 return MFDRV_OffsetClipRgn( hdc, nXOffset, nYOffset );
2130 else
2131 {
2132 PLDC pLDC = GdiGetLDC(hdc);
2133 if ( !pLDC )
2134 {
2135 SetLastError(ERROR_INVALID_HANDLE);
2136 return 0;
2137 }
2138 if (pLDC->iType == LDC_EMFLDC && !EMFDRV_OffsetClipRgn( hdc, nXOffset, nYOffset ))
2139 return 0;
2140 return NtGdiOffsetClipRgn( hdc, nXOffset, nYOffset);
2141 }
2142 }
2143 #endif
2144 return NtGdiOffsetClipRgn( hdc, nXOffset, nYOffset);
2145 }
2146
2147
2148 INT
2149 WINAPI
2150 NamedEscape(HDC hdc,
2151 PWCHAR pDriver,
2152 INT iEsc,
2153 INT cjIn,
2154 LPSTR pjIn,
2155 INT cjOut,
2156 LPSTR pjOut)
2157 {
2158 /* FIXME metadc, metadc are done most in user mode, and we do not support it
2159 * Windows 2000/XP/Vista ignore the current hdc, that are being pass and always set hdc to NULL
2160 * when it calls to NtGdiExtEscape from NamedEscape
2161 */
2162 return NtGdiExtEscape(NULL,pDriver,wcslen(pDriver),iEsc,cjIn,pjIn,cjOut,pjOut);
2163 }
2164
2165
2166
2167 /*
2168 * @unimplemented
2169 */
2170
2171 /* FIXME wrong protypes, it is a fastcall api */
2172 DWORD
2173 WINAPI
2174 cGetTTFFromFOT(DWORD x1 ,DWORD x2 ,DWORD x3, DWORD x4, DWORD x5, DWORD x6, DWORD x7)
2175 {
2176 UNIMPLEMENTED;
2177 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
2178 return 0;
2179 }
2180