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
24 #define WIN32_NO_STATUS
28 #include "wow64win_private.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(wow
);
40 DWORD dwContextHelpID
;
90 } RAWINPUTDEVICELIST32
;
137 BYTE rgbReserved
[32];
142 ULONG lpCreateParams
;
168 ULONG hwndInsertAfter
;
184 } MEASUREITEMSTRUCT32
;
214 } MOUSEHOOKSTRUCTEX32
;
247 } CBTACTIVATESTRUCT32
;
256 } DELETEITEMSTRUCT32
;
274 struct client_menu_name32
281 struct win_proc_params32
292 enum wm_char_mapping mapping
;
298 struct win_event_hook_params32
308 WCHAR module
[MAX_PATH
];
311 struct draw_text_params32
321 struct unpack_dde_message_params32
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
;
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
;
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
);
367 static struct client_menu_name32
*client_menu_name_64to32( const struct client_menu_name
*name
,
368 struct client_menu_name32
*name32
)
372 name32
->nameA
= PtrToUlong( name
->nameA
);
373 name32
->nameW
= PtrToUlong( name
->nameW
);
374 name32
->nameUS
= PtrToUlong( name
->nameUS
);
379 static void win_proc_params_64to32( const struct win_proc_params
*src
, struct win_proc_params32
*dst
,
382 dst
->func
= PtrToUlong( src
->func
);
383 dst
->hwnd
= HandleToUlong( src
->hwnd
);
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
);
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
);
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
);
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
);
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
;
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
;
474 static NTSTATUS
dispatch_callback( ULONG id
, void *args
, ULONG 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
;
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
, ¶ms32
, sizeof(params32
) );
502 static NTSTATUS WINAPI
wow64_NtUserCallSendAsyncCallback( void *arg
, ULONG size
)
504 struct send_async_params
*params
= arg
;
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
, ¶ms32
, 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
, ¶ms32
,
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
= ¶ms32_buf
;
552 if (size
> sizeof(*params
))
554 if (!(params32
= Wow64AllocateTemp( size
- sizeof(*params
) + sizeof(*params32
) )))
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
;
568 *params
->result
= result
;
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;
580 case WH_SYSMSGFILTER
:
583 msg_64to32( lp
, lp32
);
584 return sizeof(MSG32
);
587 switch (params
->code
)
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
);
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
);
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
:
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
);
642 mousehookstruct_64to32( lp
, lp32
);
643 return sizeof(MOUSEHOOKSTRUCTEX32
);
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
);
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
:
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
;
707 UINT lparam32_size
= 0, module_size
, size32
;
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 );
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
);
737 case WH_SYSMSGFILTER
:
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
);
750 static NTSTATUS WINAPI
wow64_NtUserCopyImage( void *arg
, ULONG size
)
752 struct copy_image_params
*params
= arg
;
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
, ¶ms32
, sizeof(params32
) );
770 static NTSTATUS WINAPI
wow64_NtUserDrawNonClientButton( void *arg
, ULONG size
)
772 struct draw_non_client_button_params
*params
= arg
;
777 enum NONCLIENT_BUTTON_TYPE type
;
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
, ¶ms32
, sizeof(params32
) );
792 static NTSTATUS WINAPI
wow64_NtUserDrawScrollBar( void *arg
, ULONG size
)
794 struct draw_scroll_bar_params
*params
= arg
;
808 enum SCROLL_HITTEST hit_test
;
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
, ¶ms32
, 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
;
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
;
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
;
876 params32
.format
= params
->format
;
877 params32
.handle
= HandleToUlong( params
->handle
);
878 return dispatch_callback( NtUserFreeCachedClipboardData
, ¶ms32
, sizeof(params32
) );
881 static NTSTATUS WINAPI
wow64_NtUserImmProcessKey( void *arg
, ULONG size
)
883 struct imm_process_key_params
*params
= arg
;
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
, ¶ms32
, sizeof(params32
) );
899 static NTSTATUS WINAPI
wow64_NtUserImmTranslateMessage( void *arg
, ULONG size
)
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
;
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
, ¶ms32
, 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
;
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
, ¶ms32
, 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
;
982 size
-= FIELD_OFFSET( struct unpack_dde_message_params
, data
);
983 if (!(params32
= Wow64AllocateTemp( FIELD_OFFSET( struct unpack_dde_message_params32
, data
[size
] ))))
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
))
996 if (ret_len
== sizeof(*result32
))
999 result
.wparam
= result32
->wparam
;
1000 result
.lparam
= result32
->lparam
;
1003 if (!params
->result
) NtCallbackReturn( &result
, sizeof(result
), TRUE
);
1004 *params
->result
= result
;
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
)
1024 static NTSTATUS WINAPI
wow64_NtUserCallVulkanDebugUtilsCallback( void *arg
, ULONG size
)
1030 static NTSTATUS WINAPI
wow64_NtUserCallOpenGLDebugMessageCallback( void *arg
, ULONG size
)
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
,
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
);
1172 ret
= NtUserBeginPaint( hwnd
, ps32
? & ps
: NULL
);
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
);
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
] );
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
);
1216 if (!(buffer
= Wow64AllocateTemp( count
* sizeof(*buffer
) ))) return STATUS_NO_MEMORY
;
1218 if ((status
= NtUserBuildHwndList( desktop
, unk2
, unk3
, unk4
, thread_id
, count
, buffer
, size
)))
1221 for (i
= 0; i
< *size
; i
++)
1222 buffer32
[i
] = HandleToUlong( buffer
[i
] );
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
);
1242 case NtUserCallHwndParam_GetScrollInfo
:
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
:
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
)¶ms
, code
);
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
);
1284 ret
= NtUserCallMsgFilter( msg_32to64( &msg
, msg32
), code
);
1285 msg_64to32( &msg
, msg32
);
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
);
1322 case NtUserCallTwoParam_GetMenuInfo
:
1324 MENUINFO32
*info32
= UlongToPtr( arg2
);
1327 if (!info32
|| info32
->cbSize
!= sizeof(*info32
))
1329 set_last_error32( ERROR_INVALID_PARAMETER
);
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
;
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
;
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
;
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
);
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
);
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
;
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
;
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
)
1793 } *info32
= get_ptr( &args
);
1799 set_last_error32( ERROR_NOACCESS
);
1803 if (info32
->cbSize
!= sizeof(*info32
))
1805 set_last_error32( ERROR_INVALID_PARAMETER
);
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
);
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
;
1867 wc
.cbSize
= sizeof(wc
);
1868 if (!(ret
= NtUserGetClassInfoEx( instance
, unicode_str_32to64( &name
, name32
), &wc
,
1869 &client_name
, ansi
)))
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
);
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
);
1895 return NtUserGetClassName( hwnd
, real
, unicode_str_32to64( &str
, str32
));
1898 NTSTATUS WINAPI
wow64_NtUserGetClipboardData( UINT
*args
)
1900 UINT format
= get_ulong( &args
);
1908 } *params32
= get_ptr( &args
);
1910 struct get_clipboard_params params
;
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
, ¶ms
);
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
)
1973 } *info32
= get_ptr( &args
);
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
;
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
);
2040 ULONG hwndMenuOwner
;
2044 } *info32
= get_ptr( &args
);
2047 if (info32
->cbSize
!= sizeof(*info32
))
2049 set_last_error32( ERROR_INVALID_PARAMETER
);
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
;
2066 NTSTATUS WINAPI
wow64_NtUserGetIconInfo( UINT
*args
)
2068 HICON icon
= get_handle( &args
);
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
);
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
))
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
);
2096 module32
->Buffer
= PtrToUlong( module
.Buffer
);
2097 module32
->Length
= module
.Length
;
2101 res_name32
->Buffer
= PtrToUlong( res_name
.Buffer
);
2102 res_name32
->Length
= res_name
.Length
;
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
;
2156 if (layouts32
&& size
&& !(layouts
= Wow64AllocateTemp( size
* sizeof(*layouts
) )))
2159 ret
= NtUserGetKeyboardLayoutList( size
, layouts
);
2161 for (i
= 0; i
< ret
; i
++) layouts32
[i
] = HandleToUlong( layouts
[i
] );
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
);
2202 } *info32
= get_ptr( &args
);
2206 if (info32
->cbSize
!= sizeof(*info32
))
2208 set_last_error32( ERROR_INVALID_PARAMETER
);
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
;
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
);
2241 ret
= NtUserGetMessage( &msg
, hwnd
, first
, last
);
2242 if (ret
!= -1) msg_64to32( &msg
, msg32
);
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];
2257 if (size
!= sizeof(MOUSEMOVEPOINT32
) || count
< 0 || count
> ARRAYSIZE( ptin
))
2259 set_last_error32( ERROR_INVALID_PARAMETER
);
2263 if (!ptin32
|| (!ptout32
&& count
))
2265 set_last_error32( ERROR_NOACCESS
);
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
;
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
);
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
);
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
);
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
);
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
;
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
);
2432 UINT data_size64
= sizeof(RAWINPUTHEADER
);
2433 RAWINPUTHEADER32
*data32
= data
;
2434 RAWINPUTHEADER data64
;
2439 *data_size
= sizeof(RAWINPUTHEADER32
);
2443 if (*data_size
< sizeof(RAWINPUTHEADER32
))
2445 set_last_error32( ERROR_INSUFFICIENT_BUFFER
);
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
);
2459 set_last_error32( ERROR_INVALID_PARAMETER
);
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
);
2488 RAWINPUTDEVICELIST
*devices64
;
2489 unsigned int ret
, i
;
2491 if (!(devices64
= Wow64AllocateTemp( (*count
) * sizeof(*devices64
) )))
2493 set_last_error32( ERROR_NOT_ENOUGH_MEMORY
);
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
;
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
;
2536 if (wc32
->cbSize
!= sizeof(*wc32
))
2538 set_last_error32( ERROR_INVALID_PARAMETER
);
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
),
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
);
2576 RAWINPUTDEVICE
*devices64
;
2577 unsigned int ret
, i
;
2579 if (!(devices64
= Wow64AllocateTemp( (*count
) * sizeof(*devices64
) )))
2581 set_last_error32( ERROR_NOT_ENOUGH_MEMORY
);
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
;
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
;
2717 ULONG pListBoxWndProc
;
2718 ULONG pMDIClientWndProc
;
2719 ULONG pScrollBarWndProc
;
2720 ULONG pStaticWndProc
;
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
);
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
)
2862 CREATESTRUCT32
*cs32
= (void *)lparam
;
2865 createstruct_32to64( cs32
, &cs
);
2866 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&cs
, result_info
, type
, ansi
);
2867 createstruct_64to32( &cs
, cs32
);
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
);
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
;
2906 winpos_32to64( &winpos
, winpos32
);
2907 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&winpos
, result_info
, type
, ansi
);
2908 winpos_64to32( &winpos
, winpos32
);
2919 } *params32
= (void *)lparam
;
2920 NCCALCSIZE_PARAMS params
;
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
)¶ms
, 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
));
2935 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
2937 case WM_COMPAREITEM
:
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
);
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
;
2994 DRAWITEMSTRUCT32
*dis32
= (void *)lparam
;
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
);
3019 } *cds32
= (void *)lparam
;
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
);
3031 MSG32
*msg32
= (MSG32
*)lparam
;
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
);
3046 } *next32
= (void *)lparam
;
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
:
3059 paintstruct_32to64( &ps
, (PAINTSTRUCT32
*)lparam
);
3060 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&ps
, result_info
, type
, ansi
);
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
);
3080 case NtUserGetDispatchParams
:
3081 case NtUserCallWindowProc
:
3083 struct win_proc_params32
*params32
= result_info
;
3084 struct win_proc_params params
;
3087 result32
= UlongToPtr( params32
->result
);
3088 if (type
== NtUserCallWindowProc
) params
.func
= UlongToPtr( params32
->func
);
3090 if (!NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
))
3093 win_proc_params_64to32( ¶ms
, params32
, result32
);
3097 case NtUserSendMessage
:
3099 struct win_proc_params32
*params32
= result_info
;
3103 struct win_proc_params params
;
3107 ret
= message_call_32to64( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
);
3108 if (params
.hwnd
) win_proc_params_64to32( ¶ms
, params32
, NULL
);
3112 return message_call_32to64( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3115 case NtUserSendMessageTimeout
:
3122 } *params32
= result_info
;
3123 struct send_message_timeout_params params
;
3126 params
.flags
= params32
->flags
;
3127 params
.timeout
= params32
->timeout
;
3128 ret
= message_call_32to64( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
);
3129 params32
->result
= params
.result
;
3133 case NtUserSendMessageCallback
:
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
, ¶ms
, 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
:
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
, ¶ms
, 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
];
3200 if (count
> ARRAYSIZE(handles
))
3202 set_last_error32( ERROR_INVALID_PARAMETER
);
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
);
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
);
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
;
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
);
3279 if (!NtUserPeekMessage( msg32
? &msg
: NULL
, hwnd
, first
, last
, flags
)) return FALSE
;
3280 msg_64to32( &msg
, msg32
);
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_NtUserQueryDisplayConfig( UINT
*args
)
3323 UINT32 flags
= get_ulong( &args
);
3324 UINT32
*paths_count
= get_ptr( &args
);
3325 DISPLAYCONFIG_PATH_INFO
*paths
= get_ptr( &args
);
3326 UINT32
*modes_count
= get_ptr( &args
);
3327 DISPLAYCONFIG_MODE_INFO
*modes
= get_ptr( &args
);
3328 DISPLAYCONFIG_TOPOLOGY_ID
*topology_id
= get_ptr( &args
);
3330 return NtUserQueryDisplayConfig( flags
, paths_count
, paths
, modes_count
, modes
, topology_id
);
3333 NTSTATUS WINAPI
wow64_NtUserQueryInputContext( UINT
*args
)
3335 HIMC handle
= get_handle( &args
);
3336 UINT attr
= get_ulong( &args
);
3338 return NtUserQueryInputContext( handle
, attr
);
3341 NTSTATUS WINAPI
wow64_NtUserRedrawWindow( UINT
*args
)
3343 HWND hwnd
= get_handle( &args
);
3344 const RECT
*rect
= get_ptr( &args
);
3345 HRGN hrgn
= get_handle( &args
);
3346 UINT flags
= get_ulong( &args
);
3348 return NtUserRedrawWindow( hwnd
, rect
, hrgn
, flags
);
3351 NTSTATUS WINAPI
wow64_NtUserRegisterHotKey( UINT
*args
)
3353 HWND hwnd
= get_handle( &args
);
3354 INT id
= get_ulong( &args
);
3355 UINT modifiers
= get_ulong( &args
);
3356 UINT vk
= get_ulong( &args
);
3358 return NtUserRegisterHotKey( hwnd
, id
, modifiers
, vk
);
3361 NTSTATUS WINAPI
wow64_NtUserRegisterRawInputDevices( UINT
*args
)
3363 const RAWINPUTDEVICE32
*devices32
= get_ptr( &args
);
3364 UINT count
= get_ulong( &args
);
3365 UINT size
= get_ulong( &args
);
3367 RAWINPUTDEVICE
*devices64
;
3370 if (size
!= sizeof(RAWINPUTDEVICE32
))
3372 set_last_error32( ERROR_INVALID_PARAMETER
);
3376 if (!(devices64
= Wow64AllocateTemp( count
* sizeof(*devices64
) )))
3378 set_last_error32( ERROR_NOT_ENOUGH_MEMORY
);
3382 for (i
= 0; i
< count
; ++i
)
3384 devices64
[i
].usUsagePage
= devices32
[i
].usUsagePage
;
3385 devices64
[i
].usUsage
= devices32
[i
].usUsage
;
3386 devices64
[i
].dwFlags
= devices32
[i
].dwFlags
;
3387 devices64
[i
].hwndTarget
= UlongToPtr( devices32
[i
].hwndTarget
);
3390 return NtUserRegisterRawInputDevices( devices64
, count
, sizeof(*devices64
) );
3393 NTSTATUS WINAPI
wow64_NtUserReleaseDC( UINT
*args
)
3395 HWND hwnd
= get_handle( &args
);
3396 HDC hdc
= get_handle( &args
);
3398 return NtUserReleaseDC( hwnd
, hdc
);
3401 NTSTATUS WINAPI
wow64_NtUserRemoveClipboardFormatListener( UINT
*args
)
3403 HWND hwnd
= get_handle( &args
);
3405 return NtUserRemoveClipboardFormatListener( hwnd
);
3408 NTSTATUS WINAPI
wow64_NtUserRemoveMenu( UINT
*args
)
3410 HMENU handle
= get_handle( &args
);
3411 UINT id
= get_ulong( &args
);
3412 UINT flags
= get_ulong( &args
);
3414 return NtUserRemoveMenu( handle
, id
, flags
);
3417 NTSTATUS WINAPI
wow64_NtUserRemoveProp( UINT
*args
)
3419 HWND hwnd
= get_handle( &args
);
3420 const WCHAR
*str
= get_ptr( &args
);
3422 return HandleToUlong( NtUserRemoveProp( hwnd
, str
));
3425 NTSTATUS WINAPI
wow64_NtUserScrollDC( UINT
*args
)
3427 HDC hdc
= get_handle( &args
);
3428 INT dx
= get_ulong( &args
);
3429 INT dy
= get_ulong( &args
);
3430 const RECT
*scroll
= get_ptr( &args
);
3431 const RECT
*clip
= get_ptr( &args
);
3432 HRGN ret_update_rgn
= get_handle( &args
);
3433 RECT
*update_rect
= get_ptr( &args
);
3435 return NtUserScrollDC( hdc
, dx
, dy
, scroll
, clip
, ret_update_rgn
, update_rect
);
3438 NTSTATUS WINAPI
wow64_NtUserScrollWindowEx( UINT
*args
)
3440 HWND hwnd
= get_handle( &args
);
3441 INT dx
= get_ulong( &args
);
3442 INT dy
= get_ulong( &args
);
3443 const RECT
*rect
= get_ptr( &args
);
3444 const RECT
*clip_rect
= get_ptr( &args
);
3445 HRGN update_rgn
= get_handle( &args
);
3446 RECT
*update_rect
= get_ptr( &args
);
3447 UINT flags
= get_ulong( &args
);
3449 return NtUserScrollWindowEx( hwnd
, dx
, dy
, rect
, clip_rect
, update_rgn
, update_rect
, flags
);
3452 NTSTATUS WINAPI
wow64_NtUserSelectPalette( UINT
*args
)
3454 HDC hdc
= get_handle( &args
);
3455 HPALETTE hpal
= get_handle( &args
);
3456 WORD bkg
= get_ulong( &args
);
3458 return HandleToUlong( NtUserSelectPalette( hdc
, hpal
, bkg
));
3461 NTSTATUS WINAPI
wow64_NtUserSendInput( UINT
*args
)
3463 UINT count
= get_ulong( &args
);
3464 INPUT32
*inputs32
= get_ptr( &args
);
3465 int size
= get_ulong( &args
);
3467 INPUT
*inputs
= NULL
;
3470 if (size
!= sizeof(*inputs32
) || !count
)
3472 set_last_error32( ERROR_INVALID_PARAMETER
);
3478 set_last_error32( ERROR_NOACCESS
);
3482 if (count
&& !(inputs
= Wow64AllocateTemp( count
* sizeof(*inputs
) )))
3485 for (i
= 0; i
< count
; i
++)
3487 inputs
[i
].type
= inputs32
[i
].type
;
3488 switch (inputs
[i
].type
)
3491 inputs
[i
].mi
.dx
= inputs32
[i
].mi
.dx
;
3492 inputs
[i
].mi
.dy
= inputs32
[i
].mi
.dy
;
3493 inputs
[i
].mi
.mouseData
= inputs32
[i
].mi
.mouseData
;
3494 inputs
[i
].mi
.dwFlags
= inputs32
[i
].mi
.dwFlags
;
3495 inputs
[i
].mi
.time
= inputs32
[i
].mi
.time
;
3496 inputs
[i
].mi
.dwExtraInfo
= inputs32
[i
].mi
.dwExtraInfo
;
3498 case INPUT_KEYBOARD
:
3499 inputs
[i
].ki
.wVk
= inputs32
[i
].ki
.wVk
;
3500 inputs
[i
].ki
.wScan
= inputs32
[i
].ki
.wScan
;
3501 inputs
[i
].ki
.dwFlags
= inputs32
[i
].ki
.dwFlags
;
3502 inputs
[i
].ki
.time
= inputs32
[i
].ki
.time
;
3503 inputs
[i
].ki
.dwExtraInfo
= inputs32
[i
].ki
.dwExtraInfo
;
3505 case INPUT_HARDWARE
:
3506 inputs
[i
].hi
= inputs32
[i
].hi
;
3511 return NtUserSendInput( count
, inputs
, sizeof(*inputs
) );
3514 NTSTATUS WINAPI
wow64_NtUserSetActiveWindow( UINT
*args
)
3516 HWND hwnd
= get_handle( &args
);
3518 return HandleToUlong( NtUserSetActiveWindow( hwnd
));
3521 NTSTATUS WINAPI
wow64_NtUserSetCapture( UINT
*args
)
3523 HWND hwnd
= get_handle( &args
);
3525 return HandleToUlong( NtUserSetCapture( hwnd
));
3528 NTSTATUS WINAPI
wow64_NtUserSetClassLong( UINT
*args
)
3530 HWND hwnd
= get_handle( &args
);
3531 INT offset
= get_ulong( &args
);
3532 LONG newval
= get_ulong( &args
);
3533 BOOL ansi
= get_ulong( &args
);
3535 return NtUserSetClassLong( hwnd
, offset
, newval
, ansi
);
3538 NTSTATUS WINAPI
wow64_NtUserSetClassLongPtr( UINT
*args
)
3540 HWND hwnd
= get_handle( &args
);
3541 INT offset
= get_ulong( &args
);
3542 LONG_PTR newval
= get_ulong( &args
);
3543 BOOL ansi
= get_ulong( &args
);
3545 if (offset
== GCLP_MENUNAME
)
3547 struct client_menu_name menu_name
;
3548 struct client_menu_name32
*menu_name32
= UlongToPtr( newval
);
3549 NtUserSetClassLong( hwnd
, offset
,
3550 (UINT_PTR
)client_menu_name_32to64( &menu_name
, menu_name32
), ansi
);
3551 client_menu_name_64to32( &menu_name
, menu_name32
);
3555 return NtUserSetClassLongPtr( hwnd
, offset
, newval
, ansi
);
3558 NTSTATUS WINAPI
wow64_NtUserSetClassWord( UINT
*args
)
3560 HWND hwnd
= get_handle( &args
);
3561 INT offset
= get_ulong( &args
);
3562 WORD newval
= get_ulong( &args
);
3564 return NtUserSetClassWord( hwnd
, offset
, newval
);
3567 NTSTATUS WINAPI
wow64_NtUserSetClipboardData( UINT
*args
)
3569 UINT format
= get_ulong( &args
);
3570 HANDLE handle
= get_handle( &args
);
3577 } *params32
= get_ptr( &args
);
3579 struct set_clipboard_params params
;
3580 params
.data
= UlongToPtr( params32
->data
);
3581 params
.size
= params32
->size
;
3582 params
.cache_only
= params32
->cache_only
;
3583 params
.seqno
= params32
->seqno
;
3585 return NtUserSetClipboardData( format
, handle
, ¶ms
);
3588 NTSTATUS WINAPI
wow64_NtUserSetClipboardViewer( UINT
*args
)
3590 HWND hwnd
= get_handle( &args
);
3592 return HandleToUlong( NtUserSetClipboardViewer( hwnd
));
3595 NTSTATUS WINAPI
wow64_NtUserSetCursor( UINT
*args
)
3597 HCURSOR cursor
= get_handle( &args
);
3599 return HandleToUlong( NtUserSetCursor( cursor
));
3602 NTSTATUS WINAPI
wow64_NtUserSetCursorIconData( UINT
*args
)
3604 HCURSOR cursor
= get_handle( &args
);
3605 UNICODE_STRING32
*module32
= get_ptr( &args
);
3606 UNICODE_STRING32
*res_name32
= get_ptr( &args
);
3617 } *desc32
= get_ptr( &args
);
3626 } *frames32
= UlongToPtr( desc32
->frames
);
3628 UNICODE_STRING module
, res_name
;
3629 struct cursoricon_desc desc
;
3632 num_frames
= max( desc32
->num_frames
, 1 );
3633 if (!(desc
.frames
= Wow64AllocateTemp( num_frames
* sizeof(*desc
.frames
) ))) return FALSE
;
3634 desc
.flags
= desc32
->flags
;
3635 desc
.num_steps
= desc32
->num_steps
;
3636 desc
.num_frames
= desc32
->num_frames
;
3637 desc
.delay
= desc32
->delay
;
3638 desc
.frame_seq
= UlongToPtr( desc32
->frame_seq
);
3639 desc
.frame_rates
= UlongToPtr( desc32
->frame_rates
);
3640 desc
.rsrc
= UlongToPtr( desc32
->rsrc
);
3642 for (i
= 0; i
< num_frames
; i
++)
3644 desc
.frames
[i
].width
= frames32
[i
].width
;
3645 desc
.frames
[i
].height
= frames32
[i
].height
;
3646 desc
.frames
[i
].color
= UlongToHandle( frames32
[i
].color
);
3647 desc
.frames
[i
].alpha
= UlongToHandle( frames32
[i
].alpha
);
3648 desc
.frames
[i
].mask
= UlongToHandle( frames32
[i
].mask
);
3649 desc
.frames
[i
].hotspot
= frames32
[i
].hotspot
;
3652 return NtUserSetCursorIconData( cursor
, unicode_str_32to64( &module
, module32
),
3653 unicode_str_32to64( &res_name
, res_name32
), &desc
);
3656 NTSTATUS WINAPI
wow64_NtUserSetCursorPos( UINT
*args
)
3658 INT x
= get_ulong( &args
);
3659 INT y
= get_ulong( &args
);
3661 return NtUserSetCursorPos( x
, y
);
3664 NTSTATUS WINAPI
wow64_NtUserSetFocus( UINT
*args
)
3666 HWND hwnd
= get_handle( &args
);
3668 return HandleToUlong( NtUserSetFocus( hwnd
));
3671 NTSTATUS WINAPI
wow64_NtUserSetInternalWindowPos( UINT
*args
)
3673 HWND hwnd
= get_handle( &args
);
3674 UINT cmd
= get_ulong( &args
);
3675 RECT
*rect
= get_ptr( &args
);
3676 POINT
*pt
= get_ptr( &args
);
3678 NtUserSetInternalWindowPos( hwnd
, cmd
, rect
, pt
);
3682 NTSTATUS WINAPI
wow64_NtUserSetKeyboardState( UINT
*args
)
3684 BYTE
*state
= get_ptr( &args
);
3686 return NtUserSetKeyboardState( state
);
3689 NTSTATUS WINAPI
wow64_NtUserSetLayeredWindowAttributes( UINT
*args
)
3691 HWND hwnd
= get_handle( &args
);
3692 COLORREF key
= get_ulong( &args
);
3693 BYTE alpha
= get_ulong( &args
);
3694 DWORD flags
= get_ulong( &args
);
3696 return NtUserSetLayeredWindowAttributes( hwnd
, key
, alpha
, flags
);
3699 NTSTATUS WINAPI
wow64_NtUserSetMenu( UINT
*args
)
3701 HWND hwnd
= get_handle( &args
);
3702 HMENU menu
= get_handle( &args
);
3704 return NtUserSetMenu( hwnd
, menu
);
3707 NTSTATUS WINAPI
wow64_NtUserSetMenuContextHelpId( UINT
*args
)
3709 HMENU menu
= get_handle( &args
);
3710 DWORD id
= get_ulong( &args
);
3712 return NtUserSetMenuContextHelpId( menu
, id
);
3715 NTSTATUS WINAPI
wow64_NtUserSetMenuDefaultItem( UINT
*args
)
3717 HMENU handle
= get_handle( &args
);
3718 UINT item
= get_ulong( &args
);
3719 UINT bypos
= get_ulong( &args
);
3721 return NtUserSetMenuDefaultItem( handle
, item
, bypos
);
3724 NTSTATUS WINAPI
wow64_NtUserSetObjectInformation( UINT
*args
)
3726 HANDLE handle
= get_handle( &args
);
3727 INT index
= get_ulong( &args
);
3728 void *info
= get_ptr( &args
);
3729 DWORD len
= get_ulong( &args
);
3731 return NtUserSetObjectInformation( handle
, index
, info
, len
);
3734 NTSTATUS WINAPI
wow64_NtUserSetParent( UINT
*args
)
3736 HWND hwnd
= get_handle( &args
);
3737 HWND parent
= get_handle( &args
);
3739 return HandleToUlong( NtUserSetParent( hwnd
, parent
));
3742 NTSTATUS WINAPI
wow64_NtUserSetProcessDpiAwarenessContext( UINT
*args
)
3744 ULONG awareness
= get_ulong( &args
);
3745 ULONG unknown
= get_ulong( &args
);
3747 return NtUserSetProcessDpiAwarenessContext( awareness
, unknown
);
3750 NTSTATUS WINAPI
wow64_NtUserSetProcessWindowStation( UINT
*args
)
3752 HWINSTA handle
= get_handle( &args
);
3754 return NtUserSetProcessWindowStation( handle
);
3757 NTSTATUS WINAPI
wow64_NtUserSetProp( UINT
*args
)
3759 HWND hwnd
= get_handle( &args
);
3760 const WCHAR
*str
= get_ptr( &args
);
3761 HANDLE handle
= get_handle( &args
);
3763 return NtUserSetProp( hwnd
, str
, handle
);
3766 NTSTATUS WINAPI
wow64_NtUserSetScrollInfo( UINT
*args
)
3768 HWND hwnd
= get_handle( &args
);
3769 INT bar
= get_ulong( &args
);
3770 const SCROLLINFO
*info
= get_ptr( &args
);
3771 BOOL redraw
= get_ulong( &args
);
3773 return NtUserSetScrollInfo( hwnd
, bar
, info
, redraw
);
3776 NTSTATUS WINAPI
wow64_NtUserSetShellWindowEx( UINT
*args
)
3778 HWND shell
= get_handle( &args
);
3779 HWND list_view
= get_handle( &args
);
3781 return NtUserSetShellWindowEx( shell
, list_view
);
3784 NTSTATUS WINAPI
wow64_NtUserSetSysColors( UINT
*args
)
3786 INT count
= get_ulong( &args
);
3787 const INT
*colors
= get_ptr( &args
);
3788 const COLORREF
*values
= get_ptr( &args
);
3790 return NtUserSetSysColors( count
, colors
, values
);
3793 NTSTATUS WINAPI
wow64_NtUserSetSystemMenu( UINT
*args
)
3795 HWND hwnd
= get_handle( &args
);
3796 HMENU menu
= get_handle( &args
);
3798 return NtUserSetSystemMenu( hwnd
, menu
);
3801 NTSTATUS WINAPI
wow64_NtUserSetSystemTimer( UINT
*args
)
3803 HWND hwnd
= get_handle( &args
);
3804 UINT_PTR id
= get_ulong( &args
);
3805 UINT timeout
= get_ulong( &args
);
3807 return NtUserSetSystemTimer( hwnd
, id
, timeout
);
3810 NTSTATUS WINAPI
wow64_NtUserSetThreadDesktop( UINT
*args
)
3812 HDESK handle
= get_handle( &args
);
3814 return NtUserSetThreadDesktop( handle
);
3817 NTSTATUS WINAPI
wow64_NtUserSetTimer( UINT
*args
)
3819 HWND hwnd
= get_handle( &args
);
3820 UINT_PTR id
= get_ulong( &args
);
3821 UINT timeout
= get_ulong( &args
);
3822 TIMERPROC proc
= get_ptr( &args
);
3823 ULONG tolerance
= get_ulong( &args
);
3825 return NtUserSetTimer( hwnd
, id
, timeout
, proc
, tolerance
);
3828 NTSTATUS WINAPI
wow64_NtUserSetWinEventHook( UINT
*args
)
3830 DWORD event_min
= get_ulong( &args
);
3831 DWORD event_max
= get_ulong( &args
);
3832 HMODULE inst
= get_handle( &args
);
3833 UNICODE_STRING32
*module32
= get_ptr( &args
);
3834 WINEVENTPROC proc
= get_ptr(&args
);
3835 DWORD pid
= get_ulong( &args
);
3836 DWORD tid
= get_ulong( &args
);
3837 DWORD flags
= get_ulong( &args
);
3838 UNICODE_STRING module
;
3841 ret
= NtUserSetWinEventHook( event_min
, event_max
, inst
,
3842 unicode_str_32to64( &module
, module32
),
3843 proc
, pid
, tid
, flags
);
3844 return HandleToUlong( ret
);
3847 NTSTATUS WINAPI
wow64_NtUserSetWindowLong( UINT
*args
)
3849 HWND hwnd
= get_handle( &args
);
3850 INT offset
= get_ulong( &args
);
3851 LONG newval
= get_ulong( &args
);
3852 BOOL ansi
= get_ulong( &args
);
3854 return NtUserSetWindowLong( hwnd
, offset
, newval
, ansi
);
3857 NTSTATUS WINAPI
wow64_NtUserSetWindowLongPtr( UINT
*args
)
3859 HWND hwnd
= get_handle( &args
);
3860 INT offset
= get_ulong( &args
);
3861 LONG_PTR newval
= get_ulong( &args
);
3862 BOOL ansi
= get_ulong( &args
);
3864 return NtUserSetWindowLongPtr( hwnd
, offset
, newval
, ansi
);
3867 NTSTATUS WINAPI
wow64_NtUserSetWindowPlacement( UINT
*args
)
3869 HWND hwnd
= get_handle( &args
);
3870 const WINDOWPLACEMENT
*wpl
= get_ptr( &args
);
3872 return NtUserSetWindowPlacement( hwnd
, wpl
);
3875 NTSTATUS WINAPI
wow64_NtUserSetWindowPos( UINT
*args
)
3877 HWND hwnd
= get_handle( &args
);
3878 HWND after
= get_handle( &args
);
3879 INT x
= get_ulong( &args
);
3880 INT y
= get_ulong( &args
);
3881 INT cx
= get_ulong( &args
);
3882 INT cy
= get_ulong( &args
);
3883 UINT flags
= get_ulong( &args
);
3885 return NtUserSetWindowPos( hwnd
, after
, x
, y
, cx
, cy
, flags
);
3888 NTSTATUS WINAPI
wow64_NtUserSetWindowRgn( UINT
*args
)
3890 HWND hwnd
= get_handle( &args
);
3891 HRGN hrgn
= get_handle( &args
);
3892 BOOL redraw
= get_ulong( &args
);
3894 return NtUserSetWindowRgn( hwnd
, hrgn
, redraw
);
3897 NTSTATUS WINAPI
wow64_NtUserSetWindowWord( UINT
*args
)
3899 HWND hwnd
= get_handle( &args
);
3900 INT offset
= get_ulong( &args
);
3901 WORD newval
= get_ulong( &args
);
3903 return NtUserSetWindowWord( hwnd
, offset
, newval
);
3906 NTSTATUS WINAPI
wow64_NtUserSetWindowsHookEx( UINT
*args
)
3908 HINSTANCE inst
= get_handle( &args
);
3909 UNICODE_STRING32
*module32
= get_ptr( &args
);
3910 DWORD tid
= get_ulong( &args
);
3911 INT id
= get_ulong( &args
);
3912 HOOKPROC proc
= get_ptr( &args
);
3913 BOOL ansi
= get_ulong( &args
);
3914 UNICODE_STRING module
;
3917 ret
= NtUserSetWindowsHookEx( inst
, unicode_str_32to64( &module
, module32
),
3918 tid
, id
, proc
, ansi
);
3919 return HandleToUlong( ret
);
3922 NTSTATUS WINAPI
wow64_NtUserShowCaret( UINT
*args
)
3924 HWND hwnd
= get_handle( &args
);
3926 return NtUserShowCaret( hwnd
);
3929 NTSTATUS WINAPI
wow64_NtUserShowCursor( UINT
*args
)
3931 BOOL show
= get_ulong( &args
);
3933 return NtUserShowCursor( show
);
3936 NTSTATUS WINAPI
wow64_NtUserShowScrollBar( UINT
*args
)
3938 HWND hwnd
= get_handle( &args
);
3939 INT bar
= get_ulong( &args
);
3940 BOOL show
= get_ulong( &args
);
3942 return NtUserShowScrollBar( hwnd
, bar
, show
);
3945 NTSTATUS WINAPI
wow64_NtUserShowWindow( UINT
*args
)
3947 HWND hwnd
= get_handle( &args
);
3948 INT cmd
= get_ulong( &args
);
3950 return NtUserShowWindow( hwnd
, cmd
);
3953 NTSTATUS WINAPI
wow64_NtUserShowWindowAsync( UINT
*args
)
3955 HWND hwnd
= get_handle( &args
);
3956 INT cmd
= get_ulong( &args
);
3958 return NtUserShowWindowAsync( hwnd
, cmd
);
3961 NTSTATUS WINAPI
wow64_NtUserSystemParametersInfo( UINT
*args
)
3963 UINT action
= get_ulong( &args
);
3964 UINT val
= get_ulong( &args
);
3965 void *ptr
= get_ptr( &args
);
3966 UINT winini
= get_ulong( &args
);
3970 case SPI_GETSERIALKEYS
:
3977 ULONG lpszActivePort
;
3985 if (keys32
->cbSize
!= sizeof(*keys32
)) return FALSE
;
3986 keys
.cbSize
= sizeof(keys
);
3987 if (!NtUserSystemParametersInfo( action
, val
, &keys
, winini
)) return FALSE
;
3988 keys32
->dwFlags
= keys
.dwFlags
;
3989 keys32
->lpszActivePort
= PtrToUlong( keys
.lpszActivePort
);
3990 keys32
->lpszPort
= PtrToUlong( keys
.lpszPort
);
3991 keys32
->iBaudRate
= keys
.iBaudRate
;
3992 keys32
->iPortState
= keys
.iPortState
;
3993 keys32
->iActive
= keys
.iActive
;
3998 case SPI_GETSOUNDSENTRY
:
4005 DWORD iFSTextEffect
;
4006 DWORD iFSTextEffectMSec
;
4007 DWORD iFSTextEffectColorBits
;
4008 DWORD iFSGrafEffect
;
4009 DWORD iFSGrafEffectMSec
;
4010 DWORD iFSGrafEffectColor
;
4011 DWORD iWindowsEffect
;
4012 DWORD iWindowsEffectMSec
;
4013 ULONG lpszWindowsEffectDLL
;
4014 DWORD iWindowsEffectOrdinal
;
4018 if (entry32
->cbSize
!= sizeof(*entry32
)) return FALSE
;
4019 entry
.cbSize
= sizeof(entry
);
4020 if (!NtUserSystemParametersInfo( action
, val
, &entry
, winini
)) return FALSE
;
4021 entry32
->dwFlags
= entry
.dwFlags
;
4022 entry32
->iFSTextEffect
= entry
.iFSTextEffect
;
4023 entry32
->iFSTextEffectMSec
= entry
.iFSTextEffectMSec
;
4024 entry32
->iFSTextEffectColorBits
= entry
.iFSTextEffectColorBits
;
4025 entry32
->iFSGrafEffect
= entry
.iFSGrafEffect
;
4026 entry32
->iFSGrafEffectMSec
= entry
.iFSGrafEffectMSec
;
4027 entry32
->iFSGrafEffectColor
= entry
.iFSGrafEffectColor
;
4028 entry32
->iWindowsEffect
= entry
.iWindowsEffect
;
4029 entry32
->iWindowsEffectMSec
= entry
.iWindowsEffectMSec
;
4030 entry32
->lpszWindowsEffectDLL
= PtrToUlong( entry
.lpszWindowsEffectDLL
);
4031 entry32
->iWindowsEffectOrdinal
= entry
.iWindowsEffectOrdinal
;
4036 case SPI_GETHIGHCONTRAST
:
4043 ULONG lpszDefaultScheme
;
4047 if (info32
->cbSize
!= sizeof(*info32
)) return FALSE
;
4048 info
.cbSize
= sizeof(info
);
4049 if (!NtUserSystemParametersInfo( action
, val
, &info
, winini
)) return FALSE
;
4050 info32
->dwFlags
= info
.dwFlags
;
4051 info32
->lpszDefaultScheme
= PtrToUlong( info
.lpszDefaultScheme
);
4057 return NtUserSystemParametersInfo( action
, val
, ptr
, winini
);
4060 NTSTATUS WINAPI
wow64_NtUserSystemParametersInfoForDpi( UINT
*args
)
4062 UINT action
= get_ulong( &args
);
4063 UINT val
= get_ulong( &args
);
4064 void *ptr
= get_ptr( &args
);
4065 UINT winini
= get_ulong( &args
);
4066 UINT dpi
= get_ulong( &args
);
4068 return NtUserSystemParametersInfoForDpi( action
, val
, ptr
, winini
, dpi
);
4071 NTSTATUS WINAPI
wow64_NtUserThunkedMenuInfo( UINT
*args
)
4073 HMENU menu
= get_handle( &args
);
4074 MENUINFO32
*info32
= get_ptr( &args
);
4079 info
.cbSize
= sizeof(info
);
4080 info
.fMask
= info32
->fMask
;
4081 info
.dwStyle
= info32
->dwStyle
;
4082 info
.cyMax
= info32
->cyMax
;
4083 info
.hbrBack
= UlongToHandle( info32
->hbrBack
);
4084 info
.dwContextHelpID
= info32
->dwContextHelpID
;
4085 info
.dwMenuData
= info32
->dwMenuData
;
4088 return NtUserThunkedMenuInfo( menu
, info32
? &info
: NULL
);
4091 NTSTATUS WINAPI
wow64_NtUserThunkedMenuItemInfo( UINT
*args
)
4093 HMENU handle
= get_handle( &args
);
4094 UINT pos
= get_ulong( &args
);
4095 UINT flags
= get_ulong( &args
);
4096 UINT method
= get_ulong( &args
);
4097 MENUITEMINFOW32
*info32
= get_ptr( &args
);
4098 UNICODE_STRING32
*str32
= get_ptr( &args
);
4099 MENUITEMINFOW info
= { sizeof(info
) }, *info_ptr
;
4105 info
.cbSize
= sizeof(info
);
4106 info
.fMask
= info32
->fMask
;
4109 case NtUserSetMenuItemInfo
:
4110 case NtUserInsertMenuItem
:
4111 info
.fType
= info32
->fType
;
4112 info
.fState
= info32
->fState
;
4113 info
.wID
= info32
->wID
;
4114 info
.hSubMenu
= LongToHandle( info32
->hSubMenu
);
4115 info
.hbmpChecked
= UlongToHandle( info32
->hbmpChecked
);
4116 info
.hbmpUnchecked
= UlongToHandle( info32
->hbmpUnchecked
);
4117 info
.dwItemData
= info32
->dwItemData
;
4118 info
.dwTypeData
= UlongToPtr( info32
->dwTypeData
);
4119 info
.cch
= info32
->cch
;
4120 info
.hbmpItem
= UlongToHandle( info32
->hbmpItem
);
4122 case NtUserCheckMenuRadioItem
:
4123 info
.cch
= info32
->cch
;
4125 case NtUserGetMenuItemInfoA
:
4126 case NtUserGetMenuItemInfoW
:
4127 info
.dwTypeData
= UlongToPtr( info32
->dwTypeData
);
4128 info
.cch
= info32
->cch
;
4133 else info_ptr
= NULL
;
4135 ret
= NtUserThunkedMenuItemInfo( handle
, pos
, flags
, method
, info_ptr
,
4136 unicode_str_32to64( &str
, str32
));
4142 case NtUserGetMenuItemInfoA
:
4143 case NtUserGetMenuItemInfoW
:
4144 if (info
.fMask
& (MIIM_TYPE
| MIIM_STRING
| MIIM_FTYPE
))
4145 info32
->fType
= info
.fType
;
4146 if (info
.fMask
& (MIIM_TYPE
| MIIM_BITMAP
))
4147 info32
->hbmpItem
= HandleToUlong( info
.hbmpItem
);
4148 if (info
.fMask
& (MIIM_TYPE
| MIIM_STRING
))
4150 info32
->dwTypeData
= (UINT_PTR
)info
.dwTypeData
;
4151 info32
->cch
= info
.cch
;
4153 if (info
.fMask
& MIIM_STATE
) info32
->fState
= info
.fState
;
4154 if (info
.fMask
& MIIM_ID
) info32
->wID
= info
.wID
;
4155 info32
->hSubMenu
= HandleToUlong( info
.hSubMenu
);
4156 if (info
.fMask
& MIIM_CHECKMARKS
)
4158 info32
->hbmpChecked
= HandleToUlong( info
.hbmpChecked
);
4159 info32
->hbmpUnchecked
= HandleToUlong( info
.hbmpUnchecked
);
4161 if (info
.fMask
& MIIM_DATA
) info32
->dwItemData
= info
.dwItemData
;
4169 NTSTATUS WINAPI
wow64_NtUserToUnicodeEx( UINT
*args
)
4171 UINT virt
= get_ulong( &args
);
4172 UINT scan
= get_ulong( &args
);
4173 const BYTE
*state
= get_ptr( &args
);
4174 WCHAR
*str
= get_ptr( &args
);
4175 int size
= get_ulong( &args
);
4176 UINT flags
= get_ulong( &args
);
4177 HKL layout
= get_handle( &args
);
4179 return NtUserToUnicodeEx( virt
, scan
, state
, str
, size
, flags
, layout
);
4182 NTSTATUS WINAPI
wow64_NtUserTrackMouseEvent( UINT
*args
)
4190 } *info32
= get_ptr( &args
);
4191 TRACKMOUSEEVENT info
;
4194 if (info32
->cbSize
!= sizeof(*info32
))
4196 set_last_error32( ERROR_INVALID_PARAMETER
);
4200 info
.cbSize
= sizeof(info
);
4201 info
.dwFlags
= info32
->dwFlags
;
4202 info
.hwndTrack
= LongToHandle( info32
->hwndTrack
);
4203 info
.dwHoverTime
= info32
->dwHoverTime
;
4204 ret
= NtUserTrackMouseEvent( &info
);
4205 info32
->dwFlags
= info
.dwFlags
;
4206 info32
->hwndTrack
= HandleToUlong( info
.hwndTrack
);
4207 info32
->dwHoverTime
= info
.dwHoverTime
;
4211 NTSTATUS WINAPI
wow64_NtUserTrackPopupMenuEx( UINT
*args
)
4213 HMENU handle
= get_handle( &args
);
4214 UINT flags
= get_ulong( &args
);
4215 int x
= get_ulong( &args
);
4216 int y
= get_ulong( &args
);
4217 HWND hwnd
= get_handle( &args
);
4218 TPMPARAMS
*params
= get_ptr( &args
);
4220 return NtUserTrackPopupMenuEx( handle
, flags
, x
, y
, hwnd
, params
);
4223 NTSTATUS WINAPI
wow64_NtUserTranslateAccelerator( UINT
*args
)
4225 HWND hwnd
= get_handle( &args
);
4226 HACCEL accel
= get_handle( &args
);
4227 MSG32
*msg32
= get_ptr( &args
);
4231 return NtUserTranslateAccelerator( hwnd
, accel
, msg_32to64( &msg
, msg32
));
4234 NTSTATUS WINAPI
wow64_NtUserTranslateMessage( UINT
*args
)
4236 const MSG32
*msg32
= get_ptr( &args
);
4237 UINT flags
= get_ulong( &args
);
4240 return NtUserTranslateMessage( msg_32to64( &msg
, msg32
), flags
);
4243 NTSTATUS WINAPI
wow64_NtUserUnhookWinEvent( UINT
*args
)
4245 HWINEVENTHOOK handle
= get_handle( &args
);
4247 return NtUserUnhookWinEvent( handle
);
4250 NTSTATUS WINAPI
wow64_NtUserUnhookWindowsHookEx( UINT
*args
)
4252 HHOOK handle
= get_handle( &args
);
4254 return NtUserUnhookWindowsHookEx( handle
);
4257 NTSTATUS WINAPI
wow64_NtUserUnregisterClass( UINT
*args
)
4259 UNICODE_STRING32
*name32
= get_ptr( &args
);
4260 HINSTANCE instance
= get_ptr( &args
);
4261 struct client_menu_name32
*menu_name32
= get_ptr( &args
);
4263 UNICODE_STRING name
;
4264 struct client_menu_name menu_name
;
4267 ret
= NtUserUnregisterClass( unicode_str_32to64( &name
, name32
), instance
, &menu_name
);
4268 if (ret
) client_menu_name_64to32( &menu_name
, menu_name32
);
4272 NTSTATUS WINAPI
wow64_NtUserUnregisterHotKey( UINT
*args
)
4274 HWND hwnd
= get_handle( &args
);
4275 int id
= get_ulong( &args
);
4277 return NtUserUnregisterHotKey( hwnd
, id
);
4280 NTSTATUS WINAPI
wow64_NtUserUpdateInputContext( UINT
*args
)
4282 HIMC handle
= get_handle( &args
);
4283 UINT attr
= get_ulong( &args
);
4284 UINT_PTR value
= get_ulong( &args
);
4286 return NtUserUpdateInputContext( handle
, attr
, value
);
4289 NTSTATUS WINAPI
wow64_NtUserUpdateLayeredWindow( UINT
*args
)
4291 HWND hwnd
= get_handle( &args
);
4292 HDC hdc_dst
= get_handle( &args
);
4293 const POINT
*pts_dst
= get_ptr( &args
);
4294 const SIZE
*size
= get_ptr( &args
);
4295 HDC hdc_src
= get_handle( &args
);
4296 const POINT
*pts_src
= get_ptr( &args
);
4297 COLORREF key
= get_ulong( &args
);
4298 const BLENDFUNCTION
*blend
= get_ptr( &args
);
4299 DWORD flags
= get_ulong( &args
);
4300 const RECT
*dirty
= get_ptr( &args
);
4302 return NtUserUpdateLayeredWindow( hwnd
, hdc_dst
, pts_dst
, size
, hdc_src
, pts_src
,
4303 key
, blend
, flags
, dirty
);
4306 NTSTATUS WINAPI
wow64_NtUserValidateRect( UINT
*args
)
4308 HWND hwnd
= get_handle( &args
);
4309 const RECT
*rect
= get_ptr( &args
);
4311 return NtUserValidateRect( hwnd
, rect
);
4314 NTSTATUS WINAPI
wow64_NtUserVkKeyScanEx( UINT
*args
)
4316 WCHAR chr
= get_ulong( &args
);
4317 HKL layout
= get_handle( &args
);
4319 return NtUserVkKeyScanEx( chr
, layout
);
4322 NTSTATUS WINAPI
wow64_NtUserWaitForInputIdle( UINT
*args
)
4324 HANDLE process
= get_handle( &args
);
4325 DWORD timeout
= get_ulong( &args
);
4326 BOOL wow
= get_ulong( &args
);
4328 return NtUserWaitForInputIdle( process
, timeout
, wow
);
4331 NTSTATUS WINAPI
wow64_NtUserWaitMessage( UINT
*args
)
4333 return NtUserWaitMessage();
4336 NTSTATUS WINAPI
wow64_NtUserWindowFromDC( UINT
*args
)
4338 HDC hdc
= get_handle( &args
);
4340 return HandleToUlong( NtUserWindowFromDC( hdc
));
4343 NTSTATUS WINAPI
wow64_NtUserWindowFromPoint( UINT
*args
)
4345 LONG x
= get_ulong( &args
);
4346 LONG y
= get_ulong( &args
);
4348 return HandleToUlong( NtUserWindowFromPoint( x
, y
));
4351 NTSTATUS WINAPI
wow64_NtUserDisplayConfigGetDeviceInfo( UINT
*args
)
4353 DISPLAYCONFIG_DEVICE_INFO_HEADER
*packet
= get_ptr( &args
);
4355 return NtUserDisplayConfigGetDeviceInfo( packet
);
4358 NTSTATUS WINAPI
wow64___wine_send_input( UINT
*args
)
4360 ERR( "not supported\n" );