- Merge from trunk up to r45543
[reactos.git] / dll / win32 / gdi32 / misc / stubsa.c
1 /*
2 * dll/win32/gdi32/misc/stubsa.c
3 *
4 * GDI32.DLL Stubs for ANSI functions
5 *
6 * When you implement one of these functions,
7 * remove its stub from this file.
8 *
9 */
10
11 #include "precomp.h"
12 #include <debug.h>
13
14
15 /*
16 * @unimplemented
17 */
18 BOOL
19 WINAPI
20 PolyTextOutA( HDC hdc, const POLYTEXTA *pptxt, INT cStrings )
21 {
22 for (; cStrings>0; cStrings--, pptxt++)
23 if (!ExtTextOutA( hdc, pptxt->x, pptxt->y, pptxt->uiFlags, &pptxt->rcl, pptxt->lpstr, pptxt->n, pptxt->pdx ))
24 return FALSE;
25 return TRUE;
26 }
27
28 /*
29 * @unimplemented
30 */
31 BOOL
32 WINAPI
33 GetLogColorSpaceA(
34 HCOLORSPACE a0,
35 LPLOGCOLORSPACEA a1,
36 DWORD a2
37 )
38 {
39 UNIMPLEMENTED;
40 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
41 return FALSE;
42 }
43
44
45 /*
46 * @unimplemented
47 */
48 BOOL
49 WINAPI
50 GetICMProfileA(
51 HDC hdc,
52 LPDWORD pBufSize,
53 LPSTR pszFilename
54 )
55 {
56 WCHAR filenameW[MAX_PATH];
57 DWORD buflen = MAX_PATH;
58 BOOL ret = FALSE;
59
60 if (!hdc || !pBufSize || !pszFilename) return FALSE;
61
62 if (GetICMProfileW(hdc, &buflen, filenameW))
63 {
64 int len = WideCharToMultiByte(CP_ACP, 0, filenameW, -1, NULL, 0, NULL, NULL);
65 if (*pBufSize >= len)
66 {
67 WideCharToMultiByte(CP_ACP, 0, filenameW, -1, pszFilename, *pBufSize, NULL, NULL);
68 ret = TRUE;
69 }
70 else SetLastError(ERROR_INSUFFICIENT_BUFFER);
71 *pBufSize = len;
72 }
73
74 return ret;
75 }
76
77
78 /*
79 * @unimplemented
80 */
81 BOOL
82 WINAPI
83 SetICMProfileA(
84 HDC a0,
85 LPSTR a1
86 )
87 {
88 UNIMPLEMENTED;
89 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
90 return FALSE;
91 }
92
93
94 /*
95 * @unimplemented
96 */
97 int
98 WINAPI
99 EnumICMProfilesA(
100 HDC a0,
101 ICMENUMPROCA a1,
102 LPARAM a2
103 )
104 {
105 /*
106 * FIXME - call NtGdiEnumICMProfiles with NULL for lpstrBuffer
107 * to find out how big a buffer we need. Then allocate that buffer
108 * and call NtGdiEnumICMProfiles again to have the buffer filled.
109 *
110 * Finally, step through the buffer ( MULTI-SZ recommended for format ),
111 * and convert each string to ANSI, calling the user's callback function
112 * until we run out of strings or the user returns FALSE
113 */
114
115 UNIMPLEMENTED;
116 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
117 return 0;
118 }
119
120
121 /*
122 * @unimplemented
123 */
124 BOOL
125 WINAPI
126 UpdateICMRegKeyA(
127 DWORD a0,
128 LPSTR a1,
129 LPSTR a2,
130 UINT a3
131 )
132 {
133 UNIMPLEMENTED;
134 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
135 return FALSE;
136 }
137
138 /*
139 * @implemented
140 */
141 UINT
142 WINAPI
143 GetStringBitmapA(HDC hdc,
144 LPSTR psz,
145 BOOL DoCall,
146 UINT cj,
147 BYTE *lpSB)
148 {
149
150 NTSTATUS Status;
151 PWSTR pwsz;
152 UINT retValue = 0;
153
154 if (DoCall)
155 {
156 Status = HEAP_strdupA2W ( &pwsz, psz );
157 if ( !NT_SUCCESS (Status) )
158 {
159 SetLastError (RtlNtStatusToDosError(Status));
160 }
161 else
162 {
163 retValue = NtGdiGetStringBitmapW(hdc, pwsz, 1, lpSB, cj);
164 HEAP_free ( pwsz );
165 }
166 }
167
168 return retValue;
169
170 }
171
172
173 /* EOF */