win32u: Use syscall interface for all ntuser functions.
[wine.git] / dlls / wow64win / user.c
blob627de08b77783c084052b61965ee59668206677f
1 /*
2 * WoW64 User functions
4 * Copyright 2021 Jacek Caban for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdarg.h>
23 #include "ntstatus.h"
24 #define WIN32_NO_STATUS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "ntuser.h"
28 #include "wow64win_private.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(wow);
33 typedef struct
35 DWORD cbSize;
36 DWORD fMask;
37 DWORD dwStyle;
38 UINT cyMax;
39 ULONG hbrBack;
40 DWORD dwContextHelpID;
41 ULONG dwMenuData;
42 } MENUINFO32;
44 typedef struct
46 UINT cbSize;
47 UINT fMask;
48 UINT fType;
49 UINT fState;
50 UINT wID;
51 UINT32 hSubMenu;
52 UINT32 hbmpChecked;
53 UINT32 hbmpUnchecked;
54 UINT32 dwItemData;
55 UINT32 dwTypeData;
56 UINT cch;
57 UINT32 hbmpItem;
58 } MENUITEMINFOW32;
60 typedef struct
62 UINT32 hwnd;
63 UINT message;
64 UINT32 wParam;
65 UINT32 lParam;
66 DWORD time;
67 POINT pt;
68 } MSG32;
70 typedef struct
72 DWORD dwType;
73 DWORD dwSize;
74 UINT32 hDevice;
75 UINT32 wParam;
76 } RAWINPUTHEADER32;
78 typedef struct
80 USHORT usUsagePage;
81 USHORT usUsage;
82 DWORD dwFlags;
83 UINT32 hwndTarget;
84 } RAWINPUTDEVICE32;
86 typedef struct
88 UINT32 hDevice;
89 DWORD dwType;
90 } RAWINPUTDEVICELIST32;
92 typedef struct
94 LONG dx;
95 LONG dy;
96 DWORD mouseData;
97 DWORD dwFlags;
98 DWORD time;
99 ULONG dwExtraInfo;
100 } MOUSEINPUT32;
102 typedef struct
104 WORD wVk;
105 WORD wScan;
106 DWORD dwFlags;
107 DWORD time;
108 ULONG dwExtraInfo;
109 } KEYBDINPUT32;
111 typedef struct
113 DWORD type;
114 union
116 MOUSEINPUT32 mi;
117 KEYBDINPUT32 ki;
118 HARDWAREINPUT hi;
119 } DUMMYUNIONNAME;
120 } INPUT32;
122 typedef struct
124 int x;
125 int y;
126 DWORD time;
127 ULONG dwExtraInfo;
128 } MOUSEMOVEPOINT32;
130 typedef struct
132 UINT32 hdc;
133 BOOL fErase;
134 RECT rcPaint;
135 BOOL fRestore;
136 BOOL fIncUpdate;
137 BYTE rgbReserved[32];
138 } PAINTSTRUCT32;
140 typedef struct
142 ULONG lpCreateParams;
143 ULONG hInstance;
144 ULONG hMenu;
145 ULONG hwndParent;
146 INT cy;
147 INT cx;
148 INT y;
149 INT x;
150 LONG style;
151 ULONG lpszName;
152 ULONG lpszClass;
153 DWORD dwExStyle;
154 } CREATESTRUCT32;
156 typedef struct
158 LONG lResult;
159 LONG lParam;
160 LONG wParam;
161 DWORD message;
162 ULONG hwnd;
163 } CWPRETSTRUCT32;
165 typedef struct
167 ULONG hwnd;
168 ULONG hwndInsertAfter;
169 INT x;
170 INT y;
171 INT cx;
172 INT cy;
173 UINT flags;
174 } WINDOWPOS32;
176 typedef struct
178 UINT CtlType;
179 UINT CtlID;
180 UINT itemID;
181 UINT itemWidth;
182 UINT itemHeight;
183 ULONG itemData;
184 } MEASUREITEMSTRUCT32;
186 typedef struct
188 UINT CtlType;
189 UINT CtlID;
190 UINT itemID;
191 UINT itemAction;
192 UINT itemState;
193 ULONG hwndItem;
194 ULONG hDC;
195 RECT rcItem;
196 ULONG itemData;
197 } DRAWITEMSTRUCT32;
199 typedef struct
201 ULONG lParam;
202 ULONG wParam;
203 UINT message;
204 ULONG hwnd;
205 } CWPSTRUCT32;
207 typedef struct
209 POINT pt;
210 ULONG hwnd;
211 UINT wHitTestCode;
212 ULONG dwExtraInfo;
213 DWORD mouseData;
214 } MOUSEHOOKSTRUCTEX32;
216 typedef struct
218 POINT pt;
219 DWORD mouseData;
220 DWORD flags;
221 DWORD time;
222 ULONG dwExtraInfo;
223 } MSLLHOOKSTRUCT32;
225 typedef struct
227 DWORD vkCode;
228 DWORD scanCode;
229 DWORD flags;
230 DWORD time;
231 ULONG dwExtraInfo;
232 } KBDLLHOOKSTRUCT32;
234 typedef struct
236 UINT message;
237 UINT paramL;
238 UINT paramH;
239 DWORD time;
240 ULONG hwnd;
241 } EVENTMSG32;
243 typedef struct
245 BOOL fMouse;
246 ULONG hWndActive;
247 } CBTACTIVATESTRUCT32;
249 typedef struct
251 UINT CtlType;
252 UINT CtlID;
253 UINT itemID;
254 ULONG hwndItem;
255 ULONG itemData;
256 } DELETEITEMSTRUCT32;
258 typedef struct
260 UINT cbSize;
261 UINT style;
262 ULONG lpfnWndProc;
263 INT cbClsExtra;
264 INT cbWndExtra;
265 ULONG hInstance;
266 ULONG hIcon;
267 ULONG hCursor;
268 ULONG hbrBackground;
269 ULONG lpszMenuName;
270 ULONG lpszClassName;
271 ULONG hIconSm;
272 } WNDCLASSEXW32;
274 struct client_menu_name32
276 ULONG nameA;
277 ULONG nameW;
278 ULONG nameUS;
281 struct win_proc_params32
283 ULONG func;
284 ULONG hwnd;
285 UINT msg;
286 ULONG wparam;
287 ULONG lparam;
288 ULONG result;
289 BOOL ansi;
290 BOOL ansi_dst;
291 BOOL needs_unpack;
292 enum wm_char_mapping mapping;
293 ULONG dpi_awareness;
294 ULONG procA;
295 ULONG procW;
298 struct win_event_hook_params32
300 DWORD event;
301 ULONG hwnd;
302 LONG object_id;
303 LONG child_id;
304 ULONG handle;
305 DWORD tid;
306 DWORD time;
307 ULONG proc;
308 WCHAR module[MAX_PATH];
311 struct draw_text_params32
313 ULONG hdc;
314 int count;
315 RECT rect;
316 ULONG ret_rect;
317 UINT flags;
318 WCHAR str[1];
321 struct unpack_dde_message_params32
323 ULONG result;
324 ULONG hwnd;
325 UINT message;
326 LONG wparam;
327 LONG lparam;
328 char data[1];
331 static MSG *msg_32to64( MSG *msg, const MSG32 *msg32 )
333 if (!msg32) return NULL;
335 msg->hwnd = LongToHandle( msg32->hwnd );
336 msg->message = msg32->message;
337 msg->wParam = msg32->wParam;
338 msg->lParam = msg32->lParam;
339 msg->time = msg32->time;
340 msg->pt = msg32->pt;
341 return msg;
344 static MSG32 *msg_64to32( const MSG *msg, MSG32 *msg32 )
346 if (!msg32) return NULL;
348 msg32->hwnd = HandleToUlong( msg->hwnd );
349 msg32->message = msg->message;
350 msg32->wParam = msg->wParam;
351 msg32->lParam = msg->lParam;
352 msg32->time = msg->time;
353 msg32->pt = msg->pt;
354 return msg32;
357 static struct client_menu_name *client_menu_name_32to64( struct client_menu_name *name,
358 const struct client_menu_name32 *name32 )
360 if (!name32) return NULL;
361 name->nameA = UlongToPtr( name32->nameA );
362 name->nameW = UlongToPtr( name32->nameW );
363 name->nameUS = UlongToPtr( name32->nameUS );
364 return name;
367 static struct client_menu_name32 *client_menu_name_64to32( const struct client_menu_name *name,
368 struct client_menu_name32 *name32 )
370 if (name32)
372 name32->nameA = PtrToUlong( name->nameA );
373 name32->nameW = PtrToUlong( name->nameW );
374 name32->nameUS = PtrToUlong( name->nameUS );
376 return name32;
379 static void win_proc_params_64to32( const struct win_proc_params *src, struct win_proc_params32 *dst,
380 ULONG *result )
382 dst->func = PtrToUlong( src->func );
383 dst->hwnd = HandleToUlong( src->hwnd );
384 dst->msg = src->msg;
385 dst->wparam = src->wparam;
386 dst->lparam = src->lparam;
387 dst->result = PtrToUlong( result );
388 dst->ansi = src->ansi;
389 dst->ansi_dst = src->ansi_dst;
390 dst->needs_unpack = src->needs_unpack;
391 dst->mapping = src->mapping;
392 dst->dpi_awareness = HandleToUlong( src->dpi_awareness );
393 dst->procA = PtrToUlong( src->procA );
394 dst->procW = PtrToUlong( src->procW );
397 static void createstruct_32to64( const CREATESTRUCT32 *from, CREATESTRUCTW *to )
400 to->lpCreateParams = UlongToPtr( from->lpCreateParams );
401 to->hInstance = UlongToPtr( from->hInstance );
402 to->hMenu = LongToHandle( from->hMenu );
403 to->hwndParent = LongToHandle( from->hwndParent );
404 to->cy = from->cy;
405 to->cx = from->cx;
406 to->y = from->y;
407 to->x = from->x;
408 to->style = from->style;
409 to->dwExStyle = from->dwExStyle;
410 to->lpszName = UlongToPtr( from->lpszName );
411 to->lpszClass = UlongToPtr( from->lpszClass );
414 static void createstruct_64to32( const CREATESTRUCTW *from, CREATESTRUCT32 *to )
416 to->lpCreateParams = PtrToUlong( from->lpCreateParams );
417 to->hInstance = PtrToUlong( from->hInstance );
418 to->hMenu = HandleToUlong( from->hMenu );
419 to->hwndParent = HandleToUlong( from->hwndParent );
420 to->cy = from->cy;
421 to->cx = from->cx;
422 to->y = from->y;
423 to->x = from->x;
424 to->style = from->style;
425 to->dwExStyle = from->dwExStyle;
428 static void winpos_32to64( WINDOWPOS *dst, const WINDOWPOS32 *src )
430 dst->hwnd = LongToHandle( src->hwnd );
431 dst->hwndInsertAfter = LongToHandle( src->hwndInsertAfter );
432 dst->x = src->x;
433 dst->y = src->y;
434 dst->cx = src->cx;
435 dst->cy = src->cy;
436 dst->flags = src->flags;
439 static void winpos_64to32( const WINDOWPOS *src, WINDOWPOS32 *dst )
441 dst->hwnd = HandleToUlong( src->hwnd );
442 dst->hwndInsertAfter = HandleToUlong( src->hwndInsertAfter );
443 dst->x = src->x;
444 dst->y = src->y;
445 dst->cx = src->cx;
446 dst->cy = src->cy;
447 dst->flags = src->flags;
450 static PAINTSTRUCT *paintstruct_32to64( PAINTSTRUCT *ps, const PAINTSTRUCT32 *ps32 )
452 if (!ps32) return NULL;
453 ps->hdc = ULongToHandle( ps32->hdc );
454 ps->fErase = ps32->fErase;
455 ps->rcPaint = ps32->rcPaint;
456 ps->fRestore = ps32->fRestore;
457 ps->fIncUpdate = ps32->fIncUpdate;
458 return ps;
461 static MOUSEHOOKSTRUCTEX32 *mousehookstruct_64to32( const MOUSEHOOKSTRUCTEX *hook,
462 MOUSEHOOKSTRUCTEX32 *hook32 )
464 if (!hook) return NULL;
466 hook32->pt = hook->pt;
467 hook32->hwnd = HandleToUlong( hook->hwnd );
468 hook32->wHitTestCode = hook->wHitTestCode;
469 hook32->dwExtraInfo = hook->dwExtraInfo;
470 hook32->mouseData = hook->mouseData;
471 return hook32;
474 static NTSTATUS dispatch_callback( ULONG id, void *args, ULONG len )
476 void *ret_ptr;
477 ULONG ret_len;
478 NTSTATUS status = Wow64KiUserCallbackDispatcher( id, args, len, &ret_ptr, &ret_len );
479 return NtCallbackReturn( ret_ptr, ret_len, status );
482 static NTSTATUS WINAPI wow64_NtUserCallEnumDisplayMonitor( void *arg, ULONG size )
484 struct enum_display_monitor_params *params = arg;
485 struct
487 ULONG proc;
488 ULONG monitor;
489 ULONG hdc;
490 RECT rect;
491 ULONG lparam;
492 } params32;
494 params32.proc = PtrToUlong( params->proc );
495 params32.monitor = HandleToUlong( params->monitor );
496 params32.hdc = HandleToUlong( params->hdc );
497 params32.rect = params->rect;
498 params32.lparam = params->lparam;
499 return dispatch_callback( NtUserCallEnumDisplayMonitor, &params32, sizeof(params32) );
502 static NTSTATUS WINAPI wow64_NtUserCallSendAsyncCallback( void *arg, ULONG size )
504 struct send_async_params *params = arg;
505 struct
507 ULONG callback;
508 ULONG hwnd;
509 UINT msg;
510 ULONG data;
511 ULONG result;
512 } params32;
514 params32.callback = PtrToUlong( params->callback );
515 params32.hwnd = HandleToUlong( params->hwnd );
516 params32.msg = params->msg;
517 params32.data = params->data;
518 params32.result = params->result;
519 return dispatch_callback( NtUserCallSendAsyncCallback, &params32, sizeof(params32) );
522 static NTSTATUS WINAPI wow64_NtUserCallWinEventHook( void *arg, ULONG size )
524 struct win_event_hook_params *params = arg;
525 struct win_event_hook_params32 params32;
527 params32.event = params->event;
528 params32.hwnd = HandleToUlong( params->hwnd );
529 params32.object_id = params->object_id;
530 params32.child_id = params->child_id;
531 params32.handle = HandleToUlong( params->handle );
532 params32.tid = params->tid;
533 params32.time = params->time;
534 params32.proc = PtrToUlong( params->proc );
536 size -= FIELD_OFFSET( struct win_event_hook_params, module );
537 if (size) memcpy( params32.module, params->module, size );
538 return dispatch_callback( NtUserCallWinEventHook, &params32,
539 FIELD_OFFSET( struct win_event_hook_params32, module ) + size);
542 static NTSTATUS WINAPI wow64_NtUserCallWinProc( void *arg, ULONG size )
544 struct win_proc_params *params = arg;
545 struct win_proc_params32 params32_buf, *params32 = &params32_buf;
546 LONG result32 = 0;
547 LRESULT result;
548 void *ret_ptr;
549 ULONG ret_len;
550 NTSTATUS status;
552 if (size > sizeof(*params))
554 if (!(params32 = Wow64AllocateTemp( size - sizeof(*params) + sizeof(*params32) )))
555 return 0;
556 memcpy( params32 + 1, params + 1, size - sizeof(*params) );
558 win_proc_params_64to32( params, params32, NULL );
560 status = Wow64KiUserCallbackDispatcher( NtUserCallWinProc, params32,
561 size - sizeof(*params) + sizeof(*params32),
562 &ret_ptr, &ret_len );
563 if (ret_len == sizeof(result32)) result32 = *(LONG *)ret_ptr;
564 result = result32;
566 if (params->result)
568 *params->result = result;
569 return status;
571 return NtCallbackReturn( &result, sizeof(result), status );
574 static UINT hook_lparam_64to32( struct win_hook_params *params, const void *lp, void *lp32 )
576 if (!params->lparam_size) return 0;
578 switch (params->id)
580 case WH_SYSMSGFILTER:
581 case WH_MSGFILTER:
582 case WH_GETMESSAGE:
583 msg_64to32( lp, lp32 );
584 return sizeof(MSG32);
586 case WH_CBT:
587 switch (params->code)
589 case HCBT_CREATEWND:
590 if (lp)
592 const CREATESTRUCTW *cs = lp;
593 CREATESTRUCT32 *cs32 = lp32;
594 createstruct_64to32( cs, cs32 );
595 cs32->lpszName = PtrToUlong( cs->lpszName );
596 cs32->lpszClass = PtrToUlong( cs->lpszClass );
598 return sizeof(CREATESTRUCT32);
600 case HCBT_ACTIVATE:
601 if (lp)
603 const CBTACTIVATESTRUCT *cbt = lp;
604 CBTACTIVATESTRUCT32 *cbt32 = lp32;
605 cbt32->fMouse = cbt->fMouse;
606 cbt32->hWndActive = HandleToUlong( cbt->hWndActive );
608 return sizeof(CBTACTIVATESTRUCT32);
610 case HCBT_CLICKSKIPPED:
611 mousehookstruct_64to32( lp, lp32 );
612 return sizeof(MOUSEHOOKSTRUCTEX32);
614 break;
616 case WH_CALLWNDPROC:
617 if (lp)
619 const CWPSTRUCT *cwp = lp;
620 CWPSTRUCT32 *cwp32 = lp32;
621 cwp32->lParam = cwp->lParam;
622 cwp32->wParam = cwp->wParam;
623 cwp32->message = cwp->message;
624 cwp32->hwnd = HandleToUlong( cwp->hwnd );
626 return sizeof(CWPSTRUCT32);
628 case WH_CALLWNDPROCRET:
629 if (lp)
631 const CWPRETSTRUCT *cwpret = lp;
632 CWPRETSTRUCT32 *cwpret32 = lp32;
633 cwpret32->lResult = cwpret->lResult;
634 cwpret32->lParam = cwpret->lParam;
635 cwpret32->wParam = cwpret->wParam;
636 cwpret32->message = cwpret->message;
637 cwpret32->hwnd = HandleToUlong( cwpret->hwnd );
639 return sizeof(CWPRETSTRUCT32);
641 case WH_MOUSE:
642 mousehookstruct_64to32( lp, lp32 );
643 return sizeof(MOUSEHOOKSTRUCTEX32);
645 case WH_MOUSE_LL:
646 if (lp)
648 const MSLLHOOKSTRUCT *hook = lp;
649 MSLLHOOKSTRUCT32 *hook32 = lp32;
650 hook32->pt = hook->pt;
651 hook32->mouseData = hook->mouseData;
652 hook32->flags = hook->flags;
653 hook32->time = hook->time;
654 hook32->dwExtraInfo = hook->dwExtraInfo;
656 return sizeof(MSLLHOOKSTRUCT32);
658 case WH_KEYBOARD_LL:
659 if (lp)
661 const KBDLLHOOKSTRUCT *hook = lp;
662 KBDLLHOOKSTRUCT32 *hook32 = lp32;
663 hook32->vkCode = hook->vkCode;
664 hook32->scanCode = hook->scanCode;
665 hook32->flags = hook->flags;
666 hook32->time = hook->time;
667 hook32->dwExtraInfo = hook->dwExtraInfo;
669 return sizeof(KBDLLHOOKSTRUCT32);
671 case WH_JOURNALRECORD:
672 if (lp)
674 const EVENTMSG *event = lp;
675 EVENTMSG32 *event32 = lp32;
677 event32->message = event->message;
678 event32->paramL = event->paramL;
679 event32->paramH = event->paramH;
680 event32->time = event->time;
681 event32->hwnd = HandleToUlong( event->hwnd );
683 return sizeof(EVENTMSG32);
686 if (lp) memcpy( lp32, lp, params->lparam_size );
687 return params->lparam_size;
690 static NTSTATUS WINAPI wow64_NtUserCallWindowsHook( void *arg, ULONG size )
692 struct win_hook_params *params = arg;
693 struct
695 ULONG proc;
696 ULONG handle;
697 DWORD pid;
698 DWORD tid;
699 int id;
700 int code;
701 ULONG wparam;
702 ULONG lparam;
703 UINT lparam_size;
704 BOOL prev_unicode;
705 BOOL next_unicode;
706 } *params32;
707 UINT lparam32_size = 0, module_size, size32;
708 void *ret_ptr;
709 ULONG ret_len;
710 NTSTATUS ret;
712 lparam32_size = hook_lparam_64to32( params, NULL, NULL );
713 module_size = size - params->lparam_size - sizeof(*params);
715 size32 = sizeof(*params32) + lparam32_size + module_size;
716 if (!(params32 = Wow64AllocateTemp( size32 ))) return 0;
717 params32->proc = (UINT_PTR)params->proc;
718 params32->handle = HandleToUlong( params->handle );
719 params32->pid = params->pid;
720 params32->tid = params->tid;
721 params32->id = params->id;
722 params32->code = params->code;
723 params32->wparam = params->wparam;
724 params32->lparam = params->lparam_size ? 0 : params->lparam;
725 params32->lparam_size = lparam32_size;
726 params32->prev_unicode = params->prev_unicode;
727 params32->next_unicode = params->next_unicode;
728 if (lparam32_size) hook_lparam_64to32( params, params + 1, params32 + 1 );
729 if (module_size)
730 memcpy( (char *)(params32 + 1) + params32->lparam_size,
731 (const char *)params + size - module_size, module_size );
733 ret = Wow64KiUserCallbackDispatcher( NtUserCallWindowsHook, params32, size32, &ret_ptr, &ret_len );
735 switch (params->id)
737 case WH_SYSMSGFILTER:
738 case WH_MSGFILTER:
739 case WH_GETMESSAGE:
740 if (params->lparam_size == sizeof(MSG))
742 msg_32to64( (MSG *)(params + 1), (const MSG32 *)(params32 + 1) );
743 return NtCallbackReturn( params + 1, params->lparam_size, ret );
747 return ret;
750 static NTSTATUS WINAPI wow64_NtUserCopyImage( void *arg, ULONG size )
752 struct copy_image_params *params = arg;
753 struct
755 ULONG hwnd;
756 UINT type;
757 INT dx;
758 INT dy;
759 UINT flags;
760 } params32;
762 params32.hwnd = HandleToUlong( params->hwnd );
763 params32.type = params->type;
764 params32.dx = params->dx;
765 params32.dy = params->dy;
766 params32.flags = params->flags;
767 return dispatch_callback( NtUserCopyImage, &params32, sizeof(params32) );
770 static NTSTATUS WINAPI wow64_NtUserDrawNonClientButton( void *arg, ULONG size )
772 struct draw_non_client_button_params *params = arg;
773 struct
775 ULONG hwnd;
776 ULONG hdc;
777 enum NONCLIENT_BUTTON_TYPE type;
778 RECT rect;
779 BOOL down;
780 BOOL grayed;
781 } params32;
783 params32.hwnd = HandleToUlong( params->hwnd );
784 params32.hdc = HandleToUlong( params->hdc );
785 params32.type = params->type;
786 params32.rect = params->rect;
787 params32.down = params->down;
788 params32.grayed = params->grayed;
789 return dispatch_callback( NtUserDrawNonClientButton, &params32, sizeof(params32) );
792 static NTSTATUS WINAPI wow64_NtUserDrawScrollBar( void *arg, ULONG size )
794 struct draw_scroll_bar_params *params = arg;
795 struct
797 ULONG hwnd;
798 ULONG hdc;
799 INT bar;
800 UINT hit_test;
801 struct
803 ULONG win;
804 INT bar;
805 INT thumb_pos;
806 INT thumb_val;
807 BOOL vertical;
808 enum SCROLL_HITTEST hit_test;
809 } tracking_info;
810 BOOL arrows;
811 BOOL interior;
812 RECT rect;
813 UINT enable_flags;
814 INT arrow_size;
815 INT thumb_pos;
816 INT thumb_size;
817 BOOL vertical;
818 } params32;
820 params32.hwnd = HandleToUlong( params->hwnd );
821 params32.hdc = HandleToUlong( params->hdc );
822 params32.bar = params->bar;
823 params32.hit_test = params->hit_test;
824 params32.tracking_info.win = HandleToUlong( params->tracking_info.win );
825 params32.tracking_info.bar = params->tracking_info.bar;
826 params32.tracking_info.thumb_pos = params->tracking_info.thumb_pos;
827 params32.tracking_info.thumb_val = params->tracking_info.thumb_val;
828 params32.tracking_info.vertical = params->tracking_info.vertical;
829 params32.tracking_info.hit_test = params->tracking_info.hit_test;
830 params32.arrows = params->arrows;
831 params32.interior = params->interior;
832 params32.rect = params->rect;
833 params32.enable_flags = params->enable_flags;
834 params32.arrow_size = params->arrow_size;
835 params32.thumb_pos = params->thumb_pos;
836 params32.thumb_size = params->thumb_size;
837 params32.vertical = params->vertical;
838 return dispatch_callback( NtUserDrawScrollBar, &params32, sizeof(params32) );
841 static NTSTATUS WINAPI wow64_NtUserDrawText( void *arg, ULONG size )
843 struct draw_text_params *params = arg;
844 struct draw_text_params32 *params32;
845 RECT *rect_ptr = params->ret_rect;
846 ULONG ret_len;
847 void *ret_ptr;
848 NTSTATUS ret;
850 params32 = (struct draw_text_params32 *)(params + 1) - 1;
851 params32->flags = params->flags;
852 params32->ret_rect = 0;
853 params32->rect = params->rect;
854 params32->count = params->count;
855 params32->hdc = HandleToUlong( params->hdc );
857 ret = Wow64KiUserCallbackDispatcher( NtUserDrawText, params32,
858 size - sizeof(*params) + sizeof(*params32), &ret_ptr, &ret_len );
859 if (ret_len == sizeof(RECT) && rect_ptr)
861 *rect_ptr = *(const RECT *)ret_ptr;
862 return ret;
864 return NtCallbackReturn( ret_ptr, ret_len, ret );
867 static NTSTATUS WINAPI wow64_NtUserFreeCachedClipboardData( void *arg, ULONG size )
869 struct free_cached_data_params *params = arg;
870 struct
872 UINT format;
873 ULONG handle;
874 } params32;
876 params32.format = params->format;
877 params32.handle = HandleToUlong( params->handle );
878 return dispatch_callback( NtUserFreeCachedClipboardData, &params32, sizeof(params32) );
881 static NTSTATUS WINAPI wow64_NtUserImmProcessKey( void *arg, ULONG size )
883 struct imm_process_key_params *params = arg;
884 struct
886 ULONG hwnd;
887 ULONG hkl;
888 UINT vkey;
889 ULONG key_data;
890 } params32;
892 params32.hwnd = HandleToUlong( params->hwnd );
893 params32.hkl = HandleToUlong( params->hkl );
894 params32.vkey = params->vkey;
895 params32.key_data = params->key_data;
896 return dispatch_callback( NtUserImmProcessKey, &params32, sizeof(params32) );
899 static NTSTATUS WINAPI wow64_NtUserImmTranslateMessage( void *arg, ULONG size )
901 FIXME( "\n" );
902 return 0;
905 static NTSTATUS WINAPI wow64_NtUserInitBuiltinClasses( void *arg, ULONG size )
907 return dispatch_callback( NtUserInitBuiltinClasses, arg, size );
910 static NTSTATUS WINAPI wow64_NtUserLoadDriver( void *arg, ULONG size )
912 return dispatch_callback( NtUserLoadDriver, arg, size );
915 static NTSTATUS WINAPI wow64_NtUserLoadImage( void *arg, ULONG size )
917 struct load_image_params *params = arg;
918 struct
920 ULONG hinst;
921 ULONG name;
922 UINT type;
923 INT dx;
924 INT dy;
925 UINT flags;
926 } params32;
928 params32.hinst = PtrToUlong( params->hinst );
929 params32.name = PtrToUlong( params->name );
930 params32.type = params->type;
931 params32.dx = params->dx;
932 params32.dy = params->dy;
933 params32.flags = params->flags;
934 return dispatch_callback( NtUserLoadImage, &params32, sizeof(params32) );
937 static NTSTATUS WINAPI wow64_NtUserLoadSysMenu( void *arg, ULONG size )
939 return dispatch_callback( NtUserLoadSysMenu, arg, size );
942 static NTSTATUS WINAPI wow64_NtUserPostDDEMessage( void *arg, ULONG size )
944 struct post_dde_message_params *params = arg;
945 struct
947 ULONG hwnd;
948 UINT msg;
949 LONG wparam;
950 LONG lparam;
951 DWORD dest_tid;
952 DWORD type;
953 } params32;
955 params32.hwnd = HandleToUlong( params->hwnd );
956 params32.msg = params->msg;
957 params32.wparam = params->wparam;
958 params32.lparam = params->lparam;
959 params32.dest_tid = params->dest_tid;
960 params32.type = params->type;
961 return dispatch_callback( NtUserPostDDEMessage, &params32, sizeof(params32) );
964 static NTSTATUS WINAPI wow64_NtUserRenderSynthesizedFormat( void *arg, ULONG size )
966 return dispatch_callback( NtUserRenderSynthesizedFormat, arg, size );
969 static NTSTATUS WINAPI wow64_NtUserUnpackDDEMessage( void *arg, ULONG size )
971 struct unpack_dde_message_params *params = arg;
972 struct unpack_dde_message_params32 *params32;
973 struct unpack_dde_message_result result;
974 struct
976 LONG wparam;
977 LONG lparam;
978 } *result32;
979 void *ret_ptr;
980 ULONG ret_len;
982 size -= FIELD_OFFSET( struct unpack_dde_message_params, data );
983 if (!(params32 = Wow64AllocateTemp( FIELD_OFFSET( struct unpack_dde_message_params32, data[size] ))))
984 return 0;
986 params32->result = 0;
987 params32->hwnd = HandleToUlong( params->hwnd );
988 params32->message = params->message;
989 params32->wparam = params->wparam;
990 params32->lparam = params->lparam;
991 if (size) memcpy( params32->data, params->data, size );
992 size = FIELD_OFFSET( struct unpack_dde_message_params32, data[size] );
994 if (!Wow64KiUserCallbackDispatcher( NtUserUnpackDDEMessage, params32, size, &ret_ptr, &ret_len ))
995 return FALSE;
996 if (ret_len == sizeof(*result32))
998 result32 = ret_ptr;
999 result.wparam = result32->wparam;
1000 result.lparam = result32->lparam;
1003 if (!params->result) NtCallbackReturn( &result, sizeof(result), TRUE );
1004 *params->result = result;
1005 return TRUE;
1008 static NTSTATUS WINAPI wow64_NtUserCallFreeIcon( void *arg, ULONG size )
1010 return dispatch_callback( NtUserCallFreeIcon, arg, size );
1013 static NTSTATUS WINAPI wow64_NtUserThunkLock( void *arg, ULONG size )
1015 return dispatch_callback( NtUserThunkLock, arg, size );
1018 static NTSTATUS WINAPI wow64_NtUserCallVulkanDebugReportCallback( void *arg, ULONG size )
1020 FIXME( "\n" );
1021 return 0;
1024 static NTSTATUS WINAPI wow64_NtUserCallVulkanDebugUtilsCallback( void *arg, ULONG size )
1026 FIXME( "\n" );
1027 return 0;
1030 static NTSTATUS WINAPI wow64_NtUserCallOpenGLDebugMessageCallback( void *arg, ULONG size )
1032 FIXME( "\n" );
1033 return 0;
1036 static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst0( void *arg, ULONG size )
1038 return dispatch_callback( NtUserDriverCallbackFirst + 0, arg, size );
1041 static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst1( void *arg, ULONG size )
1043 return dispatch_callback( NtUserDriverCallbackFirst + 1, arg, size );
1046 static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst2( void *arg, ULONG size )
1048 return dispatch_callback( NtUserDriverCallbackFirst + 2, arg, size );
1051 static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst3( void *arg, ULONG size )
1053 return dispatch_callback( NtUserDriverCallbackFirst + 3, arg, size );
1056 static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst4( void *arg, ULONG size )
1058 return dispatch_callback( NtUserDriverCallbackFirst + 4, arg, size );
1061 static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst5( void *arg, ULONG size )
1063 return dispatch_callback( NtUserDriverCallbackFirst + 5, arg, size );
1066 static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst6( void *arg, ULONG size )
1068 return dispatch_callback( NtUserDriverCallbackFirst + 6, arg, size );
1071 static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst7( void *arg, ULONG size )
1073 return dispatch_callback( NtUserDriverCallbackFirst + 7, arg, size );
1076 static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst8( void *arg, ULONG size )
1078 return dispatch_callback( NtUserDriverCallbackFirst + 8, arg, size );
1081 static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst9( void *arg, ULONG size )
1083 return dispatch_callback( NtUserDriverCallbackFirst + 9, arg, size );
1086 user_callback user_callbacks[] =
1088 /* user32 callbacks */
1089 wow64_NtUserCallEnumDisplayMonitor,
1090 wow64_NtUserCallSendAsyncCallback,
1091 wow64_NtUserCallWinEventHook,
1092 wow64_NtUserCallWinProc,
1093 wow64_NtUserCallWindowsHook,
1094 wow64_NtUserCopyImage,
1095 wow64_NtUserDrawNonClientButton,
1096 wow64_NtUserDrawScrollBar,
1097 wow64_NtUserDrawText,
1098 wow64_NtUserFreeCachedClipboardData,
1099 wow64_NtUserImmProcessKey,
1100 wow64_NtUserImmTranslateMessage,
1101 wow64_NtUserInitBuiltinClasses,
1102 wow64_NtUserLoadDriver,
1103 wow64_NtUserLoadImage,
1104 wow64_NtUserLoadSysMenu,
1105 wow64_NtUserPostDDEMessage,
1106 wow64_NtUserRenderSynthesizedFormat,
1107 wow64_NtUserUnpackDDEMessage,
1108 /* win16 hooks */
1109 wow64_NtUserCallFreeIcon,
1110 wow64_NtUserThunkLock,
1111 /* Vulkan support */
1112 wow64_NtUserCallVulkanDebugReportCallback,
1113 wow64_NtUserCallVulkanDebugUtilsCallback,
1114 /* OpenGL support */
1115 wow64_NtUserCallOpenGLDebugMessageCallback,
1116 /* Driver-specific callbacks */
1117 wow64_NtUserDriverCallbackFirst0,
1118 wow64_NtUserDriverCallbackFirst1,
1119 wow64_NtUserDriverCallbackFirst2,
1120 wow64_NtUserDriverCallbackFirst3,
1121 wow64_NtUserDriverCallbackFirst4,
1122 wow64_NtUserDriverCallbackFirst5,
1123 wow64_NtUserDriverCallbackFirst6,
1124 wow64_NtUserDriverCallbackFirst7,
1125 wow64_NtUserDriverCallbackFirst8,
1126 wow64_NtUserDriverCallbackFirst9,
1129 C_ASSERT( ARRAYSIZE(user_callbacks) == NtUserCallCount );
1131 NTSTATUS WINAPI wow64_NtUserActivateKeyboardLayout( UINT *args )
1133 HKL layout = get_handle( &args );
1134 UINT flags = get_ulong( &args );
1136 return HandleToUlong( NtUserActivateKeyboardLayout( layout, flags ));
1139 NTSTATUS WINAPI wow64_NtUserAddClipboardFormatListener( UINT *args )
1141 HWND hwnd = get_handle( &args );
1143 return NtUserAddClipboardFormatListener( hwnd );
1146 NTSTATUS WINAPI wow64_NtUserAssociateInputContext( UINT *args )
1148 HWND hwnd = get_handle( &args );
1149 HIMC ctx = get_handle( &args );
1150 ULONG flags = get_ulong( &args );
1152 return NtUserAssociateInputContext( hwnd, ctx, flags );
1155 NTSTATUS WINAPI wow64_NtUserAttachThreadInput( UINT *args )
1157 DWORD from = get_ulong( &args );
1158 DWORD to = get_ulong( &args );
1159 BOOL attach = get_ulong( &args );
1161 return NtUserAttachThreadInput( from, to, attach );
1164 NTSTATUS WINAPI wow64_NtUserBeginPaint( UINT *args )
1166 HWND hwnd = get_handle( &args );
1167 PAINTSTRUCT32 *ps32 = get_ptr( &args );
1169 PAINTSTRUCT ps;
1170 HDC ret;
1172 ret = NtUserBeginPaint( hwnd, ps32 ? & ps : NULL );
1173 if (ret && ps32)
1175 ps32->hdc = HandleToUlong( ps.hdc );
1176 ps32->fErase = ps.fErase;
1177 ps32->rcPaint = ps.rcPaint;
1179 return HandleToUlong( ret );
1182 NTSTATUS WINAPI wow64_NtUserBuildHimcList( UINT *args )
1184 ULONG thread_id = get_ulong( &args );
1185 ULONG count = get_ulong( &args );
1186 UINT32 *buffer32 = get_ptr( &args );
1187 UINT *size = get_ptr( &args );
1189 HIMC *buffer;
1190 ULONG i;
1191 NTSTATUS status;
1193 if (!(buffer = Wow64AllocateTemp( count * sizeof(*buffer) ))) return STATUS_NO_MEMORY;
1195 if ((status = NtUserBuildHimcList( thread_id, count, buffer, size ))) return status;
1197 for (i = 0; i < *size; i++) buffer32[i] = HandleToUlong( buffer[i] );
1198 return status;
1201 NTSTATUS WINAPI wow64_NtUserBuildHwndList( UINT *args )
1203 HDESK desktop = get_handle( &args );
1204 ULONG unk2 = get_ulong( &args );
1205 ULONG unk3 = get_ulong( &args );
1206 ULONG unk4 = get_ulong( &args );
1207 ULONG thread_id = get_ulong( &args );
1208 ULONG count = get_ulong( &args );
1209 UINT32 *buffer32 = get_ptr( &args );
1210 ULONG *size = get_ptr( &args );
1212 HWND *buffer;
1213 ULONG i;
1214 NTSTATUS status;
1216 if (!(buffer = Wow64AllocateTemp( count * sizeof(*buffer) ))) return STATUS_NO_MEMORY;
1218 if ((status = NtUserBuildHwndList( desktop, unk2, unk3, unk4, thread_id, count, buffer, size )))
1219 return status;
1221 for (i = 0; i < *size; i++)
1222 buffer32[i] = HandleToUlong( buffer[i] );
1223 return status;
1226 NTSTATUS WINAPI wow64_NtUserCallHwnd( UINT *args )
1228 HWND hwnd = get_handle( &args );
1229 DWORD code = get_ulong( &args );
1231 return NtUserCallHwnd( hwnd, code );
1234 NTSTATUS WINAPI wow64_NtUserCallHwndParam( UINT *args )
1236 HWND hwnd = get_handle( &args );
1237 DWORD_PTR param = get_ulong( &args );
1238 DWORD code = get_ulong( &args );
1240 switch (code)
1242 case NtUserCallHwndParam_GetScrollInfo:
1244 struct
1246 int bar;
1247 ULONG info;
1248 } *info32 = UlongToPtr( param );
1249 struct get_scroll_info_params info;
1251 info.bar = info32->bar;
1252 info.info = UlongToPtr( info32->info );
1253 return NtUserCallHwndParam( hwnd, (UINT_PTR)&info, code );
1256 case NtUserCallHwndParam_MapWindowPoints:
1258 struct
1260 ULONG hwnd_to;
1261 ULONG points;
1262 UINT count;
1263 } *params32 = UlongToPtr( param );
1264 struct map_window_points_params params;
1266 params.hwnd_to = LongToHandle( params32->hwnd_to );
1267 params.points = UlongToPtr( params32->points );
1268 params.count = params32->count;
1269 return NtUserCallHwndParam( hwnd, (UINT_PTR)&params, code );
1272 default:
1273 return NtUserCallHwndParam( hwnd, param, code );
1277 NTSTATUS WINAPI wow64_NtUserCallMsgFilter( UINT *args )
1279 MSG32 *msg32 = get_ptr( &args );
1280 INT code = get_ulong( &args );
1281 MSG msg;
1282 BOOL ret;
1284 ret = NtUserCallMsgFilter( msg_32to64( &msg, msg32 ), code );
1285 msg_64to32( &msg, msg32 );
1286 return ret;
1289 NTSTATUS WINAPI wow64_NtUserCallNextHookEx( UINT *args )
1291 HHOOK hhook = get_handle( &args );
1292 INT code = get_ulong( &args );
1293 WPARAM wparam = get_ulong( &args );
1294 LPARAM lparam = get_ulong( &args );
1296 return NtUserCallNextHookEx( hhook, code, wparam, lparam );
1299 NTSTATUS WINAPI wow64_NtUserCallNoParam( UINT *args )
1301 ULONG code = get_ulong( &args );
1303 return NtUserCallNoParam( code );
1306 NTSTATUS WINAPI wow64_NtUserCallOneParam( UINT *args )
1308 ULONG_PTR arg = get_ulong( &args );
1309 ULONG code = get_ulong( &args );
1311 return NtUserCallOneParam( arg, code );
1314 NTSTATUS WINAPI wow64_NtUserCallTwoParam( UINT *args )
1316 ULONG_PTR arg1 = get_ulong( &args );
1317 ULONG_PTR arg2 = get_ulong( &args );
1318 ULONG code = get_ulong( &args );
1320 switch (code)
1322 case NtUserCallTwoParam_GetMenuInfo:
1324 MENUINFO32 *info32 = UlongToPtr( arg2 );
1325 MENUINFO info;
1327 if (!info32 || info32->cbSize != sizeof(*info32))
1329 set_last_error32( ERROR_INVALID_PARAMETER );
1330 return FALSE;
1333 info.cbSize = sizeof(info);
1334 info.fMask = info32->fMask;
1335 if (!NtUserCallTwoParam( arg1, (UINT_PTR)&info, code )) return FALSE;
1336 if (info.fMask & MIM_BACKGROUND) info32->hbrBack = HandleToUlong( info.hbrBack );
1337 if (info.fMask & MIM_HELPID) info32->dwContextHelpID = info.dwContextHelpID;
1338 if (info.fMask & MIM_MAXHEIGHT) info32->cyMax = info.cyMax;
1339 if (info.fMask & MIM_MENUDATA) info32->dwMenuData = info.dwMenuData;
1340 if (info.fMask & MIM_STYLE) info32->dwStyle = info.dwStyle;
1341 return TRUE;
1344 default:
1345 return NtUserCallTwoParam( arg1, arg2, code );
1349 NTSTATUS WINAPI wow64_NtUserChangeClipboardChain( UINT *args )
1351 HWND hwnd = get_handle( &args );
1352 HWND next = get_handle( &args );
1354 return NtUserChangeClipboardChain( hwnd, next );
1357 NTSTATUS WINAPI wow64_NtUserChangeDisplaySettings( UINT *args )
1359 UNICODE_STRING32 *devname32 = get_ptr( &args );
1360 DEVMODEW *devmode = get_ptr( &args );
1361 HWND hwnd = get_handle( &args );
1362 DWORD flags = get_ulong( &args );
1363 void *lparam = get_ptr( &args );
1365 UNICODE_STRING devname;
1367 return NtUserChangeDisplaySettings( unicode_str_32to64( &devname, devname32 ),
1368 devmode, hwnd, flags, lparam );
1371 NTSTATUS WINAPI wow64_NtUserCheckMenuItem( UINT *args )
1373 HMENU handle = get_handle( &args );
1374 UINT id = get_ulong( &args );
1375 UINT flags = get_ulong( &args );
1377 return NtUserCheckMenuItem( handle, id, flags );
1380 NTSTATUS WINAPI wow64_NtUserChildWindowFromPointEx( UINT *args )
1382 HWND parent = get_handle( &args );
1383 LONG x = get_ulong( &args );
1384 LONG y = get_ulong( &args );
1385 UINT flags = get_ulong( &args );
1387 return HandleToUlong( NtUserChildWindowFromPointEx( parent, x, y, flags ));
1390 NTSTATUS WINAPI wow64_NtUserClipCursor( UINT *args )
1392 const RECT *rect = get_ptr( &args );
1394 return NtUserClipCursor( rect );
1397 NTSTATUS WINAPI wow64_NtUserCloseClipboard( UINT *args )
1399 return NtUserCloseClipboard();
1402 NTSTATUS WINAPI wow64_NtUserCloseDesktop( UINT *args )
1404 HDESK handle = get_handle( &args );
1406 return NtUserCloseDesktop( handle );
1409 NTSTATUS WINAPI wow64_NtUserCloseWindowStation( UINT *args )
1411 HWINSTA handle = get_handle( &args );
1413 return NtUserCloseWindowStation( handle );
1416 NTSTATUS WINAPI wow64_NtUserCopyAcceleratorTable( UINT *args )
1418 HACCEL src = get_handle( &args );
1419 ACCEL *dst = get_ptr( &args );
1420 INT count = get_ulong( &args );
1422 return NtUserCopyAcceleratorTable( src, dst, count );
1425 NTSTATUS WINAPI wow64_NtUserCountClipboardFormats( UINT *args )
1427 return NtUserCountClipboardFormats();
1430 NTSTATUS WINAPI wow64_NtUserCreateAcceleratorTable( UINT *args )
1432 ACCEL *table = get_ptr( &args );
1433 INT count = get_ulong( &args );
1435 return HandleToUlong( NtUserCreateAcceleratorTable( table, count ));
1438 NTSTATUS WINAPI wow64_NtUserCreateCaret( UINT *args )
1440 HWND hwnd = get_handle( &args );
1441 HBITMAP bitmap = get_handle( &args );
1442 int width = get_ulong( &args );
1443 int height = get_ulong( &args );
1445 return NtUserCreateCaret( hwnd, bitmap, width, height );
1448 NTSTATUS WINAPI wow64_NtUserCreateDesktopEx( UINT *args )
1450 OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
1451 UNICODE_STRING32 *device32 = get_ptr( &args );
1452 DEVMODEW *devmode = get_ptr( &args );
1453 DWORD flags = get_ulong( &args );
1454 ACCESS_MASK access = get_ulong( &args );
1455 ULONG heap_size = get_ulong( &args );
1457 struct object_attr64 attr;
1458 UNICODE_STRING device;
1459 HANDLE ret;
1461 ret = NtUserCreateDesktopEx( objattr_32to64( &attr, attr32 ),
1462 unicode_str_32to64( &device, device32 ),
1463 devmode, flags, access, heap_size );
1464 return HandleToUlong( ret );
1467 NTSTATUS WINAPI wow64_NtUserCreateInputContext( UINT *args )
1469 UINT_PTR client_ptr = get_ulong( &args );
1471 return HandleToUlong( NtUserCreateInputContext( client_ptr ));
1474 NTSTATUS WINAPI wow64_NtUserCreateWindowEx( UINT *args )
1476 DWORD ex_style = get_ulong( &args );
1477 UNICODE_STRING32 *class_name32 = get_ptr( &args );
1478 UNICODE_STRING32 *version32 = get_ptr( &args );
1479 UNICODE_STRING32 *window_name32 = get_ptr( &args );
1480 DWORD style = get_ulong( &args );
1481 int x = get_ulong( &args );
1482 int y = get_ulong( &args );
1483 int width = get_ulong( &args );
1484 int height = get_ulong( &args );
1485 HWND parent = get_handle( &args );
1486 HMENU menu = get_handle( &args );
1487 HINSTANCE instance = get_handle( &args );
1488 void *params = get_ptr( &args );
1489 DWORD flags = get_ulong( &args );
1490 HINSTANCE client_instance = get_handle( &args );
1491 DWORD unk = get_ulong( &args );
1492 BOOL ansi = get_ulong( &args );
1494 UNICODE_STRING class_name, version, window_name;
1495 HWND ret;
1497 ret = NtUserCreateWindowEx( ex_style,
1498 unicode_str_32to64( &class_name, class_name32),
1499 unicode_str_32to64( &version, version32 ),
1500 unicode_str_32to64( &window_name, window_name32 ),
1501 style, x, y, width, height, parent, menu,
1502 instance, params, flags, client_instance, unk, ansi );
1503 return HandleToUlong( ret );
1506 NTSTATUS WINAPI wow64_NtUserCreateWindowStation( UINT *args )
1508 OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
1509 ACCESS_MASK access = get_ulong( &args );
1510 ULONG arg3 = get_ulong( &args );
1511 ULONG arg4 = get_ulong( &args );
1512 ULONG arg5 = get_ulong( &args );
1513 ULONG arg6 = get_ulong( &args );
1514 ULONG arg7 = get_ulong( &args );
1516 struct object_attr64 attr;
1518 return HandleToUlong( NtUserCreateWindowStation( objattr_32to64( &attr, attr32 ), access,
1519 arg3, arg4, arg5, arg6, arg7 ));
1522 NTSTATUS WINAPI wow64_NtUserDeferWindowPosAndBand( UINT *args )
1524 HDWP hdwp = get_handle( &args );
1525 HWND hwnd = get_handle( &args );
1526 HWND after = get_handle( &args );
1527 INT x = get_ulong( &args );
1528 INT y = get_ulong( &args );
1529 INT cx = get_ulong( &args );
1530 INT cy = get_ulong( &args );
1531 UINT flags = get_ulong( &args );
1532 UINT unk1 = get_ulong( &args );
1533 UINT unk2 = get_ulong( &args );
1535 HDWP ret = NtUserDeferWindowPosAndBand( hdwp, hwnd, after, x, y, cx, cy, flags, unk1, unk2 );
1536 return HandleToUlong( ret );
1539 NTSTATUS WINAPI wow64_NtUserDeleteMenu( UINT *args )
1541 HMENU menu = get_handle( &args );
1542 UINT id = get_ulong( &args );
1543 UINT flags = get_ulong( &args );
1545 return NtUserDeleteMenu( menu, id, flags );
1548 NTSTATUS WINAPI wow64_NtUserDestroyAcceleratorTable( UINT *args )
1550 HACCEL handle = get_handle( &args );
1552 return NtUserDestroyAcceleratorTable( handle );
1555 NTSTATUS WINAPI wow64_NtUserDestroyCursor( UINT *args )
1557 HCURSOR cursor = get_handle( &args );
1558 ULONG arg = get_ulong( &args );
1560 return NtUserDestroyCursor( cursor, arg );
1563 NTSTATUS WINAPI wow64_NtUserDestroyInputContext( UINT *args )
1565 HIMC handle = get_handle( &args );
1567 return NtUserDestroyInputContext( handle );
1570 NTSTATUS WINAPI wow64_NtUserDestroyMenu( UINT *args )
1572 HMENU handle = get_handle( &args );
1574 return NtUserDestroyMenu( handle );
1577 NTSTATUS WINAPI wow64_NtUserDestroyWindow( UINT *args )
1579 HWND hwnd = get_handle( &args );
1581 return NtUserDestroyWindow( hwnd );
1584 NTSTATUS WINAPI wow64_NtUserDisableThreadIme( UINT *args )
1586 DWORD thread_id = get_ulong( &args );
1588 return NtUserDisableThreadIme( thread_id );
1591 NTSTATUS WINAPI wow64_NtUserDispatchMessage( UINT *args )
1593 const MSG32 *msg32 = get_ptr( &args );
1594 MSG msg;
1596 return NtUserDispatchMessage( msg_32to64( &msg, msg32 ));
1599 NTSTATUS WINAPI wow64_NtUserDragDetect( UINT *args )
1601 HWND hwnd = get_handle( &args );
1602 int x = get_ulong( &args );
1603 int y = get_ulong( &args );
1605 return NtUserDragDetect( hwnd, x, y );
1608 NTSTATUS WINAPI wow64_NtUserDragObject( UINT *args )
1610 HWND parent = get_handle( &args );
1611 HWND hwnd = get_handle( &args );
1612 UINT fmt = get_ulong( &args );
1613 ULONG_PTR data = get_ulong( &args );
1614 HCURSOR hcursor = get_handle( &args );
1616 return NtUserDragObject( parent, hwnd, fmt, data, hcursor );
1619 NTSTATUS WINAPI wow64_NtUserDrawCaptionTemp( UINT *args )
1621 HWND hwnd = get_handle( &args );
1622 HDC hdc = get_handle( &args );
1623 const RECT *rect = get_ptr( &args );
1624 HFONT font = get_handle( &args );
1625 HICON icon = get_handle( &args );
1626 const WCHAR *str = get_ptr( &args );
1627 UINT flags = get_ulong( &args );
1629 return NtUserDrawCaptionTemp( hwnd, hdc, rect, font, icon, str, flags );
1632 NTSTATUS WINAPI wow64_NtUserDrawIconEx( UINT *args )
1634 HDC hdc = get_handle( &args );
1635 int x0 = get_ulong( &args );
1636 int y0 = get_ulong( &args );
1637 HICON icon = get_handle( &args );
1638 int width = get_ulong( &args );
1639 int height = get_ulong( &args );
1640 UINT istep = get_ulong( &args );
1641 HBRUSH hbr = get_handle( &args );
1642 UINT flags = get_ulong( &args );
1644 return NtUserDrawIconEx( hdc, x0, y0, icon, width, height, istep, hbr, flags );
1647 NTSTATUS WINAPI wow64_NtUserDrawMenuBarTemp( UINT *args )
1649 HWND hwnd = get_handle( &args );
1650 HDC hdc = get_handle( &args );
1651 RECT *rect = get_ptr( &args );
1652 HMENU handle = get_handle( &args );
1653 HFONT font = get_handle( &args );
1655 return NtUserDrawMenuBarTemp( hwnd, hdc, rect, handle, font );
1658 NTSTATUS WINAPI wow64_NtUserEmptyClipboard( UINT *args )
1660 return NtUserEmptyClipboard();
1663 NTSTATUS WINAPI wow64_NtUserEnableMenuItem( UINT *args )
1665 HMENU handle = get_handle( &args );
1666 UINT id = get_ulong( &args );
1667 UINT flags = get_ulong( &args );
1669 return NtUserEnableMenuItem( handle, id, flags );
1672 NTSTATUS WINAPI wow64_NtUserEnableMouseInPointer( UINT *args )
1674 UINT enable = get_ulong( &args );
1676 return NtUserEnableMouseInPointer( enable );
1679 NTSTATUS WINAPI wow64_NtUserEnableScrollBar( UINT *args )
1681 HWND hwnd = get_handle( &args );
1682 UINT bar = get_ulong( &args );
1683 UINT flags = get_ulong( &args );
1685 return NtUserEnableScrollBar( hwnd, bar, flags );
1688 NTSTATUS WINAPI wow64_NtUserEndDeferWindowPosEx( UINT *args )
1690 HDWP hdwp = get_handle( &args );
1691 BOOL async = get_ulong( &args );
1693 return NtUserEndDeferWindowPosEx( hdwp, async );
1696 NTSTATUS WINAPI wow64_NtUserEndMenu( UINT *args )
1698 return NtUserEndMenu();
1701 NTSTATUS WINAPI wow64_NtUserEndPaint( UINT *args )
1703 HWND hwnd = get_handle( &args );
1704 const PAINTSTRUCT32 *ps32 = get_ptr( &args );
1705 PAINTSTRUCT ps;
1707 return NtUserEndPaint( hwnd, paintstruct_32to64( &ps, ps32 ));
1710 NTSTATUS WINAPI wow64_NtUserEnumDisplayDevices( UINT *args )
1712 UNICODE_STRING32 *device32 = get_ptr( &args );
1713 DWORD index = get_ulong( &args );
1714 DISPLAY_DEVICEW *info = get_ptr( &args );
1715 DWORD flags = get_ulong( &args );
1717 UNICODE_STRING device;
1719 return NtUserEnumDisplayDevices( unicode_str_32to64( &device, device32 ), index, info, flags );
1722 NTSTATUS WINAPI wow64_NtUserEnumDisplayMonitors( UINT *args )
1724 HDC hdc = get_handle( &args );
1725 RECT *rect = get_ptr( &args );
1726 MONITORENUMPROC proc = get_ptr( &args );
1727 LPARAM lp = get_ulong( &args );
1729 return NtUserEnumDisplayMonitors( hdc, rect, proc, lp );
1732 NTSTATUS WINAPI wow64_NtUserEnumDisplaySettings( UINT *args )
1734 UNICODE_STRING32 *device32 = get_ptr( &args );
1735 DWORD mode = get_ulong( &args );
1736 DEVMODEW *dev_mode = get_ptr( &args );
1737 DWORD flags = get_ulong( &args );
1739 UNICODE_STRING device;
1741 return NtUserEnumDisplaySettings( unicode_str_32to64( &device, device32 ),
1742 mode, dev_mode, flags );
1745 NTSTATUS WINAPI wow64_NtUserExcludeUpdateRgn( UINT *args )
1747 HDC hdc = get_handle( &args );
1748 HWND hwnd = get_handle( &args );
1750 return NtUserExcludeUpdateRgn( hdc, hwnd );
1753 NTSTATUS WINAPI wow64_NtUserFindExistingCursorIcon( UINT *args )
1755 UNICODE_STRING32 *module32 = get_ptr( &args );
1756 UNICODE_STRING32 *res_name32 = get_ptr( &args );
1757 void *desc = get_ptr( &args );
1759 UNICODE_STRING module;
1760 UNICODE_STRING res_name;
1761 HICON ret;
1763 ret = NtUserFindExistingCursorIcon( unicode_str_32to64( &module, module32 ),
1764 unicode_str_32to64( &res_name, res_name32 ), desc );
1765 return HandleToUlong( ret );
1768 NTSTATUS WINAPI wow64_NtUserFindWindowEx( UINT *args )
1770 HWND parent = get_handle( &args );
1771 HWND child = get_handle( &args );
1772 UNICODE_STRING32 *class32 = get_ptr( &args );
1773 UNICODE_STRING32 *title32 = get_ptr( &args );
1774 ULONG unk = get_ulong( &args );
1776 UNICODE_STRING class, title;
1777 HWND ret;
1779 ret = NtUserFindWindowEx( parent, child, unicode_str_32to64( &class, class32 ),
1780 unicode_str_32to64( &title, title32 ), unk );
1781 return HandleToUlong( ret );
1784 NTSTATUS WINAPI wow64_NtUserFlashWindowEx( UINT *args )
1786 struct
1788 UINT cbSize;
1789 ULONG hwnd;
1790 DWORD dwFlags;
1791 UINT uCount;
1792 DWORD dwTimeout;
1793 } *info32 = get_ptr( &args );
1795 FLASHWINFO info;
1797 if (!info32)
1799 set_last_error32( ERROR_NOACCESS );
1800 return FALSE;
1803 if (info32->cbSize != sizeof(*info32))
1805 set_last_error32( ERROR_INVALID_PARAMETER );
1806 return FALSE;
1809 info.cbSize = sizeof(info);
1810 info.hwnd = LongToHandle( info32->hwnd );
1811 info.dwFlags = info32->dwFlags;
1812 info.uCount = info32->uCount;
1813 info.dwTimeout = info32->dwTimeout;
1814 return NtUserFlashWindowEx( &info );
1817 NTSTATUS WINAPI wow64_NtUserGetAncestor( UINT *args )
1819 HWND hwnd = get_handle( &args );
1820 UINT type = get_ulong( &args );
1822 return HandleToUlong( NtUserGetAncestor( hwnd, type ));
1825 NTSTATUS WINAPI wow64_NtUserGetAsyncKeyState( UINT *args )
1827 INT key = get_ulong( &args );
1829 return NtUserGetAsyncKeyState( key );
1832 NTSTATUS WINAPI wow64_NtUserGetAtomName( UINT *args )
1834 ATOM atom = get_ulong( &args );
1835 UNICODE_STRING32 *str32 = get_ptr( &args );
1837 UNICODE_STRING str;
1839 return NtUserGetAtomName( atom, unicode_str_32to64( &str, str32 ));
1842 NTSTATUS WINAPI wow64_NtUserGetCaretBlinkTime( UINT *args )
1844 return NtUserGetCaretBlinkTime();
1847 NTSTATUS WINAPI wow64_NtUserGetCaretPos( UINT *args )
1849 POINT *pt = get_ptr( &args );
1851 return NtUserGetCaretPos( pt );
1854 NTSTATUS WINAPI wow64_NtUserGetClassInfoEx( UINT *args )
1856 HINSTANCE instance = get_ptr( &args );
1857 UNICODE_STRING32 *name32 = get_ptr( &args );
1858 WNDCLASSEXW32 *wc32 = get_ptr( &args );
1859 struct client_menu_name32 *client_name32 = get_ptr( &args );
1860 BOOL ansi = get_ulong( &args );
1862 struct client_menu_name client_name;
1863 UNICODE_STRING name;
1864 WNDCLASSEXW wc;
1865 ATOM ret;
1867 wc.cbSize = sizeof(wc);
1868 if (!(ret = NtUserGetClassInfoEx( instance, unicode_str_32to64( &name, name32 ), &wc,
1869 &client_name, ansi )))
1870 return 0;
1872 wc32->style = wc.style;
1873 wc32->lpfnWndProc = PtrToUlong( wc.lpfnWndProc );
1874 wc32->cbClsExtra = wc.cbClsExtra;
1875 wc32->cbWndExtra = wc.cbWndExtra;
1876 wc32->hInstance = HandleToUlong( wc.hInstance );
1877 wc32->hIcon = HandleToUlong( wc.hIcon );
1878 wc32->hCursor = HandleToUlong( wc.hCursor );
1879 wc32->hbrBackground = HandleToUlong( wc.hbrBackground );
1880 wc32->lpszMenuName = PtrToUlong( wc.lpszMenuName );
1881 wc32->lpszClassName = PtrToUlong( wc.lpszClassName );
1882 wc32->hIconSm = HandleToUlong( wc.hIconSm );
1883 client_menu_name_64to32( &client_name, client_name32 );
1884 return ret;
1887 NTSTATUS WINAPI wow64_NtUserGetClassName( UINT *args )
1889 HWND hwnd = get_handle( &args );
1890 BOOL real = get_ulong( &args );
1891 UNICODE_STRING32 *str32 = get_ptr( &args );
1893 UNICODE_STRING str;
1895 return NtUserGetClassName( hwnd, real, unicode_str_32to64( &str, str32 ));
1898 NTSTATUS WINAPI wow64_NtUserGetClipboardData( UINT *args )
1900 UINT format = get_ulong( &args );
1901 struct
1903 UINT32 data;
1904 UINT32 size;
1905 UINT32 data_size;
1906 UINT seqno;
1907 BOOL data_only;
1908 } *params32 = get_ptr( &args );
1910 struct get_clipboard_params params;
1911 HANDLE ret;
1913 params.data = UlongToPtr( params32->data );
1914 params.size = params32->size;
1915 params.data_size = params32->data_size;
1916 params.data_only = params32->data_only;
1918 ret = NtUserGetClipboardData( format, &params );
1920 params32->size = params.size;
1921 params32->data_size = params.data_size;
1922 params32->seqno = params.seqno;
1923 return HandleToUlong( ret );
1926 NTSTATUS WINAPI wow64_NtUserGetClipboardFormatName( UINT *args )
1928 UINT format = get_ulong( &args );
1929 WCHAR *buffer = get_ptr( &args );
1930 INT maxlen = get_ulong( &args );
1932 return NtUserGetClipboardFormatName( format, buffer, maxlen );
1935 NTSTATUS WINAPI wow64_NtUserGetClipboardOwner( UINT *args )
1937 return HandleToUlong( NtUserGetClipboardOwner() );
1940 NTSTATUS WINAPI wow64_NtUserGetClipboardSequenceNumber( UINT *args )
1942 return NtUserGetClipboardSequenceNumber();
1945 NTSTATUS WINAPI wow64_NtUserGetClipboardViewer( UINT *args )
1947 return HandleToUlong( NtUserGetClipboardViewer() );
1950 NTSTATUS WINAPI wow64_NtUserGetCursor( UINT *args )
1952 return HandleToUlong( NtUserGetCursor() );
1955 NTSTATUS WINAPI wow64_NtUserGetCursorFrameInfo( UINT *args )
1957 HCURSOR cursor = get_ptr( &args );
1958 DWORD istep = get_ulong( &args );
1959 DWORD *rate_jiffies = get_ptr( &args );
1960 DWORD *num_steps = get_ptr( &args );
1962 return HandleToUlong( NtUserGetCursorFrameInfo( cursor, istep, rate_jiffies, num_steps ));
1965 NTSTATUS WINAPI wow64_NtUserGetCursorInfo( UINT *args )
1967 struct
1969 DWORD cbSize;
1970 DWORD flags;
1971 ULONG hCursor;
1972 POINT ptScreenPos;
1973 } *info32 = get_ptr( &args );
1974 CURSORINFO info;
1976 if (!info32) return FALSE;
1977 info.cbSize = sizeof(info);
1978 if (!NtUserGetCursorInfo( &info )) return FALSE;
1979 info32->flags = info.flags;
1980 info32->hCursor = HandleToUlong( info.hCursor );
1981 info32->ptScreenPos = info.ptScreenPos;
1982 return TRUE;
1985 NTSTATUS WINAPI wow64_NtUserGetDC( UINT *args )
1987 HWND hwnd = get_handle( &args );
1989 return HandleToUlong( NtUserGetDC( hwnd ));
1992 NTSTATUS WINAPI wow64_NtUserGetDCEx( UINT *args )
1994 HWND hwnd = get_handle( &args );
1995 HRGN clip_rgn = get_handle( &args );
1996 DWORD flags = get_ulong( &args );
1998 return HandleToUlong( NtUserGetDCEx( hwnd, clip_rgn, flags ));
2001 NTSTATUS WINAPI wow64_NtUserGetDisplayConfigBufferSizes( UINT *args )
2003 UINT32 flags = get_ulong( &args );
2004 UINT32 *num_path_info = get_ptr( &args );
2005 UINT32 *num_mode_info = get_ptr( &args );
2007 return NtUserGetDisplayConfigBufferSizes( flags, num_path_info, num_mode_info );
2010 NTSTATUS WINAPI wow64_NtUserGetDoubleClickTime( UINT *args )
2012 return NtUserGetDoubleClickTime();
2015 NTSTATUS WINAPI wow64_NtUserGetDpiForMonitor( UINT *args )
2017 HMONITOR monitor = get_handle( &args );
2018 UINT type = get_ulong( &args );
2019 UINT *x = get_ptr( &args );
2020 UINT *y = get_ptr( &args );
2022 return NtUserGetDpiForMonitor( monitor, type, x, y );
2025 NTSTATUS WINAPI wow64_NtUserGetForegroundWindow( UINT *args )
2027 return HandleToUlong( NtUserGetForegroundWindow() );
2030 NTSTATUS WINAPI wow64_NtUserGetGUIThreadInfo( UINT *args )
2032 DWORD id = get_ulong( &args );
2033 struct
2035 DWORD cbSize;
2036 DWORD flags;
2037 ULONG hwndActive;
2038 ULONG hwndFocus;
2039 ULONG hwndCapture;
2040 ULONG hwndMenuOwner;
2041 ULONG hwndMoveSize;
2042 ULONG hwndCaret;
2043 RECT rcCaret;
2044 } *info32 = get_ptr( &args );
2045 GUITHREADINFO info;
2047 if (info32->cbSize != sizeof(*info32))
2049 set_last_error32( ERROR_INVALID_PARAMETER );
2050 return FALSE;
2053 info.cbSize = sizeof(info);
2054 if (!NtUserGetGUIThreadInfo( id, &info )) return FALSE;
2055 info32->flags = info.flags;
2056 info32->hwndActive = HandleToUlong( info.hwndActive );
2057 info32->hwndFocus = HandleToUlong( info.hwndFocus );
2058 info32->hwndCapture = HandleToUlong( info.hwndCapture );
2059 info32->hwndMenuOwner = HandleToUlong( info.hwndMenuOwner );
2060 info32->hwndMoveSize = HandleToUlong( info.hwndMoveSize );
2061 info32->hwndCaret = HandleToUlong( info.hwndCaret );
2062 info32->rcCaret = info.rcCaret;
2063 return TRUE;
2066 NTSTATUS WINAPI wow64_NtUserGetIconInfo( UINT *args )
2068 HICON icon = get_handle( &args );
2069 struct
2071 BOOL fIcon;
2072 DWORD xHotspot;
2073 DWORD yHotspot;
2074 UINT32 hbmMask;
2075 UINT32 hbmColor;
2076 } *info32 = get_ptr( &args );
2077 UNICODE_STRING32 *module32 = get_ptr( &args );
2078 UNICODE_STRING32 *res_name32 = get_ptr( &args );
2079 DWORD *bpp = get_ptr( &args );
2080 LONG unk = get_ulong( &args );
2082 ICONINFO info;
2083 UNICODE_STRING module, res_name;
2085 if (!NtUserGetIconInfo( icon, &info, unicode_str_32to64( &module, module32 ),
2086 unicode_str_32to64( &res_name, res_name32 ), bpp, unk ))
2087 return FALSE;
2089 info32->fIcon = info.fIcon;
2090 info32->xHotspot = info.xHotspot;
2091 info32->yHotspot = info.yHotspot;
2092 info32->hbmMask = HandleToUlong( info.hbmMask );
2093 info32->hbmColor = HandleToUlong( info.hbmColor );
2094 if (module32)
2096 module32->Buffer = PtrToUlong( module.Buffer );
2097 module32->Length = module.Length;
2099 if (res_name32)
2101 res_name32->Buffer = PtrToUlong( res_name.Buffer );
2102 res_name32->Length = res_name.Length;
2104 return TRUE;
2107 NTSTATUS WINAPI wow64_NtUserGetIconSize( UINT *args )
2109 HICON handle = get_handle( &args );
2110 UINT step = get_ulong( &args );
2111 LONG *width = get_ptr( &args );
2112 LONG *height = get_ptr( &args );
2114 return NtUserGetIconSize( handle, step, width, height );
2117 NTSTATUS WINAPI wow64_NtUserGetInternalWindowPos( UINT *args )
2119 HWND hwnd = get_handle( &args );
2120 RECT *rect = get_ptr( &args );
2121 POINT *pt = get_ptr( &args );
2123 return NtUserGetInternalWindowPos( hwnd, rect, pt );
2126 NTSTATUS WINAPI wow64_NtUserGetKeyNameText( UINT *args )
2128 LONG lparam = get_ulong( &args );
2129 WCHAR *buffer = get_ptr( &args );
2130 INT size = get_ulong( &args );
2132 return NtUserGetKeyNameText( lparam, buffer, size );
2135 NTSTATUS WINAPI wow64_NtUserGetKeyState( UINT *args )
2137 INT vkey = get_ulong( &args );
2139 return NtUserGetKeyState( vkey );
2142 NTSTATUS WINAPI wow64_NtUserGetKeyboardLayout( UINT *args )
2144 DWORD tid = get_ulong( &args );
2146 return HandleToUlong( NtUserGetKeyboardLayout( tid ));
2149 NTSTATUS WINAPI wow64_NtUserGetKeyboardLayoutList( UINT *args )
2151 INT size = get_ulong( &args );
2152 UINT32 *layouts32 = get_ptr( &args );
2153 HKL *layouts = NULL;
2154 UINT ret, i;
2156 if (layouts32 && size && !(layouts = Wow64AllocateTemp( size * sizeof(*layouts) )))
2157 return 0;
2159 ret = NtUserGetKeyboardLayoutList( size, layouts );
2160 if (layouts)
2161 for (i = 0; i < ret; i++) layouts32[i] = HandleToUlong( layouts[i] );
2162 return ret;
2165 NTSTATUS WINAPI wow64_NtUserGetKeyboardLayoutName( UINT *args )
2167 WCHAR *name = get_ptr( &args );
2169 return NtUserGetKeyboardLayoutName( name );
2172 NTSTATUS WINAPI wow64_NtUserGetKeyboardState( UINT *args )
2174 BYTE *state = get_ptr( &args );
2176 return NtUserGetKeyboardState( state );
2179 NTSTATUS WINAPI wow64_NtUserGetLayeredWindowAttributes( UINT *args )
2181 HWND hwnd = get_handle( &args );
2182 COLORREF *key = get_ptr( &args );
2183 BYTE *alpha = get_ptr( &args );
2184 DWORD *flags = get_ptr( &args );
2186 return NtUserGetLayeredWindowAttributes( hwnd, key, alpha, flags );
2189 NTSTATUS WINAPI wow64_NtUserGetMenuBarInfo( UINT *args )
2191 HWND hwnd = get_handle( &args );
2192 LONG id = get_ulong( &args );
2193 LONG item = get_ulong( &args );
2194 struct
2196 DWORD cbSize;
2197 RECT rcBar;
2198 ULONG hMenu;
2199 ULONG hwndMenu;
2200 BOOL fBarFocused:1;
2201 BOOL fFocused:1;
2202 } *info32 = get_ptr( &args );
2204 MENUBARINFO info;
2206 if (info32->cbSize != sizeof(*info32))
2208 set_last_error32( ERROR_INVALID_PARAMETER );
2209 return FALSE;
2212 info.cbSize = sizeof(info);
2213 if (!NtUserGetMenuBarInfo( hwnd, id, item, &info )) return FALSE;
2214 info32->rcBar = info.rcBar;
2215 info32->hMenu = HandleToUlong( info.hMenu );
2216 info32->hwndMenu = HandleToUlong( info.hwndMenu );
2217 info32->fBarFocused = info.fBarFocused;
2218 info32->fFocused = info.fFocused;
2219 return TRUE;
2222 NTSTATUS WINAPI wow64_NtUserGetMenuItemRect( UINT *args )
2224 HWND hwnd = get_handle( &args );
2225 HMENU handle = get_handle( &args );
2226 UINT item = get_ulong( &args );
2227 RECT *rect = get_ptr( &args );
2229 return NtUserGetMenuItemRect( hwnd, handle, item, rect );
2232 NTSTATUS WINAPI wow64_NtUserGetMessage( UINT *args )
2234 MSG32 *msg32 = get_ptr( &args );
2235 HWND hwnd = get_handle( &args );
2236 UINT first = get_ulong( &args );
2237 UINT last = get_ulong( &args );
2238 MSG msg;
2239 int ret;
2241 ret = NtUserGetMessage( &msg, hwnd, first, last );
2242 if (ret != -1) msg_64to32( &msg, msg32 );
2243 return ret;
2246 NTSTATUS WINAPI wow64_NtUserGetMouseMovePointsEx( UINT *args )
2248 UINT size = get_ulong( &args );
2249 MOUSEMOVEPOINT32 *ptin32 = get_ptr( &args );
2250 MOUSEMOVEPOINT32 *ptout32 = get_ptr( &args );
2251 int count = get_ulong( &args );
2252 DWORD resolution = get_ulong( &args );
2254 MOUSEMOVEPOINT ptin[64], ptout[64];
2255 int ret, i;
2257 if (size != sizeof(MOUSEMOVEPOINT32) || count < 0 || count > ARRAYSIZE( ptin ))
2259 set_last_error32( ERROR_INVALID_PARAMETER );
2260 return -1;
2263 if (!ptin32 || (!ptout32 && count))
2265 set_last_error32( ERROR_NOACCESS );
2266 return -1;
2269 for (i = 0; i < count; i++)
2271 ptin[i].x = ptin32[i].x;
2272 ptin[i].y = ptin32[i].y;
2273 ptin[i].time = ptin32[i].time;
2274 ptin[i].dwExtraInfo = ptin32[i].dwExtraInfo;
2277 ret = NtUserGetMouseMovePointsEx( sizeof(MOUSEMOVEPOINT), ptin, ptout, count, resolution );
2279 for (i = 0; i < ret; i++)
2281 ptout32[i].x = ptout[i].x;
2282 ptout32[i].y = ptout[i].y;
2283 ptout32[i].time = ptout[i].time;
2284 ptout32[i].dwExtraInfo = ptout[i].dwExtraInfo;
2287 return ret;
2290 NTSTATUS WINAPI wow64_NtUserGetObjectInformation( UINT *args )
2292 HANDLE handle = get_handle( &args );
2293 INT index = get_ulong( &args );
2294 void *info = get_ptr( &args );
2295 DWORD len = get_ulong( &args );
2296 DWORD *needed = get_ptr( &args );
2298 return NtUserGetObjectInformation( handle, index, info, len, needed );
2301 NTSTATUS WINAPI wow64_NtUserGetOpenClipboardWindow( UINT *args )
2303 return HandleToUlong( NtUserGetOpenClipboardWindow() );
2306 NTSTATUS WINAPI wow64_NtUserGetPointerInfoList( UINT *args )
2308 UINT id = get_ulong( &args );
2309 UINT type = get_ulong( &args );
2310 UINT unk0 = get_ulong( &args );
2311 UINT unk1 = get_ulong( &args );
2312 UINT size = get_ulong( &args );
2313 void *entry_count = get_ptr( &args );
2314 void *pointer_count = get_ptr( &args );
2315 void *pointer_info = get_ptr( &args );
2317 return NtUserGetPointerInfoList( id, type, unk0, unk1, size, entry_count, pointer_count, pointer_info );
2320 NTSTATUS WINAPI wow64_NtUserGetPriorityClipboardFormat( UINT *args )
2322 UINT *list = get_ptr( &args );
2323 INT count = get_ulong( &args );
2325 return NtUserGetPriorityClipboardFormat( list, count );
2328 NTSTATUS WINAPI wow64_NtUserGetProcessDpiAwarenessContext( UINT *args )
2330 HANDLE process = get_handle( &args );
2332 return NtUserGetProcessDpiAwarenessContext( process );
2335 NTSTATUS WINAPI wow64_NtUserGetProcessWindowStation( UINT *args )
2337 return HandleToUlong( NtUserGetProcessWindowStation() );
2340 NTSTATUS WINAPI wow64_NtUserGetProp( UINT *args )
2342 HWND hwnd = get_handle( &args );
2343 const WCHAR *str = get_ptr( &args );
2345 return HandleToUlong( NtUserGetProp( hwnd, str ));
2348 NTSTATUS WINAPI wow64_NtUserGetQueueStatus( UINT *args )
2350 UINT flags = get_ulong( &args );
2352 return NtUserGetQueueStatus( flags );
2355 NTSTATUS WINAPI wow64_NtUserGetRawInputBuffer( UINT *args )
2357 RAWINPUT *data = get_ptr( &args );
2358 UINT *data_size = get_ptr( &args );
2359 UINT header_size = get_ulong( &args );
2361 if (header_size != sizeof(RAWINPUTHEADER32))
2363 set_last_error32( ERROR_INVALID_PARAMETER );
2364 return ~0u;
2367 /* RAWINPUT has different sizes on 32-bit and 64-bit, but no translation is
2368 * done. The function actually returns different structures depending on
2369 * whether it's operating under WoW64 or not. */
2370 return NtUserGetRawInputBuffer( data, data_size, sizeof(RAWINPUTHEADER) );
2373 NTSTATUS WINAPI wow64_NtUserGetRawInputData( UINT *args )
2375 HRAWINPUT handle = get_handle( &args );
2376 UINT command = get_ulong( &args );
2377 void *data = get_ptr( &args );
2378 UINT *data_size = get_ptr( &args );
2379 UINT header_size = get_ulong( &args );
2381 if (header_size != sizeof(RAWINPUTHEADER32))
2383 set_last_error32( ERROR_INVALID_PARAMETER );
2384 return ~0u;
2387 switch (command)
2389 case RID_INPUT:
2390 if (data)
2392 UINT data_size64, body_size, ret;
2393 RAWINPUTHEADER32 *data32 = data;
2394 RAWINPUTHEADER *data64 = NULL;
2396 data_size64 = *data_size + sizeof(RAWINPUTHEADER);
2397 if (!(data64 = Wow64AllocateTemp( data_size64 )))
2399 set_last_error32( STATUS_NO_MEMORY );
2400 return ~0u;
2403 ret = NtUserGetRawInputData( handle, command, data64, &data_size64, sizeof(RAWINPUTHEADER) );
2404 if (ret == ~0u) return ret;
2406 body_size = ret - sizeof(RAWINPUTHEADER);
2407 if (*data_size < sizeof(RAWINPUTHEADER32) + body_size)
2409 set_last_error32( ERROR_INSUFFICIENT_BUFFER );
2410 return ~0u;
2413 data32->dwType = data64->dwType;
2414 data32->dwSize = sizeof(RAWINPUTHEADER32) + body_size;
2415 data32->hDevice = (UINT_PTR)data64->hDevice;
2416 data32->wParam = data64->wParam;
2417 memcpy( data32 + 1, data64 + 1, body_size );
2418 return sizeof(RAWINPUTHEADER32) + body_size;
2420 else
2422 UINT data_size64, ret;
2424 ret = NtUserGetRawInputData( handle, command, NULL, &data_size64, sizeof(RAWINPUTHEADER) );
2425 if (ret == ~0u) return ret;
2426 *data_size = data_size64 - sizeof(RAWINPUTHEADER) + sizeof(RAWINPUTHEADER32);
2427 return 0;
2430 case RID_HEADER:
2432 UINT data_size64 = sizeof(RAWINPUTHEADER);
2433 RAWINPUTHEADER32 *data32 = data;
2434 RAWINPUTHEADER data64;
2435 UINT ret;
2437 if (!data)
2439 *data_size = sizeof(RAWINPUTHEADER32);
2440 return 0;
2443 if (*data_size < sizeof(RAWINPUTHEADER32))
2445 set_last_error32( ERROR_INSUFFICIENT_BUFFER );
2446 return ~0u;
2449 ret = NtUserGetRawInputData( handle, command, &data64, &data_size64, sizeof(RAWINPUTHEADER) );
2450 if (ret == ~0u) return ret;
2451 data32->dwType = data64.dwType;
2452 data32->dwSize = data64.dwSize - sizeof(RAWINPUTHEADER) + sizeof(RAWINPUTHEADER32);
2453 data32->hDevice = (UINT_PTR)data64.hDevice;
2454 data32->wParam = data64.wParam;
2455 return sizeof(RAWINPUTHEADER32);
2458 default:
2459 set_last_error32( ERROR_INVALID_PARAMETER );
2460 return ~0u;
2464 NTSTATUS WINAPI wow64_NtUserGetRawInputDeviceInfo( UINT *args )
2466 HANDLE handle = get_handle( &args );
2467 UINT command = get_ulong( &args );
2468 void *data = get_ptr( &args );
2469 UINT *data_size = get_ptr( &args );
2471 return NtUserGetRawInputDeviceInfo( handle, command, data, data_size );
2474 NTSTATUS WINAPI wow64_NtUserGetRawInputDeviceList( UINT *args )
2476 RAWINPUTDEVICELIST32 *devices32 = get_ptr( &args );
2477 UINT *count = get_ptr( &args );
2478 UINT size = get_ulong( &args );
2480 if (size != sizeof(RAWINPUTDEVICELIST32))
2482 set_last_error32( ERROR_INVALID_PARAMETER );
2483 return ~0u;
2486 if (devices32)
2488 RAWINPUTDEVICELIST *devices64;
2489 unsigned int ret, i;
2491 if (!(devices64 = Wow64AllocateTemp( (*count) * sizeof(*devices64) )))
2493 set_last_error32( ERROR_NOT_ENOUGH_MEMORY );
2494 return ~0u;
2497 ret = NtUserGetRawInputDeviceList( devices64, count, sizeof(RAWINPUTDEVICELIST) );
2498 if (ret == ~0u) return ret;
2500 for (i = 0; i < *count; ++i)
2502 devices32[i].hDevice = (UINT_PTR)devices64[i].hDevice;
2503 devices32[i].dwType = devices64[i].dwType;
2505 return ret;
2507 else
2509 return NtUserGetRawInputDeviceList( NULL, count, sizeof(RAWINPUTDEVICELIST) );
2513 NTSTATUS WINAPI wow64_NtUserRealChildWindowFromPoint( UINT *args )
2515 HWND parent = get_handle( &args );
2516 LONG x = get_ulong( &args );
2517 LONG y = get_ulong( &args );
2519 return HandleToUlong( NtUserRealChildWindowFromPoint( parent, x, y ));
2522 NTSTATUS WINAPI wow64_NtUserRegisterClassExWOW( UINT *args )
2524 const WNDCLASSEXW32 *wc32 = get_ptr( &args );
2525 UNICODE_STRING32 *name32 = get_ptr( &args );
2526 UNICODE_STRING32 *version32 = get_ptr( &args );
2527 struct client_menu_name32 *client_name32 = get_ptr( &args );
2528 DWORD fnid = get_ulong( &args );
2529 DWORD flags = get_ulong( &args );
2530 DWORD *wow = get_ptr( &args );
2532 struct client_menu_name client_name;
2533 UNICODE_STRING name, version;
2534 WNDCLASSEXW wc;
2536 if (wc32->cbSize != sizeof(*wc32))
2538 set_last_error32( ERROR_INVALID_PARAMETER );
2539 return 0;
2542 wc.cbSize = sizeof(wc);
2543 wc.style = wc32->style;
2544 wc.lpfnWndProc = UlongToPtr( wc32->lpfnWndProc );
2545 wc.cbClsExtra = wc32->cbClsExtra;
2546 wc.cbWndExtra = wc32->cbWndExtra;
2547 wc.hInstance = UlongToPtr( wc32->hInstance );
2548 wc.hIcon = LongToHandle( wc32->hIcon );
2549 wc.hCursor = LongToHandle( wc32->hCursor );
2550 wc.hbrBackground = UlongToHandle( wc32->hbrBackground );
2551 wc.lpszMenuName = UlongToPtr( wc32->lpszMenuName );
2552 wc.lpszClassName = UlongToPtr( wc32->lpszClassName );
2553 wc.hIconSm = LongToHandle( wc32->hIconSm );
2555 return NtUserRegisterClassExWOW( &wc,
2556 unicode_str_32to64( &name, name32 ),
2557 unicode_str_32to64( &version, version32 ),
2558 client_menu_name_32to64( &client_name, client_name32 ),
2559 fnid, flags, wow );
2562 NTSTATUS WINAPI wow64_NtUserGetRegisteredRawInputDevices( UINT *args )
2564 RAWINPUTDEVICE32 *devices32 = get_ptr( &args );
2565 UINT *count = get_ptr( &args );
2566 UINT size = get_ulong( &args );
2568 if (size != sizeof(RAWINPUTDEVICE32))
2570 set_last_error32( ERROR_INVALID_PARAMETER );
2571 return ~0u;
2574 if (devices32)
2576 RAWINPUTDEVICE *devices64;
2577 unsigned int ret, i;
2579 if (!(devices64 = Wow64AllocateTemp( (*count) * sizeof(*devices64) )))
2581 set_last_error32( ERROR_NOT_ENOUGH_MEMORY );
2582 return ~0u;
2585 ret = NtUserGetRegisteredRawInputDevices( devices64, count, sizeof(RAWINPUTDEVICE) );
2586 if (ret == ~0u) return ret;
2588 for (i = 0; i < *count; ++i)
2590 devices32[i].usUsagePage = devices64[i].usUsagePage;
2591 devices32[i].usUsage = devices64[i].usUsage;
2592 devices32[i].dwFlags = devices64[i].dwFlags;
2593 devices32[i].hwndTarget = (ULONG_PTR)devices64[i].hwndTarget;
2595 return ret;
2597 else
2599 return NtUserGetRegisteredRawInputDevices( NULL, count, sizeof(RAWINPUTDEVICE) );
2603 NTSTATUS WINAPI wow64_NtUserGetScrollBarInfo( UINT *args )
2605 HWND hwnd = get_handle( &args );
2606 LONG id = get_ulong( &args );
2607 SCROLLBARINFO *info = get_ptr( &args );
2609 return NtUserGetScrollBarInfo( hwnd, id, info );
2612 NTSTATUS WINAPI wow64_NtUserGetSystemDpiForProcess( UINT *args )
2614 HANDLE process = get_handle( &args );
2616 return NtUserGetSystemDpiForProcess( process );
2619 NTSTATUS WINAPI wow64_NtUserGetSystemMenu( UINT *args )
2621 HWND hwnd = get_handle( &args );
2622 BOOL revert = get_ulong( &args );
2624 return HandleToUlong( NtUserGetSystemMenu( hwnd, revert ));
2627 NTSTATUS WINAPI wow64_NtUserGetThreadDesktop( UINT *args )
2629 DWORD thread = get_ulong( &args );
2631 return HandleToUlong( NtUserGetThreadDesktop( thread ));
2634 NTSTATUS WINAPI wow64_NtUserGetTitleBarInfo( UINT *args )
2636 HWND hwnd = get_handle( &args );
2637 TITLEBARINFO *info = get_ptr( &args );
2639 return NtUserGetTitleBarInfo( hwnd, info );
2642 NTSTATUS WINAPI wow64_NtUserGetUpdateRect( UINT *args )
2644 HWND hwnd = get_handle( &args );
2645 RECT *rect = get_ptr( &args );
2646 BOOL erase = get_ulong( &args );
2648 return NtUserGetUpdateRect( hwnd, rect, erase );
2651 NTSTATUS WINAPI wow64_NtUserGetUpdateRgn( UINT *args )
2653 HWND hwnd = get_handle( &args );
2654 HRGN hrgn = get_handle( &args );
2655 BOOL erase = get_ulong( &args );
2657 return NtUserGetUpdateRgn( hwnd, hrgn, erase );
2660 NTSTATUS WINAPI wow64_NtUserGetUpdatedClipboardFormats( UINT *args )
2662 UINT *formats = get_ptr( &args );
2663 UINT size = get_ulong( &args );
2664 UINT *out_size = get_ptr( &args );
2666 return NtUserGetUpdatedClipboardFormats( formats, size, out_size );
2669 NTSTATUS WINAPI wow64_NtUserGetWindowDC( UINT *args )
2671 HWND hwnd = get_handle( &args );
2673 return HandleToUlong( NtUserGetWindowDC( hwnd ));
2676 NTSTATUS WINAPI wow64_NtUserGetWindowPlacement( UINT *args )
2678 HWND hwnd = get_handle( &args );
2679 WINDOWPLACEMENT *placement = get_ptr( &args );
2681 return NtUserGetWindowPlacement( hwnd, placement );
2684 NTSTATUS WINAPI wow64_NtUserGetWindowRgnEx( UINT *args )
2686 HWND hwnd = get_handle( &args );
2687 HRGN hrgn = get_handle( &args );
2688 UINT unk = get_ulong( &args );
2690 return NtUserGetWindowRgnEx( hwnd, hrgn, unk );
2693 NTSTATUS WINAPI wow64_NtUserHideCaret( UINT *args )
2695 HWND hwnd = get_handle( &args );
2697 return NtUserHideCaret( hwnd );
2700 NTSTATUS WINAPI wow64_NtUserHiliteMenuItem( UINT *args )
2702 HWND hwnd = get_handle( &args );
2703 HMENU handle = get_handle( &args );
2704 UINT item = get_ulong( &args );
2705 UINT hilite = get_ulong( &args );
2707 return NtUserHiliteMenuItem( hwnd, handle, item, hilite );
2710 struct user_client_procs32
2712 ULONG pButtonWndProc;
2713 ULONG pComboWndProc;
2714 ULONG pDefWindowProc;
2715 ULONG pDefDlgProc;
2716 ULONG pEditWndProc;
2717 ULONG pListBoxWndProc;
2718 ULONG pMDIClientWndProc;
2719 ULONG pScrollBarWndProc;
2720 ULONG pStaticWndProc;
2721 ULONG pImeWndProc;
2722 ULONG pDesktopWndProc;
2723 ULONG pIconTitleWndProc;
2724 ULONG pPopupMenuWndProc;
2725 ULONG pMessageWndProc;
2728 static struct user_client_procs *user_client_procs_32to64( struct user_client_procs *procs,
2729 const struct user_client_procs32 *procs32 )
2731 if (!procs32) return NULL;
2733 procs->pButtonWndProc = UlongToPtr( procs32->pButtonWndProc );
2734 procs->pComboWndProc = UlongToPtr( procs32->pComboWndProc );
2735 procs->pDefWindowProc = UlongToPtr( procs32->pDefWindowProc );
2736 procs->pDefDlgProc = UlongToPtr( procs32->pDefDlgProc );
2737 procs->pEditWndProc = UlongToPtr( procs32->pEditWndProc );
2738 procs->pListBoxWndProc = UlongToPtr( procs32->pListBoxWndProc );
2739 procs->pMDIClientWndProc = UlongToPtr( procs32->pMDIClientWndProc );
2740 procs->pScrollBarWndProc = UlongToPtr( procs32->pScrollBarWndProc );
2741 procs->pStaticWndProc = UlongToPtr( procs32->pStaticWndProc );
2742 procs->pImeWndProc = UlongToPtr( procs32->pImeWndProc );
2743 procs->pDesktopWndProc = UlongToPtr( procs32->pDesktopWndProc );
2744 procs->pIconTitleWndProc = UlongToPtr( procs32->pIconTitleWndProc );
2745 procs->pPopupMenuWndProc = UlongToPtr( procs32->pPopupMenuWndProc );
2746 procs->pMessageWndProc = UlongToPtr( procs32->pMessageWndProc );
2747 return procs;
2750 NTSTATUS WINAPI wow64_NtUserInitializeClientPfnArrays( UINT *args )
2752 const struct user_client_procs32 *procsA32 = get_ptr( &args );
2753 const struct user_client_procs32 *procsW32 = get_ptr( &args );
2754 void *workers = get_ptr( &args );
2755 HINSTANCE user_module = get_ptr( &args );
2757 struct user_client_procs procsA, procsW;
2758 return NtUserInitializeClientPfnArrays( user_client_procs_32to64( &procsA, procsA32 ),
2759 user_client_procs_32to64( &procsW, procsW32 ),
2760 workers, user_module );
2763 NTSTATUS WINAPI wow64_NtUserInternalGetWindowIcon( UINT *args )
2765 HWND hwnd = get_handle( &args );
2766 UINT type = get_ulong( &args );
2768 return HandleToUlong( NtUserInternalGetWindowIcon( hwnd, type ));
2771 NTSTATUS WINAPI wow64_NtUserInternalGetWindowText( UINT *args )
2773 HWND hwnd = get_handle( &args );
2774 WCHAR *text = get_ptr( &args );
2775 INT count = get_ulong( &args );
2777 return NtUserInternalGetWindowText( hwnd, text, count );
2780 NTSTATUS WINAPI wow64_NtUserInvalidateRect( UINT *args )
2782 HWND hwnd = get_handle( &args );
2783 const RECT *rect = get_ptr( &args );
2784 BOOL erase = get_ulong( &args );
2786 return NtUserInvalidateRect( hwnd, rect, erase );
2789 NTSTATUS WINAPI wow64_NtUserInvalidateRgn( UINT *args )
2791 HWND hwnd = get_handle( &args );
2792 HRGN hrgn = get_handle( &args );
2793 BOOL erase = get_ulong( &args );
2795 return NtUserInvalidateRgn( hwnd, hrgn, erase );
2798 NTSTATUS WINAPI wow64_NtUserIsClipboardFormatAvailable( UINT *args )
2800 UINT format = get_ulong( &args );
2802 return NtUserIsClipboardFormatAvailable( format );
2805 NTSTATUS WINAPI wow64_NtUserIsMouseInPointerEnabled( UINT *args )
2807 return NtUserIsMouseInPointerEnabled();
2810 NTSTATUS WINAPI wow64_NtUserKillTimer( UINT *args )
2812 HWND hwnd = get_handle( &args );
2813 UINT_PTR id = get_ulong( &args );
2815 return NtUserKillTimer( hwnd, id );
2818 NTSTATUS WINAPI wow64_NtUserLockWindowUpdate( UINT *args )
2820 HWND hwnd = get_handle( &args );
2822 return NtUserLockWindowUpdate( hwnd );
2825 NTSTATUS WINAPI wow64_NtUserLogicalToPerMonitorDPIPhysicalPoint( UINT *args )
2827 HWND hwnd = get_handle( &args );
2828 POINT *pt = get_ptr( &args );
2830 return NtUserLogicalToPerMonitorDPIPhysicalPoint( hwnd, pt );
2833 NTSTATUS WINAPI wow64_NtUserMapVirtualKeyEx( UINT *args )
2835 UINT code = get_ulong( &args );
2836 UINT type = get_ulong( &args );
2837 HKL layout = get_handle( &args );
2839 return NtUserMapVirtualKeyEx( code, type, layout );
2842 NTSTATUS WINAPI wow64_NtUserMenuItemFromPoint( UINT *args )
2844 HWND hwnd = get_handle( &args );
2845 HMENU handle = get_handle( &args );
2846 int x = get_ulong( &args );
2847 int y = get_ulong( &args );
2849 return NtUserMenuItemFromPoint( hwnd, handle, x, y );
2852 static LRESULT message_call_32to64( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
2853 void *result_info, DWORD type, BOOL ansi )
2855 LRESULT ret = 0;
2857 switch (msg)
2859 case WM_NCCREATE:
2860 case WM_CREATE:
2862 CREATESTRUCT32 *cs32 = (void *)lparam;
2863 CREATESTRUCTW cs;
2865 createstruct_32to64( cs32, &cs );
2866 ret = NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&cs, result_info, type, ansi );
2867 createstruct_64to32( &cs, cs32 );
2868 return ret;
2871 case WM_MDICREATE:
2873 struct
2875 ULONG szClass;
2876 ULONG szTitle;
2877 ULONG hOwner;
2878 INT x;
2879 INT y;
2880 INT cx;
2881 INT cy;
2882 DWORD style;
2883 ULONG lParam;
2884 } *cs32 = (void *)lparam;
2885 MDICREATESTRUCTW cs;
2887 cs.szClass = UlongToPtr( cs32->szClass );
2888 cs.szTitle = UlongToPtr( cs32->szTitle );
2889 cs.hOwner = LongToHandle( cs32->hOwner );
2890 cs.x = cs32->x;
2891 cs.y = cs32->y;
2892 cs.cx = cs32->cx;
2893 cs.cy = cs32->cy;
2894 cs.style = cs32->style;
2895 cs.lParam = cs32->lParam;
2897 return NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&cs, result_info, type, ansi );
2900 case WM_WINDOWPOSCHANGING:
2901 case WM_WINDOWPOSCHANGED:
2903 WINDOWPOS32 *winpos32 = (void *)lparam;
2904 WINDOWPOS winpos;
2906 winpos_32to64( &winpos, winpos32 );
2907 ret = NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&winpos, result_info, type, ansi );
2908 winpos_64to32( &winpos, winpos32 );
2909 return ret;
2912 case WM_NCCALCSIZE:
2913 if (wparam)
2915 struct
2917 RECT rgrc[3];
2918 ULONG lppos;
2919 } *params32 = (void *)lparam;
2920 NCCALCSIZE_PARAMS params;
2921 WINDOWPOS winpos;
2923 params.rgrc[0] = params32->rgrc[0];
2924 params.rgrc[1] = params32->rgrc[1];
2925 params.rgrc[2] = params32->rgrc[2];
2926 params.lppos = &winpos;
2927 winpos_32to64( &winpos, UlongToPtr( params32->lppos ));
2928 ret = NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&params, result_info, type, ansi );
2929 params32->rgrc[0] = params.rgrc[0];
2930 params32->rgrc[1] = params.rgrc[1];
2931 params32->rgrc[2] = params.rgrc[2];
2932 winpos_64to32( &winpos, UlongToPtr( params32->lppos ));
2933 return ret;
2935 return NtUserMessageCall( hwnd, msg, wparam, lparam, result_info, type, ansi );
2937 case WM_COMPAREITEM:
2939 struct
2941 UINT CtlType;
2942 UINT CtlID;
2943 ULONG hwndItem;
2944 UINT itemID1;
2945 ULONG itemData1;
2946 UINT itemID2;
2947 ULONG itemData2;
2948 DWORD dwLocaleId;
2949 } *cis32 = (void *)lparam;
2950 COMPAREITEMSTRUCT cis;
2952 cis.CtlType = cis32->CtlType;
2953 cis.CtlID = cis32->CtlID;
2954 cis.hwndItem = LongToHandle( cis32->hwndItem );
2955 cis.itemID1 = cis32->itemID1;
2956 cis.itemData1 = cis32->itemData1;
2957 cis.itemID2 = cis32->itemID2;
2958 cis.itemData2 = cis32->itemData2;
2959 cis.dwLocaleId = cis32->dwLocaleId;
2960 return NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&cis, result_info, type, ansi );
2963 case WM_DELETEITEM:
2965 DELETEITEMSTRUCT32 *dis32 = (void *)lparam;
2966 DELETEITEMSTRUCT dis;
2968 dis.CtlType = dis32->CtlType;
2969 dis.CtlID = dis32->CtlID;
2970 dis.hwndItem = LongToHandle( dis32->hwndItem );
2971 dis.itemData = dis32->itemData;
2972 return NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&dis, result_info, type, ansi );
2975 case WM_MEASUREITEM:
2977 MEASUREITEMSTRUCT32 *mis32 = (void *)lparam;
2978 MEASUREITEMSTRUCT mis;
2980 mis.CtlType = mis32->CtlType;
2981 mis.CtlID = mis32->CtlID;
2982 mis.itemID = mis32->itemID;
2983 mis.itemWidth = mis32->itemWidth;
2984 mis.itemHeight = mis32->itemHeight;
2985 mis.itemData = mis32->itemData;
2986 ret = NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&mis, result_info, type, ansi );
2987 mis32->itemWidth = mis.itemWidth;
2988 mis32->itemHeight = mis.itemHeight;
2989 return ret;
2992 case WM_DRAWITEM:
2994 DRAWITEMSTRUCT32 *dis32 = (void *)lparam;
2995 DRAWITEMSTRUCT dis;
2997 dis.CtlType = dis32->CtlType;
2998 dis.CtlID = dis32->CtlID;
2999 dis.itemID = dis32->itemID;
3000 dis.itemAction = dis32->itemAction;
3001 dis.itemState = dis32->itemState;
3002 dis.hwndItem = LongToHandle( dis32->hwndItem );
3003 dis.hDC = LongToHandle( dis32->hDC );
3004 dis.itemData = dis32->itemData;
3005 dis.rcItem.left = dis32->rcItem.left;
3006 dis.rcItem.top = dis32->rcItem.top;
3007 dis.rcItem.right = dis32->rcItem.right;
3008 dis.rcItem.bottom = dis32->rcItem.bottom;
3009 return NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&dis, result_info, type, ansi );
3012 case WM_COPYDATA:
3014 struct
3016 ULONG dwData;
3017 DWORD cbData;
3018 ULONG lpData;
3019 } *cds32 = (void *)lparam;
3020 COPYDATASTRUCT cds;
3022 cds.dwData = cds32->dwData;
3023 cds.cbData = cds32->cbData;
3024 cds.lpData = UlongToPtr( cds32->lpData );
3025 return NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&cds, result_info, type, ansi );
3028 case WM_GETDLGCODE:
3029 if (lparam)
3031 MSG32 *msg32 = (MSG32 *)lparam;
3032 MSG msg64;
3034 return NtUserMessageCall( hwnd, msg, wparam, (LPARAM)msg_32to64( &msg64, msg32 ),
3035 result_info, type, ansi );
3037 return NtUserMessageCall( hwnd, msg, wparam, lparam, result_info, type, ansi );
3039 case WM_NEXTMENU:
3041 struct
3043 ULONG hmenuIn;
3044 ULONG hmenuNext;
3045 ULONG hwndNext;
3046 } *next32 = (void *)lparam;
3047 MDINEXTMENU next;
3049 next.hmenuIn = LongToHandle( next32->hmenuIn );
3050 next.hmenuNext = LongToHandle( next32->hmenuNext );
3051 next.hwndNext = LongToHandle( next32->hwndNext );
3052 return NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&next, result_info, type, ansi );
3055 case WM_PAINTCLIPBOARD:
3057 PAINTSTRUCT ps;
3059 paintstruct_32to64( &ps, (PAINTSTRUCT32 *)lparam );
3060 return NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&ps, result_info, type, ansi );
3063 default:
3064 return NtUserMessageCall( hwnd, msg, wparam, lparam, result_info, type, ansi );
3068 NTSTATUS WINAPI wow64_NtUserMessageCall( UINT *args )
3070 HWND hwnd = get_handle( &args );
3071 UINT msg = get_ulong( &args );
3072 LONG wparam = get_ulong( &args );
3073 LONG lparam = get_ulong( &args );
3074 void *result_info = get_ptr( &args );
3075 UINT type = get_ulong ( &args );
3076 BOOL ansi = get_ulong( &args );
3078 switch (type)
3080 case NtUserGetDispatchParams:
3081 case NtUserCallWindowProc:
3083 struct win_proc_params32 *params32 = result_info;
3084 struct win_proc_params params;
3085 ULONG *result32;
3087 result32 = UlongToPtr( params32->result );
3088 if (type == NtUserCallWindowProc) params.func = UlongToPtr( params32->func );
3090 if (!NtUserMessageCall( hwnd, msg, wparam, lparam, &params, type, ansi ))
3091 return FALSE;
3093 win_proc_params_64to32( &params, params32, result32 );
3094 return TRUE;
3097 case NtUserSendMessage:
3099 struct win_proc_params32 *params32 = result_info;
3101 if (params32)
3103 struct win_proc_params params;
3104 NTSTATUS ret;
3106 params.hwnd = 0;
3107 ret = message_call_32to64( hwnd, msg, wparam, lparam, &params, type, ansi );
3108 if (params.hwnd) win_proc_params_64to32( &params, params32, NULL );
3109 return ret;
3112 return message_call_32to64( hwnd, msg, wparam, lparam, result_info, type, ansi );
3115 case NtUserSendMessageTimeout:
3117 struct
3119 UINT flags;
3120 UINT timeout;
3121 DWORD result;
3122 } *params32 = result_info;
3123 struct send_message_timeout_params params;
3124 LRESULT ret;
3126 params.flags = params32->flags;
3127 params.timeout = params32->timeout;
3128 ret = message_call_32to64( hwnd, msg, wparam, lparam, &params, type, ansi );
3129 params32->result = params.result;
3130 return ret;
3133 case NtUserSendMessageCallback:
3135 struct
3137 ULONG callback;
3138 ULONG data;
3139 } *params32 = result_info;
3140 struct send_message_callback_params params;
3142 params.callback = UlongToPtr( params32->callback );
3143 params.data = params32->data;
3144 return message_call_32to64( hwnd, msg, wparam, lparam, &params, type, ansi );
3147 case NtUserSpyGetMsgName:
3148 /* no argument conversion */
3149 return NtUserMessageCall( hwnd, msg, wparam, lparam, result_info, type, ansi );
3151 case NtUserWinProcResult:
3153 LONG result32 = PtrToLong( result_info );
3154 return message_call_32to64( hwnd, msg, wparam, lparam,
3155 LongToPtr( result32 ), type, ansi );
3158 case NtUserImeDriverCall:
3160 struct
3162 ULONG himc;
3163 ULONG state;
3164 ULONG compstr;
3165 } *params32 = result_info;
3166 struct ime_driver_call_params params;
3167 params.himc = UlongToPtr( params32->himc );
3168 params.state = UlongToPtr( params32->state );
3169 params.compstr = UlongToPtr( params32->compstr );
3170 return NtUserMessageCall( hwnd, msg, wparam, lparam, &params, type, ansi );
3174 return message_call_32to64( hwnd, msg, wparam, lparam, result_info, type, ansi );
3177 NTSTATUS WINAPI wow64_NtUserMoveWindow( UINT *args )
3179 HWND hwnd = get_handle( &args );
3180 INT x = get_ulong( &args );
3181 INT y = get_ulong( &args );
3182 INT cx = get_ulong( &args );
3183 INT cy = get_ulong( &args );
3184 BOOL repaint = get_ulong( &args );
3186 return NtUserMoveWindow( hwnd, x, y, cx, cy, repaint );
3189 NTSTATUS WINAPI wow64_NtUserMsgWaitForMultipleObjectsEx( UINT *args )
3191 DWORD count = get_ulong( &args );
3192 const ULONG *handles32 = get_ptr( &args );
3193 DWORD timeout = get_ulong( &args );
3194 DWORD mask = get_ulong( &args );
3195 DWORD flags = get_ulong( &args );
3197 HANDLE handles[MAXIMUM_WAIT_OBJECTS];
3198 unsigned int i;
3200 if (count > ARRAYSIZE(handles))
3202 set_last_error32( ERROR_INVALID_PARAMETER );
3203 return WAIT_FAILED;
3205 for (i = 0; i < count; i++) handles[i] = LongToHandle( handles32[i] );
3207 return NtUserMsgWaitForMultipleObjectsEx( count, handles, timeout, mask, flags );
3210 NTSTATUS WINAPI wow64_NtUserNotifyIMEStatus( UINT *args )
3212 HWND hwnd = get_handle( &args );
3213 ULONG status = get_ulong( &args );
3215 NtUserNotifyIMEStatus( hwnd, status );
3216 return 0;
3219 NTSTATUS WINAPI wow64_NtUserNotifyWinEvent( UINT *args )
3221 DWORD event = get_ulong( &args );
3222 HWND hwnd = get_handle( &args );
3223 LONG object_id = get_ulong( &args );
3224 LONG child_id = get_ulong( &args );
3226 NtUserNotifyWinEvent( event, hwnd, object_id, child_id );
3227 return 0;
3230 NTSTATUS WINAPI wow64_NtUserOpenClipboard( UINT *args )
3232 HWND hwnd = get_handle( &args );
3233 ULONG unk = get_ulong( &args );
3235 return NtUserOpenClipboard( hwnd, unk );
3238 NTSTATUS WINAPI wow64_NtUserOpenDesktop( UINT *args )
3240 OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
3241 DWORD flags = get_ulong( &args );
3242 ACCESS_MASK access = get_ulong( &args );
3244 struct object_attr64 attr;
3245 HANDLE ret;
3247 ret = NtUserOpenDesktop( objattr_32to64( &attr, attr32 ), flags, access );
3248 return HandleToUlong( ret );
3251 NTSTATUS WINAPI wow64_NtUserOpenInputDesktop( UINT *args )
3253 DWORD flags = get_ulong( &args );
3254 BOOL inherit = get_ulong( &args );
3255 ACCESS_MASK access = get_ulong( &args );
3257 return HandleToUlong( NtUserOpenInputDesktop( flags, inherit, access ));
3260 NTSTATUS WINAPI wow64_NtUserOpenWindowStation( UINT *args )
3262 OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
3263 ACCESS_MASK access = get_ulong( &args );
3265 struct object_attr64 attr;
3267 return HandleToUlong( NtUserOpenWindowStation( objattr_32to64( &attr, attr32 ), access ));
3270 NTSTATUS WINAPI wow64_NtUserPeekMessage( UINT *args )
3272 MSG32 *msg32 = get_ptr( &args );
3273 HWND hwnd = get_handle( &args );
3274 UINT first = get_ulong( &args );
3275 UINT last = get_ulong( &args );
3276 UINT flags = get_ulong( &args );
3277 MSG msg;
3279 if (!NtUserPeekMessage( msg32 ? &msg : NULL, hwnd, first, last, flags )) return FALSE;
3280 msg_64to32( &msg, msg32 );
3281 return TRUE;
3284 NTSTATUS WINAPI wow64_NtUserPerMonitorDPIPhysicalToLogicalPoint( UINT *args )
3286 HWND hwnd = get_handle( &args );
3287 POINT *pt = get_ptr( &args );
3289 return NtUserPerMonitorDPIPhysicalToLogicalPoint( hwnd, pt );
3292 NTSTATUS WINAPI wow64_NtUserPostMessage( UINT *args )
3294 HWND hwnd = get_handle( &args );
3295 UINT msg = get_ulong( &args );
3296 WPARAM wparam = get_ulong( &args );
3297 LPARAM lparam = get_ulong( &args );
3299 return NtUserPostMessage( hwnd, msg, wparam, lparam );
3302 NTSTATUS WINAPI wow64_NtUserPostThreadMessage( UINT *args )
3304 DWORD thread = get_ulong( &args );
3305 UINT msg = get_ulong( &args );
3306 WPARAM wparam = get_ulong( &args );
3307 LPARAM lparam = get_ulong( &args );
3309 return NtUserPostThreadMessage( thread, msg, wparam, lparam );
3312 NTSTATUS WINAPI wow64_NtUserPrintWindow( UINT *args )
3314 HWND hwnd = get_handle( &args );
3315 HDC hdc = get_handle( &args );
3316 UINT flags = get_ulong( &args );
3318 return NtUserPrintWindow( hwnd, hdc, flags );
3321 NTSTATUS WINAPI wow64_NtUserQueryInputContext( UINT *args )
3323 HIMC handle = get_handle( &args );
3324 UINT attr = get_ulong( &args );
3326 return NtUserQueryInputContext( handle, attr );
3329 NTSTATUS WINAPI wow64_NtUserRedrawWindow( UINT *args )
3331 HWND hwnd = get_handle( &args );
3332 const RECT *rect = get_ptr( &args );
3333 HRGN hrgn = get_handle( &args );
3334 UINT flags = get_ulong( &args );
3336 return NtUserRedrawWindow( hwnd, rect, hrgn, flags );
3339 NTSTATUS WINAPI wow64_NtUserRegisterHotKey( UINT *args )
3341 HWND hwnd = get_handle( &args );
3342 INT id = get_ulong( &args );
3343 UINT modifiers = get_ulong( &args );
3344 UINT vk = get_ulong( &args );
3346 return NtUserRegisterHotKey( hwnd, id, modifiers, vk );
3349 NTSTATUS WINAPI wow64_NtUserRegisterRawInputDevices( UINT *args )
3351 const RAWINPUTDEVICE32 *devices32 = get_ptr( &args );
3352 UINT count = get_ulong( &args );
3353 UINT size = get_ulong( &args );
3355 RAWINPUTDEVICE *devices64;
3356 unsigned int i;
3358 if (size != sizeof(RAWINPUTDEVICE32))
3360 set_last_error32( ERROR_INVALID_PARAMETER );
3361 return FALSE;
3364 if (!(devices64 = Wow64AllocateTemp( count * sizeof(*devices64) )))
3366 set_last_error32( ERROR_NOT_ENOUGH_MEMORY );
3367 return FALSE;
3370 for (i = 0; i < count; ++i)
3372 devices64[i].usUsagePage = devices32[i].usUsagePage;
3373 devices64[i].usUsage = devices32[i].usUsage;
3374 devices64[i].dwFlags = devices32[i].dwFlags;
3375 devices64[i].hwndTarget = UlongToPtr( devices32[i].hwndTarget );
3378 return NtUserRegisterRawInputDevices( devices64, count, sizeof(*devices64) );
3381 NTSTATUS WINAPI wow64_NtUserReleaseDC( UINT *args )
3383 HWND hwnd = get_handle( &args );
3384 HDC hdc = get_handle( &args );
3386 return NtUserReleaseDC( hwnd, hdc );
3389 NTSTATUS WINAPI wow64_NtUserRemoveClipboardFormatListener( UINT *args )
3391 HWND hwnd = get_handle( &args );
3393 return NtUserRemoveClipboardFormatListener( hwnd );
3396 NTSTATUS WINAPI wow64_NtUserRemoveMenu( UINT *args )
3398 HMENU handle = get_handle( &args );
3399 UINT id = get_ulong( &args );
3400 UINT flags = get_ulong( &args );
3402 return NtUserRemoveMenu( handle, id, flags );
3405 NTSTATUS WINAPI wow64_NtUserRemoveProp( UINT *args )
3407 HWND hwnd = get_handle( &args );
3408 const WCHAR *str = get_ptr( &args );
3410 return HandleToUlong( NtUserRemoveProp( hwnd, str ));
3413 NTSTATUS WINAPI wow64_NtUserScrollDC( UINT *args )
3415 HDC hdc = get_handle( &args );
3416 INT dx = get_ulong( &args );
3417 INT dy = get_ulong( &args );
3418 const RECT *scroll = get_ptr( &args );
3419 const RECT *clip = get_ptr( &args );
3420 HRGN ret_update_rgn = get_handle( &args );
3421 RECT *update_rect = get_ptr( &args );
3423 return NtUserScrollDC( hdc, dx, dy, scroll, clip, ret_update_rgn, update_rect );
3426 NTSTATUS WINAPI wow64_NtUserScrollWindowEx( UINT *args )
3428 HWND hwnd = get_handle( &args );
3429 INT dx = get_ulong( &args );
3430 INT dy = get_ulong( &args );
3431 const RECT *rect = get_ptr( &args );
3432 const RECT *clip_rect = get_ptr( &args );
3433 HRGN update_rgn = get_handle( &args );
3434 RECT *update_rect = get_ptr( &args );
3435 UINT flags = get_ulong( &args );
3437 return NtUserScrollWindowEx( hwnd, dx, dy, rect, clip_rect, update_rgn, update_rect, flags );
3440 NTSTATUS WINAPI wow64_NtUserSelectPalette( UINT *args )
3442 HDC hdc = get_handle( &args );
3443 HPALETTE hpal = get_handle( &args );
3444 WORD bkg = get_ulong( &args );
3446 return HandleToUlong( NtUserSelectPalette( hdc, hpal, bkg ));
3449 NTSTATUS WINAPI wow64_NtUserSendInput( UINT *args )
3451 UINT count = get_ulong( &args );
3452 INPUT32 *inputs32 = get_ptr( &args );
3453 int size = get_ulong( &args );
3455 INPUT *inputs = NULL;
3456 unsigned int i;
3458 if (size != sizeof(*inputs32) || !count)
3460 set_last_error32( ERROR_INVALID_PARAMETER );
3461 return 0;
3464 if (!inputs32)
3466 set_last_error32( ERROR_NOACCESS );
3467 return 0;
3470 if (count && !(inputs = Wow64AllocateTemp( count * sizeof(*inputs) )))
3471 return 0;
3473 for (i = 0; i < count; i++)
3475 inputs[i].type = inputs32[i].type;
3476 switch (inputs[i].type)
3478 case INPUT_MOUSE:
3479 inputs[i].mi.dx = inputs32[i].mi.dx;
3480 inputs[i].mi.dy = inputs32[i].mi.dy;
3481 inputs[i].mi.mouseData = inputs32[i].mi.mouseData;
3482 inputs[i].mi.dwFlags = inputs32[i].mi.dwFlags;
3483 inputs[i].mi.time = inputs32[i].mi.time;
3484 inputs[i].mi.dwExtraInfo = inputs32[i].mi.dwExtraInfo;
3485 break;
3486 case INPUT_KEYBOARD:
3487 inputs[i].ki.wVk = inputs32[i].ki.wVk;
3488 inputs[i].ki.wScan = inputs32[i].ki.wScan;
3489 inputs[i].ki.dwFlags = inputs32[i].ki.dwFlags;
3490 inputs[i].ki.time = inputs32[i].ki.time;
3491 inputs[i].ki.dwExtraInfo = inputs32[i].ki.dwExtraInfo;
3492 break;
3493 case INPUT_HARDWARE:
3494 inputs[i].hi = inputs32[i].hi;
3495 break;
3499 return NtUserSendInput( count, inputs, sizeof(*inputs) );
3502 NTSTATUS WINAPI wow64_NtUserSetActiveWindow( UINT *args )
3504 HWND hwnd = get_handle( &args );
3506 return HandleToUlong( NtUserSetActiveWindow( hwnd ));
3509 NTSTATUS WINAPI wow64_NtUserSetCapture( UINT *args )
3511 HWND hwnd = get_handle( &args );
3513 return HandleToUlong( NtUserSetCapture( hwnd ));
3516 NTSTATUS WINAPI wow64_NtUserSetClassLong( UINT *args )
3518 HWND hwnd = get_handle( &args );
3519 INT offset = get_ulong( &args );
3520 LONG newval = get_ulong( &args );
3521 BOOL ansi = get_ulong( &args );
3523 return NtUserSetClassLong( hwnd, offset, newval, ansi );
3526 NTSTATUS WINAPI wow64_NtUserSetClassLongPtr( UINT *args )
3528 HWND hwnd = get_handle( &args );
3529 INT offset = get_ulong( &args );
3530 LONG_PTR newval = get_ulong( &args );
3531 BOOL ansi = get_ulong( &args );
3533 if (offset == GCLP_MENUNAME)
3535 struct client_menu_name menu_name;
3536 struct client_menu_name32 *menu_name32 = UlongToPtr( newval );
3537 NtUserSetClassLong( hwnd, offset,
3538 (UINT_PTR)client_menu_name_32to64( &menu_name, menu_name32 ), ansi );
3539 client_menu_name_64to32( &menu_name, menu_name32 );
3540 return 0;
3543 return NtUserSetClassLongPtr( hwnd, offset, newval, ansi );
3546 NTSTATUS WINAPI wow64_NtUserSetClassWord( UINT *args )
3548 HWND hwnd = get_handle( &args );
3549 INT offset = get_ulong( &args );
3550 WORD newval = get_ulong( &args );
3552 return NtUserSetClassWord( hwnd, offset, newval );
3555 NTSTATUS WINAPI wow64_NtUserSetClipboardData( UINT *args )
3557 UINT format = get_ulong( &args );
3558 HANDLE handle = get_handle( &args );
3559 struct
3561 UINT32 data;
3562 UINT32 size;
3563 BOOL cache_only;
3564 UINT seqno;
3565 } *params32 = get_ptr( &args );
3567 struct set_clipboard_params params;
3568 params.data = UlongToPtr( params32->data );
3569 params.size = params32->size;
3570 params.cache_only = params32->cache_only;
3571 params.seqno = params32->seqno;
3573 return NtUserSetClipboardData( format, handle, &params );
3576 NTSTATUS WINAPI wow64_NtUserSetClipboardViewer( UINT *args )
3578 HWND hwnd = get_handle( &args );
3580 return HandleToUlong( NtUserSetClipboardViewer( hwnd ));
3583 NTSTATUS WINAPI wow64_NtUserSetCursor( UINT *args )
3585 HCURSOR cursor = get_handle( &args );
3587 return HandleToUlong( NtUserSetCursor( cursor ));
3590 NTSTATUS WINAPI wow64_NtUserSetCursorIconData( UINT *args )
3592 HCURSOR cursor = get_handle( &args );
3593 UNICODE_STRING32 *module32 = get_ptr( &args );
3594 UNICODE_STRING32 *res_name32 = get_ptr( &args );
3595 struct
3597 UINT flags;
3598 UINT num_steps;
3599 UINT num_frames;
3600 UINT delay;
3601 ULONG frames;
3602 ULONG frame_seq;
3603 ULONG frame_rates;
3604 ULONG rsrc;
3605 } *desc32 = get_ptr( &args );
3606 struct
3608 UINT width;
3609 UINT height;
3610 ULONG color;
3611 ULONG alpha;
3612 ULONG mask;
3613 POINT hotspot;
3614 } *frames32 = UlongToPtr( desc32->frames );
3616 UNICODE_STRING module, res_name;
3617 struct cursoricon_desc desc;
3618 UINT i, num_frames;
3620 num_frames = max( desc32->num_frames, 1 );
3621 if (!(desc.frames = Wow64AllocateTemp( num_frames * sizeof(*desc.frames) ))) return FALSE;
3622 desc.flags = desc32->flags;
3623 desc.num_steps = desc32->num_steps;
3624 desc.num_frames = desc32->num_frames;
3625 desc.delay = desc32->delay;
3626 desc.frame_seq = UlongToPtr( desc32->frame_seq );
3627 desc.frame_rates = UlongToPtr( desc32->frame_rates );
3628 desc.rsrc = UlongToPtr( desc32->rsrc );
3630 for (i = 0; i < num_frames; i++)
3632 desc.frames[i].width = frames32[i].width;
3633 desc.frames[i].height = frames32[i].height;
3634 desc.frames[i].color = UlongToHandle( frames32[i].color );
3635 desc.frames[i].alpha = UlongToHandle( frames32[i].alpha );
3636 desc.frames[i].mask = UlongToHandle( frames32[i].mask );
3637 desc.frames[i].hotspot = frames32[i].hotspot;
3640 return NtUserSetCursorIconData( cursor, unicode_str_32to64( &module, module32 ),
3641 unicode_str_32to64( &res_name, res_name32), &desc );
3644 NTSTATUS WINAPI wow64_NtUserSetCursorPos( UINT *args )
3646 INT x = get_ulong( &args );
3647 INT y = get_ulong( &args );
3649 return NtUserSetCursorPos( x, y );
3652 NTSTATUS WINAPI wow64_NtUserSetFocus( UINT *args )
3654 HWND hwnd = get_handle( &args );
3656 return HandleToUlong( NtUserSetFocus( hwnd ));
3659 NTSTATUS WINAPI wow64_NtUserSetInternalWindowPos( UINT *args )
3661 HWND hwnd = get_handle( &args );
3662 UINT cmd = get_ulong( &args );
3663 RECT *rect = get_ptr( &args );
3664 POINT *pt = get_ptr( &args );
3666 NtUserSetInternalWindowPos( hwnd, cmd, rect, pt );
3667 return 0;
3670 NTSTATUS WINAPI wow64_NtUserSetKeyboardState( UINT *args )
3672 BYTE *state = get_ptr( &args );
3674 return NtUserSetKeyboardState( state );
3677 NTSTATUS WINAPI wow64_NtUserSetLayeredWindowAttributes( UINT *args )
3679 HWND hwnd = get_handle( &args );
3680 COLORREF key = get_ulong( &args );
3681 BYTE alpha = get_ulong( &args );
3682 DWORD flags = get_ulong( &args );
3684 return NtUserSetLayeredWindowAttributes( hwnd, key, alpha, flags );
3687 NTSTATUS WINAPI wow64_NtUserSetMenu( UINT *args )
3689 HWND hwnd = get_handle( &args );
3690 HMENU menu = get_handle( &args );
3692 return NtUserSetMenu( hwnd, menu );
3695 NTSTATUS WINAPI wow64_NtUserSetMenuContextHelpId( UINT *args )
3697 HMENU menu = get_handle( &args );
3698 DWORD id = get_ulong( &args );
3700 return NtUserSetMenuContextHelpId( menu, id );
3703 NTSTATUS WINAPI wow64_NtUserSetMenuDefaultItem( UINT *args )
3705 HMENU handle = get_handle( &args );
3706 UINT item = get_ulong( &args );
3707 UINT bypos = get_ulong( &args );
3709 return NtUserSetMenuDefaultItem( handle, item, bypos );
3712 NTSTATUS WINAPI wow64_NtUserSetObjectInformation( UINT *args )
3714 HANDLE handle = get_handle( &args );
3715 INT index = get_ulong( &args );
3716 void *info = get_ptr( &args );
3717 DWORD len = get_ulong( &args );
3719 return NtUserSetObjectInformation( handle, index, info, len );
3722 NTSTATUS WINAPI wow64_NtUserSetParent( UINT *args )
3724 HWND hwnd = get_handle( &args );
3725 HWND parent = get_handle( &args );
3727 return HandleToUlong( NtUserSetParent( hwnd, parent ));
3730 NTSTATUS WINAPI wow64_NtUserSetProcessDpiAwarenessContext( UINT *args )
3732 ULONG awareness = get_ulong( &args );
3733 ULONG unknown = get_ulong( &args );
3735 return NtUserSetProcessDpiAwarenessContext( awareness, unknown );
3738 NTSTATUS WINAPI wow64_NtUserSetProcessWindowStation( UINT *args )
3740 HWINSTA handle = get_handle( &args );
3742 return NtUserSetProcessWindowStation( handle );
3745 NTSTATUS WINAPI wow64_NtUserSetProp( UINT *args )
3747 HWND hwnd = get_handle( &args );
3748 const WCHAR *str = get_ptr( &args );
3749 HANDLE handle = get_handle( &args );
3751 return NtUserSetProp( hwnd, str, handle );
3754 NTSTATUS WINAPI wow64_NtUserSetScrollInfo( UINT *args )
3756 HWND hwnd = get_handle( &args );
3757 INT bar = get_ulong( &args );
3758 const SCROLLINFO *info = get_ptr( &args );
3759 BOOL redraw = get_ulong( &args );
3761 return NtUserSetScrollInfo( hwnd, bar, info, redraw );
3764 NTSTATUS WINAPI wow64_NtUserSetShellWindowEx( UINT *args )
3766 HWND shell = get_handle( &args );
3767 HWND list_view = get_handle( &args );
3769 return NtUserSetShellWindowEx( shell, list_view );
3772 NTSTATUS WINAPI wow64_NtUserSetSysColors( UINT *args )
3774 INT count = get_ulong( &args );
3775 const INT *colors = get_ptr( &args );
3776 const COLORREF *values = get_ptr( &args );
3778 return NtUserSetSysColors( count, colors, values );
3781 NTSTATUS WINAPI wow64_NtUserSetSystemMenu( UINT *args )
3783 HWND hwnd = get_handle( &args );
3784 HMENU menu = get_handle( &args );
3786 return NtUserSetSystemMenu( hwnd, menu );
3789 NTSTATUS WINAPI wow64_NtUserSetSystemTimer( UINT *args )
3791 HWND hwnd = get_handle( &args );
3792 UINT_PTR id = get_ulong( &args );
3793 UINT timeout = get_ulong( &args );
3795 return NtUserSetSystemTimer( hwnd, id, timeout );
3798 NTSTATUS WINAPI wow64_NtUserSetThreadDesktop( UINT *args )
3800 HDESK handle = get_handle( &args );
3802 return NtUserSetThreadDesktop( handle );
3805 NTSTATUS WINAPI wow64_NtUserSetTimer( UINT *args )
3807 HWND hwnd = get_handle( &args );
3808 UINT_PTR id = get_ulong( &args );
3809 UINT timeout = get_ulong( &args );
3810 TIMERPROC proc = get_ptr( &args );
3811 ULONG tolerance = get_ulong( &args );
3813 return NtUserSetTimer( hwnd, id, timeout, proc, tolerance );
3816 NTSTATUS WINAPI wow64_NtUserSetWinEventHook( UINT *args )
3818 DWORD event_min = get_ulong( &args );
3819 DWORD event_max = get_ulong( &args );
3820 HMODULE inst = get_handle( &args );
3821 UNICODE_STRING32 *module32 = get_ptr( &args );
3822 WINEVENTPROC proc = get_ptr(&args );
3823 DWORD pid = get_ulong( &args );
3824 DWORD tid = get_ulong( &args );
3825 DWORD flags = get_ulong( &args );
3826 UNICODE_STRING module;
3827 HWINEVENTHOOK ret;
3829 ret = NtUserSetWinEventHook( event_min, event_max, inst,
3830 unicode_str_32to64( &module, module32 ),
3831 proc, pid, tid, flags );
3832 return HandleToUlong( ret );
3835 NTSTATUS WINAPI wow64_NtUserSetWindowLong( UINT *args )
3837 HWND hwnd = get_handle( &args );
3838 INT offset = get_ulong( &args );
3839 LONG newval = get_ulong( &args );
3840 BOOL ansi = get_ulong( &args );
3842 return NtUserSetWindowLong( hwnd, offset, newval, ansi );
3845 NTSTATUS WINAPI wow64_NtUserSetWindowLongPtr( UINT *args )
3847 HWND hwnd = get_handle( &args );
3848 INT offset = get_ulong( &args );
3849 LONG_PTR newval = get_ulong( &args );
3850 BOOL ansi = get_ulong( &args );
3852 return NtUserSetWindowLongPtr( hwnd, offset, newval, ansi );
3855 NTSTATUS WINAPI wow64_NtUserSetWindowPlacement( UINT *args )
3857 HWND hwnd = get_handle( &args );
3858 const WINDOWPLACEMENT *wpl = get_ptr( &args );
3860 return NtUserSetWindowPlacement( hwnd, wpl );
3863 NTSTATUS WINAPI wow64_NtUserSetWindowPos( UINT *args )
3865 HWND hwnd = get_handle( &args );
3866 HWND after = get_handle( &args );
3867 INT x = get_ulong( &args );
3868 INT y = get_ulong( &args );
3869 INT cx = get_ulong( &args );
3870 INT cy = get_ulong( &args );
3871 UINT flags = get_ulong( &args );
3873 return NtUserSetWindowPos( hwnd, after, x, y, cx, cy, flags );
3876 NTSTATUS WINAPI wow64_NtUserSetWindowRgn( UINT *args )
3878 HWND hwnd = get_handle( &args );
3879 HRGN hrgn = get_handle( &args );
3880 BOOL redraw = get_ulong( &args );
3882 return NtUserSetWindowRgn( hwnd, hrgn, redraw );
3885 NTSTATUS WINAPI wow64_NtUserSetWindowWord( UINT *args )
3887 HWND hwnd = get_handle( &args );
3888 INT offset = get_ulong( &args );
3889 WORD newval = get_ulong( &args );
3891 return NtUserSetWindowWord( hwnd, offset, newval );
3894 NTSTATUS WINAPI wow64_NtUserSetWindowsHookEx( UINT *args )
3896 HINSTANCE inst = get_handle( &args );
3897 UNICODE_STRING32 *module32 = get_ptr( &args );
3898 DWORD tid = get_ulong( &args );
3899 INT id = get_ulong( &args );
3900 HOOKPROC proc = get_ptr( &args );
3901 BOOL ansi = get_ulong( &args );
3902 UNICODE_STRING module;
3903 HHOOK ret;
3905 ret = NtUserSetWindowsHookEx( inst, unicode_str_32to64( &module, module32 ),
3906 tid, id, proc, ansi );
3907 return HandleToUlong( ret );
3910 NTSTATUS WINAPI wow64_NtUserShowCaret( UINT *args )
3912 HWND hwnd = get_handle( &args );
3914 return NtUserShowCaret( hwnd );
3917 NTSTATUS WINAPI wow64_NtUserShowCursor( UINT *args )
3919 BOOL show = get_ulong( &args );
3921 return NtUserShowCursor( show );
3924 NTSTATUS WINAPI wow64_NtUserShowScrollBar( UINT *args )
3926 HWND hwnd = get_handle( &args );
3927 INT bar = get_ulong( &args );
3928 BOOL show = get_ulong( &args );
3930 return NtUserShowScrollBar( hwnd, bar, show );
3933 NTSTATUS WINAPI wow64_NtUserShowWindow( UINT *args )
3935 HWND hwnd = get_handle( &args );
3936 INT cmd = get_ulong( &args );
3938 return NtUserShowWindow( hwnd, cmd );
3941 NTSTATUS WINAPI wow64_NtUserShowWindowAsync( UINT *args )
3943 HWND hwnd = get_handle( &args );
3944 INT cmd = get_ulong( &args );
3946 return NtUserShowWindowAsync( hwnd, cmd );
3949 NTSTATUS WINAPI wow64_NtUserSystemParametersInfo( UINT *args )
3951 UINT action = get_ulong( &args );
3952 UINT val = get_ulong( &args );
3953 void *ptr = get_ptr( &args );
3954 UINT winini = get_ulong( &args );
3956 switch (action)
3958 case SPI_GETSERIALKEYS:
3959 if (ptr)
3961 struct
3963 UINT cbSize;
3964 DWORD dwFlags;
3965 ULONG lpszActivePort;
3966 ULONG lpszPort;
3967 UINT iBaudRate;
3968 UINT iPortState;
3969 UINT iActive;
3970 } *keys32 = ptr;
3971 SERIALKEYSW keys;
3973 if (keys32->cbSize != sizeof(*keys32)) return FALSE;
3974 keys.cbSize = sizeof(keys);
3975 if (!NtUserSystemParametersInfo( action, val, &keys, winini )) return FALSE;
3976 keys32->dwFlags = keys.dwFlags;
3977 keys32->lpszActivePort = PtrToUlong( keys.lpszActivePort );
3978 keys32->lpszPort = PtrToUlong( keys.lpszPort );
3979 keys32->iBaudRate = keys.iBaudRate;
3980 keys32->iPortState = keys.iPortState;
3981 keys32->iActive = keys.iActive;
3982 return TRUE;
3984 break;
3986 case SPI_GETSOUNDSENTRY:
3987 if (ptr)
3989 struct
3991 UINT cbSize;
3992 DWORD dwFlags;
3993 DWORD iFSTextEffect;
3994 DWORD iFSTextEffectMSec;
3995 DWORD iFSTextEffectColorBits;
3996 DWORD iFSGrafEffect;
3997 DWORD iFSGrafEffectMSec;
3998 DWORD iFSGrafEffectColor;
3999 DWORD iWindowsEffect;
4000 DWORD iWindowsEffectMSec;
4001 ULONG lpszWindowsEffectDLL;
4002 DWORD iWindowsEffectOrdinal;
4003 } *entry32 = ptr;
4004 SOUNDSENTRYW entry;
4006 if (entry32->cbSize != sizeof(*entry32)) return FALSE;
4007 entry.cbSize = sizeof(entry);
4008 if (!NtUserSystemParametersInfo( action, val, &entry, winini )) return FALSE;
4009 entry32->dwFlags = entry.dwFlags;
4010 entry32->iFSTextEffect = entry.iFSTextEffect;
4011 entry32->iFSTextEffectMSec = entry.iFSTextEffectMSec;
4012 entry32->iFSTextEffectColorBits = entry.iFSTextEffectColorBits;
4013 entry32->iFSGrafEffect = entry.iFSGrafEffect;
4014 entry32->iFSGrafEffectMSec = entry.iFSGrafEffectMSec;
4015 entry32->iFSGrafEffectColor = entry.iFSGrafEffectColor;
4016 entry32->iWindowsEffect = entry.iWindowsEffect;
4017 entry32->iWindowsEffectMSec = entry.iWindowsEffectMSec;
4018 entry32->lpszWindowsEffectDLL = PtrToUlong( entry.lpszWindowsEffectDLL );
4019 entry32->iWindowsEffectOrdinal = entry.iWindowsEffectOrdinal;
4020 return TRUE;
4022 break;
4024 case SPI_GETHIGHCONTRAST:
4025 if (ptr)
4027 struct
4029 UINT cbSize;
4030 DWORD dwFlags;
4031 ULONG lpszDefaultScheme;
4032 } *info32 = ptr;
4033 HIGHCONTRASTW info;
4035 if (info32->cbSize != sizeof(*info32)) return FALSE;
4036 info.cbSize = sizeof(info);
4037 if (!NtUserSystemParametersInfo( action, val, &info, winini )) return FALSE;
4038 info32->dwFlags = info.dwFlags;
4039 info32->lpszDefaultScheme = PtrToUlong( info.lpszDefaultScheme );
4040 return TRUE;
4042 break;
4045 return NtUserSystemParametersInfo( action, val, ptr, winini );
4048 NTSTATUS WINAPI wow64_NtUserSystemParametersInfoForDpi( UINT *args )
4050 UINT action = get_ulong( &args );
4051 UINT val = get_ulong( &args );
4052 void *ptr = get_ptr( &args );
4053 UINT winini = get_ulong( &args );
4054 UINT dpi = get_ulong( &args );
4056 return NtUserSystemParametersInfoForDpi( action, val, ptr, winini, dpi );
4059 NTSTATUS WINAPI wow64_NtUserThunkedMenuInfo( UINT *args )
4061 HMENU menu = get_handle( &args );
4062 MENUINFO32 *info32 = get_ptr( &args );
4063 MENUINFO info;
4065 if (info32)
4067 info.cbSize = sizeof(info);
4068 info.fMask = info32->fMask;
4069 info.dwStyle = info32->dwStyle;
4070 info.cyMax = info32->cyMax;
4071 info.hbrBack = UlongToHandle( info32->hbrBack );
4072 info.dwContextHelpID = info32->dwContextHelpID;
4073 info.dwMenuData = info32->dwMenuData;
4076 return NtUserThunkedMenuInfo( menu, info32 ? &info : NULL );
4079 NTSTATUS WINAPI wow64_NtUserThunkedMenuItemInfo( UINT *args )
4081 HMENU handle = get_handle( &args );
4082 UINT pos = get_ulong( &args );
4083 UINT flags = get_ulong( &args );
4084 UINT method = get_ulong( &args );
4085 MENUITEMINFOW32 *info32 = get_ptr( &args );
4086 UNICODE_STRING32 *str32 = get_ptr( &args );
4087 MENUITEMINFOW info = { sizeof(info) }, *info_ptr;
4088 UNICODE_STRING str;
4089 UINT ret;
4091 if (info32)
4093 info.cbSize = sizeof(info);
4094 info.fMask = info32->fMask;
4095 switch (method)
4097 case NtUserSetMenuItemInfo:
4098 case NtUserInsertMenuItem:
4099 info.fType = info32->fType;
4100 info.fState = info32->fState;
4101 info.wID = info32->wID;
4102 info.hSubMenu = LongToHandle( info32->hSubMenu );
4103 info.hbmpChecked = UlongToHandle( info32->hbmpChecked );
4104 info.hbmpUnchecked = UlongToHandle( info32->hbmpUnchecked );
4105 info.dwItemData = info32->dwItemData;
4106 info.dwTypeData = UlongToPtr( info32->dwTypeData );
4107 info.cch = info32->cch;
4108 info.hbmpItem = UlongToHandle( info32->hbmpItem );
4109 break;
4110 case NtUserCheckMenuRadioItem:
4111 info.cch = info32->cch;
4112 break;
4113 case NtUserGetMenuItemInfoA:
4114 case NtUserGetMenuItemInfoW:
4115 info.dwTypeData = UlongToPtr( info32->dwTypeData );
4116 info.cch = info32->cch;
4117 break;
4119 info_ptr = &info;
4121 else info_ptr = NULL;
4123 ret = NtUserThunkedMenuItemInfo( handle, pos, flags, method, info_ptr,
4124 unicode_str_32to64( &str, str32 ));
4126 if (info_ptr)
4128 switch (method)
4130 case NtUserGetMenuItemInfoA:
4131 case NtUserGetMenuItemInfoW:
4132 if (info.fMask & (MIIM_TYPE | MIIM_STRING | MIIM_FTYPE))
4133 info32->fType = info.fType;
4134 if (info.fMask & (MIIM_TYPE | MIIM_BITMAP))
4135 info32->hbmpItem = HandleToUlong( info.hbmpItem );
4136 if (info.fMask & (MIIM_TYPE | MIIM_STRING))
4138 info32->dwTypeData = (UINT_PTR)info.dwTypeData;
4139 info32->cch = info.cch;
4141 if (info.fMask & MIIM_STATE) info32->fState = info.fState;
4142 if (info.fMask & MIIM_ID) info32->wID = info.wID;
4143 info32->hSubMenu = HandleToUlong( info.hSubMenu );
4144 if (info.fMask & MIIM_CHECKMARKS)
4146 info32->hbmpChecked = HandleToUlong( info.hbmpChecked );
4147 info32->hbmpUnchecked = HandleToUlong( info.hbmpUnchecked );
4149 if (info.fMask & MIIM_DATA) info32->dwItemData = info.dwItemData;
4150 break;
4154 return ret;
4157 NTSTATUS WINAPI wow64_NtUserToUnicodeEx( UINT *args )
4159 UINT virt = get_ulong( &args );
4160 UINT scan = get_ulong( &args );
4161 const BYTE *state = get_ptr( &args );
4162 WCHAR *str = get_ptr( &args );
4163 int size = get_ulong( &args );
4164 UINT flags = get_ulong( &args );
4165 HKL layout = get_handle( &args );
4167 return NtUserToUnicodeEx( virt, scan, state, str, size, flags, layout );
4170 NTSTATUS WINAPI wow64_NtUserTrackMouseEvent( UINT *args )
4172 struct
4174 DWORD cbSize;
4175 DWORD dwFlags;
4176 UINT32 hwndTrack;
4177 DWORD dwHoverTime;
4178 } *info32 = get_ptr( &args );
4179 TRACKMOUSEEVENT info;
4180 BOOL ret;
4182 if (info32->cbSize != sizeof(*info32))
4184 set_last_error32( ERROR_INVALID_PARAMETER );
4185 return FALSE;
4188 info.cbSize = sizeof(info);
4189 info.dwFlags = info32->dwFlags;
4190 info.hwndTrack = LongToHandle( info32->hwndTrack );
4191 info.dwHoverTime = info32->dwHoverTime;
4192 ret = NtUserTrackMouseEvent( &info );
4193 info32->dwFlags = info.dwFlags;
4194 info32->hwndTrack = HandleToUlong( info.hwndTrack );
4195 info32->dwHoverTime = info.dwHoverTime;
4196 return ret;
4199 NTSTATUS WINAPI wow64_NtUserTrackPopupMenuEx( UINT *args )
4201 HMENU handle = get_handle( &args );
4202 UINT flags = get_ulong( &args );
4203 int x = get_ulong( &args );
4204 int y = get_ulong( &args );
4205 HWND hwnd = get_handle( &args );
4206 TPMPARAMS *params = get_ptr( &args );
4208 return NtUserTrackPopupMenuEx( handle, flags, x, y, hwnd, params );
4211 NTSTATUS WINAPI wow64_NtUserTranslateAccelerator( UINT *args )
4213 HWND hwnd = get_handle( &args );
4214 HACCEL accel = get_handle( &args );
4215 MSG32 *msg32 = get_ptr( &args );
4217 MSG msg;
4219 return NtUserTranslateAccelerator( hwnd, accel, msg_32to64( &msg, msg32 ));
4222 NTSTATUS WINAPI wow64_NtUserTranslateMessage( UINT *args )
4224 const MSG32 *msg32 = get_ptr( &args );
4225 UINT flags = get_ulong( &args );
4226 MSG msg;
4228 return NtUserTranslateMessage( msg_32to64( &msg, msg32 ), flags );
4231 NTSTATUS WINAPI wow64_NtUserUnhookWinEvent( UINT *args )
4233 HWINEVENTHOOK handle = get_handle( &args );
4235 return NtUserUnhookWinEvent( handle );
4238 NTSTATUS WINAPI wow64_NtUserUnhookWindowsHookEx( UINT *args )
4240 HHOOK handle = get_handle( &args );
4242 return NtUserUnhookWindowsHookEx( handle );
4245 NTSTATUS WINAPI wow64_NtUserUnregisterClass( UINT *args )
4247 UNICODE_STRING32 *name32 = get_ptr( &args );
4248 HINSTANCE instance = get_ptr( &args );
4249 struct client_menu_name32 *menu_name32 = get_ptr( &args );
4251 UNICODE_STRING name;
4252 struct client_menu_name menu_name;
4253 BOOL ret;
4255 ret = NtUserUnregisterClass( unicode_str_32to64( &name, name32 ), instance, &menu_name );
4256 if (ret) client_menu_name_64to32( &menu_name, menu_name32 );
4257 return ret;
4260 NTSTATUS WINAPI wow64_NtUserUnregisterHotKey( UINT *args )
4262 HWND hwnd = get_handle( &args );
4263 int id = get_ulong( &args );
4265 return NtUserUnregisterHotKey( hwnd, id );
4268 NTSTATUS WINAPI wow64_NtUserUpdateInputContext( UINT *args )
4270 HIMC handle = get_handle( &args );
4271 UINT attr = get_ulong( &args );
4272 UINT_PTR value = get_ulong( &args );
4274 return NtUserUpdateInputContext( handle, attr, value );
4277 NTSTATUS WINAPI wow64_NtUserUpdateLayeredWindow( UINT *args )
4279 HWND hwnd = get_handle( &args );
4280 HDC hdc_dst = get_handle( &args );
4281 const POINT *pts_dst = get_ptr( &args );
4282 const SIZE *size = get_ptr( &args );
4283 HDC hdc_src = get_handle( &args );
4284 const POINT *pts_src = get_ptr( &args );
4285 COLORREF key = get_ulong( &args );
4286 const BLENDFUNCTION *blend = get_ptr( &args );
4287 DWORD flags = get_ulong( &args );
4288 const RECT *dirty = get_ptr( &args );
4290 return NtUserUpdateLayeredWindow( hwnd, hdc_dst, pts_dst, size, hdc_src, pts_src,
4291 key, blend, flags, dirty );
4294 NTSTATUS WINAPI wow64_NtUserValidateRect( UINT *args )
4296 HWND hwnd = get_handle( &args );
4297 const RECT *rect = get_ptr( &args );
4299 return NtUserValidateRect( hwnd, rect );
4302 NTSTATUS WINAPI wow64_NtUserVkKeyScanEx( UINT *args )
4304 WCHAR chr = get_ulong( &args );
4305 HKL layout = get_handle( &args );
4307 return NtUserVkKeyScanEx( chr, layout );
4310 NTSTATUS WINAPI wow64_NtUserWaitForInputIdle( UINT *args )
4312 HANDLE process = get_handle( &args );
4313 DWORD timeout = get_ulong( &args );
4314 BOOL wow = get_ulong( &args );
4316 return NtUserWaitForInputIdle( process, timeout, wow );
4319 NTSTATUS WINAPI wow64_NtUserWaitMessage( UINT *args )
4321 return NtUserWaitMessage();
4324 NTSTATUS WINAPI wow64_NtUserWindowFromDC( UINT *args )
4326 HDC hdc = get_handle( &args );
4328 return HandleToUlong( NtUserWindowFromDC( hdc ));
4331 NTSTATUS WINAPI wow64_NtUserWindowFromPoint( UINT *args )
4333 LONG x = get_ulong( &args );
4334 LONG y = get_ulong( &args );
4336 return HandleToUlong( NtUserWindowFromPoint( x, y ));
4339 NTSTATUS WINAPI wow64_NtUserDisplayConfigGetDeviceInfo( UINT *args )
4341 DISPLAYCONFIG_DEVICE_INFO_HEADER *packet = get_ptr( &args );
4343 return NtUserDisplayConfigGetDeviceInfo( packet );