3 * reactos/lib/gdi32/misc/stubs.c
5 * GDI32.DLL Stubs for ANSI functions
7 * When you implement one of these functions,
8 * remove its stub from this file.
15 #undef WIN32_LEAN_AND_MEAN
17 #include <ddk/ntddk.h>
18 #include <win32k/text.h>
19 #include <win32k/metafile.h>
20 #include <win32k/dc.h>
21 #include <rosrtl/devmode.h>
22 #include <rosrtl/logfont.h>
23 #include <internal/heap.h>
30 AddFontResourceExA ( LPCSTR lpszFilename, DWORD fl, PVOID pvReserved )
36 Status = HEAP_strdupA2W ( &FilenameW, lpszFilename );
37 if ( !NT_SUCCESS (Status) )
38 SetLastError (RtlNtStatusToDosError(Status));
41 rc = AddFontResourceExW ( FilenameW, fl, pvReserved );
43 HEAP_free ( &FilenameW );
53 AddFontResourceA ( LPCSTR lpszFilename )
55 return AddFontResourceExA ( lpszFilename, 0, 0 );
73 Status = HEAP_strdupA2W ( &lpszFileW, lpszFile );
74 if (!NT_SUCCESS (Status))
75 SetLastError (RtlNtStatusToDosError(Status));
78 rc = NtGdiCopyMetaFile ( Src, lpszFileW );
80 HEAP_free ( lpszFileW );
96 CONST DEVMODEA * lpdvmInit
100 LPWSTR lpszDriverW, lpszDeviceW, lpszOutputW;
104 Status = HEAP_strdupA2W ( &lpszDriverW, lpszDriver );
105 if (!NT_SUCCESS (Status))
106 SetLastError (RtlNtStatusToDosError(Status));
109 Status = HEAP_strdupA2W ( &lpszDeviceW, lpszDevice );
110 if (!NT_SUCCESS (Status))
111 SetLastError (RtlNtStatusToDosError(Status));
114 Status = HEAP_strdupA2W ( &lpszOutputW, lpszOutput );
115 if (!NT_SUCCESS (Status))
116 SetLastError (RtlNtStatusToDosError(Status));
120 RosRtlDevModeA2W ( &dvmInitW, (const LPDEVMODEA)lpdvmInit );
122 rc = NtGdiCreateIC ( lpszDriverW,
125 lpdvmInit ? &dvmInitW : NULL );
127 HEAP_free ( lpszOutputW );
129 HEAP_free ( lpszDeviceW );
131 HEAP_free ( lpszDriverW );
150 Status = HEAP_strdupA2W ( &lpszFileW, lpszFile );
151 if (!NT_SUCCESS (Status))
152 SetLastError (RtlNtStatusToDosError(Status));
155 rc = NtGdiCreateMetaFile ( lpszFileW );
157 HEAP_free ( lpszFileW );
168 CreateScalableFontResourceA(
172 LPCSTR lpszCurrentPath
176 LPWSTR lpszFontResW, lpszFontFileW, lpszCurrentPathW;
179 Status = HEAP_strdupA2W ( &lpszFontResW, lpszFontRes );
180 if (!NT_SUCCESS (Status))
181 SetLastError (RtlNtStatusToDosError(Status));
184 Status = HEAP_strdupA2W ( &lpszFontFileW, lpszFontFile );
185 if (!NT_SUCCESS (Status))
186 SetLastError (RtlNtStatusToDosError(Status));
189 Status = HEAP_strdupA2W ( &lpszCurrentPathW, lpszCurrentPath );
190 if (!NT_SUCCESS (Status))
191 SetLastError (RtlNtStatusToDosError(Status));
194 rc = NtGdiCreateScalableFontResource ( fdwHidden,
199 HEAP_free ( lpszCurrentPathW );
202 HEAP_free ( lpszFontFileW );
205 HEAP_free ( lpszFontResW );
216 DeviceCapabilitiesExA(
221 CONST DEVMODEA *pDevMode
224 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
234 EnumFontFamiliesExA (
236 LPLOGFONTA lpLogFont,
237 FONTENUMEXPROCA lpEnumFontFamProc,
242 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
247 RosRtlLogFontA2W ( &LogFontW, lpLogFont );
249 /* no need to convert LogFontW back to lpLogFont b/c it's an [in] parameter only */
250 return NtGdiEnumFontFamiliesEx ( hdc, &LogFontW, lpEnumFontFamProc, lParam, dwFlags );
263 FONTENUMPROCA lpEnumFontFamProc,
267 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
274 Status = HEAP_strdupA2W ( &lpszFamilyW, lpszFamily );
275 if (!NT_SUCCESS (Status))
276 SetLastError (RtlNtStatusToDosError(Status));
279 rc = NtGdiEnumFontFamilies ( hdc, lpszFamilyW, lpEnumFontFamProc, lParam );
281 HEAP_free ( lpszFamilyW );
297 FONTENUMPROCA FontFunc,
301 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
308 Status = HEAP_strdupA2W ( &lpFaceNameW, lpFaceName );
309 if (!NT_SUCCESS (Status))
310 SetLastError (RtlNtStatusToDosError(Status));
313 rc = NtGdiEnumFonts ( hDC, lpFaceNameW, FontFunc, lParam );
315 HEAP_free ( lpFaceNameW );
334 /* FIXME what to do with iFirstChar and iLastChar ??? */
335 return NtGdiGetCharWidth ( hdc, iFirstChar, iLastChar, lpBuffer );
351 /* FIXME what to do with iFirstChar and iLastChar ??? */
352 return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
368 /* FIXME what to do with iFirstChar and iLastChar ??? */
369 return NtGdiGetCharWidthFloat ( hdc, iFirstChar, iLastChar, pxBuffer );
385 /* FIXME what to do with uFirstChar and uLastChar ??? */
386 return NtGdiGetCharABCWidths ( hdc, uFirstChar, uLastChar, lpabc );
395 GetCharABCWidthsFloatA(
402 /* FIXME what to do with iFirstChar and iLastChar ??? */
403 return NtGdiGetCharABCWidthsFloat ( hdc, iFirstChar, iLastChar, lpABCF );
422 return NtGdiGetGlyphOutline ( hdc, uChar, uFormat, lpgm, cbBuffer, lpvBuffer, (CONST LPMAT2)lpmat2 );
436 LPWSTR lpszMetaFileW;
439 Status = HEAP_strdupA2W ( &lpszMetaFileW, lpszMetaFile );
440 if (!NT_SUCCESS (Status))
441 SetLastError (RtlNtStatusToDosError(Status));
444 rc = NtGdiGetMetaFile ( lpszMetaFileW );
446 HEAP_free ( lpszMetaFileW );
458 GetOutlineTextMetricsA(
461 LPOUTLINETEXTMETRICA lpOTM
464 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
474 GetTextExtentExPointA(
488 Status = HEAP_strdupA2W ( &lpszStrW, lpszStr );
489 if (!NT_SUCCESS (Status))
490 SetLastError (RtlNtStatusToDosError(Status));
493 rc = NtGdiGetTextExtentExPoint (
494 hdc, lpszStrW, cchString, nMaxExtent, lpnFit, alpDx, lpSize );
496 HEAP_free ( lpszStrW );
508 GetCharacterPlacementA(
517 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
529 CONST DEVMODEA *lpInitData
534 RosRtlDevModeA2W ( &InitDataW, (CONST LPDEVMODEA)lpInitData );
536 return NtGdiResetDC ( hdc, &InitDataW );
553 Status = HEAP_strdupA2W ( &lpFileNameW, lpFileName );
554 if (!NT_SUCCESS (Status))
555 SetLastError (RtlNtStatusToDosError(Status));
558 rc = NtGdiRemoveFontResource ( lpFileNameW );
560 HEAP_free ( lpFileNameW );
573 HENHMETAFILE hemfSrc,
581 Status = HEAP_strdupA2W ( &lpszFileW, lpszFile );
582 if (!NT_SUCCESS (Status))
583 SetLastError (RtlNtStatusToDosError(Status));
586 rc = NtGdiCopyEnhMetaFile ( hemfSrc, lpszFileW );
588 HEAP_free ( lpszFileW );
607 LPWSTR lpFileNameW, lpDescriptionW;
610 Status = HEAP_strdupA2W ( &lpFileNameW, lpFileName );
611 if (!NT_SUCCESS (Status))
612 SetLastError (RtlNtStatusToDosError(Status));
615 Status = HEAP_strdupA2W ( &lpDescriptionW, lpDescription );
616 if (!NT_SUCCESS (Status))
617 SetLastError (RtlNtStatusToDosError(Status));
620 rc = NtGdiCreateEnhMetaFile (
621 hdc, lpFileNameW, (CONST LPRECT)lpRect, lpDescriptionW );
623 HEAP_free ( lpDescriptionW );
625 HEAP_free ( lpFileNameW );
642 LPWSTR lpszMetaFileW;
645 Status = HEAP_strdupA2W ( &lpszMetaFileW, lpszMetaFile );
646 if (!NT_SUCCESS (Status))
647 SetLastError (RtlNtStatusToDosError(Status));
650 rc = NtGdiGetEnhMetaFile ( lpszMetaFileW );
652 HEAP_free ( lpszMetaFileW );
664 GetEnhMetaFileDescriptionA(
667 LPSTR lpszDescription
671 LPWSTR lpszDescriptionW;
674 if ( lpszDescription && cchBuffer )
676 lpszDescriptionW = (LPWSTR)HEAP_alloc ( cchBuffer*sizeof(WCHAR) );
677 if ( !lpszDescriptionW )
679 SetLastError (RtlNtStatusToDosError(STATUS_NO_MEMORY));
684 lpszDescriptionW = NULL;
686 rc = NtGdiGetEnhMetaFileDescription ( hemf, cchBuffer, lpszDescriptionW );
688 if ( lpszDescription && cchBuffer )
690 Status = RtlUnicodeToMultiByteN ( lpszDescription,
695 HEAP_free ( lpszDescriptionW );
696 if ( !NT_SUCCESS(Status) )
698 SetLastError (RtlNtStatusToDosError(Status));
717 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
733 return NtGdiGetObject ( a0, a1, a2 );
748 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
764 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
780 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
796 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
810 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
822 DWORD a1, /* MS says LPDWORD! */
826 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
841 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
858 * FIXME - call NtGdiEnumICMProfiles with NULL for lpstrBuffer
859 * to find out how big a buffer we need. Then allocate that buffer
860 * and call NtGdiEnumICMProfiles again to have the buffer filled.
862 * Finally, step through the buffer ( MULTI-SZ recommended for format ),
863 * and convert each string to ANSI, calling the user's callback function
864 * until we run out of strings or the user returns FALSE
867 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
884 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
902 LPGLYPHMETRICSFLOAT a7
905 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
922 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);