ANSI/UNICODE struct separation patch by Royce3, ANSI/UNICODE WNDCLASS separation...
[reactos.git] / reactos / lib / user32 / windows / class.c
1 /* $Id: class.c,v 1.22 2003/08/05 15:41:03 weiden Exp $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS user32.dll
5 * FILE: lib/user32/windows/class.c
6 * PURPOSE: Window classes
7 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
8 * UPDATE HISTORY:
9 * 09-05-2001 CSH Created
10 */
11 #include <windows.h>
12 #include <user32.h>
13 #include <string.h>
14 #include <stdlib.h>
15 #include <debug.h>
16
17 /*
18 * @unimplemented
19 */
20 WINBOOL
21 STDCALL
22 GetClassInfoA(
23 HINSTANCE hInstance,
24 LPCSTR lpClassName,
25 LPWNDCLASSA lpWndClass)
26 {
27 UNIMPLEMENTED;
28 return FALSE;
29 }
30
31
32 /*
33 * @unimplemented
34 */
35 WINBOOL
36 STDCALL
37 GetClassInfoExA(
38 HINSTANCE hinst,
39 LPCSTR lpszClass,
40 LPWNDCLASSEXA lpwcx)
41 {
42 UNIMPLEMENTED;
43 return FALSE;
44 }
45
46
47 /*
48 * @unimplemented
49 */
50 WINBOOL
51 STDCALL
52 GetClassInfoExW(
53 HINSTANCE hinst,
54 LPCWSTR lpszClass,
55 LPWNDCLASSEXW lpwcx)
56 {
57 UNIMPLEMENTED;
58 return FALSE;
59 }
60
61
62 /*
63 * @unimplemented
64 */
65 WINBOOL
66 STDCALL
67 GetClassInfoW(
68 HINSTANCE hInstance,
69 LPCWSTR lpClassName,
70 LPWNDCLASSW lpWndClass)
71 {
72 UNIMPLEMENTED;
73 return FALSE;
74 }
75
76
77 /*
78 * @implemented
79 */
80 DWORD STDCALL
81 GetClassLongA(HWND hWnd, int nIndex)
82 {
83 return(NtUserGetClassLong(hWnd, nIndex, TRUE));
84 }
85
86 /*
87 * @implemented
88 */
89 DWORD STDCALL
90 GetClassLongW(HWND hWnd, int nIndex)
91 {
92 return(NtUserGetClassLong(hWnd, nIndex, FALSE));
93 }
94
95
96 /*
97 * @implemented
98 */
99 int
100 STDCALL
101 GetClassNameA(
102 HWND hWnd,
103 LPSTR lpClassName,
104 int nMaxCount)
105 {
106 int result;
107 LPWSTR ClassName;
108 NTSTATUS Status;
109 ClassName = RtlAllocateHeap(RtlGetProcessHeap(),HEAP_ZERO_MEMORY,nMaxCount);
110 result = NtUserGetClassName(hWnd, ClassName, nMaxCount);
111 Status = RtlUnicodeToMultiByteN (lpClassName,
112 result,
113 NULL,
114 ClassName,
115 result);
116 if (!NT_SUCCESS(Status))
117 {
118 return 0;
119 }
120 RtlFreeHeap(RtlGetProcessHeap(),0,ClassName);
121 return result;
122 }
123
124
125 /*
126 * @implemented
127 */
128 int
129 STDCALL
130 GetClassNameW(
131 HWND hWnd,
132 LPWSTR lpClassName,
133 int nMaxCount)
134 {
135 int result;
136 LPWSTR ClassName;
137 ClassName = RtlAllocateHeap(RtlGetProcessHeap(),HEAP_ZERO_MEMORY,nMaxCount);
138 result = NtUserGetClassName(hWnd, ClassName, nMaxCount);
139 RtlCopyMemory(ClassName,lpClassName,result);
140 RtlFreeHeap(RtlGetProcessHeap(),0,ClassName);
141 return result;
142 }
143
144
145 /*
146 * @unimplemented
147 */
148 WORD
149 STDCALL
150 GetClassWord(
151 HWND hWnd,
152 int nIndex)
153 /*
154 * NOTE: Obsoleted in 32-bit windows
155 */
156 {
157 UNIMPLEMENTED;
158 return 0;
159 }
160
161
162 /*
163 * @implemented
164 */
165 LONG STDCALL
166 GetWindowLongA(HWND hWnd, int nIndex)
167 {
168 return NtUserGetWindowLong(hWnd, nIndex, TRUE);
169 }
170
171
172 /*
173 * @implemented
174 */
175 LONG STDCALL
176 GetWindowLongW(HWND hWnd, int nIndex)
177 {
178 return NtUserGetWindowLong(hWnd, nIndex, FALSE);
179 }
180
181
182 /*
183 * @unimplemented
184 */
185 UINT
186 STDCALL
187 RealGetWindowClass(
188 HWND hwnd,
189 LPSTR pszType,
190 UINT cchType)
191 {
192 UNIMPLEMENTED;
193 return 0;
194 }
195
196
197 /*
198 * @unimplemented
199 */
200 UINT
201 STDCALL
202 RealGetWindowClassA(
203 HWND hwnd,
204 LPSTR pszType,
205 UINT cchType)
206 {
207 UNIMPLEMENTED;
208 return 0;
209 }
210
211
212 /*
213 * @unimplemented
214 */
215 UINT
216 STDCALL
217 RealGetWindowClassW(
218 HWND hwnd,
219 LPWSTR pszType,
220 UINT cchType)
221 {
222 UNIMPLEMENTED;
223 return 0;
224 }
225
226
227 /*
228 * @implemented
229 */
230 ATOM STDCALL
231 RegisterClassA(CONST WNDCLASSA *lpWndClass)
232 {
233 WNDCLASSEXA Class;
234
235 RtlMoveMemory ( &Class.style, lpWndClass, sizeof(WNDCLASSA));
236 Class.cbSize = sizeof(WNDCLASSEXA);
237 Class.hIconSm = INVALID_HANDLE_VALUE;
238 return RegisterClassExA(&Class);
239 }
240
241
242 /*
243 * @implemented
244 */
245 ATOM STDCALL
246 RegisterClassExA(CONST WNDCLASSEXA *lpwcx)
247 {
248 RTL_ATOM Atom;
249
250 Atom = NtUserRegisterClassExWOW(0,(WNDCLASSEXA*)lpwcx,
251 FALSE,
252 0,
253 0,
254 0);
255
256 return (ATOM)Atom;
257 }
258
259
260 /*
261 * @implemented
262 */
263 ATOM STDCALL
264 RegisterClassExW(CONST WNDCLASSEXW *lpwcx)
265 {
266 RTL_ATOM Atom;
267
268 Atom = NtUserRegisterClassExWOW((WNDCLASSEXW*)lpwcx,
269 0,
270 TRUE,
271 0,
272 0,
273 0);
274
275 return (ATOM)Atom;
276 }
277
278
279 /*
280 * @implemented
281 */
282 ATOM STDCALL
283 RegisterClassW(CONST WNDCLASSW *lpWndClass)
284 {
285 WNDCLASSEXW Class;
286
287 RtlMoveMemory(&Class.style, lpWndClass, sizeof(WNDCLASSW));
288 Class.cbSize = sizeof(WNDCLASSEXW);
289 Class.hIconSm = INVALID_HANDLE_VALUE;
290 return RegisterClassExW(&Class);
291 }
292
293
294 /*
295 * @mplemented
296 */
297 DWORD
298 STDCALL
299 SetClassLongA(
300 HWND hWnd,
301 int nIndex,
302 LONG dwNewLong)
303 {
304 return(NtUserSetClassLong(hWnd, nIndex, dwNewLong, TRUE));
305 }
306
307
308 /*
309 * @implemented
310 */
311 DWORD
312 STDCALL
313 SetClassLongW(
314 HWND hWnd,
315 int nIndex,
316 LONG dwNewLong)
317 {
318 return(NtUserSetClassLong(hWnd, nIndex, dwNewLong, FALSE));
319 }
320
321
322 /*
323 * @unimplemented
324 */
325 WORD
326 STDCALL
327 SetClassWord(
328 HWND hWnd,
329 int nIndex,
330 WORD wNewWord)
331 /*
332 * NOTE: Obsoleted in 32-bit windows
333 */
334 {
335 UNIMPLEMENTED;
336 return 0;
337 }
338
339
340 /*
341 * @implemented
342 */
343 LONG
344 STDCALL
345 SetWindowLongA(
346 HWND hWnd,
347 int nIndex,
348 LONG dwNewLong)
349 {
350 return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, TRUE);
351 }
352
353
354 /*
355 * @implemented
356 */
357 LONG
358 STDCALL
359 SetWindowLongW(
360 HWND hWnd,
361 int nIndex,
362 LONG dwNewLong)
363 {
364 return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE);
365 }
366
367
368 /*
369 * @unimplemented
370 */
371 WINBOOL
372 STDCALL
373 UnregisterClassA(
374 LPCSTR lpClassName,
375 HINSTANCE hInstance)
376 {
377 UNIMPLEMENTED;
378 return FALSE;
379 }
380
381
382 /*
383 * @unimplemented
384 */
385 WINBOOL
386 STDCALL
387 UnregisterClassW(
388 LPCWSTR lpClassName,
389 HINSTANCE hInstance)
390 {
391 UNIMPLEMENTED;
392 return FALSE;
393 }
394
395 /* EOF */