2 # Copyright 1999, 2000, 2001 Patrik Stridvall
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 package winapi_module_user
;
23 use vars
qw($VERSION @ISA @EXPORT @EXPORT_OK);
30 get_message_result_type
31 get_message_result_kind
32 get_message_wparam_type
33 get_message_wparam_kind
34 get_message_lparam_type
35 get_message_lparam_kind
38 use config
qw($wine_dir);
39 use options qw($options);
40 use output qw($output);
44 ########################################################################
48 ########################################################################
51 sub is_user_function($) {
53 if($name =~ /^(?:DefWindowProc|SendMessage)[AW]?$/) {
57 ########################################################################
62 id => 0x0006, result => "void", wparam => ["", ""], lparam => "HWND" },
64 id => 0x001c, result => "void", wparam => "BOOL", lparam => "DWORD" },
65 WM_ACTIVATESHELLWINDOW => {
66 id => 0x003e, result => "", wparam => "", lparam => "" },
67 WM_ACTIVATETOPLEVEL => {
68 id => 0x036e, result => "", wparam => "", lparam => "" },
70 id => 0x0029, result => "", wparam => "", lparam => "" },
72 id => 0x8000, result => "", wparam => "", lparam => "" },
73 WM_ASKCBFORMATNAME => {
74 id => 0x030c, result => "void", wparam => "int", lparam => "LPTSTR" },
77 id => 0x022c, result => "", wparam => "", lparam => "" },
80 id => 0x001f, result => "void", wparam => "void", lparam => "void" },
82 id => 0x004b, result => "", wparam => "", lparam => "" },
83 WM_CAPTURECHANGED => {
84 id => 0x0215, result => "void", wparam => "void", lparam => "HWND" },
86 id => 0x030d, result => "void", wparam => "HWND", lparam => "HWND" },
88 id => 0x0022, result => "void", wparam => "void", lparam => "void" },
90 id => 0x0303, result => "void", wparam => "void", lparam => "void" },
92 id => 0x0102, result => "void", wparam => "TCHAR", lparam => ["", ""] },
94 id => 0x002f, result => "int", wparam => ["UINT", "UINT"], lparam => "HWND" },
96 id => 0x0010, result => "void", wparam => "void", lparam => "void" },
97 WM_COALESCE_FIRST => {
98 id => 0x0390, result => "", wparam => "", lparam => "" },
100 id => 0x039f, result => "", wparam => "", lparam => "" },
102 id => 0x0111, result => "void", wparam => ["UINT", "UINT"], lparam => "HWND" },
104 id => 0x0365, result => "", wparam => "", lparam => "" },
106 id => 0x0044, result => "void", wparam => "int", lparam => ["", ""] },
108 id => 0x007b, result => "void", wparam => "HWND", lparam => ["UINT", "UINT"] },
110 id => 0x0301, result => "void", wparam => "void", lparam => "void" },
112 id => 0x004a, result => "", wparam => "", lparam => "" },
114 id => 0x0041, result => "void", wparam => "UINT", lparam => "void" },
116 id => 0x0039, result => "int", wparam => "UINT", lparam => "const COMPAREITEMSTRUCT *" },
118 id => 0x0001, result => "BOOL", wparam => "void", lparam => "LPCREATESTRUCT" },
120 id => 0x0019, result => "", wparam => "", lparam => "" },
122 id => 0x0135, result => "HBRUSH", wparam => "HDC", lparam => "HWND" },
124 id => 0x136, result => "HBRUSH", wparam => "HDC", lparam => "HWND" },
126 id => 0x133, result => "HBRUSH", wparam => "HDC", lparam => "HWND" },
127 WM_CTLCOLORLISTBOX => {
128 id => 0x134, result => "HBRUSH", wparam => "HDC", lparam => "HWND" },
129 WM_CTLCOLORMSGBOX => {
130 id => 0x132, result => "HBRUSH", wparam => "HDC", lparam => "HWND" },
131 WM_CTLCOLORSCROLLBAR => {
132 id => 0x137, result => "HBRUSH", wparam => "HDC", lparam => "HWND" },
133 WM_CTLCOLORSTATIC => {
134 id => 0x138, result => "HBRUSH", wparam => "HDC", lparam => "HWND" },
136 id => 0x0300, result => "void", wparam => "void", lparam => "void" },
138 WM_DDE_ACK => { # FIXME: Only correct if replying to WM_DDE_INITIATE
139 id => 0x03E4, result => "void", wparam => "HWND", lparam => ["ATOM", "ATOM"] },
141 id => 0x03E0, result => "void", wparam => "HWND", lparam => ["ATOM", "ATOM"] },
143 id => 0x0103, result => "void", wparam => "TCHAR", lparam => ["", ""] },
145 id => 0x0219, result => "BOOL", wparam => "UINT", lparam => "DWORD" },
147 id => 0x002d, result => "void", wparam => "UINT", lparam => "const DELETEITEMSTRUCT *" },
148 WM_DEVMODECHANGE => {
149 id => 0x001b, result => "void", wparam => "void", lparam => "LPCTSTR" },
151 id => 0x0002, result => "void", wparam => "void", lparam => "void" },
152 WM_DESTROYCLIPBOARD => {
153 id => 0x0307, result => "void", wparam => "void", lparam => "void" },
155 id => 0x036c, result => "", wparam => "", lparam => "" },
156 WM_DISPLAYCHANGE => {
157 id => 0x007e, result => "void", wparam => "UINT", lparam => ["UINT", "UINT"] },
159 id => 0x022d, result => "", wparam => "", lparam => "" },
161 id => 0x022f, result => "", wparam => "", lparam => "" },
163 id => 0x022e, result => "", wparam => "", lparam => "" },
164 WM_DRAWCLIPBOARD => {
165 id => 0x0308, result => "void", wparam => "void", lparam => "void" },
167 id => 0x002b, result => "void", wparam => "UINT", lparam => "const DRAWITEMSTRUCT *" },
169 id => 0x0233, result => "void", wparam => "HDROP", lparam => "void" },
171 id => 0x022a, result => "", wparam => "", lparam => "" },
174 id => 0x000a, result => "void", wparam => "BOOL", lparam => "void" },
176 id => 0x0016, result => "void", wparam => "BOOL", lparam => "void" },
178 id => 0x0121, result => "void", wparam => "UINT", lparam => "HWND" },
179 WM_ENTERSIZEMOVE => {
180 id => 0x0231, result => "", wparam => "", lparam => "" },
181 WM_ENTERMENULOOP => {
182 id => 0x0211, result => "", wparam => "", lparam => "" },
184 id => 0x0014, result => "BOOL", wparam => "HDC", lparam => "void" },
186 id => 0x0367, result => "", wparam => "", lparam => "" },
188 id => 0x0212, result => "", wparam => "", lparam => "" },
190 id => 0x0232, result => "", wparam => "", lparam => "" },
192 WM_FILESYSCHANGE => {
193 id => 0x0034, result => "", wparam => "", lparam => "" },
195 id => 0x036d, result => "", wparam => "", lparam => "" },
197 id => 0x001d, result => "void", wparam => "void", lparam => "void" },
200 id => 0x0087, result => "UINT", wparam => "WPARAM", lparam => "LPMSG" },
202 id => 0x0031, result => "HFONT", wparam => "void", lparam => "void" },
204 id => 0x0033, result => "", wparam => "", lparam => "" },
206 id => 0x007f, result => "", wparam => "", lparam => "" },
207 WM_GETMINMAXINFO => {
208 id => 0x0024, result => "void", wparam => "void", lparam => "LPMINMAXINFO" },
210 id => 0x000d, result => "int", wparam => "int", lparam => "LPTSTR" },
211 WM_GETTEXTLENGTH => {
212 id => 0x000e, result => "int", wparam => "void", lparam => "void" },
215 id => 0x0053, result => "void", wparam => "void", lparam => "LPHELPINFO" },
217 id => 0x0366, result => "", wparam => "", lparam => "" },
219 id => 0x0312, result => "", wparam => "", lparam => "" },
221 id => 0x0114, result => "void", wparam => ["int", "int"], lparam => "HWND" },
222 WM_HSCROLLCLIPBOARD => {
223 id => 0x030e, result => "void", wparam => "HWND", lparam => "" },
225 WM_ICONERASEBKGND => {
226 id => 0x0027, result => "BOOL", wparam => "HDC", lparam => "void" },
228 id => 0x0286, result => "", wparam => "", lparam => "" },
229 WM_IME_COMPOSITION => {
230 id => 0x010f, result => "", wparam => "", lparam => "" },
231 WM_IME_COMPOSITIONFULL => {
232 id => 0x0284, result => "", wparam => "", lparam => "" },
234 id => 0x0283, result => "", wparam => "", lparam => "" },
235 WM_IME_ENDCOMPOSITION => {
236 id => 0x010e, result => "", wparam => "", lparam => "" },
238 id => 0x0290, result => "void", wparam => "UINT", lparam => ["int", "UINT"] },
240 id => 0x010f, result => "", wparam => "", lparam => "" },
242 id => 0x0291, result => "void", wparam => "UINT", lparam => ["int", "UINT"] },
244 id => 0x0282, result => "", wparam => "", lparam => "" },
246 id => 0x0288, result => "", wparam => "", lparam => "" },
248 id => 0x0285, result => "", wparam => "", lparam => "" },
249 WM_IME_SETCONTEXT => {
250 id => 0x0281, result => "", wparam => "", lparam => "" },
251 WM_IME_STARTCOMPOSITION => {
252 id => 0x010d, result => "", wparam => "", lparam => "" },
253 WM_IDLEUPDATECMDUI => {
254 id => 0x0363, result => "", wparam => "", lparam => "" },
256 id => 0x0110, result => "BOOL", wparam => "HWND", lparam => "LPARAM" },
257 WM_INITIALUPDATE => {
258 id => 0x0364, result => "", wparam => "", lparam => "" },
260 id => 0x0116, result => "void", wparam => "HMENU", lparam => "void" },
261 WM_INITMENUPOPUP => {
262 id => 0x0117, result => "void", wparam => "HMENU", lparam => ["UINT", "BOOL"] },
263 WM_INPUTLANGCHANGE => {
264 id => 0x0051, result => "", wparam => "", lparam => "" },
265 WM_INPUTLANGCHANGEREQUEST => {
266 id => 0x0050, result => "", wparam => "", lparam => "" },
268 id => 0x0035, result => "", wparam => "", lparam => "" },
271 id => 0x0100, result => "void", wparam => "UINT", lparam => ["int", "UINT"] },
273 id => 0x0108, result => "", wparam => "", lparam => "" },
275 id => 0x036a, result => "", wparam => "", lparam => "" },
277 id => 0x0101, result => "void", wparam => "UINT", lparam => ["", ""] },
279 id => 0x0008, result => "void", wparam => "HWND", lparam => "void" },
282 id => 0x0131, result => "", wparam => "", lparam => "" },
283 WM_LBUTTONDBLCLK => {
284 id => 0x0203, result => "void", wparam => "UINT", lparam => ["", ""] },
286 id => 0x0201, result => "void", wparam => "UINT", lparam => ["", ""] },
288 id => 0x0202, result => "void", wparam => "UINT", lparam => ["", ""] },
290 WM_MBUTTONDBLCLK => {
291 id => 0x0209, result => "void", wparam => "UINT", lparam => ["", ""] },
293 id => 0x0207, result => "void", wparam => "UINT", lparam => ["", ""] },
295 id => 0x0208, result => "void", wparam => "UINT", lparam => ["", ""] },
297 id => 0x0222, result => "void", wparam => "HWND", lparam => "HWND" },
299 id => 0x0227, result => "BOOL", wparam => "UINT", lparam => "void" },
301 id => 0x0220, result => "HWND", wparam => "void", lparam => "const LPMDICREATESTRUCT" },
303 id => 0x0221, result => "void", wparam => "HWND", lparam => "void" },
305 id => 0x0229, result => "HWND", wparam => "void", lparam => "void" },
306 WM_MDIICONARRANGE => {
307 id => 0x0228, result => "void", wparam => "void", lparam => "void" },
309 id => 0x0225, result => "void", wparam => "HWND", lparam => "void" },
311 id => 0x0224, result => "HWND", wparam => "HWND", lparam => "BOOL" },
312 WM_MDIREFRESHMENU => {
313 id => 0x0234, result => "", wparam => "", lparam => "" },
315 id => 0x0223, result => "void", wparam => "HWND", lparam => "void" },
317 id => 0x0230, result => "HMENU", wparam => "BOOL", lparam => "HMENU" },
319 id => 0x0226, result => "BOOL", wparam => "UINT", lparam => "void" },
321 id => 0x002c, result => "void", wparam => "UINT", lparam => "MEASUREITEMSTRUCT *" },
323 id => 0x011f, result => "void", wparam => ["", ""], lparam => "HMENU" },
325 id => 0x0120, result => "DWORD", wparam => ["", "WORD"], lparam => "HMENU" },
326 WM_MOUSEACTIVATE => {
327 id => 0x0021, result => "int", wparam => "HWND", lparam => ["", ""] },
329 id => 0x0200, result => "void", wparam => "UINT", lparam => ["", ""] },
331 id => 0x020a, result => "void", wparam => ["DWORD", "int"], lparam => ["UINT", "UINT"] },
333 id => 0x0003, result => "void", wparam => "void", lparam => ["", ""] },
335 id => 0x0216, result => "", wparam => "", lparam => "" },
338 id => 0x0086, result => "BOOL", wparam => "BOOL", lparam => "void" },
339 WM_NCLBUTTONDBLCLK => {
340 id => 0x00a3, result => "void", wparam => "UINT", lparam => ["", ""] },
341 WM_NCLBUTTONDOWN => {
342 id => 0x00a1, result => "void", wparam => "UINT", lparam => ["", ""] },
344 id => 0x00a2, result => "void", wparam => "UINT", lparam => ["", ""] },
346 id => 0x00a0, result => "void", wparam => "UINT", lparam => ["", ""] },
347 WM_NCMBUTTONDBLCLK => {
348 id => 0x00a9, result => "void", wparam => "UINT", lparam => ["", ""] },
349 WM_NCMBUTTONDOWN => {
350 id => 0x00a7, result => "void", wparam => "UINT", lparam => ["", ""] },
352 id => 0x00a8, result => "void", wparam => "UINT", lparam => ["", ""] },
353 WM_NCRBUTTONDBLCLK => {
354 id => 0x00a6, result => "void", wparam => "UINT", lparam => ["", ""] },
355 WM_NCRBUTTONDOWN => {
356 id => 0x00a4, result => "void", wparam => "UINT", lparam => ["", ""] },
358 id => 0x00a5, result => "void", wparam => "UINT", lparam => ["", ""] },
360 id => 0x0083, result => "UINT", wparam => "void", lparam => "NCCALCSIZE_PARAMS *" },
362 id => 0x0081, result => "BOOL", wparam => "void", lparam => "LPCREATESTRUCT" },
364 id => 0x0082, result => "void", wparam => "void", lparam => "void" },
366 id => 0x0084, result => "UINT", wparam => "void", lparam => ["int", "int"] },
368 id => 0x0085, result => "void", wparam => "HRGN", lparam => "void" },
370 id => 0x0028, result => "HWND", wparam => "HWND", lparam => "BOOL" },
372 id => 0x0213, result => "void", wparam => "UINT", lparam => "LPMDINEXTMENU" },
374 id => 0x004e, result => "LRESULT", wparam => "int", lparam => "NMHDR *" },
376 id => 0x0055, result => "", wparam => "", lparam => "" },
378 id => 0x0000, result => "", wparam => "", lparam => "" },
381 id => 0x0378, result => "", wparam => "", lparam => "" },
382 WM_OCC_LOADFROMSTORAGE => {
383 id => 0x0377, result => "", wparam => "", lparam => "" },
384 WM_OCC_LOADFROMSTORAGE_EX => {
385 id => 0x037b, result => "", wparam => "", lparam => "" },
386 WM_OCC_LOADFROMSTREAM => {
387 id => 0x0376, result => "", wparam => "", lparam => "" },
388 WM_OCC_LOADFROMSTREAM_EX => {
389 id => 0x037a, result => "", wparam => "", lparam => "" },
390 WM_OTHERWINDOWCREATED => {
391 id => 0x003c, result => "", wparam => "", lparam => "" },
392 WM_OTHERWINDOWDESTROYED => {
393 id => 0x003d, result => "", wparam => "", lparam => "" },
396 id => 0x000f, result => "void", wparam => "void", lparam => "void" },
397 WM_PAINTCLIPBOARD => {
398 id => 0x0309, result => "void", wparam => "HWND", lparam => "const LPPAINTSTRUCT" },
400 id => 0x0026, result => "", wparam => "", lparam => "" },
401 WM_PALETTEISCHANGING => {
402 id => 0x0310, result => "void", wparam => "HWND", lparam => "void" },
403 WM_PALETTECHANGED => {
404 id => 0x0311, result => "void", wparam => "HWND", lparam => "void" },
406 id => 0x0210, result => "void", wparam => ["UINT", "int"], lparam => "HWND" },
408 id => 0x0302, result => "void", wparam => "void", lparam => "void" },
410 id => 0x0380, result => "", wparam => "", lparam => "" },
412 id => 0x038f, result => "", wparam => "", lparam => "" },
413 WM_POPMESSAGESTRING => {
414 id => 0x0375, result => "", wparam => "", lparam => "" },
416 id => 0x0048, result => "void", wparam => "int", lparam => "void" },
417 WM_POWERBROADCAST => {
418 id => 0x0218, result => "", wparam => "", lparam => "" },
420 id => 0x0317, result => "", wparam => "", lparam => "" },
422 id => 0x0318, result => "void", wparam => "HDC", lparam => "DWORD" },
424 WM_QUERY3DCONTROLS => {
425 id => 0x036f, result => "", wparam => "", lparam => "" },
426 WM_QUERYAFXWNDPROC => {
427 id => 0x0360, result => "", wparam => "", lparam => "" },
428 WM_QUERYCENTERWND => {
429 id => 0x036b, result => "", wparam => "", lparam => "" },
430 WM_QUERYDRAGICON => {
431 id => 0x0037, result => "HICON", wparam => "void", lparam => "void" },
432 WM_QUERYDROPOBJECT => {
433 id => 0x022b, result => "", wparam => "", lparam => "" },
434 WM_QUERYENDSESSION => {
435 id => 0x0011, result => "BOOL", wparam => "void", lparam => "void" },
436 WM_QUERYNEWPALETTE => {
437 id => 0x030f, result => "BOOL", wparam => "void", lparam => "void" },
439 id => 0x0013, result => "BOOL", wparam => "void", lparam => "void" },
440 WM_QUERYPARKICON => {
441 id => 0x0036, result => "", wparam => "", lparam => "" },
442 WM_QUERYSAVESTATE => {
443 id => 0x0038, result => "", wparam => "", lparam => "" },
445 id => 0x0023, result => "void", wparam => "void", lparam => "void" },
446 WM_QUEUE_SENTINEL => {
447 id => 0x0379, result => "", wparam => "", lparam => "" },
449 id => 0x0012, result => "void", wparam => "int", lparam => "void" },
451 WM_RBUTTONDBLCLK => {
452 id => 0x0206, result => "void", wparam => "UINT", lparam => ["", ""] },
454 id => 0x0204, result => "void", wparam => "UINT", lparam => ["", ""] },
456 id => 0x0205, result => "void", wparam => "UINT", lparam => ["", ""] },
458 id => 0x0368, result => "", wparam => "", lparam => "" },
459 WM_RENDERALLFORMATS => {
460 id => 0x0306, result => "void", wparam => "void", lparam => "void" },
462 id => 0x0305, result => "HANDLE", wparam => "UINT", lparam => "void" },
465 id => 0x0020, result => "BOOL", wparam => "HWND", lparam => ["UINT", "UINT"] },
467 id => 0x0007, result => "void", wparam => "HWND", lparam => "void" },
469 id => 0x0030, result => "void", wparam => "HFONT", lparam => "BOOL" },
471 id => 0x0032, result => "", wparam => "", lparam => "" },
473 id => 0x0080, result => "HICON", wparam => "DWORD", lparam => "HICON" },
474 WM_SETMESSAGESTRING => {
475 id => 0x0362, result => "", wparam => "", lparam => "" },
477 id => 0x000b, result => "void", wparam => "BOOL", lparam => "void" },
479 id => 0x000c, result => "void", wparam => "void", lparam => "LPCTSTR" },
481 id => 0x0009, result => "", wparam => "", lparam => "" },
483 id => 0x0018, result => "void", wparam => "BOOL", lparam => "UINT" },
485 id => 0x0005, result => "void", wparam => "UINT", lparam => ["", ""] },
487 id => 0x0369, result => "", wparam => "", lparam => "" },
488 WM_SIZECLIPBOARD => {
489 id => 0x030b, result => "void", wparam => "HWND", lparam => "const LPRECT" },
491 id => 0x0361, result => "", wparam => "", lparam => "" },
493 id => 0x0004, result => "", wparam => "", lparam => "" },
495 id => 0x0214, result => "", wparam => "", lparam => "" },
497 id => 0x0374, result => "", wparam => "", lparam => "" },
498 WM_SOCKET_NOTIFY => {
499 id => 0x0373, result => "", wparam => "", lparam => "" },
500 WM_SPOOLERSTATUS => {
501 id => 0x002a, result => "void", wparam => "UINT", lparam => ["", ""] },
503 id => 0x007d, result => "void", wparam => "DWORD", lparam => "LPSTYLESTRUCT" },
504 WM_STYLECHANGING => {
505 id => 0x007c, result => "void", wparam => "DWORD", lparam => "LPSTYLESTRUCT" },
507 id => 0x0088, result => "", wparam => "", lparam => "" },
509 id => 0x0089, result => "", wparam => "", lparam => "" },
511 id => 0x0106, result => "void", wparam => "TCHAR", lparam => ["", ""] },
512 WM_SYSCOLORCHANGE => {
513 id => 0x0015, result => "void", wparam => "void", lparam => "void" },
515 id => 0x0112, result => "void", wparam => "UINT", lparam => "int" },
517 id => 0x0107, result => "void", wparam => "TCHAR", lparam => ["", ""] },
519 id => 0x0104, result => "void", wparam => "UINT", lparam => ["", ""] },
521 id => 0x0105, result => "void", wparam => "UINT", lparam => ["", ""] },
523 id => 0x0017, result => "", wparam => "", lparam => "" },
525 id => 0x0118, result => "", wparam => "", lparam => "" },
528 id => 0x0052, result => "", wparam => "", lparam => "" },
530 id => 0x003a, result => "", wparam => "", lparam => "" },
532 id => 0x001e, result => "void", wparam => "void", lparam => "void" },
534 id => 0x0113, result => "void", wparam => "UINT", lparam => "void" },
537 id => 0x0304, result => "void", wparam => "void", lparam => "void" },
539 id => 0x0400, result => "", wparam => "", lparam => "" },
541 id => 0x0054, result => "", wparam => "", lparam => "" },
544 id => 0x002e, result => "int", wparam => ["UINT", "int"], lparam => "HWND" },
546 id => 0x0115, result => "void", wparam => ["int", "int"], lparam => "HWND" },
547 WM_VSCROLLCLIPBOARD => {
548 id => 0x030a, result => "void", wparam => "HWND", lparam => ["", ""] },
550 WM_WINDOWPOSCHANGING => {
551 id => 0x0046, result => "BOOL", wparam => "void", lparam => "LPWINDOWPOS" },
552 WM_WINDOWPOSCHANGED => {
553 id => 0x0047, result => "void", wparam => "void", lparam => "const LPWINDOWPOS" },
555 id => 0x001a, result => "void", wparam => "void", lparam => "LPCTSTR" }
558 ########################################################################
566 } elsif(/^(?:HBRUSH|HDC|HFONT|HMENU|HRGN|HWND)$/ || /\*$/ ||
575 ########################################################################
576 # get_message_result_type
578 sub get_message_result_type($) {
580 return $$message{$name}{result};
583 ########################################################################
584 # get_message_result_kind
586 sub get_message_result_kind(@) {
587 return _get_kind(get_message_result_type(@_));
590 ########################################################################
591 # get_message_wparam_type
593 sub get_message_wparam_type($) {
595 return $$message{$name}{wparam};
598 ########################################################################
599 # get_message_wparam_kind
601 sub get_message_wparam_kind(@) {
602 return _get_kind(get_message_wparam_type(@_));
605 ########################################################################
606 # get_message_lparam_type
608 sub get_message_lparam_type($) {
610 return $$message{$name}{lparam};
613 ########################################################################
614 # get_message_lparam_kind
616 sub get_message_lparam_kind(@) {
617 return _get_kind(get_message_lparam_type(@_));
620 ########################################################################
623 sub _parse_file($$$) {
625 my $found_preprocessor = shift;
626 my $found_comment = shift;
635 my @lines = split(/\n/, $_);
636 my $max_line = scalar(@lines);
638 my $parser = new c_parser($file);
640 $parser->set_found_preprocessor_callback($found_preprocessor);
641 $parser->set_found_comment_callback($found_comment);
643 my $found_line = sub {
647 $output->progress("$file: line $line of $max_line");
650 $parser->set_found_line_callback($found_line);
655 my $old_prefix = $output->prefix;
656 $output->progress("$file");
657 $output->prefix("$file: ");
659 if(!$parser->parse_c_file(\$_, \$line, \$column)) {
660 $output->write("can't parse file\n");
663 $output->prefix($old_prefix);
666 ########################################################################
667 # _get_tuple_arguments
669 sub _get_tuple_arguments($) {
672 my $parser = new c_parser;
679 my @argument_columns;
680 if(!$parser->parse_c_tuple(\$_, \$line, \$column, \@arguments, \@argument_lines, \@argument_columns)) {
687 ########################################################################
691 sub _parse_windowsx_h($$$) {
694 my $found_preprocessor = sub {
695 my $begin_line = shift;
696 my $begin_column = shift;
699 if(!s/^\#\s*define\s*// || !/^FORWARD_WM_/) {
704 if(s/^FORWARD_(\w+)\([^\)]*\)\s*(.*?)\s*$/$2/s) {
708 if($name eq "WM_SYSTEMERROR") {
713 if(s/^\(\s*(\w+)\s*\)(?:\(\s*\w+\s*\))*\(\s*\w+\s*\)//) {
719 (undef, $_, my $wparam, my $lparam) = _get_tuple_arguments($_);
724 } elsif(/^\(\w+\)\s*\?\s*(\w+)\s*:\s*(\w+)$/) {
730 local $_ = $last_comment;
731 s%^/\*\s*(.*?)\s*\*/$%$1%;
734 if(s/^(\w+)\s+\w+\s*\(\s*(.*?)\s*\)$/$2/) {
736 if($result2 eq "INT") { $result2 = "int"; }
737 if($result ne $result2) {
738 $output->write("message $name: result type mismatch '$result' != '$result2'\n");
740 foreach (split(/\s*,\s*/)) {
741 if(/^((?:const\s+|volatile\s+)?\w+(?:\s*\*\s*|\s+)?)(\w+)$/) {
745 $type =~ s/^\s*(.*?)\s*$/$1/;
747 $arguments{$name} = $type;
752 # $output->write("$1: $_\n");
757 my $find_inner_cast = sub {
759 if(/^(?:\(\s*((?:const\s+|volatile\s+)?\w+(?:\s*\*)?)\s*\))*\(.*?\)$/) {
770 [ \$wparam, "W", "w" ],
771 [ \$lparam, "L", "l" ]
773 foreach my $entry (@entries) {
774 (my $refparam, my $upper, my $lower) = @$entry;
776 local $_ = $$refparam;
777 if(s/^\(\s*$upper(?:)PARAM\s*\)\s*(?:\(\s*((?:const\s+|volatile\s+)?\w+(?:\s*\*)?)\s*\))*\(\s*(.*?)\s*\)$/$2/) {
785 if(exists($arguments{$_})) {
786 $$refparam = $arguments{$_};
788 } elsif(/^\(\s*(\w+)\s*\)\s*\?\s*\(\s*(\w+)\s*\)\s*:\s*(?:\(\s*(\w+)\s*\)|0)$/) {
789 foreach ($1, $2, $3) {
790 if(exists($arguments{$_})) {
791 $$refparam = $arguments{$_};
795 } elsif(/^\(\((?:const\s+|volatile\s+)?\w+\s*(?:\*\s*)?\)\s*(?:\(\s*\w+\s*\)|\w+)\s*\)\s*\->\s*\w+$/) {
800 } elsif(s/^(?:\(\s*$upper(?:)PARAM\s*\)\s*)?MAKE$upper(?:)PARAM\s*//) {
801 (my $low, my $high) = _get_tuple_arguments($_);
803 $low = &$find_inner_cast($low);
804 $high = &$find_inner_cast($high);
806 $$refparam = "($low,$high)";
807 } elsif(s/^\(.*?$lower(?:)Param.*?\)$//) {
808 $$refparam = $upper . "PARAM";
809 } elsif(s/^\(\s*(.*?)\s*\)$//) {
818 # $output->write("$result: '@names', '$wparam', '$lparam'\n");
820 foreach my $name (@names) {
821 my $result2 = $$message{$name}{result};
822 my $wparam2 = $$message{$name}{wparam};
823 my $lparam2 = $$message{$name}{lparam};
826 $wparam2 = "(" . join(",", @$wparam2) . ")";
830 $lparam2 = "(" . join(",", @$lparam2) . ")";
833 if($result ne $result2) {
834 $output->write("message $name: wrong result type '$result2' should be '$result'\n");
837 if($wparam ne $wparam2) {
838 # if($wparam ne "WPARAM" && $wparam ne "(,)") {
839 $output->write("message $name: wrong wparam type '$wparam2' should be '$wparam'\n");
843 if($lparam ne $lparam2) {
844 # if($lparam ne "LPARAM" && $lparam ne "(,)") {
845 $output->write("message $name: wrong lparam type '$lparam2' should be '$lparam'\n");
853 my $found_comment = sub {
854 my $begin_line = shift;
855 my $begin_column = shift;
858 $last_comment = $comment;
863 _parse_file("$wine_dir/include/windowsx.h", $found_preprocessor, $found_comment);
867 ########################################################################
870 sub _parse_winuser_h($$$) {
873 my $found_preprocessor = sub {
874 my $begin_line = shift;
875 my $begin_column = shift;
878 if(/^\#\s*define\s+(WM_\w+)\s+(0x[0-9a-fA-F]+)\s*$/) {
882 if(exists($$message{$name})) {
883 my $id2 = sprintf("0x%04x", $$message{$name}{id});
885 $output->write("message $name: wrong value ($id2) should be $id\n");
888 $output->write("message $name: exists but is not supported\n");
889 $not_found{$name} = $id;
896 _parse_file("$wine_dir/include/winuser.h", $found_preprocessor);
898 foreach my $name (sort(keys(%not_found))) {
899 my $id = $not_found{$name};
901 print " $name => {\n";
902 print "\tid => $id, result => \"\", wparam => \"\", lparam => \"\" },\n";