1 /* $Id: stubsa.c,v 1.25 2003/11/15 15:18:06 weiden Exp $
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/dc.h>
20 #include <rosrtl/devmode.h>
21 #include <rosrtl/logfont.h>
22 #include <internal/heap.h>
29 AddFontResourceExA ( LPCSTR lpszFilename
, DWORD fl
, PVOID pvReserved
)
35 Status
= HEAP_strdupA2W ( &FilenameW
, lpszFilename
);
36 if ( !NT_SUCCESS (Status
) )
37 SetLastError (RtlNtStatusToDosError(Status
));
40 rc
= AddFontResourceExW ( FilenameW
, fl
, pvReserved
);
42 HEAP_free ( &FilenameW
);
52 AddFontResourceA ( LPCSTR lpszFilename
)
54 return AddFontResourceExA ( lpszFilename
, 0, 0 );
67 CONST DEVMODEA
* lpdvmInit
71 LPWSTR lpszDriverW
, lpszDeviceW
, lpszOutputW
;
75 Status
= HEAP_strdupA2W ( &lpszDriverW
, lpszDriver
);
76 if (!NT_SUCCESS (Status
))
77 SetLastError (RtlNtStatusToDosError(Status
));
80 Status
= HEAP_strdupA2W ( &lpszDeviceW
, lpszDevice
);
81 if (!NT_SUCCESS (Status
))
82 SetLastError (RtlNtStatusToDosError(Status
));
85 Status
= HEAP_strdupA2W ( &lpszOutputW
, lpszOutput
);
86 if (!NT_SUCCESS (Status
))
87 SetLastError (RtlNtStatusToDosError(Status
));
91 RosRtlDevModeA2W ( &dvmInitW
, (const LPDEVMODEA
)lpdvmInit
);
93 rc
= NtGdiCreateIC ( lpszDriverW
,
96 lpdvmInit
? &dvmInitW
: NULL
);
98 HEAP_free ( lpszOutputW
);
100 HEAP_free ( lpszDeviceW
);
102 HEAP_free ( lpszDriverW
);
113 CreateScalableFontResourceA(
117 LPCSTR lpszCurrentPath
121 LPWSTR lpszFontResW
, lpszFontFileW
, lpszCurrentPathW
;
124 Status
= HEAP_strdupA2W ( &lpszFontResW
, lpszFontRes
);
125 if (!NT_SUCCESS (Status
))
126 SetLastError (RtlNtStatusToDosError(Status
));
129 Status
= HEAP_strdupA2W ( &lpszFontFileW
, lpszFontFile
);
130 if (!NT_SUCCESS (Status
))
131 SetLastError (RtlNtStatusToDosError(Status
));
134 Status
= HEAP_strdupA2W ( &lpszCurrentPathW
, lpszCurrentPath
);
135 if (!NT_SUCCESS (Status
))
136 SetLastError (RtlNtStatusToDosError(Status
));
139 rc
= NtGdiCreateScalableFontResource ( fdwHidden
,
144 HEAP_free ( lpszCurrentPathW
);
147 HEAP_free ( lpszFontFileW
);
150 HEAP_free ( lpszFontResW
);
161 DeviceCapabilitiesExA(
166 CONST DEVMODEA
*pDevMode
169 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
179 EnumFontFamiliesExA (
181 LPLOGFONTA lpLogFont
,
182 FONTENUMEXPROCA lpEnumFontFamProc
,
187 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
192 RosRtlLogFontA2W ( &LogFontW
, lpLogFont
);
194 /* no need to convert LogFontW back to lpLogFont b/c it's an [in] parameter only */
195 return NtGdiEnumFontFamiliesEx ( hdc
, &LogFontW
, lpEnumFontFamProc
, lParam
, dwFlags
);
208 FONTENUMPROCA lpEnumFontFamProc
,
212 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
219 Status
= HEAP_strdupA2W ( &lpszFamilyW
, lpszFamily
);
220 if (!NT_SUCCESS (Status
))
221 SetLastError (RtlNtStatusToDosError(Status
));
224 rc
= NtGdiEnumFontFamilies ( hdc
, lpszFamilyW
, lpEnumFontFamProc
, lParam
);
226 HEAP_free ( lpszFamilyW
);
242 FONTENUMPROCA FontFunc
,
246 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
253 Status
= HEAP_strdupA2W ( &lpFaceNameW
, lpFaceName
);
254 if (!NT_SUCCESS (Status
))
255 SetLastError (RtlNtStatusToDosError(Status
));
258 rc
= NtGdiEnumFonts ( hDC
, lpFaceNameW
, FontFunc
, lParam
);
260 HEAP_free ( lpFaceNameW
);
279 /* FIXME what to do with iFirstChar and iLastChar ??? */
280 return NtGdiGetCharWidth ( hdc
, iFirstChar
, iLastChar
, lpBuffer
);
296 /* FIXME what to do with iFirstChar and iLastChar ??? */
297 return NtGdiGetCharWidth32 ( hdc
, iFirstChar
, iLastChar
, lpBuffer
);
313 /* FIXME what to do with iFirstChar and iLastChar ??? */
314 return NtGdiGetCharWidthFloat ( hdc
, iFirstChar
, iLastChar
, pxBuffer
);
330 /* FIXME what to do with uFirstChar and uLastChar ??? */
331 return NtGdiGetCharABCWidths ( hdc
, uFirstChar
, uLastChar
, lpabc
);
340 GetCharABCWidthsFloatA(
347 /* FIXME what to do with iFirstChar and iLastChar ??? */
348 return NtGdiGetCharABCWidthsFloat ( hdc
, iFirstChar
, iLastChar
, lpABCF
);
367 return NtGdiGetGlyphOutline ( hdc
, uChar
, uFormat
, lpgm
, cbBuffer
, lpvBuffer
, (CONST LPMAT2
)lpmat2
);
376 GetOutlineTextMetricsA(
379 LPOUTLINETEXTMETRICA lpOTM
382 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
392 GetTextExtentExPointA(
406 Status
= HEAP_strdupA2W ( &lpszStrW
, lpszStr
);
407 if (!NT_SUCCESS (Status
))
408 SetLastError (RtlNtStatusToDosError(Status
));
411 rc
= NtGdiGetTextExtentExPoint (
412 hdc
, lpszStrW
, cchString
, nMaxExtent
, lpnFit
, alpDx
, lpSize
);
414 HEAP_free ( lpszStrW
);
426 GetCharacterPlacementA(
435 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
447 CONST DEVMODEA
*lpInitData
452 RosRtlDevModeA2W ( &InitDataW
, (CONST LPDEVMODEA
)lpInitData
);
454 return NtGdiResetDC ( hdc
, &InitDataW
);
471 Status
= HEAP_strdupA2W ( &lpFileNameW
, lpFileName
);
472 if (!NT_SUCCESS (Status
))
473 SetLastError (RtlNtStatusToDosError(Status
));
476 rc
= NtGdiRemoveFontResource ( lpFileNameW
);
478 HEAP_free ( lpFileNameW
);
495 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
511 return NtGdiGetObject ( a0
, a1
, a2
);
526 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
542 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
558 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
574 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
588 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
600 DWORD a1
, /* MS says LPDWORD! */
604 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
619 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
636 * FIXME - call NtGdiEnumICMProfiles with NULL for lpstrBuffer
637 * to find out how big a buffer we need. Then allocate that buffer
638 * and call NtGdiEnumICMProfiles again to have the buffer filled.
640 * Finally, step through the buffer ( MULTI-SZ recommended for format ),
641 * and convert each string to ANSI, calling the user's callback function
642 * until we run out of strings or the user returns FALSE
645 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
662 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
680 LPGLYPHMETRICSFLOAT a7
683 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
700 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);