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
29 #include "wow64win_private.h"
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(wow
);
41 DWORD dwContextHelpID
;
91 } RAWINPUTDEVICELIST32
;
138 BYTE rgbReserved
[32];
143 ULONG lpCreateParams
;
189 ULONG hwndInsertAfter
;
201 } NCCALCSIZE_PARAMS32
;
213 } COMPAREITEMSTRUCT32
;
240 } MEASUREITEMSTRUCT32
;
281 } MOUSEHOOKSTRUCTEX32
;
314 } CBTACTIVATESTRUCT32
;
323 } DELETEITEMSTRUCT32
;
341 struct client_menu_name32
348 struct win_proc_params32
357 enum wm_char_mapping mapping
;
363 struct win_hook_params32
378 struct win_event_hook_params32
388 WCHAR module
[MAX_PATH
];
391 struct draw_text_params32
400 struct unpack_dde_message_params32
409 static MSG
*msg_32to64( MSG
*msg
, const MSG32
*msg32
)
411 if (!msg32
) return NULL
;
413 msg
->hwnd
= LongToHandle( msg32
->hwnd
);
414 msg
->message
= msg32
->message
;
415 msg
->wParam
= msg32
->wParam
;
416 msg
->lParam
= msg32
->lParam
;
417 msg
->time
= msg32
->time
;
422 static MSG32
*msg_64to32( const MSG
*msg64
, MSG32
*msg32
)
426 if (!msg32
) return NULL
;
428 msg
.hwnd
= HandleToLong( msg64
->hwnd
);
429 msg
.message
= msg64
->message
;
430 msg
.wParam
= msg64
->wParam
;
431 msg
.lParam
= msg64
->lParam
;
432 msg
.time
= msg64
->time
;
434 memcpy( msg32
, &msg
, sizeof(msg
) );
438 static struct client_menu_name
*client_menu_name_32to64( struct client_menu_name
*name
,
439 const struct client_menu_name32
*name32
)
441 if (!name32
) return NULL
;
442 name
->nameA
= UlongToPtr( name32
->nameA
);
443 name
->nameW
= UlongToPtr( name32
->nameW
);
444 name
->nameUS
= UlongToPtr( name32
->nameUS
);
448 static struct client_menu_name32
*client_menu_name_64to32( const struct client_menu_name
*name64
,
449 struct client_menu_name32
*name32
)
453 struct client_menu_name32 name
;
454 name
.nameA
= PtrToUlong( name64
->nameA
);
455 name
.nameW
= PtrToUlong( name64
->nameW
);
456 name
.nameUS
= PtrToUlong( name64
->nameUS
);
457 memcpy( name32
, &name
, sizeof(name
) );
462 static void win_proc_params_64to32( const struct win_proc_params
*src
, struct win_proc_params32
*dst
)
464 struct win_proc_params32 params
;
466 params
.func
= PtrToUlong( src
->func
);
467 params
.hwnd
= HandleToUlong( src
->hwnd
);
468 params
.msg
= src
->msg
;
469 params
.wparam
= src
->wparam
;
470 params
.lparam
= src
->lparam
;
471 params
.ansi
= src
->ansi
;
472 params
.ansi_dst
= src
->ansi_dst
;
473 params
.mapping
= src
->mapping
;
474 params
.dpi_context
= src
->dpi_context
;
475 params
.procA
= PtrToUlong( src
->procA
);
476 params
.procW
= PtrToUlong( src
->procW
);
477 memcpy( dst
, ¶ms
, sizeof(params
) );
480 static void createstruct_32to64( const CREATESTRUCT32
*from
, CREATESTRUCTW
*to
)
483 to
->lpCreateParams
= UlongToPtr( from
->lpCreateParams
);
484 to
->hInstance
= UlongToPtr( from
->hInstance
);
485 to
->hMenu
= LongToHandle( from
->hMenu
);
486 to
->hwndParent
= LongToHandle( from
->hwndParent
);
491 to
->style
= from
->style
;
492 to
->dwExStyle
= from
->dwExStyle
;
493 to
->lpszName
= UlongToPtr( from
->lpszName
);
494 to
->lpszClass
= UlongToPtr( from
->lpszClass
);
497 static void createstruct_64to32( const CREATESTRUCTW
*from
, CREATESTRUCT32
*to
)
501 cs
.lpCreateParams
= PtrToUlong( from
->lpCreateParams
);
502 cs
.hInstance
= PtrToUlong( from
->hInstance
);
503 cs
.hMenu
= HandleToUlong( from
->hMenu
);
504 cs
.hwndParent
= HandleToUlong( from
->hwndParent
);
509 cs
.style
= from
->style
;
510 cs
.lpszName
= PtrToUlong( from
->lpszName
);
511 cs
.lpszClass
= PtrToUlong( from
->lpszClass
);
512 cs
.dwExStyle
= from
->dwExStyle
;
513 memcpy( to
, &cs
, sizeof(cs
) );
516 static void winpos_32to64( WINDOWPOS
*dst
, const WINDOWPOS32
*src
)
518 dst
->hwnd
= LongToHandle( src
->hwnd
);
519 dst
->hwndInsertAfter
= LongToHandle( src
->hwndInsertAfter
);
524 dst
->flags
= src
->flags
;
527 static void winpos_64to32( const WINDOWPOS
*src
, WINDOWPOS32
*dst
)
531 wp
.hwnd
= HandleToUlong( src
->hwnd
);
532 wp
.hwndInsertAfter
= HandleToUlong( src
->hwndInsertAfter
);
537 wp
.flags
= src
->flags
;
538 memcpy( dst
, &wp
, sizeof(wp
) );
541 static PAINTSTRUCT
*paintstruct_32to64( PAINTSTRUCT
*ps
, const PAINTSTRUCT32
*ps32
)
543 if (!ps32
) return NULL
;
544 ps
->hdc
= ULongToHandle( ps32
->hdc
);
545 ps
->fErase
= ps32
->fErase
;
546 ps
->rcPaint
= ps32
->rcPaint
;
547 ps
->fRestore
= ps32
->fRestore
;
548 ps
->fIncUpdate
= ps32
->fIncUpdate
;
552 static MOUSEHOOKSTRUCTEX32
*mousehookstruct_64to32( const MOUSEHOOKSTRUCTEX
*hook64
,
553 MOUSEHOOKSTRUCTEX32
*hook32
)
555 MOUSEHOOKSTRUCTEX32 hook
;
557 if (!hook64
) return NULL
;
559 hook
.pt
= hook64
->pt
;
560 hook
.hwnd
= HandleToUlong( hook64
->hwnd
);
561 hook
.wHitTestCode
= hook64
->wHitTestCode
;
562 hook
.dwExtraInfo
= hook64
->dwExtraInfo
;
563 hook
.mouseData
= hook64
->mouseData
;
564 memcpy( hook32
, &hook
, sizeof(hook
) );
568 static NTSTATUS
dispatch_callback( ULONG id
, void *args
, ULONG len
)
572 NTSTATUS status
= Wow64KiUserCallbackDispatcher( id
, args
, len
, &ret_ptr
, &ret_len
);
573 return NtCallbackReturn( ret_ptr
, ret_len
, status
);
576 static NTSTATUS WINAPI
wow64_NtUserCallEnumDisplayMonitor( void *arg
, ULONG size
)
578 struct enum_display_monitor_params
*params
= arg
;
588 params32
.proc
= PtrToUlong( params
->proc
);
589 params32
.monitor
= HandleToUlong( params
->monitor
);
590 params32
.hdc
= HandleToUlong( params
->hdc
);
591 params32
.rect
= params
->rect
;
592 params32
.lparam
= params
->lparam
;
593 return dispatch_callback( NtUserCallEnumDisplayMonitor
, ¶ms32
, sizeof(params32
) );
596 static NTSTATUS WINAPI
wow64_NtUserCallSendAsyncCallback( void *arg
, ULONG size
)
598 struct send_async_params
*params
= arg
;
608 params32
.callback
= PtrToUlong( params
->callback
);
609 params32
.hwnd
= HandleToUlong( params
->hwnd
);
610 params32
.msg
= params
->msg
;
611 params32
.data
= params
->data
;
612 params32
.result
= params
->result
;
613 return dispatch_callback( NtUserCallSendAsyncCallback
, ¶ms32
, sizeof(params32
) );
616 static NTSTATUS WINAPI
wow64_NtUserCallWinEventHook( void *arg
, ULONG size
)
618 struct win_event_hook_params
*params
= arg
;
619 struct win_event_hook_params32 params32
;
621 params32
.event
= params
->event
;
622 params32
.hwnd
= HandleToUlong( params
->hwnd
);
623 params32
.object_id
= params
->object_id
;
624 params32
.child_id
= params
->child_id
;
625 params32
.handle
= HandleToUlong( params
->handle
);
626 params32
.tid
= params
->tid
;
627 params32
.time
= params
->time
;
628 params32
.proc
= PtrToUlong( params
->proc
);
630 size
-= FIELD_OFFSET( struct win_event_hook_params
, module
);
631 if (size
) memcpy( params32
.module
, params
->module
, size
);
632 return dispatch_callback( NtUserCallWinEventHook
, ¶ms32
,
633 FIELD_OFFSET( struct win_event_hook_params32
, module
) + size
);
636 static size_t packed_message_64to32( UINT message
, WPARAM wparam
,
637 const void *params64
, void *params32
, size_t size
)
646 CREATESTRUCT32
*cs32
= params32
;
647 const CREATESTRUCTW
*cs64
= params64
;
649 createstruct_64to32( cs64
, cs32
);
650 size
-= sizeof(*cs64
);
651 if (size
) memmove( cs32
+ 1, cs64
+ 1, size
);
652 return sizeof(*cs32
) + size
;
658 NCCALCSIZE_PARAMS32 ncp32
;
659 const NCCALCSIZE_PARAMS
*ncp64
= params64
;
661 ncp32
.rgrc
[0] = ncp64
->rgrc
[0];
662 ncp32
.rgrc
[1] = ncp64
->rgrc
[1];
663 ncp32
.rgrc
[2] = ncp64
->rgrc
[2];
664 winpos_64to32( (const WINDOWPOS
*)(ncp64
+ 1),
665 (WINDOWPOS32
*)((const char *)params32
+ sizeof(ncp32
)) );
666 memcpy( params32
, &ncp32
, sizeof(ncp32
) );
667 return sizeof(ncp32
) + sizeof(WINDOWPOS32
);
673 DRAWITEMSTRUCT32 dis32
;
674 const DRAWITEMSTRUCT
*dis64
= params64
;
676 dis32
.CtlType
= dis64
->CtlType
;
677 dis32
.CtlID
= dis64
->CtlID
;
678 dis32
.itemID
= dis64
->itemID
;
679 dis32
.itemAction
= dis64
->itemAction
;
680 dis32
.itemState
= dis64
->itemState
;
681 dis32
.hwndItem
= HandleToLong( dis64
->hwndItem
);
682 dis32
.hDC
= HandleToUlong( dis64
->hDC
);
683 dis32
.itemData
= dis64
->itemData
;
684 dis32
.rcItem
.left
= dis64
->rcItem
.left
;
685 dis32
.rcItem
.top
= dis64
->rcItem
.top
;
686 dis32
.rcItem
.right
= dis64
->rcItem
.right
;
687 dis32
.rcItem
.bottom
= dis64
->rcItem
.bottom
;
688 memcpy( params32
, &dis32
, sizeof(dis32
) );
689 return sizeof(dis32
);
694 MEASUREITEMSTRUCT32 mis32
;
695 const MEASUREITEMSTRUCT
*mis64
= params64
;
697 mis32
.CtlType
= mis64
->CtlType
;
698 mis32
.CtlID
= mis64
->CtlID
;
699 mis32
.itemID
= mis64
->itemID
;
700 mis32
.itemWidth
= mis64
->itemWidth
;
701 mis32
.itemHeight
= mis64
->itemHeight
;
702 mis32
.itemData
= mis64
->itemData
;
703 memcpy( params32
, &mis32
, sizeof(mis32
) );
704 return sizeof(mis32
);
709 DELETEITEMSTRUCT32 dis32
;
710 const DELETEITEMSTRUCT
*dis64
= params64
;
712 dis32
.CtlType
= dis64
->CtlType
;
713 dis32
.CtlID
= dis64
->CtlID
;
714 dis32
.itemID
= dis64
->itemID
;
715 dis32
.hwndItem
= HandleToLong( dis64
->hwndItem
);
716 dis32
.itemData
= dis64
->itemData
;
717 memcpy( params32
, &dis32
, sizeof(dis32
) );
718 return sizeof(dis32
);
723 COMPAREITEMSTRUCT32 cis32
;
724 const COMPAREITEMSTRUCT
*cis64
= params64
;
726 cis32
.CtlType
= cis64
->CtlType
;
727 cis32
.CtlID
= cis64
->CtlID
;
728 cis32
.hwndItem
= HandleToLong( cis64
->hwndItem
);
729 cis32
.itemID1
= cis64
->itemID1
;
730 cis32
.itemData1
= cis64
->itemData1
;
731 cis32
.itemID2
= cis64
->itemID2
;
732 cis32
.itemData2
= cis64
->itemData2
;
733 cis32
.dwLocaleId
= cis64
->dwLocaleId
;
734 memcpy( params32
, &cis32
, sizeof(cis32
) );
735 return sizeof(cis32
);
738 case WM_WINDOWPOSCHANGING
:
739 case WM_WINDOWPOSCHANGED
:
740 winpos_64to32( params64
, params32
);
741 return sizeof(WINDOWPOS32
);
745 COPYDATASTRUCT32 cds32
;
746 const COPYDATASTRUCT
*cds64
= params64
;
748 cds32
.dwData
= cds64
->dwData
;
749 cds32
.cbData
= cds64
->cbData
;
750 cds32
.lpData
= PtrToUlong( cds64
->lpData
);
751 memcpy( params32
, &cds32
, sizeof(cds32
) );
752 size
-= sizeof(cds32
);
753 if (size
) memmove( (char *)params32
+ sizeof(cds32
), cds64
+ 1, size
);
754 return sizeof(cds32
) + size
;
759 const HELPINFO
*hi64
= params64
;
761 hi32
.cbSize
= sizeof(hi32
);
762 hi32
.iContextType
= hi64
->iContextType
;
763 hi32
.iCtrlId
= hi64
->iCtrlId
;
764 hi32
.hItemHandle
= HandleToLong( hi64
->hItemHandle
);
765 hi32
.dwContextId
= hi64
->dwContextId
;
766 hi32
.MousePos
= hi64
->MousePos
;
767 memcpy( params32
, &hi32
, sizeof(hi32
) );
772 msg_64to32( params64
, params32
);
773 return sizeof(MSG32
);
777 MDINEXTMENU32
*next32
= params32
;
778 const MDINEXTMENU
*next64
= params64
;
780 next32
->hmenuIn
= HandleToLong( next64
->hmenuIn
);
781 next32
->hmenuNext
= HandleToLong( next64
->hmenuNext
);
782 next32
->hwndNext
= HandleToLong( next64
->hwndNext
);
783 return sizeof(*next32
);
788 MDICREATESTRUCT32 mcs32
;
789 const MDICREATESTRUCTW
*mcs64
= params64
;
791 mcs32
.szClass
= PtrToUlong( mcs64
->szClass
);
792 mcs32
.szTitle
= PtrToUlong( mcs64
->szTitle
);
793 mcs32
.hOwner
= HandleToLong( mcs64
->hOwner
);
796 mcs32
.cx
= mcs64
->cx
;
797 mcs32
.cy
= mcs64
->cy
;
798 mcs32
.style
= mcs64
->style
;
799 mcs32
.lParam
= mcs64
->lParam
;
800 size
-= sizeof(*mcs64
);
801 if (size
) memmove( (char *)params32
+ sizeof(mcs32
), mcs64
+ 1, size
);
802 memcpy( params32
, &mcs32
, sizeof(mcs32
) );
803 return sizeof(mcs32
) + size
;
806 case CB_GETCOMBOBOXINFO
:
809 const COMBOBOXINFO
*ci64
= params64
;
811 ci32
.cbSize
= sizeof(ci32
);
812 ci32
.rcItem
= ci64
->rcItem
;
813 ci32
.rcButton
= ci64
->rcButton
;
814 ci32
.stateButton
= ci64
->stateButton
;
815 ci32
.hwndCombo
= HandleToLong( ci64
->hwndCombo
);
816 ci32
.hwndItem
= HandleToLong( ci64
->hwndItem
);
817 ci32
.hwndList
= HandleToLong( ci64
->hwndList
);
818 memcpy( params32
, &ci32
, sizeof(ci32
) );
823 memmove( params32
, params64
, size
);
827 static size_t packed_result_32to64( UINT message
, WPARAM wparam
, const void *params32
,
828 size_t size
, void *params64
)
836 if (size
>= sizeof(CREATESTRUCT32
))
838 const CREATESTRUCT32
*cs32
= params32
;
839 CREATESTRUCTW
*cs64
= params64
;
841 cs64
->lpCreateParams
= UlongToPtr( cs32
->lpCreateParams
);
842 cs64
->hInstance
= UlongToPtr( cs32
->hInstance
);
843 cs64
->hMenu
= LongToHandle( cs32
->hMenu
);
844 cs64
->hwndParent
= LongToHandle( cs32
->hwndParent
);
849 cs64
->style
= cs32
->style
;
850 cs64
->dwExStyle
= cs32
->dwExStyle
;
851 return sizeof(*cs64
);
858 const NCCALCSIZE_PARAMS32
*ncp32
= params32
;
859 NCCALCSIZE_PARAMS
*ncp64
= params64
;
861 ncp64
->rgrc
[0] = ncp32
->rgrc
[0];
862 ncp64
->rgrc
[1] = ncp32
->rgrc
[1];
863 ncp64
->rgrc
[2] = ncp32
->rgrc
[2];
864 winpos_32to64( (WINDOWPOS
*)(ncp64
+ 1), (const WINDOWPOS32
*)(ncp32
+ 1) );
865 return sizeof(*ncp64
) + sizeof(WINDOWPOS
);
871 const MEASUREITEMSTRUCT32
*mis32
= params32
;
872 MEASUREITEMSTRUCT
*mis64
= params64
;
874 mis64
->CtlType
= mis32
->CtlType
;
875 mis64
->CtlID
= mis32
->CtlID
;
876 mis64
->itemID
= mis32
->itemID
;
877 mis64
->itemWidth
= mis32
->itemWidth
;
878 mis64
->itemHeight
= mis32
->itemHeight
;
879 mis64
->itemData
= mis32
->itemData
;
880 return sizeof(*mis64
);
883 case WM_WINDOWPOSCHANGING
:
884 case WM_WINDOWPOSCHANGED
:
885 winpos_32to64( params64
, params32
);
886 return sizeof(WINDOWPOS
);
890 const MDINEXTMENU32
*next32
= params32
;
891 MDINEXTMENU
*next64
= params64
;
893 next64
->hmenuIn
= LongToHandle( next32
->hmenuIn
);
894 next64
->hmenuNext
= LongToHandle( next32
->hmenuNext
);
895 next64
->hwndNext
= LongToHandle( next32
->hwndNext
);
896 return sizeof(*next64
);
899 case CB_GETCOMBOBOXINFO
:
901 const COMBOBOXINFO32
*ci32
= params32
;
902 COMBOBOXINFO
*ci64
= params64
;
904 ci64
->cbSize
= sizeof(*ci32
);
905 ci64
->rcItem
= ci32
->rcItem
;
906 ci64
->rcButton
= ci32
->rcButton
;
907 ci64
->stateButton
= ci32
->stateButton
;
908 ci64
->hwndCombo
= LongToHandle( ci32
->hwndCombo
);
909 ci64
->hwndItem
= LongToHandle( ci32
->hwndItem
);
910 ci64
->hwndList
= LongToHandle( ci32
->hwndList
);
911 return sizeof(*ci64
);
915 case WM_ASKCBFORMATNAME
:
916 case WM_GETMINMAXINFO
:
917 case WM_STYLECHANGING
:
918 case SBM_SETSCROLLINFO
:
919 case SBM_GETSCROLLINFO
:
920 case SBM_GETSCROLLBARINFO
:
928 case CB_GETDROPPEDCONTROLRECT
:
935 case WM_MDIGETACTIVE
:
942 if (size
) memcpy( params64
, params32
, size
);
946 static NTSTATUS WINAPI
wow64_NtUserCallWinProc( void *arg
, ULONG size
)
948 struct win_proc_params
*params
= arg
;
949 struct win_proc_params32
*params32
= arg
;
950 size_t lparam_size
= 0, offset32
= sizeof(*params32
);
956 win_proc_params_64to32( params
, params32
);
957 if (size
> sizeof(*params
))
959 const size_t offset64
= (sizeof(*params
) + 15) & ~15;
960 offset32
= (offset32
+ 15) & ~15;
961 lparam_size
= packed_message_64to32( params32
->msg
, params32
->wparam
,
962 (char *)params
+ offset64
,
963 (char *)params32
+ offset32
,
967 status
= Wow64KiUserCallbackDispatcher( NtUserCallWinProc
, params32
,
968 offset32
+ lparam_size
,
969 &ret_ptr
, &ret_len
);
971 if (ret_len
>= sizeof(LONG
))
973 LRESULT
*result_ptr
= arg
;
974 result
= *(LONG
*)ret_ptr
;
975 ret_len
= packed_result_32to64( params32
->msg
, params32
->wparam
, (LONG
*)ret_ptr
+ 1,
976 ret_len
- sizeof(LONG
), result_ptr
+ 1 );
977 *result_ptr
= result
;
978 return NtCallbackReturn( result_ptr
, sizeof(*result_ptr
) + ret_len
, status
);
981 return NtCallbackReturn( &result
, sizeof(result
), status
);
984 static UINT
hook_lparam_64to32( int id
, int code
, const void *lp
, size_t size
, void *lp32
)
990 case WH_SYSMSGFILTER
:
993 msg_64to32( lp
, lp32
);
994 return sizeof(MSG32
);
1000 return packed_message_64to32( WM_CREATE
, 0, lp
, lp32
, size
);
1004 const CBTACTIVATESTRUCT
*cbt
= lp
;
1005 CBTACTIVATESTRUCT32 cbt32
;
1006 cbt32
.fMouse
= cbt
->fMouse
;
1007 cbt32
.hWndActive
= HandleToUlong( cbt
->hWndActive
);
1008 memcpy( lp32
, &cbt32
, sizeof(cbt32
) );
1009 return sizeof(cbt32
);
1012 case HCBT_CLICKSKIPPED
:
1013 mousehookstruct_64to32( lp
, lp32
);
1014 return sizeof(MOUSEHOOKSTRUCTEX32
);
1018 case WH_CALLWNDPROC
:
1020 const CWPSTRUCT
*cwp
= lp
;
1022 cwp32
.lParam
= cwp
->lParam
;
1023 cwp32
.wParam
= cwp
->wParam
;
1024 cwp32
.message
= cwp
->message
;
1025 cwp32
.hwnd
= HandleToUlong( cwp
->hwnd
);
1026 memcpy( lp32
, &cwp32
, sizeof(cwp32
) );
1027 if (size
> sizeof(*cwp
))
1029 const size_t offset64
= (sizeof(*cwp
) + 15) & ~15;
1030 const size_t offset32
= (sizeof(cwp32
) + 15) & ~15;
1031 size
= packed_message_64to32( cwp32
.message
, cwp32
.wParam
,
1032 (const char *)lp
+ offset64
,
1033 (char *)lp32
+ offset32
, size
- offset64
);
1034 return offset32
+ size
;
1036 return sizeof(cwp32
);
1039 case WH_CALLWNDPROCRET
:
1041 const CWPRETSTRUCT
*cwpret
= lp
;
1042 CWPRETSTRUCT32 cwpret32
;
1043 cwpret32
.lResult
= cwpret
->lResult
;
1044 cwpret32
.lParam
= cwpret
->lParam
;
1045 cwpret32
.wParam
= cwpret
->wParam
;
1046 cwpret32
.message
= cwpret
->message
;
1047 cwpret32
.hwnd
= HandleToUlong( cwpret
->hwnd
);
1048 memcpy( lp32
, &cwpret32
, sizeof(cwpret32
) );
1049 if (size
> sizeof(*cwpret
))
1051 const size_t offset64
= (sizeof(*cwpret
) + 15) & ~15;
1052 const size_t offset32
= (sizeof(cwpret32
) + 15) & ~15;
1053 size
= packed_message_64to32( cwpret32
.message
, cwpret32
.wParam
,
1054 (const char *)lp
+ offset64
,
1055 (char *)lp32
+ offset32
, size
- offset64
);
1056 return offset32
+ size
;
1058 return sizeof(cwpret32
);
1062 mousehookstruct_64to32( lp
, lp32
);
1063 return sizeof(MOUSEHOOKSTRUCTEX32
);
1067 const MSLLHOOKSTRUCT
*hook
= lp
;
1068 MSLLHOOKSTRUCT32 hook32
;
1069 hook32
.pt
= hook
->pt
;
1070 hook32
.mouseData
= hook
->mouseData
;
1071 hook32
.flags
= hook
->flags
;
1072 hook32
.time
= hook
->time
;
1073 hook32
.dwExtraInfo
= hook
->dwExtraInfo
;
1074 memcpy( lp32
, &hook32
, sizeof(hook32
) );
1075 return sizeof(hook32
);
1078 case WH_KEYBOARD_LL
:
1080 const KBDLLHOOKSTRUCT
*hook
= lp
;
1081 KBDLLHOOKSTRUCT32 hook32
;
1082 hook32
.vkCode
= hook
->vkCode
;
1083 hook32
.scanCode
= hook
->scanCode
;
1084 hook32
.flags
= hook
->flags
;
1085 hook32
.time
= hook
->time
;
1086 hook32
.dwExtraInfo
= hook
->dwExtraInfo
;
1087 memcpy( lp32
, &hook32
, sizeof(hook32
) );
1088 return sizeof(hook32
);
1091 case WH_JOURNALRECORD
:
1093 const EVENTMSG
*event
= lp
;
1096 event32
.message
= event
->message
;
1097 event32
.paramL
= event
->paramL
;
1098 event32
.paramH
= event
->paramH
;
1099 event32
.time
= event
->time
;
1100 event32
.hwnd
= HandleToUlong( event
->hwnd
);
1101 memcpy( lp32
, &event32
, sizeof(event32
) );
1102 return sizeof(event32
);
1106 memmove( lp32
, lp
, size
);
1110 static NTSTATUS WINAPI
wow64_NtUserCallWindowsHook( void *arg
, ULONG size
)
1112 struct win_hook_params
*params
= arg
;
1113 struct win_hook_params32 params32
;
1114 UINT module_len
, size32
, offset
;
1116 LRESULT
*result_ptr
= arg
;
1117 ULONG ret_len
, ret_size
= 0;
1120 module_len
= wcslen( params
->module
);
1121 size32
= FIELD_OFFSET( struct win_hook_params32
, module
[module_len
+ 1] );
1122 offset
= FIELD_OFFSET( struct win_hook_params
, module
[module_len
+ 1] );
1124 params32
.proc
= PtrToUlong( params
->proc
);
1125 params32
.handle
= HandleToUlong( params
->handle
);
1126 params32
.pid
= params
->pid
;
1127 params32
.tid
= params
->tid
;
1128 params32
.id
= params
->id
;
1129 params32
.code
= params
->code
;
1130 params32
.wparam
= params
->wparam
;
1131 params32
.lparam
= params
->lparam
;
1132 params32
.prev_unicode
= params
->prev_unicode
;
1133 params32
.next_unicode
= params
->next_unicode
;
1134 memcpy( arg
, ¶ms32
, FIELD_OFFSET( struct win_hook_params32
, module
));
1135 memmove( ((struct win_hook_params32
*)arg
)->module
, params
->module
,
1136 (module_len
+ 1) * sizeof(WCHAR
) );
1140 size32
= (size32
+ 15) & ~15;
1141 offset
= (offset
+ 15) & ~15;
1142 size32
+= hook_lparam_64to32( params32
.id
, params32
.code
, (char *)params
+ offset
,
1143 size
- offset
, (char *)arg
+ size32
);
1146 status
= Wow64KiUserCallbackDispatcher( NtUserCallWindowsHook
, arg
, size32
, &ret_ptr
, &ret_len
);
1147 if (status
|| ret_len
< sizeof(LONG
)) return status
;
1149 switch (params32
.id
)
1151 case WH_SYSMSGFILTER
:
1154 if (ret_len
== sizeof(MSG32
) + sizeof(LONG
))
1156 msg_32to64( (MSG
*)(result_ptr
+ 1), (MSG32
*)((LONG
*)ret_ptr
+ 1) );
1157 ret_size
= sizeof(MSG
);
1161 *result_ptr
= *(LONG
*)ret_ptr
;
1162 return NtCallbackReturn( result_ptr
, sizeof(*result_ptr
) + ret_size
, status
);
1165 static NTSTATUS WINAPI
wow64_NtUserCopyImage( void *arg
, ULONG size
)
1167 struct copy_image_params
*params
= arg
;
1180 params32
.hwnd
= HandleToUlong( params
->hwnd
);
1181 params32
.type
= params
->type
;
1182 params32
.dx
= params
->dx
;
1183 params32
.dy
= params
->dy
;
1184 params32
.flags
= params
->flags
;
1185 status
= Wow64KiUserCallbackDispatcher( NtUserCopyImage
, ¶ms32
, sizeof(params32
),
1186 &ret_ptr
, &ret_len
);
1187 if (!status
&& ret_len
== sizeof(ULONG
))
1189 HANDLE handle
= ULongToHandle( *(ULONG
*)ret_ptr
);
1190 return NtCallbackReturn( &handle
, sizeof(handle
), status
);
1195 static NTSTATUS WINAPI
wow64_NtUserDrawNonClientButton( void *arg
, ULONG size
)
1197 struct draw_non_client_button_params
*params
= arg
;
1202 enum NONCLIENT_BUTTON_TYPE type
;
1208 params32
.hwnd
= HandleToUlong( params
->hwnd
);
1209 params32
.hdc
= HandleToUlong( params
->hdc
);
1210 params32
.type
= params
->type
;
1211 params32
.rect
= params
->rect
;
1212 params32
.down
= params
->down
;
1213 params32
.grayed
= params
->grayed
;
1214 return dispatch_callback( NtUserDrawNonClientButton
, ¶ms32
, sizeof(params32
) );
1217 static NTSTATUS WINAPI
wow64_NtUserDrawScrollBar( void *arg
, ULONG size
)
1219 struct draw_scroll_bar_params
*params
= arg
;
1233 enum SCROLL_HITTEST hit_test
;
1245 params32
.hwnd
= HandleToUlong( params
->hwnd
);
1246 params32
.hdc
= HandleToUlong( params
->hdc
);
1247 params32
.bar
= params
->bar
;
1248 params32
.hit_test
= params
->hit_test
;
1249 params32
.tracking_info
.win
= HandleToUlong( params
->tracking_info
.win
);
1250 params32
.tracking_info
.bar
= params
->tracking_info
.bar
;
1251 params32
.tracking_info
.thumb_pos
= params
->tracking_info
.thumb_pos
;
1252 params32
.tracking_info
.thumb_val
= params
->tracking_info
.thumb_val
;
1253 params32
.tracking_info
.vertical
= params
->tracking_info
.vertical
;
1254 params32
.tracking_info
.hit_test
= params
->tracking_info
.hit_test
;
1255 params32
.arrows
= params
->arrows
;
1256 params32
.interior
= params
->interior
;
1257 params32
.rect
= params
->rect
;
1258 params32
.enable_flags
= params
->enable_flags
;
1259 params32
.arrow_size
= params
->arrow_size
;
1260 params32
.thumb_pos
= params
->thumb_pos
;
1261 params32
.thumb_size
= params
->thumb_size
;
1262 params32
.vertical
= params
->vertical
;
1263 return dispatch_callback( NtUserDrawScrollBar
, ¶ms32
, sizeof(params32
) );
1266 static NTSTATUS WINAPI
wow64_NtUserDrawText( void *arg
, ULONG size
)
1268 struct draw_text_params
*params
= arg
;
1269 struct draw_text_params32
*params32
;
1270 ULONG offset
= offsetof( struct draw_text_params
, str
) - offsetof( struct draw_text_params32
, str
);
1272 params32
= (struct draw_text_params32
*)((char *)params
+ offset
);
1273 params32
->flags
= params
->flags
;
1274 params32
->rect
= params
->rect
;
1275 params32
->count
= params
->count
;
1276 params32
->hdc
= HandleToUlong( params
->hdc
);
1277 return dispatch_callback( NtUserDrawText
, params32
, size
- offset
);
1280 static NTSTATUS WINAPI
wow64_NtUserFreeCachedClipboardData( void *arg
, ULONG size
)
1282 struct free_cached_data_params
*params
= arg
;
1289 params32
.format
= params
->format
;
1290 params32
.handle
= HandleToUlong( params
->handle
);
1291 return dispatch_callback( NtUserFreeCachedClipboardData
, ¶ms32
, sizeof(params32
) );
1294 static NTSTATUS WINAPI
wow64_NtUserImmProcessKey( void *arg
, ULONG size
)
1296 struct imm_process_key_params
*params
= arg
;
1305 params32
.hwnd
= HandleToUlong( params
->hwnd
);
1306 params32
.hkl
= HandleToUlong( params
->hkl
);
1307 params32
.vkey
= params
->vkey
;
1308 params32
.key_data
= params
->key_data
;
1309 return dispatch_callback( NtUserImmProcessKey
, ¶ms32
, sizeof(params32
) );
1312 static NTSTATUS WINAPI
wow64_NtUserImmTranslateMessage( void *arg
, ULONG size
)
1314 struct imm_translate_message_params
*params
= arg
;
1323 params32
.hwnd
= HandleToLong( params
->hwnd
);
1324 params32
.msg
= params
->msg
;
1325 params32
.wparam
= params
->wparam
;
1326 params32
.key_data
= params
->key_data
;
1327 return dispatch_callback( NtUserImmTranslateMessage
, ¶ms32
, sizeof(params32
) );
1330 static NTSTATUS WINAPI
wow64_NtUserInitBuiltinClasses( void *arg
, ULONG size
)
1332 return dispatch_callback( NtUserInitBuiltinClasses
, arg
, size
);
1335 static NTSTATUS WINAPI
wow64_NtUserLoadDriver( void *arg
, ULONG size
)
1337 return dispatch_callback( NtUserLoadDriver
, arg
, size
);
1340 static NTSTATUS WINAPI
wow64_NtUserLoadImage( void *arg
, ULONG size
)
1342 struct load_image_params
*params
= arg
;
1356 params32
.hinst
= PtrToUlong( params
->hinst
);
1357 params32
.name
= PtrToUlong( params
->name
);
1358 params32
.type
= params
->type
;
1359 params32
.dx
= params
->dx
;
1360 params32
.dy
= params
->dy
;
1361 params32
.flags
= params
->flags
;
1362 status
= Wow64KiUserCallbackDispatcher( NtUserLoadImage
, ¶ms32
, sizeof(params32
),
1363 &ret_ptr
, &ret_len
);
1364 if (!status
&& ret_len
== sizeof(ULONG
))
1366 HANDLE handle
= ULongToHandle( *(ULONG
*)ret_ptr
);
1367 return NtCallbackReturn( &handle
, sizeof(handle
), status
);
1372 static NTSTATUS WINAPI
wow64_NtUserLoadSysMenu( void *arg
, ULONG size
)
1378 status
= Wow64KiUserCallbackDispatcher( NtUserLoadSysMenu
, arg
, size
, &ret_ptr
, &ret_len
);
1379 if (!status
&& ret_len
== sizeof(ULONG
))
1381 HMENU menu
= ULongToHandle( *(ULONG
*)ret_ptr
);
1382 return NtCallbackReturn( &menu
, sizeof(menu
), status
);
1387 static NTSTATUS WINAPI
wow64_NtUserPostDDEMessage( void *arg
, ULONG size
)
1389 struct post_dde_message_params
*params
= arg
;
1400 params32
.hwnd
= HandleToUlong( params
->hwnd
);
1401 params32
.msg
= params
->msg
;
1402 params32
.wparam
= params
->wparam
;
1403 params32
.lparam
= params
->lparam
;
1404 params32
.dest_tid
= params
->dest_tid
;
1405 params32
.type
= params
->type
;
1406 return dispatch_callback( NtUserPostDDEMessage
, ¶ms32
, sizeof(params32
) );
1409 static NTSTATUS WINAPI
wow64_NtUserRenderSynthesizedFormat( void *arg
, ULONG size
)
1411 return dispatch_callback( NtUserRenderSynthesizedFormat
, arg
, size
);
1414 static NTSTATUS WINAPI
wow64_NtUserUnpackDDEMessage( void *arg
, ULONG size
)
1416 struct unpack_dde_message_params
*params
= arg
;
1417 struct unpack_dde_message_params32
*params32
;
1418 struct unpack_dde_message_result result
;
1427 size
-= FIELD_OFFSET( struct unpack_dde_message_params
, data
);
1428 if (!(params32
= Wow64AllocateTemp( FIELD_OFFSET( struct unpack_dde_message_params32
, data
[size
] ))))
1429 return STATUS_NO_MEMORY
;
1431 params32
->hwnd
= HandleToUlong( params
->hwnd
);
1432 params32
->message
= params
->message
;
1433 params32
->wparam
= params
->wparam
;
1434 params32
->lparam
= params
->lparam
;
1435 if (size
) memcpy( params32
->data
, params
->data
, size
);
1436 size
= FIELD_OFFSET( struct unpack_dde_message_params32
, data
[size
] );
1438 status
= Wow64KiUserCallbackDispatcher( NtUserUnpackDDEMessage
, params32
, size
, (void **)&result32
, &ret_len
);
1439 if (!status
&& ret_len
== sizeof(*result32
))
1441 result
.wparam
= result32
->wparam
;
1442 result
.lparam
= result32
->lparam
;
1443 return NtCallbackReturn( &result
, sizeof(result
), status
);
1448 static NTSTATUS WINAPI
wow64_NtUserCallFreeIcon( void *arg
, ULONG size
)
1450 return dispatch_callback( NtUserCallFreeIcon
, arg
, size
);
1453 static NTSTATUS WINAPI
wow64_NtUserThunkLock( void *arg
, ULONG size
)
1455 return dispatch_callback( NtUserThunkLock
, arg
, size
);
1458 static NTSTATUS WINAPI
wow64_NtUserCallVulkanDebugReportCallback( void *arg
, ULONG size
)
1464 static NTSTATUS WINAPI
wow64_NtUserCallVulkanDebugUtilsCallback( void *arg
, ULONG size
)
1470 static NTSTATUS WINAPI
wow64_NtUserCallOpenGLDebugMessageCallback( void *arg
, ULONG size
)
1476 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst0( void *arg
, ULONG size
)
1478 return dispatch_callback( NtUserDriverCallbackFirst
+ 0, arg
, size
);
1481 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst1( void *arg
, ULONG size
)
1483 return dispatch_callback( NtUserDriverCallbackFirst
+ 1, arg
, size
);
1486 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst2( void *arg
, ULONG size
)
1488 return dispatch_callback( NtUserDriverCallbackFirst
+ 2, arg
, size
);
1491 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst3( void *arg
, ULONG size
)
1493 return dispatch_callback( NtUserDriverCallbackFirst
+ 3, arg
, size
);
1496 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst4( void *arg
, ULONG size
)
1498 return dispatch_callback( NtUserDriverCallbackFirst
+ 4, arg
, size
);
1501 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst5( void *arg
, ULONG size
)
1503 return dispatch_callback( NtUserDriverCallbackFirst
+ 5, arg
, size
);
1506 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst6( void *arg
, ULONG size
)
1508 return dispatch_callback( NtUserDriverCallbackFirst
+ 6, arg
, size
);
1511 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst7( void *arg
, ULONG size
)
1513 return dispatch_callback( NtUserDriverCallbackFirst
+ 7, arg
, size
);
1516 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst8( void *arg
, ULONG size
)
1518 return dispatch_callback( NtUserDriverCallbackFirst
+ 8, arg
, size
);
1521 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst9( void *arg
, ULONG size
)
1523 return dispatch_callback( NtUserDriverCallbackFirst
+ 9, arg
, size
);
1526 user_callback user_callbacks
[] =
1528 /* user32 callbacks */
1529 wow64_NtUserCallEnumDisplayMonitor
,
1530 wow64_NtUserCallSendAsyncCallback
,
1531 wow64_NtUserCallWinEventHook
,
1532 wow64_NtUserCallWinProc
,
1533 wow64_NtUserCallWindowsHook
,
1534 wow64_NtUserCopyImage
,
1535 wow64_NtUserDrawNonClientButton
,
1536 wow64_NtUserDrawScrollBar
,
1537 wow64_NtUserDrawText
,
1538 wow64_NtUserFreeCachedClipboardData
,
1539 wow64_NtUserImmProcessKey
,
1540 wow64_NtUserImmTranslateMessage
,
1541 wow64_NtUserInitBuiltinClasses
,
1542 wow64_NtUserLoadDriver
,
1543 wow64_NtUserLoadImage
,
1544 wow64_NtUserLoadSysMenu
,
1545 wow64_NtUserPostDDEMessage
,
1546 wow64_NtUserRenderSynthesizedFormat
,
1547 wow64_NtUserUnpackDDEMessage
,
1549 wow64_NtUserCallFreeIcon
,
1550 wow64_NtUserThunkLock
,
1551 /* Vulkan support */
1552 wow64_NtUserCallVulkanDebugReportCallback
,
1553 wow64_NtUserCallVulkanDebugUtilsCallback
,
1554 /* OpenGL support */
1555 wow64_NtUserCallOpenGLDebugMessageCallback
,
1556 /* Driver-specific callbacks */
1557 wow64_NtUserDriverCallbackFirst0
,
1558 wow64_NtUserDriverCallbackFirst1
,
1559 wow64_NtUserDriverCallbackFirst2
,
1560 wow64_NtUserDriverCallbackFirst3
,
1561 wow64_NtUserDriverCallbackFirst4
,
1562 wow64_NtUserDriverCallbackFirst5
,
1563 wow64_NtUserDriverCallbackFirst6
,
1564 wow64_NtUserDriverCallbackFirst7
,
1565 wow64_NtUserDriverCallbackFirst8
,
1566 wow64_NtUserDriverCallbackFirst9
,
1569 C_ASSERT( ARRAYSIZE(user_callbacks
) == NtUserCallCount
);
1571 NTSTATUS WINAPI
wow64_NtUserActivateKeyboardLayout( UINT
*args
)
1573 HKL layout
= get_handle( &args
);
1574 UINT flags
= get_ulong( &args
);
1576 return HandleToUlong( NtUserActivateKeyboardLayout( layout
, flags
));
1579 NTSTATUS WINAPI
wow64_NtUserAddClipboardFormatListener( UINT
*args
)
1581 HWND hwnd
= get_handle( &args
);
1583 return NtUserAddClipboardFormatListener( hwnd
);
1586 NTSTATUS WINAPI
wow64_NtUserAssociateInputContext( UINT
*args
)
1588 HWND hwnd
= get_handle( &args
);
1589 HIMC ctx
= get_handle( &args
);
1590 ULONG flags
= get_ulong( &args
);
1592 return NtUserAssociateInputContext( hwnd
, ctx
, flags
);
1595 NTSTATUS WINAPI
wow64_NtUserAttachThreadInput( UINT
*args
)
1597 DWORD from
= get_ulong( &args
);
1598 DWORD to
= get_ulong( &args
);
1599 BOOL attach
= get_ulong( &args
);
1601 return NtUserAttachThreadInput( from
, to
, attach
);
1604 NTSTATUS WINAPI
wow64_NtUserBeginPaint( UINT
*args
)
1606 HWND hwnd
= get_handle( &args
);
1607 PAINTSTRUCT32
*ps32
= get_ptr( &args
);
1612 ret
= NtUserBeginPaint( hwnd
, ps32
? & ps
: NULL
);
1615 ps32
->hdc
= HandleToUlong( ps
.hdc
);
1616 ps32
->fErase
= ps
.fErase
;
1617 ps32
->rcPaint
= ps
.rcPaint
;
1619 return HandleToUlong( ret
);
1622 NTSTATUS WINAPI
wow64_NtUserBuildHimcList( UINT
*args
)
1624 ULONG thread_id
= get_ulong( &args
);
1625 ULONG count
= get_ulong( &args
);
1626 UINT32
*buffer32
= get_ptr( &args
);
1627 UINT
*size
= get_ptr( &args
);
1629 HIMC
*buffer
= NULL
;
1633 if (buffer32
&& !(buffer
= Wow64AllocateTemp( count
* sizeof(*buffer
) )))
1634 return STATUS_NO_MEMORY
;
1636 if ((status
= NtUserBuildHimcList( thread_id
, count
, buffer
, size
))) return status
;
1638 for (i
= 0; i
< *size
; i
++) buffer32
[i
] = HandleToUlong( buffer
[i
] );
1642 NTSTATUS WINAPI
wow64_NtUserBuildHwndList( UINT
*args
)
1644 HDESK desktop
= get_handle( &args
);
1645 ULONG unk2
= get_ulong( &args
);
1646 ULONG unk3
= get_ulong( &args
);
1647 ULONG unk4
= get_ulong( &args
);
1648 ULONG thread_id
= get_ulong( &args
);
1649 ULONG count
= get_ulong( &args
);
1650 UINT32
*buffer32
= get_ptr( &args
);
1651 ULONG
*size
= get_ptr( &args
);
1657 if (!(buffer
= Wow64AllocateTemp( count
* sizeof(*buffer
) ))) return STATUS_NO_MEMORY
;
1659 if ((status
= NtUserBuildHwndList( desktop
, unk2
, unk3
, unk4
, thread_id
, count
, buffer
, size
)))
1662 for (i
= 0; i
< *size
; i
++)
1663 buffer32
[i
] = HandleToUlong( buffer
[i
] );
1667 NTSTATUS WINAPI
wow64_NtUserCallHwnd( UINT
*args
)
1669 HWND hwnd
= get_handle( &args
);
1670 DWORD code
= get_ulong( &args
);
1672 return NtUserCallHwnd( hwnd
, code
);
1675 NTSTATUS WINAPI
wow64_NtUserCallHwndParam( UINT
*args
)
1677 HWND hwnd
= get_handle( &args
);
1678 DWORD_PTR param
= get_ulong( &args
);
1679 DWORD code
= get_ulong( &args
);
1683 case NtUserCallHwndParam_GetScrollInfo
:
1689 } *info32
= UlongToPtr( param
);
1690 struct get_scroll_info_params info
;
1692 info
.bar
= info32
->bar
;
1693 info
.info
= UlongToPtr( info32
->info
);
1694 return NtUserCallHwndParam( hwnd
, (UINT_PTR
)&info
, code
);
1697 case NtUserCallHwndParam_GetWindowRects
:
1704 } *params32
= UlongToPtr( param
);
1705 struct get_window_rects_params params
;
1707 params
.rect
= UlongToPtr( params32
->rect
);
1708 params
.client
= params32
->client
;
1709 params
.dpi
= params32
->dpi
;
1710 return NtUserCallHwndParam( hwnd
, (UINT_PTR
)¶ms
, code
);
1713 case NtUserCallHwndParam_MapWindowPoints
:
1721 } *params32
= UlongToPtr( param
);
1722 struct map_window_points_params params
;
1724 params
.hwnd_to
= LongToHandle( params32
->hwnd_to
);
1725 params
.points
= UlongToPtr( params32
->points
);
1726 params
.count
= params32
->count
;
1727 params
.dpi
= params32
->dpi
;
1728 return NtUserCallHwndParam( hwnd
, (UINT_PTR
)¶ms
, code
);
1731 case NtUserCallHwndParam_SendHardwareInput
:
1738 } *params32
= UlongToPtr( param
);
1739 struct send_hardware_input_params params
;
1741 params
.flags
= params32
->flags
;
1742 params
.input
= UlongToPtr( params32
->input
);
1743 params
.lparam
= params32
->lparam
;
1744 return NtUserCallHwndParam( hwnd
, (UINT_PTR
)¶ms
, code
);
1748 return NtUserCallHwndParam( hwnd
, param
, code
);
1752 NTSTATUS WINAPI
wow64_NtUserCallMsgFilter( UINT
*args
)
1754 MSG32
*msg32
= get_ptr( &args
);
1755 INT code
= get_ulong( &args
);
1759 ret
= NtUserCallMsgFilter( msg_32to64( &msg
, msg32
), code
);
1760 msg_64to32( &msg
, msg32
);
1764 NTSTATUS WINAPI
wow64_NtUserCallNextHookEx( UINT
*args
)
1766 HHOOK hhook
= get_handle( &args
);
1767 INT code
= get_ulong( &args
);
1768 WPARAM wparam
= get_ulong( &args
);
1769 LPARAM lparam
= get_ulong( &args
);
1771 return NtUserCallNextHookEx( hhook
, code
, wparam
, lparam
);
1774 NTSTATUS WINAPI
wow64_NtUserCallNoParam( UINT
*args
)
1776 ULONG code
= get_ulong( &args
);
1778 return NtUserCallNoParam( code
);
1781 NTSTATUS WINAPI
wow64_NtUserCallOneParam( UINT
*args
)
1783 ULONG_PTR arg
= get_ulong( &args
);
1784 ULONG code
= get_ulong( &args
);
1786 return NtUserCallOneParam( arg
, code
);
1789 NTSTATUS WINAPI
wow64_NtUserCallTwoParam( UINT
*args
)
1791 ULONG_PTR arg1
= get_ulong( &args
);
1792 ULONG_PTR arg2
= get_ulong( &args
);
1793 ULONG code
= get_ulong( &args
);
1797 case NtUserCallTwoParam_GetMenuInfo
:
1799 MENUINFO32
*info32
= UlongToPtr( arg2
);
1802 if (!info32
|| info32
->cbSize
!= sizeof(*info32
))
1804 set_last_error32( ERROR_INVALID_PARAMETER
);
1808 info
.cbSize
= sizeof(info
);
1809 info
.fMask
= info32
->fMask
;
1810 if (!NtUserCallTwoParam( arg1
, (UINT_PTR
)&info
, code
)) return FALSE
;
1811 if (info
.fMask
& MIM_BACKGROUND
) info32
->hbrBack
= HandleToUlong( info
.hbrBack
);
1812 if (info
.fMask
& MIM_HELPID
) info32
->dwContextHelpID
= info
.dwContextHelpID
;
1813 if (info
.fMask
& MIM_MAXHEIGHT
) info32
->cyMax
= info
.cyMax
;
1814 if (info
.fMask
& MIM_MENUDATA
) info32
->dwMenuData
= info
.dwMenuData
;
1815 if (info
.fMask
& MIM_STYLE
) info32
->dwStyle
= info
.dwStyle
;
1820 return NtUserCallTwoParam( arg1
, arg2
, code
);
1824 NTSTATUS WINAPI
wow64_NtUserChangeClipboardChain( UINT
*args
)
1826 HWND hwnd
= get_handle( &args
);
1827 HWND next
= get_handle( &args
);
1829 return NtUserChangeClipboardChain( hwnd
, next
);
1832 NTSTATUS WINAPI
wow64_NtUserChangeDisplaySettings( UINT
*args
)
1834 UNICODE_STRING32
*devname32
= get_ptr( &args
);
1835 DEVMODEW
*devmode
= get_ptr( &args
);
1836 HWND hwnd
= get_handle( &args
);
1837 DWORD flags
= get_ulong( &args
);
1838 void *lparam
= get_ptr( &args
);
1840 UNICODE_STRING devname
;
1842 return NtUserChangeDisplaySettings( unicode_str_32to64( &devname
, devname32
),
1843 devmode
, hwnd
, flags
, lparam
);
1846 NTSTATUS WINAPI
wow64_NtUserCheckMenuItem( UINT
*args
)
1848 HMENU handle
= get_handle( &args
);
1849 UINT id
= get_ulong( &args
);
1850 UINT flags
= get_ulong( &args
);
1852 return NtUserCheckMenuItem( handle
, id
, flags
);
1855 NTSTATUS WINAPI
wow64_NtUserChildWindowFromPointEx( UINT
*args
)
1857 HWND parent
= get_handle( &args
);
1858 LONG x
= get_ulong( &args
);
1859 LONG y
= get_ulong( &args
);
1860 UINT flags
= get_ulong( &args
);
1862 return HandleToUlong( NtUserChildWindowFromPointEx( parent
, x
, y
, flags
));
1865 NTSTATUS WINAPI
wow64_NtUserClipCursor( UINT
*args
)
1867 const RECT
*rect
= get_ptr( &args
);
1869 return NtUserClipCursor( rect
);
1872 NTSTATUS WINAPI
wow64_NtUserCloseClipboard( UINT
*args
)
1874 return NtUserCloseClipboard();
1877 NTSTATUS WINAPI
wow64_NtUserCloseDesktop( UINT
*args
)
1879 HDESK handle
= get_handle( &args
);
1881 return NtUserCloseDesktop( handle
);
1884 NTSTATUS WINAPI
wow64_NtUserCloseWindowStation( UINT
*args
)
1886 HWINSTA handle
= get_handle( &args
);
1888 return NtUserCloseWindowStation( handle
);
1891 NTSTATUS WINAPI
wow64_NtUserCopyAcceleratorTable( UINT
*args
)
1893 HACCEL src
= get_handle( &args
);
1894 ACCEL
*dst
= get_ptr( &args
);
1895 INT count
= get_ulong( &args
);
1897 return NtUserCopyAcceleratorTable( src
, dst
, count
);
1900 NTSTATUS WINAPI
wow64_NtUserCountClipboardFormats( UINT
*args
)
1902 return NtUserCountClipboardFormats();
1905 NTSTATUS WINAPI
wow64_NtUserCreateAcceleratorTable( UINT
*args
)
1907 ACCEL
*table
= get_ptr( &args
);
1908 INT count
= get_ulong( &args
);
1910 return HandleToUlong( NtUserCreateAcceleratorTable( table
, count
));
1913 NTSTATUS WINAPI
wow64_NtUserCreateCaret( UINT
*args
)
1915 HWND hwnd
= get_handle( &args
);
1916 HBITMAP bitmap
= get_handle( &args
);
1917 int width
= get_ulong( &args
);
1918 int height
= get_ulong( &args
);
1920 return NtUserCreateCaret( hwnd
, bitmap
, width
, height
);
1923 NTSTATUS WINAPI
wow64_NtUserCreateDesktopEx( UINT
*args
)
1925 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
1926 UNICODE_STRING32
*device32
= get_ptr( &args
);
1927 DEVMODEW
*devmode
= get_ptr( &args
);
1928 DWORD flags
= get_ulong( &args
);
1929 ACCESS_MASK access
= get_ulong( &args
);
1930 ULONG heap_size
= get_ulong( &args
);
1932 struct object_attr64 attr
;
1933 UNICODE_STRING device
;
1936 ret
= NtUserCreateDesktopEx( objattr_32to64( &attr
, attr32
),
1937 unicode_str_32to64( &device
, device32
),
1938 devmode
, flags
, access
, heap_size
);
1939 return HandleToUlong( ret
);
1942 NTSTATUS WINAPI
wow64_NtUserCreateInputContext( UINT
*args
)
1944 UINT_PTR client_ptr
= get_ulong( &args
);
1946 return HandleToUlong( NtUserCreateInputContext( client_ptr
));
1949 NTSTATUS WINAPI
wow64_NtUserCreateWindowEx( UINT
*args
)
1951 DWORD ex_style
= get_ulong( &args
);
1952 UNICODE_STRING32
*class_name32
= get_ptr( &args
);
1953 UNICODE_STRING32
*version32
= get_ptr( &args
);
1954 UNICODE_STRING32
*window_name32
= get_ptr( &args
);
1955 DWORD style
= get_ulong( &args
);
1956 int x
= get_ulong( &args
);
1957 int y
= get_ulong( &args
);
1958 int width
= get_ulong( &args
);
1959 int height
= get_ulong( &args
);
1960 HWND parent
= get_handle( &args
);
1961 HMENU menu
= get_handle( &args
);
1962 HINSTANCE instance
= get_ptr( &args
);
1963 void *params
= get_ptr( &args
);
1964 DWORD flags
= get_ulong( &args
);
1965 HINSTANCE client_instance
= get_ptr( &args
);
1966 DWORD unk
= get_ulong( &args
);
1967 BOOL ansi
= get_ulong( &args
);
1969 UNICODE_STRING class_name
, version
, window_name
;
1972 ret
= NtUserCreateWindowEx( ex_style
,
1973 unicode_str_32to64( &class_name
, class_name32
),
1974 unicode_str_32to64( &version
, version32
),
1975 unicode_str_32to64( &window_name
, window_name32
),
1976 style
, x
, y
, width
, height
, parent
, menu
,
1977 instance
, params
, flags
, client_instance
, unk
, ansi
);
1978 return HandleToUlong( ret
);
1981 NTSTATUS WINAPI
wow64_NtUserCreateWindowStation( UINT
*args
)
1983 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
1984 ACCESS_MASK access
= get_ulong( &args
);
1985 ULONG arg3
= get_ulong( &args
);
1986 ULONG arg4
= get_ulong( &args
);
1987 ULONG arg5
= get_ulong( &args
);
1988 ULONG arg6
= get_ulong( &args
);
1989 ULONG arg7
= get_ulong( &args
);
1991 struct object_attr64 attr
;
1993 return HandleToUlong( NtUserCreateWindowStation( objattr_32to64( &attr
, attr32
), access
,
1994 arg3
, arg4
, arg5
, arg6
, arg7
));
1997 NTSTATUS WINAPI
wow64_NtUserDeferWindowPosAndBand( UINT
*args
)
1999 HDWP hdwp
= get_handle( &args
);
2000 HWND hwnd
= get_handle( &args
);
2001 HWND after
= get_handle( &args
);
2002 INT x
= get_ulong( &args
);
2003 INT y
= get_ulong( &args
);
2004 INT cx
= get_ulong( &args
);
2005 INT cy
= get_ulong( &args
);
2006 UINT flags
= get_ulong( &args
);
2007 UINT unk1
= get_ulong( &args
);
2008 UINT unk2
= get_ulong( &args
);
2010 HDWP ret
= NtUserDeferWindowPosAndBand( hdwp
, hwnd
, after
, x
, y
, cx
, cy
, flags
, unk1
, unk2
);
2011 return HandleToUlong( ret
);
2014 NTSTATUS WINAPI
wow64_NtUserDeleteMenu( UINT
*args
)
2016 HMENU menu
= get_handle( &args
);
2017 UINT id
= get_ulong( &args
);
2018 UINT flags
= get_ulong( &args
);
2020 return NtUserDeleteMenu( menu
, id
, flags
);
2023 NTSTATUS WINAPI
wow64_NtUserDestroyAcceleratorTable( UINT
*args
)
2025 HACCEL handle
= get_handle( &args
);
2027 return NtUserDestroyAcceleratorTable( handle
);
2030 NTSTATUS WINAPI
wow64_NtUserDestroyCursor( UINT
*args
)
2032 HCURSOR cursor
= get_handle( &args
);
2033 ULONG arg
= get_ulong( &args
);
2035 return NtUserDestroyCursor( cursor
, arg
);
2038 NTSTATUS WINAPI
wow64_NtUserDestroyInputContext( UINT
*args
)
2040 HIMC handle
= get_handle( &args
);
2042 return NtUserDestroyInputContext( handle
);
2045 NTSTATUS WINAPI
wow64_NtUserDestroyMenu( UINT
*args
)
2047 HMENU handle
= get_handle( &args
);
2049 return NtUserDestroyMenu( handle
);
2052 NTSTATUS WINAPI
wow64_NtUserDestroyWindow( UINT
*args
)
2054 HWND hwnd
= get_handle( &args
);
2056 return NtUserDestroyWindow( hwnd
);
2059 NTSTATUS WINAPI
wow64_NtUserDisableThreadIme( UINT
*args
)
2061 DWORD thread_id
= get_ulong( &args
);
2063 return NtUserDisableThreadIme( thread_id
);
2066 NTSTATUS WINAPI
wow64_NtUserDispatchMessage( UINT
*args
)
2068 const MSG32
*msg32
= get_ptr( &args
);
2071 return NtUserDispatchMessage( msg_32to64( &msg
, msg32
));
2074 NTSTATUS WINAPI
wow64_NtUserDragDetect( UINT
*args
)
2076 HWND hwnd
= get_handle( &args
);
2077 int x
= get_ulong( &args
);
2078 int y
= get_ulong( &args
);
2080 return NtUserDragDetect( hwnd
, x
, y
);
2083 NTSTATUS WINAPI
wow64_NtUserDragObject( UINT
*args
)
2085 HWND parent
= get_handle( &args
);
2086 HWND hwnd
= get_handle( &args
);
2087 UINT fmt
= get_ulong( &args
);
2088 ULONG_PTR data
= get_ulong( &args
);
2089 HCURSOR hcursor
= get_handle( &args
);
2091 return NtUserDragObject( parent
, hwnd
, fmt
, data
, hcursor
);
2094 NTSTATUS WINAPI
wow64_NtUserDrawCaptionTemp( UINT
*args
)
2096 HWND hwnd
= get_handle( &args
);
2097 HDC hdc
= get_handle( &args
);
2098 const RECT
*rect
= get_ptr( &args
);
2099 HFONT font
= get_handle( &args
);
2100 HICON icon
= get_handle( &args
);
2101 const WCHAR
*str
= get_ptr( &args
);
2102 UINT flags
= get_ulong( &args
);
2104 return NtUserDrawCaptionTemp( hwnd
, hdc
, rect
, font
, icon
, str
, flags
);
2107 NTSTATUS WINAPI
wow64_NtUserDrawIconEx( UINT
*args
)
2109 HDC hdc
= get_handle( &args
);
2110 int x0
= get_ulong( &args
);
2111 int y0
= get_ulong( &args
);
2112 HICON icon
= get_handle( &args
);
2113 int width
= get_ulong( &args
);
2114 int height
= get_ulong( &args
);
2115 UINT istep
= get_ulong( &args
);
2116 HBRUSH hbr
= get_handle( &args
);
2117 UINT flags
= get_ulong( &args
);
2119 return NtUserDrawIconEx( hdc
, x0
, y0
, icon
, width
, height
, istep
, hbr
, flags
);
2122 NTSTATUS WINAPI
wow64_NtUserDrawMenuBarTemp( UINT
*args
)
2124 HWND hwnd
= get_handle( &args
);
2125 HDC hdc
= get_handle( &args
);
2126 RECT
*rect
= get_ptr( &args
);
2127 HMENU handle
= get_handle( &args
);
2128 HFONT font
= get_handle( &args
);
2130 return NtUserDrawMenuBarTemp( hwnd
, hdc
, rect
, handle
, font
);
2133 NTSTATUS WINAPI
wow64_NtUserEmptyClipboard( UINT
*args
)
2135 return NtUserEmptyClipboard();
2138 NTSTATUS WINAPI
wow64_NtUserEnableMenuItem( UINT
*args
)
2140 HMENU handle
= get_handle( &args
);
2141 UINT id
= get_ulong( &args
);
2142 UINT flags
= get_ulong( &args
);
2144 return NtUserEnableMenuItem( handle
, id
, flags
);
2147 NTSTATUS WINAPI
wow64_NtUserEnableMouseInPointer( UINT
*args
)
2149 UINT enable
= get_ulong( &args
);
2151 return NtUserEnableMouseInPointer( enable
);
2154 NTSTATUS WINAPI
wow64_NtUserEnableScrollBar( UINT
*args
)
2156 HWND hwnd
= get_handle( &args
);
2157 UINT bar
= get_ulong( &args
);
2158 UINT flags
= get_ulong( &args
);
2160 return NtUserEnableScrollBar( hwnd
, bar
, flags
);
2163 NTSTATUS WINAPI
wow64_NtUserEndDeferWindowPosEx( UINT
*args
)
2165 HDWP hdwp
= get_handle( &args
);
2166 BOOL async
= get_ulong( &args
);
2168 return NtUserEndDeferWindowPosEx( hdwp
, async
);
2171 NTSTATUS WINAPI
wow64_NtUserEndMenu( UINT
*args
)
2173 return NtUserEndMenu();
2176 NTSTATUS WINAPI
wow64_NtUserEndPaint( UINT
*args
)
2178 HWND hwnd
= get_handle( &args
);
2179 const PAINTSTRUCT32
*ps32
= get_ptr( &args
);
2182 return NtUserEndPaint( hwnd
, paintstruct_32to64( &ps
, ps32
));
2185 NTSTATUS WINAPI
wow64_NtUserEnumDisplayDevices( UINT
*args
)
2187 UNICODE_STRING32
*device32
= get_ptr( &args
);
2188 DWORD index
= get_ulong( &args
);
2189 DISPLAY_DEVICEW
*info
= get_ptr( &args
);
2190 DWORD flags
= get_ulong( &args
);
2192 UNICODE_STRING device
;
2194 return NtUserEnumDisplayDevices( unicode_str_32to64( &device
, device32
), index
, info
, flags
);
2197 NTSTATUS WINAPI
wow64_NtUserEnumDisplayMonitors( UINT
*args
)
2199 HDC hdc
= get_handle( &args
);
2200 RECT
*rect
= get_ptr( &args
);
2201 MONITORENUMPROC proc
= get_ptr( &args
);
2202 LPARAM lp
= get_ulong( &args
);
2204 return NtUserEnumDisplayMonitors( hdc
, rect
, proc
, lp
);
2207 NTSTATUS WINAPI
wow64_NtUserEnumDisplaySettings( UINT
*args
)
2209 UNICODE_STRING32
*device32
= get_ptr( &args
);
2210 DWORD mode
= get_ulong( &args
);
2211 DEVMODEW
*dev_mode
= get_ptr( &args
);
2212 DWORD flags
= get_ulong( &args
);
2214 UNICODE_STRING device
;
2216 return NtUserEnumDisplaySettings( unicode_str_32to64( &device
, device32
),
2217 mode
, dev_mode
, flags
);
2220 NTSTATUS WINAPI
wow64_NtUserExcludeUpdateRgn( UINT
*args
)
2222 HDC hdc
= get_handle( &args
);
2223 HWND hwnd
= get_handle( &args
);
2225 return NtUserExcludeUpdateRgn( hdc
, hwnd
);
2228 NTSTATUS WINAPI
wow64_NtUserFindExistingCursorIcon( UINT
*args
)
2230 UNICODE_STRING32
*module32
= get_ptr( &args
);
2231 UNICODE_STRING32
*res_name32
= get_ptr( &args
);
2232 void *desc
= get_ptr( &args
);
2234 UNICODE_STRING module
;
2235 UNICODE_STRING res_name
;
2238 ret
= NtUserFindExistingCursorIcon( unicode_str_32to64( &module
, module32
),
2239 unicode_str_32to64( &res_name
, res_name32
), desc
);
2240 return HandleToUlong( ret
);
2243 NTSTATUS WINAPI
wow64_NtUserFindWindowEx( UINT
*args
)
2245 HWND parent
= get_handle( &args
);
2246 HWND child
= get_handle( &args
);
2247 UNICODE_STRING32
*class32
= get_ptr( &args
);
2248 UNICODE_STRING32
*title32
= get_ptr( &args
);
2249 ULONG unk
= get_ulong( &args
);
2251 UNICODE_STRING
class, title
;
2254 ret
= NtUserFindWindowEx( parent
, child
, unicode_str_32to64( &class, class32
),
2255 unicode_str_32to64( &title
, title32
), unk
);
2256 return HandleToUlong( ret
);
2259 NTSTATUS WINAPI
wow64_NtUserFlashWindowEx( UINT
*args
)
2268 } *info32
= get_ptr( &args
);
2274 set_last_error32( ERROR_NOACCESS
);
2278 if (info32
->cbSize
!= sizeof(*info32
))
2280 set_last_error32( ERROR_INVALID_PARAMETER
);
2284 info
.cbSize
= sizeof(info
);
2285 info
.hwnd
= LongToHandle( info32
->hwnd
);
2286 info
.dwFlags
= info32
->dwFlags
;
2287 info
.uCount
= info32
->uCount
;
2288 info
.dwTimeout
= info32
->dwTimeout
;
2289 return NtUserFlashWindowEx( &info
);
2292 NTSTATUS WINAPI
wow64_NtUserGetAncestor( UINT
*args
)
2294 HWND hwnd
= get_handle( &args
);
2295 UINT type
= get_ulong( &args
);
2297 return HandleToUlong( NtUserGetAncestor( hwnd
, type
));
2300 NTSTATUS WINAPI
wow64_NtUserGetAsyncKeyState( UINT
*args
)
2302 INT key
= get_ulong( &args
);
2304 return NtUserGetAsyncKeyState( key
);
2307 NTSTATUS WINAPI
wow64_NtUserGetAtomName( UINT
*args
)
2309 ATOM atom
= get_ulong( &args
);
2310 UNICODE_STRING32
*str32
= get_ptr( &args
);
2314 return NtUserGetAtomName( atom
, unicode_str_32to64( &str
, str32
));
2317 NTSTATUS WINAPI
wow64_NtUserGetCaretBlinkTime( UINT
*args
)
2319 return NtUserGetCaretBlinkTime();
2322 NTSTATUS WINAPI
wow64_NtUserGetCaretPos( UINT
*args
)
2324 POINT
*pt
= get_ptr( &args
);
2326 return NtUserGetCaretPos( pt
);
2329 NTSTATUS WINAPI
wow64_NtUserGetClassInfoEx( UINT
*args
)
2331 HINSTANCE instance
= get_ptr( &args
);
2332 UNICODE_STRING32
*name32
= get_ptr( &args
);
2333 WNDCLASSEXW32
*wc32
= get_ptr( &args
);
2334 struct client_menu_name32
*client_name32
= get_ptr( &args
);
2335 BOOL ansi
= get_ulong( &args
);
2337 struct client_menu_name client_name
;
2338 UNICODE_STRING name
;
2342 wc
.cbSize
= sizeof(wc
);
2343 if (!(ret
= NtUserGetClassInfoEx( instance
, unicode_str_32to64( &name
, name32
), &wc
,
2344 &client_name
, ansi
)))
2347 wc32
->style
= wc
.style
;
2348 wc32
->lpfnWndProc
= PtrToUlong( wc
.lpfnWndProc
);
2349 wc32
->cbClsExtra
= wc
.cbClsExtra
;
2350 wc32
->cbWndExtra
= wc
.cbWndExtra
;
2351 wc32
->hInstance
= PtrToUlong( wc
.hInstance
);
2352 wc32
->hIcon
= HandleToUlong( wc
.hIcon
);
2353 wc32
->hCursor
= HandleToUlong( wc
.hCursor
);
2354 wc32
->hbrBackground
= HandleToUlong( wc
.hbrBackground
);
2355 wc32
->lpszMenuName
= PtrToUlong( wc
.lpszMenuName
);
2356 wc32
->lpszClassName
= PtrToUlong( wc
.lpszClassName
);
2357 wc32
->hIconSm
= HandleToUlong( wc
.hIconSm
);
2358 client_menu_name_64to32( &client_name
, client_name32
);
2362 NTSTATUS WINAPI
wow64_NtUserGetClassName( UINT
*args
)
2364 HWND hwnd
= get_handle( &args
);
2365 BOOL real
= get_ulong( &args
);
2366 UNICODE_STRING32
*str32
= get_ptr( &args
);
2370 return NtUserGetClassName( hwnd
, real
, unicode_str_32to64( &str
, str32
));
2373 NTSTATUS WINAPI
wow64_NtUserGetClipboardData( UINT
*args
)
2375 UINT format
= get_ulong( &args
);
2383 } *params32
= get_ptr( &args
);
2385 struct get_clipboard_params params
;
2388 params
.data
= UlongToPtr( params32
->data
);
2389 params
.size
= params32
->size
;
2390 params
.data_size
= params32
->data_size
;
2391 params
.data_only
= params32
->data_only
;
2393 ret
= NtUserGetClipboardData( format
, ¶ms
);
2395 params32
->size
= params
.size
;
2396 params32
->data_size
= params
.data_size
;
2397 params32
->seqno
= params
.seqno
;
2398 return HandleToUlong( ret
);
2401 NTSTATUS WINAPI
wow64_NtUserGetClipboardFormatName( UINT
*args
)
2403 UINT format
= get_ulong( &args
);
2404 WCHAR
*buffer
= get_ptr( &args
);
2405 INT maxlen
= get_ulong( &args
);
2407 return NtUserGetClipboardFormatName( format
, buffer
, maxlen
);
2410 NTSTATUS WINAPI
wow64_NtUserGetClipboardOwner( UINT
*args
)
2412 return HandleToUlong( NtUserGetClipboardOwner() );
2415 NTSTATUS WINAPI
wow64_NtUserGetClipboardSequenceNumber( UINT
*args
)
2417 return NtUserGetClipboardSequenceNumber();
2420 NTSTATUS WINAPI
wow64_NtUserGetClipboardViewer( UINT
*args
)
2422 return HandleToUlong( NtUserGetClipboardViewer() );
2425 NTSTATUS WINAPI
wow64_NtUserGetCursor( UINT
*args
)
2427 return HandleToUlong( NtUserGetCursor() );
2430 NTSTATUS WINAPI
wow64_NtUserGetCursorFrameInfo( UINT
*args
)
2432 HCURSOR cursor
= get_ptr( &args
);
2433 DWORD istep
= get_ulong( &args
);
2434 DWORD
*rate_jiffies
= get_ptr( &args
);
2435 DWORD
*num_steps
= get_ptr( &args
);
2437 return HandleToUlong( NtUserGetCursorFrameInfo( cursor
, istep
, rate_jiffies
, num_steps
));
2440 NTSTATUS WINAPI
wow64_NtUserGetCursorInfo( UINT
*args
)
2448 } *info32
= get_ptr( &args
);
2451 if (!info32
) return FALSE
;
2452 info
.cbSize
= sizeof(info
);
2453 if (!NtUserGetCursorInfo( &info
)) return FALSE
;
2454 info32
->flags
= info
.flags
;
2455 info32
->hCursor
= HandleToUlong( info
.hCursor
);
2456 info32
->ptScreenPos
= info
.ptScreenPos
;
2460 NTSTATUS WINAPI
wow64_NtUserGetDC( UINT
*args
)
2462 HWND hwnd
= get_handle( &args
);
2464 return HandleToUlong( NtUserGetDC( hwnd
));
2467 NTSTATUS WINAPI
wow64_NtUserGetDCEx( UINT
*args
)
2469 HWND hwnd
= get_handle( &args
);
2470 HRGN clip_rgn
= get_handle( &args
);
2471 DWORD flags
= get_ulong( &args
);
2473 return HandleToUlong( NtUserGetDCEx( hwnd
, clip_rgn
, flags
));
2476 NTSTATUS WINAPI
wow64_NtUserGetDisplayConfigBufferSizes( UINT
*args
)
2478 UINT32 flags
= get_ulong( &args
);
2479 UINT32
*num_path_info
= get_ptr( &args
);
2480 UINT32
*num_mode_info
= get_ptr( &args
);
2482 return NtUserGetDisplayConfigBufferSizes( flags
, num_path_info
, num_mode_info
);
2485 NTSTATUS WINAPI
wow64_NtUserGetDoubleClickTime( UINT
*args
)
2487 return NtUserGetDoubleClickTime();
2490 NTSTATUS WINAPI
wow64_NtUserGetDpiForMonitor( UINT
*args
)
2492 HMONITOR monitor
= get_handle( &args
);
2493 UINT type
= get_ulong( &args
);
2494 UINT
*x
= get_ptr( &args
);
2495 UINT
*y
= get_ptr( &args
);
2497 return NtUserGetDpiForMonitor( monitor
, type
, x
, y
);
2500 NTSTATUS WINAPI
wow64_NtUserGetForegroundWindow( UINT
*args
)
2502 return HandleToUlong( NtUserGetForegroundWindow() );
2505 NTSTATUS WINAPI
wow64_NtUserGetGUIThreadInfo( UINT
*args
)
2507 DWORD id
= get_ulong( &args
);
2515 ULONG hwndMenuOwner
;
2519 } *info32
= get_ptr( &args
);
2522 if (info32
->cbSize
!= sizeof(*info32
))
2524 set_last_error32( ERROR_INVALID_PARAMETER
);
2528 info
.cbSize
= sizeof(info
);
2529 if (!NtUserGetGUIThreadInfo( id
, &info
)) return FALSE
;
2530 info32
->flags
= info
.flags
;
2531 info32
->hwndActive
= HandleToUlong( info
.hwndActive
);
2532 info32
->hwndFocus
= HandleToUlong( info
.hwndFocus
);
2533 info32
->hwndCapture
= HandleToUlong( info
.hwndCapture
);
2534 info32
->hwndMenuOwner
= HandleToUlong( info
.hwndMenuOwner
);
2535 info32
->hwndMoveSize
= HandleToUlong( info
.hwndMoveSize
);
2536 info32
->hwndCaret
= HandleToUlong( info
.hwndCaret
);
2537 info32
->rcCaret
= info
.rcCaret
;
2541 NTSTATUS WINAPI
wow64_NtUserGetIconInfo( UINT
*args
)
2543 HICON icon
= get_handle( &args
);
2551 } *info32
= get_ptr( &args
);
2552 UNICODE_STRING32
*module32
= get_ptr( &args
);
2553 UNICODE_STRING32
*res_name32
= get_ptr( &args
);
2554 DWORD
*bpp
= get_ptr( &args
);
2555 LONG unk
= get_ulong( &args
);
2558 UNICODE_STRING module
, res_name
;
2560 if (!NtUserGetIconInfo( icon
, &info
, unicode_str_32to64( &module
, module32
),
2561 unicode_str_32to64( &res_name
, res_name32
), bpp
, unk
))
2564 info32
->fIcon
= info
.fIcon
;
2565 info32
->xHotspot
= info
.xHotspot
;
2566 info32
->yHotspot
= info
.yHotspot
;
2567 info32
->hbmMask
= HandleToUlong( info
.hbmMask
);
2568 info32
->hbmColor
= HandleToUlong( info
.hbmColor
);
2571 module32
->Buffer
= PtrToUlong( module
.Buffer
);
2572 module32
->Length
= module
.Length
;
2576 res_name32
->Buffer
= PtrToUlong( res_name
.Buffer
);
2577 res_name32
->Length
= res_name
.Length
;
2582 NTSTATUS WINAPI
wow64_NtUserGetIconSize( UINT
*args
)
2584 HICON handle
= get_handle( &args
);
2585 UINT step
= get_ulong( &args
);
2586 LONG
*width
= get_ptr( &args
);
2587 LONG
*height
= get_ptr( &args
);
2589 return NtUserGetIconSize( handle
, step
, width
, height
);
2592 NTSTATUS WINAPI
wow64_NtUserGetInternalWindowPos( UINT
*args
)
2594 HWND hwnd
= get_handle( &args
);
2595 RECT
*rect
= get_ptr( &args
);
2596 POINT
*pt
= get_ptr( &args
);
2598 return NtUserGetInternalWindowPos( hwnd
, rect
, pt
);
2601 NTSTATUS WINAPI
wow64_NtUserGetKeyNameText( UINT
*args
)
2603 LONG lparam
= get_ulong( &args
);
2604 WCHAR
*buffer
= get_ptr( &args
);
2605 INT size
= get_ulong( &args
);
2607 return NtUserGetKeyNameText( lparam
, buffer
, size
);
2610 NTSTATUS WINAPI
wow64_NtUserGetKeyState( UINT
*args
)
2612 INT vkey
= get_ulong( &args
);
2614 return NtUserGetKeyState( vkey
);
2617 NTSTATUS WINAPI
wow64_NtUserGetKeyboardLayout( UINT
*args
)
2619 DWORD tid
= get_ulong( &args
);
2621 return HandleToUlong( NtUserGetKeyboardLayout( tid
));
2624 NTSTATUS WINAPI
wow64_NtUserGetKeyboardLayoutList( UINT
*args
)
2626 INT size
= get_ulong( &args
);
2627 UINT32
*layouts32
= get_ptr( &args
);
2628 HKL
*layouts
= NULL
;
2631 if (layouts32
&& size
&& !(layouts
= Wow64AllocateTemp( size
* sizeof(*layouts
) )))
2634 ret
= NtUserGetKeyboardLayoutList( size
, layouts
);
2636 for (i
= 0; i
< ret
; i
++) layouts32
[i
] = HandleToUlong( layouts
[i
] );
2640 NTSTATUS WINAPI
wow64_NtUserGetKeyboardLayoutName( UINT
*args
)
2642 WCHAR
*name
= get_ptr( &args
);
2644 return NtUserGetKeyboardLayoutName( name
);
2647 NTSTATUS WINAPI
wow64_NtUserGetKeyboardState( UINT
*args
)
2649 BYTE
*state
= get_ptr( &args
);
2651 return NtUserGetKeyboardState( state
);
2654 NTSTATUS WINAPI
wow64_NtUserGetLayeredWindowAttributes( UINT
*args
)
2656 HWND hwnd
= get_handle( &args
);
2657 COLORREF
*key
= get_ptr( &args
);
2658 BYTE
*alpha
= get_ptr( &args
);
2659 DWORD
*flags
= get_ptr( &args
);
2661 return NtUserGetLayeredWindowAttributes( hwnd
, key
, alpha
, flags
);
2664 NTSTATUS WINAPI
wow64_NtUserGetMenuBarInfo( UINT
*args
)
2666 HWND hwnd
= get_handle( &args
);
2667 LONG id
= get_ulong( &args
);
2668 LONG item
= get_ulong( &args
);
2677 } *info32
= get_ptr( &args
);
2681 if (info32
->cbSize
!= sizeof(*info32
))
2683 set_last_error32( ERROR_INVALID_PARAMETER
);
2687 info
.cbSize
= sizeof(info
);
2688 if (!NtUserGetMenuBarInfo( hwnd
, id
, item
, &info
)) return FALSE
;
2689 info32
->rcBar
= info
.rcBar
;
2690 info32
->hMenu
= HandleToUlong( info
.hMenu
);
2691 info32
->hwndMenu
= HandleToUlong( info
.hwndMenu
);
2692 info32
->fBarFocused
= info
.fBarFocused
;
2693 info32
->fFocused
= info
.fFocused
;
2697 NTSTATUS WINAPI
wow64_NtUserGetMenuItemRect( UINT
*args
)
2699 HWND hwnd
= get_handle( &args
);
2700 HMENU handle
= get_handle( &args
);
2701 UINT item
= get_ulong( &args
);
2702 RECT
*rect
= get_ptr( &args
);
2704 return NtUserGetMenuItemRect( hwnd
, handle
, item
, rect
);
2707 NTSTATUS WINAPI
wow64_NtUserGetMessage( UINT
*args
)
2709 MSG32
*msg32
= get_ptr( &args
);
2710 HWND hwnd
= get_handle( &args
);
2711 UINT first
= get_ulong( &args
);
2712 UINT last
= get_ulong( &args
);
2716 ret
= NtUserGetMessage( &msg
, hwnd
, first
, last
);
2717 if (ret
!= -1) msg_64to32( &msg
, msg32
);
2721 NTSTATUS WINAPI
wow64_NtUserGetMouseMovePointsEx( UINT
*args
)
2723 UINT size
= get_ulong( &args
);
2724 MOUSEMOVEPOINT32
*ptin32
= get_ptr( &args
);
2725 MOUSEMOVEPOINT32
*ptout32
= get_ptr( &args
);
2726 int count
= get_ulong( &args
);
2727 DWORD resolution
= get_ulong( &args
);
2729 MOUSEMOVEPOINT ptin
[64], ptout
[64];
2732 if (size
!= sizeof(MOUSEMOVEPOINT32
) || count
< 0 || count
> ARRAYSIZE( ptin
))
2734 set_last_error32( ERROR_INVALID_PARAMETER
);
2738 if (!ptin32
|| (!ptout32
&& count
))
2740 set_last_error32( ERROR_NOACCESS
);
2744 for (i
= 0; i
< count
; i
++)
2746 ptin
[i
].x
= ptin32
[i
].x
;
2747 ptin
[i
].y
= ptin32
[i
].y
;
2748 ptin
[i
].time
= ptin32
[i
].time
;
2749 ptin
[i
].dwExtraInfo
= ptin32
[i
].dwExtraInfo
;
2752 ret
= NtUserGetMouseMovePointsEx( sizeof(MOUSEMOVEPOINT
), ptin
, ptout
, count
, resolution
);
2754 for (i
= 0; i
< ret
; i
++)
2756 ptout32
[i
].x
= ptout
[i
].x
;
2757 ptout32
[i
].y
= ptout
[i
].y
;
2758 ptout32
[i
].time
= ptout
[i
].time
;
2759 ptout32
[i
].dwExtraInfo
= ptout
[i
].dwExtraInfo
;
2765 NTSTATUS WINAPI
wow64_NtUserGetObjectInformation( UINT
*args
)
2767 HANDLE handle
= get_handle( &args
);
2768 INT index
= get_ulong( &args
);
2769 void *info
= get_ptr( &args
);
2770 DWORD len
= get_ulong( &args
);
2771 DWORD
*needed
= get_ptr( &args
);
2773 return NtUserGetObjectInformation( handle
, index
, info
, len
, needed
);
2776 NTSTATUS WINAPI
wow64_NtUserGetOpenClipboardWindow( UINT
*args
)
2778 return HandleToUlong( NtUserGetOpenClipboardWindow() );
2781 NTSTATUS WINAPI
wow64_NtUserGetPointerInfoList( UINT
*args
)
2783 UINT id
= get_ulong( &args
);
2784 UINT type
= get_ulong( &args
);
2785 UINT unk0
= get_ulong( &args
);
2786 UINT unk1
= get_ulong( &args
);
2787 UINT size
= get_ulong( &args
);
2788 void *entry_count
= get_ptr( &args
);
2789 void *pointer_count
= get_ptr( &args
);
2790 void *pointer_info
= get_ptr( &args
);
2792 return NtUserGetPointerInfoList( id
, type
, unk0
, unk1
, size
, entry_count
, pointer_count
, pointer_info
);
2795 NTSTATUS WINAPI
wow64_NtUserGetPriorityClipboardFormat( UINT
*args
)
2797 UINT
*list
= get_ptr( &args
);
2798 INT count
= get_ulong( &args
);
2800 return NtUserGetPriorityClipboardFormat( list
, count
);
2803 NTSTATUS WINAPI
wow64_NtUserGetProcessDpiAwarenessContext( UINT
*args
)
2805 HANDLE process
= get_handle( &args
);
2807 return NtUserGetProcessDpiAwarenessContext( process
);
2810 NTSTATUS WINAPI
wow64_NtUserGetProcessWindowStation( UINT
*args
)
2812 return HandleToUlong( NtUserGetProcessWindowStation() );
2815 NTSTATUS WINAPI
wow64_NtUserGetProp( UINT
*args
)
2817 HWND hwnd
= get_handle( &args
);
2818 const WCHAR
*str
= get_ptr( &args
);
2820 return HandleToUlong( NtUserGetProp( hwnd
, str
));
2823 NTSTATUS WINAPI
wow64_NtUserGetQueueStatus( UINT
*args
)
2825 UINT flags
= get_ulong( &args
);
2827 return NtUserGetQueueStatus( flags
);
2830 NTSTATUS WINAPI
wow64_NtUserGetRawInputBuffer( UINT
*args
)
2832 RAWINPUT
*data
= get_ptr( &args
);
2833 UINT
*data_size
= get_ptr( &args
);
2834 UINT header_size
= get_ulong( &args
);
2836 if (header_size
!= sizeof(RAWINPUTHEADER32
))
2838 set_last_error32( ERROR_INVALID_PARAMETER
);
2842 /* RAWINPUT has different sizes on 32-bit and 64-bit, but no translation is
2843 * done. The function actually returns different structures depending on
2844 * whether it's operating under WoW64 or not. */
2845 return NtUserGetRawInputBuffer( data
, data_size
, sizeof(RAWINPUTHEADER
) );
2848 NTSTATUS WINAPI
wow64_NtUserGetRawInputData( UINT
*args
)
2850 HRAWINPUT handle
= get_handle( &args
);
2851 UINT command
= get_ulong( &args
);
2852 void *data
= get_ptr( &args
);
2853 UINT
*data_size
= get_ptr( &args
);
2854 UINT header_size
= get_ulong( &args
);
2856 if (header_size
!= sizeof(RAWINPUTHEADER32
))
2858 set_last_error32( ERROR_INVALID_PARAMETER
);
2867 UINT data_size64
, body_size
, ret
;
2868 RAWINPUTHEADER32
*data32
= data
;
2869 RAWINPUTHEADER
*data64
= NULL
;
2871 data_size64
= *data_size
+ sizeof(RAWINPUTHEADER
);
2872 if (!(data64
= Wow64AllocateTemp( data_size64
)))
2874 set_last_error32( STATUS_NO_MEMORY
);
2878 ret
= NtUserGetRawInputData( handle
, command
, data64
, &data_size64
, sizeof(RAWINPUTHEADER
) );
2879 if (ret
== ~0u) return ret
;
2881 body_size
= ret
- sizeof(RAWINPUTHEADER
);
2882 if (*data_size
< sizeof(RAWINPUTHEADER32
) + body_size
)
2884 set_last_error32( ERROR_INSUFFICIENT_BUFFER
);
2888 data32
->dwType
= data64
->dwType
;
2889 data32
->dwSize
= sizeof(RAWINPUTHEADER32
) + body_size
;
2890 data32
->hDevice
= (UINT_PTR
)data64
->hDevice
;
2891 data32
->wParam
= data64
->wParam
;
2892 memcpy( data32
+ 1, data64
+ 1, body_size
);
2893 return sizeof(RAWINPUTHEADER32
) + body_size
;
2897 UINT data_size64
, ret
;
2899 ret
= NtUserGetRawInputData( handle
, command
, NULL
, &data_size64
, sizeof(RAWINPUTHEADER
) );
2900 if (ret
== ~0u) return ret
;
2901 *data_size
= data_size64
- sizeof(RAWINPUTHEADER
) + sizeof(RAWINPUTHEADER32
);
2907 UINT data_size64
= sizeof(RAWINPUTHEADER
);
2908 RAWINPUTHEADER32
*data32
= data
;
2909 RAWINPUTHEADER data64
;
2914 *data_size
= sizeof(RAWINPUTHEADER32
);
2918 if (*data_size
< sizeof(RAWINPUTHEADER32
))
2920 set_last_error32( ERROR_INSUFFICIENT_BUFFER
);
2924 ret
= NtUserGetRawInputData( handle
, command
, &data64
, &data_size64
, sizeof(RAWINPUTHEADER
) );
2925 if (ret
== ~0u) return ret
;
2926 data32
->dwType
= data64
.dwType
;
2927 data32
->dwSize
= data64
.dwSize
- sizeof(RAWINPUTHEADER
) + sizeof(RAWINPUTHEADER32
);
2928 data32
->hDevice
= (UINT_PTR
)data64
.hDevice
;
2929 data32
->wParam
= data64
.wParam
;
2930 return sizeof(RAWINPUTHEADER32
);
2934 set_last_error32( ERROR_INVALID_PARAMETER
);
2939 NTSTATUS WINAPI
wow64_NtUserGetRawInputDeviceInfo( UINT
*args
)
2941 HANDLE handle
= get_handle( &args
);
2942 UINT command
= get_ulong( &args
);
2943 void *data
= get_ptr( &args
);
2944 UINT
*data_size
= get_ptr( &args
);
2946 return NtUserGetRawInputDeviceInfo( handle
, command
, data
, data_size
);
2949 NTSTATUS WINAPI
wow64_NtUserGetRawInputDeviceList( UINT
*args
)
2951 RAWINPUTDEVICELIST32
*devices32
= get_ptr( &args
);
2952 UINT
*count
= get_ptr( &args
);
2953 UINT size
= get_ulong( &args
);
2955 if (size
!= sizeof(RAWINPUTDEVICELIST32
))
2957 set_last_error32( ERROR_INVALID_PARAMETER
);
2963 RAWINPUTDEVICELIST
*devices64
;
2964 unsigned int ret
, i
;
2966 if (!(devices64
= Wow64AllocateTemp( (*count
) * sizeof(*devices64
) )))
2968 set_last_error32( ERROR_NOT_ENOUGH_MEMORY
);
2972 ret
= NtUserGetRawInputDeviceList( devices64
, count
, sizeof(RAWINPUTDEVICELIST
) );
2973 if (ret
== ~0u) return ret
;
2975 for (i
= 0; i
< *count
; ++i
)
2977 devices32
[i
].hDevice
= (UINT_PTR
)devices64
[i
].hDevice
;
2978 devices32
[i
].dwType
= devices64
[i
].dwType
;
2984 return NtUserGetRawInputDeviceList( NULL
, count
, sizeof(RAWINPUTDEVICELIST
) );
2988 NTSTATUS WINAPI
wow64_NtUserRealChildWindowFromPoint( UINT
*args
)
2990 HWND parent
= get_handle( &args
);
2991 LONG x
= get_ulong( &args
);
2992 LONG y
= get_ulong( &args
);
2994 return HandleToUlong( NtUserRealChildWindowFromPoint( parent
, x
, y
));
2997 NTSTATUS WINAPI
wow64_NtUserRegisterClassExWOW( UINT
*args
)
2999 const WNDCLASSEXW32
*wc32
= get_ptr( &args
);
3000 UNICODE_STRING32
*name32
= get_ptr( &args
);
3001 UNICODE_STRING32
*version32
= get_ptr( &args
);
3002 struct client_menu_name32
*client_name32
= get_ptr( &args
);
3003 DWORD fnid
= get_ulong( &args
);
3004 DWORD flags
= get_ulong( &args
);
3005 DWORD
*wow
= get_ptr( &args
);
3007 struct client_menu_name client_name
;
3008 UNICODE_STRING name
, version
;
3011 if (wc32
->cbSize
!= sizeof(*wc32
))
3013 set_last_error32( ERROR_INVALID_PARAMETER
);
3017 wc
.cbSize
= sizeof(wc
);
3018 wc
.style
= wc32
->style
;
3019 wc
.lpfnWndProc
= UlongToPtr( wc32
->lpfnWndProc
);
3020 wc
.cbClsExtra
= wc32
->cbClsExtra
;
3021 wc
.cbWndExtra
= wc32
->cbWndExtra
;
3022 wc
.hInstance
= UlongToPtr( wc32
->hInstance
);
3023 wc
.hIcon
= LongToHandle( wc32
->hIcon
);
3024 wc
.hCursor
= LongToHandle( wc32
->hCursor
);
3025 wc
.hbrBackground
= UlongToHandle( wc32
->hbrBackground
);
3026 wc
.lpszMenuName
= UlongToPtr( wc32
->lpszMenuName
);
3027 wc
.lpszClassName
= UlongToPtr( wc32
->lpszClassName
);
3028 wc
.hIconSm
= LongToHandle( wc32
->hIconSm
);
3030 return NtUserRegisterClassExWOW( &wc
,
3031 unicode_str_32to64( &name
, name32
),
3032 unicode_str_32to64( &version
, version32
),
3033 client_menu_name_32to64( &client_name
, client_name32
),
3037 NTSTATUS WINAPI
wow64_NtUserGetRegisteredRawInputDevices( UINT
*args
)
3039 RAWINPUTDEVICE32
*devices32
= get_ptr( &args
);
3040 UINT
*count
= get_ptr( &args
);
3041 UINT size
= get_ulong( &args
);
3043 if (size
!= sizeof(RAWINPUTDEVICE32
))
3045 set_last_error32( ERROR_INVALID_PARAMETER
);
3051 RAWINPUTDEVICE
*devices64
;
3052 unsigned int ret
, i
;
3054 if (!(devices64
= Wow64AllocateTemp( (*count
) * sizeof(*devices64
) )))
3056 set_last_error32( ERROR_NOT_ENOUGH_MEMORY
);
3060 ret
= NtUserGetRegisteredRawInputDevices( devices64
, count
, sizeof(RAWINPUTDEVICE
) );
3061 if (ret
== ~0u) return ret
;
3063 for (i
= 0; i
< *count
; ++i
)
3065 devices32
[i
].usUsagePage
= devices64
[i
].usUsagePage
;
3066 devices32
[i
].usUsage
= devices64
[i
].usUsage
;
3067 devices32
[i
].dwFlags
= devices64
[i
].dwFlags
;
3068 devices32
[i
].hwndTarget
= (ULONG_PTR
)devices64
[i
].hwndTarget
;
3074 return NtUserGetRegisteredRawInputDevices( NULL
, count
, sizeof(RAWINPUTDEVICE
) );
3078 NTSTATUS WINAPI
wow64_NtUserGetScrollBarInfo( UINT
*args
)
3080 HWND hwnd
= get_handle( &args
);
3081 LONG id
= get_ulong( &args
);
3082 SCROLLBARINFO
*info
= get_ptr( &args
);
3084 return NtUserGetScrollBarInfo( hwnd
, id
, info
);
3087 NTSTATUS WINAPI
wow64_NtUserGetSystemDpiForProcess( UINT
*args
)
3089 HANDLE process
= get_handle( &args
);
3091 return NtUserGetSystemDpiForProcess( process
);
3094 NTSTATUS WINAPI
wow64_NtUserGetSystemMenu( UINT
*args
)
3096 HWND hwnd
= get_handle( &args
);
3097 BOOL revert
= get_ulong( &args
);
3099 return HandleToUlong( NtUserGetSystemMenu( hwnd
, revert
));
3102 NTSTATUS WINAPI
wow64_NtUserGetThreadDesktop( UINT
*args
)
3104 DWORD thread
= get_ulong( &args
);
3106 return HandleToUlong( NtUserGetThreadDesktop( thread
));
3109 NTSTATUS WINAPI
wow64_NtUserGetTitleBarInfo( UINT
*args
)
3111 HWND hwnd
= get_handle( &args
);
3112 TITLEBARINFO
*info
= get_ptr( &args
);
3114 return NtUserGetTitleBarInfo( hwnd
, info
);
3117 NTSTATUS WINAPI
wow64_NtUserGetUpdateRect( UINT
*args
)
3119 HWND hwnd
= get_handle( &args
);
3120 RECT
*rect
= get_ptr( &args
);
3121 BOOL erase
= get_ulong( &args
);
3123 return NtUserGetUpdateRect( hwnd
, rect
, erase
);
3126 NTSTATUS WINAPI
wow64_NtUserGetUpdateRgn( UINT
*args
)
3128 HWND hwnd
= get_handle( &args
);
3129 HRGN hrgn
= get_handle( &args
);
3130 BOOL erase
= get_ulong( &args
);
3132 return NtUserGetUpdateRgn( hwnd
, hrgn
, erase
);
3135 NTSTATUS WINAPI
wow64_NtUserGetUpdatedClipboardFormats( UINT
*args
)
3137 UINT
*formats
= get_ptr( &args
);
3138 UINT size
= get_ulong( &args
);
3139 UINT
*out_size
= get_ptr( &args
);
3141 return NtUserGetUpdatedClipboardFormats( formats
, size
, out_size
);
3144 NTSTATUS WINAPI
wow64_NtUserGetWindowDC( UINT
*args
)
3146 HWND hwnd
= get_handle( &args
);
3148 return HandleToUlong( NtUserGetWindowDC( hwnd
));
3151 NTSTATUS WINAPI
wow64_NtUserGetWindowPlacement( UINT
*args
)
3153 HWND hwnd
= get_handle( &args
);
3154 WINDOWPLACEMENT
*placement
= get_ptr( &args
);
3156 return NtUserGetWindowPlacement( hwnd
, placement
);
3159 NTSTATUS WINAPI
wow64_NtUserGetWindowRgnEx( UINT
*args
)
3161 HWND hwnd
= get_handle( &args
);
3162 HRGN hrgn
= get_handle( &args
);
3163 UINT unk
= get_ulong( &args
);
3165 return NtUserGetWindowRgnEx( hwnd
, hrgn
, unk
);
3168 NTSTATUS WINAPI
wow64_NtUserHideCaret( UINT
*args
)
3170 HWND hwnd
= get_handle( &args
);
3172 return NtUserHideCaret( hwnd
);
3175 NTSTATUS WINAPI
wow64_NtUserHiliteMenuItem( UINT
*args
)
3177 HWND hwnd
= get_handle( &args
);
3178 HMENU handle
= get_handle( &args
);
3179 UINT item
= get_ulong( &args
);
3180 UINT hilite
= get_ulong( &args
);
3182 return NtUserHiliteMenuItem( hwnd
, handle
, item
, hilite
);
3185 struct user_client_procs32
3187 ULONG pButtonWndProc
;
3188 ULONG pComboWndProc
;
3189 ULONG pDefWindowProc
;
3192 ULONG pListBoxWndProc
;
3193 ULONG pMDIClientWndProc
;
3194 ULONG pScrollBarWndProc
;
3195 ULONG pStaticWndProc
;
3197 ULONG pDesktopWndProc
;
3198 ULONG pIconTitleWndProc
;
3199 ULONG pPopupMenuWndProc
;
3200 ULONG pMessageWndProc
;
3203 static struct user_client_procs
*user_client_procs_32to64( struct user_client_procs
*procs
,
3204 const struct user_client_procs32
*procs32
)
3206 if (!procs32
) return NULL
;
3208 procs
->pButtonWndProc
= UlongToPtr( procs32
->pButtonWndProc
);
3209 procs
->pComboWndProc
= UlongToPtr( procs32
->pComboWndProc
);
3210 procs
->pDefWindowProc
= UlongToPtr( procs32
->pDefWindowProc
);
3211 procs
->pDefDlgProc
= UlongToPtr( procs32
->pDefDlgProc
);
3212 procs
->pEditWndProc
= UlongToPtr( procs32
->pEditWndProc
);
3213 procs
->pListBoxWndProc
= UlongToPtr( procs32
->pListBoxWndProc
);
3214 procs
->pMDIClientWndProc
= UlongToPtr( procs32
->pMDIClientWndProc
);
3215 procs
->pScrollBarWndProc
= UlongToPtr( procs32
->pScrollBarWndProc
);
3216 procs
->pStaticWndProc
= UlongToPtr( procs32
->pStaticWndProc
);
3217 procs
->pImeWndProc
= UlongToPtr( procs32
->pImeWndProc
);
3218 procs
->pDesktopWndProc
= UlongToPtr( procs32
->pDesktopWndProc
);
3219 procs
->pIconTitleWndProc
= UlongToPtr( procs32
->pIconTitleWndProc
);
3220 procs
->pPopupMenuWndProc
= UlongToPtr( procs32
->pPopupMenuWndProc
);
3221 procs
->pMessageWndProc
= UlongToPtr( procs32
->pMessageWndProc
);
3225 NTSTATUS WINAPI
wow64_NtUserInitializeClientPfnArrays( UINT
*args
)
3227 const struct user_client_procs32
*procsA32
= get_ptr( &args
);
3228 const struct user_client_procs32
*procsW32
= get_ptr( &args
);
3229 void *workers
= get_ptr( &args
);
3230 HINSTANCE user_module
= get_ptr( &args
);
3232 struct user_client_procs procsA
, procsW
;
3233 return NtUserInitializeClientPfnArrays( user_client_procs_32to64( &procsA
, procsA32
),
3234 user_client_procs_32to64( &procsW
, procsW32
),
3235 workers
, user_module
);
3238 NTSTATUS WINAPI
wow64_NtUserInternalGetWindowIcon( UINT
*args
)
3240 HWND hwnd
= get_handle( &args
);
3241 UINT type
= get_ulong( &args
);
3243 return HandleToUlong( NtUserInternalGetWindowIcon( hwnd
, type
));
3246 NTSTATUS WINAPI
wow64_NtUserInternalGetWindowText( UINT
*args
)
3248 HWND hwnd
= get_handle( &args
);
3249 WCHAR
*text
= get_ptr( &args
);
3250 INT count
= get_ulong( &args
);
3252 return NtUserInternalGetWindowText( hwnd
, text
, count
);
3255 NTSTATUS WINAPI
wow64_NtUserInvalidateRect( UINT
*args
)
3257 HWND hwnd
= get_handle( &args
);
3258 const RECT
*rect
= get_ptr( &args
);
3259 BOOL erase
= get_ulong( &args
);
3261 return NtUserInvalidateRect( hwnd
, rect
, erase
);
3264 NTSTATUS WINAPI
wow64_NtUserInvalidateRgn( UINT
*args
)
3266 HWND hwnd
= get_handle( &args
);
3267 HRGN hrgn
= get_handle( &args
);
3268 BOOL erase
= get_ulong( &args
);
3270 return NtUserInvalidateRgn( hwnd
, hrgn
, erase
);
3273 NTSTATUS WINAPI
wow64_NtUserIsClipboardFormatAvailable( UINT
*args
)
3275 UINT format
= get_ulong( &args
);
3277 return NtUserIsClipboardFormatAvailable( format
);
3280 NTSTATUS WINAPI
wow64_NtUserIsMouseInPointerEnabled( UINT
*args
)
3282 return NtUserIsMouseInPointerEnabled();
3285 NTSTATUS WINAPI
wow64_NtUserKillTimer( UINT
*args
)
3287 HWND hwnd
= get_handle( &args
);
3288 UINT_PTR id
= get_ulong( &args
);
3290 return NtUserKillTimer( hwnd
, id
);
3293 NTSTATUS WINAPI
wow64_NtUserLockWindowUpdate( UINT
*args
)
3295 HWND hwnd
= get_handle( &args
);
3297 return NtUserLockWindowUpdate( hwnd
);
3300 NTSTATUS WINAPI
wow64_NtUserLogicalToPerMonitorDPIPhysicalPoint( UINT
*args
)
3302 HWND hwnd
= get_handle( &args
);
3303 POINT
*pt
= get_ptr( &args
);
3305 return NtUserLogicalToPerMonitorDPIPhysicalPoint( hwnd
, pt
);
3308 NTSTATUS WINAPI
wow64_NtUserMapVirtualKeyEx( UINT
*args
)
3310 UINT code
= get_ulong( &args
);
3311 UINT type
= get_ulong( &args
);
3312 HKL layout
= get_handle( &args
);
3314 return NtUserMapVirtualKeyEx( code
, type
, layout
);
3317 NTSTATUS WINAPI
wow64_NtUserMenuItemFromPoint( UINT
*args
)
3319 HWND hwnd
= get_handle( &args
);
3320 HMENU handle
= get_handle( &args
);
3321 int x
= get_ulong( &args
);
3322 int y
= get_ulong( &args
);
3324 return NtUserMenuItemFromPoint( hwnd
, handle
, x
, y
);
3327 static LRESULT
message_call_32to64( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
,
3328 void *result_info
, DWORD type
, BOOL ansi
)
3338 CREATESTRUCT32
*cs32
= (void *)lparam
;
3341 createstruct_32to64( cs32
, &cs
);
3342 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&cs
, result_info
, type
, ansi
);
3343 cs32
->lpCreateParams
= PtrToUlong( cs
.lpCreateParams
);
3344 cs32
->hInstance
= PtrToUlong( cs
.hInstance
);
3345 cs32
->hMenu
= HandleToLong( cs
.hMenu
);
3346 cs32
->hwndParent
= HandleToLong( cs
.hwndParent
);
3351 cs32
->style
= cs
.style
;
3352 cs32
->dwExStyle
= cs
.dwExStyle
;
3355 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3359 MDICREATESTRUCT32
*cs32
= (void *)lparam
;
3360 MDICREATESTRUCTW cs
;
3362 cs
.szClass
= UlongToPtr( cs32
->szClass
);
3363 cs
.szTitle
= UlongToPtr( cs32
->szTitle
);
3364 cs
.hOwner
= LongToHandle( cs32
->hOwner
);
3369 cs
.style
= cs32
->style
;
3370 cs
.lParam
= cs32
->lParam
;
3372 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&cs
, result_info
, type
, ansi
);
3375 case WM_WINDOWPOSCHANGING
:
3376 case WM_WINDOWPOSCHANGED
:
3378 WINDOWPOS32
*winpos32
= (void *)lparam
;
3381 winpos_32to64( &winpos
, winpos32
);
3382 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&winpos
, result_info
, type
, ansi
);
3383 winpos_64to32( &winpos
, winpos32
);
3390 NCCALCSIZE_PARAMS32
*params32
= (void *)lparam
;
3391 NCCALCSIZE_PARAMS params
;
3394 params
.rgrc
[0] = params32
->rgrc
[0];
3395 params
.rgrc
[1] = params32
->rgrc
[1];
3396 params
.rgrc
[2] = params32
->rgrc
[2];
3397 params
.lppos
= &winpos
;
3398 winpos_32to64( &winpos
, UlongToPtr( params32
->lppos
));
3399 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)¶ms
, result_info
, type
, ansi
);
3400 params32
->rgrc
[0] = params
.rgrc
[0];
3401 params32
->rgrc
[1] = params
.rgrc
[1];
3402 params32
->rgrc
[2] = params
.rgrc
[2];
3403 winpos_64to32( &winpos
, UlongToPtr( params32
->lppos
));
3406 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3408 case WM_COMPAREITEM
:
3410 COMPAREITEMSTRUCT32
*cis32
= (void *)lparam
;
3411 COMPAREITEMSTRUCT cis
;
3413 cis
.CtlType
= cis32
->CtlType
;
3414 cis
.CtlID
= cis32
->CtlID
;
3415 cis
.hwndItem
= LongToHandle( cis32
->hwndItem
);
3416 cis
.itemID1
= cis32
->itemID1
;
3417 cis
.itemData1
= cis32
->itemData1
;
3418 cis
.itemID2
= cis32
->itemID2
;
3419 cis
.itemData2
= cis32
->itemData2
;
3420 cis
.dwLocaleId
= cis32
->dwLocaleId
;
3421 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&cis
, result_info
, type
, ansi
);
3426 DELETEITEMSTRUCT32
*dis32
= (void *)lparam
;
3427 DELETEITEMSTRUCT dis
;
3429 dis
.CtlType
= dis32
->CtlType
;
3430 dis
.CtlID
= dis32
->CtlID
;
3431 dis
.itemID
= dis32
->itemID
;
3432 dis
.hwndItem
= LongToHandle( dis32
->hwndItem
);
3433 dis
.itemData
= dis32
->itemData
;
3434 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&dis
, result_info
, type
, ansi
);
3437 case WM_MEASUREITEM
:
3439 MEASUREITEMSTRUCT32
*mis32
= (void *)lparam
;
3440 MEASUREITEMSTRUCT mis
;
3442 mis
.CtlType
= mis32
->CtlType
;
3443 mis
.CtlID
= mis32
->CtlID
;
3444 mis
.itemID
= mis32
->itemID
;
3445 mis
.itemWidth
= mis32
->itemWidth
;
3446 mis
.itemHeight
= mis32
->itemHeight
;
3447 mis
.itemData
= mis32
->itemData
;
3448 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&mis
, result_info
, type
, ansi
);
3449 mis32
->CtlType
= mis
.CtlType
;
3450 mis32
->CtlID
= mis
.CtlID
;
3451 mis32
->itemID
= mis
.itemID
;
3452 mis32
->itemWidth
= mis
.itemWidth
;
3453 mis32
->itemHeight
= mis
.itemHeight
;
3454 mis32
->itemData
= mis
.itemData
;
3460 DRAWITEMSTRUCT32
*dis32
= (void *)lparam
;
3463 dis
.CtlType
= dis32
->CtlType
;
3464 dis
.CtlID
= dis32
->CtlID
;
3465 dis
.itemID
= dis32
->itemID
;
3466 dis
.itemAction
= dis32
->itemAction
;
3467 dis
.itemState
= dis32
->itemState
;
3468 dis
.hwndItem
= LongToHandle( dis32
->hwndItem
);
3469 dis
.hDC
= LongToHandle( dis32
->hDC
);
3470 dis
.itemData
= dis32
->itemData
;
3471 dis
.rcItem
.left
= dis32
->rcItem
.left
;
3472 dis
.rcItem
.top
= dis32
->rcItem
.top
;
3473 dis
.rcItem
.right
= dis32
->rcItem
.right
;
3474 dis
.rcItem
.bottom
= dis32
->rcItem
.bottom
;
3475 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&dis
, result_info
, type
, ansi
);
3480 COPYDATASTRUCT32
*cds32
= (void *)lparam
;
3483 cds
.dwData
= cds32
->dwData
;
3484 cds
.cbData
= cds32
->cbData
;
3485 cds
.lpData
= UlongToPtr( cds32
->lpData
);
3486 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&cds
, result_info
, type
, ansi
);
3491 HELPINFO32
*hi32
= (void *)lparam
;
3494 hi64
.cbSize
= sizeof(hi64
);
3495 hi64
.iContextType
= hi32
->iContextType
;
3496 hi64
.iCtrlId
= hi32
->iCtrlId
;
3497 hi64
.hItemHandle
= LongToHandle( hi32
->hItemHandle
);
3498 hi64
.dwContextId
= hi32
->dwContextId
;
3499 hi64
.MousePos
= hi32
->MousePos
;
3500 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&hi64
, result_info
, type
, ansi
);
3506 MSG32
*msg32
= (MSG32
*)lparam
;
3509 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)msg_32to64( &msg64
, msg32
),
3510 result_info
, type
, ansi
);
3512 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3516 MDINEXTMENU32
*next32
= (void *)lparam
;
3519 next
.hmenuIn
= LongToHandle( next32
->hmenuIn
);
3520 next
.hmenuNext
= LongToHandle( next32
->hmenuNext
);
3521 next
.hwndNext
= LongToHandle( next32
->hwndNext
);
3522 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&next
, result_info
, type
, ansi
);
3523 next32
->hmenuIn
= HandleToLong( next
.hmenuIn
);
3524 next32
->hmenuNext
= HandleToLong( next
.hmenuNext
);
3525 next32
->hwndNext
= HandleToLong( next
.hwndNext
);
3529 case WM_PAINTCLIPBOARD
:
3533 paintstruct_32to64( &ps
, (PAINTSTRUCT32
*)lparam
);
3534 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&ps
, result_info
, type
, ansi
);
3537 case CB_GETCOMBOBOXINFO
:
3539 COMBOBOXINFO32
*ci32
= (COMBOBOXINFO32
*)lparam
;
3542 ci
.cbSize
= ci32
->cbSize
;
3543 ci
.rcItem
= ci32
->rcItem
;
3544 ci
.rcButton
= ci32
->rcButton
;
3545 ci
.stateButton
= ci32
->stateButton
;
3546 ci
.hwndCombo
= LongToHandle( ci32
->hwndCombo
);
3547 ci
.hwndItem
= LongToHandle( ci32
->hwndItem
);
3548 ci
.hwndList
= LongToHandle( ci32
->hwndList
);
3549 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&ci
, result_info
, type
, ansi
);
3550 ci32
->cbSize
= ci
.cbSize
;
3551 ci32
->rcItem
= ci
.rcItem
;
3552 ci32
->rcButton
= ci
.rcButton
;
3553 ci32
->stateButton
= ci
.stateButton
;
3554 ci32
->hwndCombo
= HandleToLong( ci
.hwndCombo
);
3555 ci32
->hwndItem
= HandleToLong( ci
.hwndItem
);
3556 ci32
->hwndList
= HandleToLong( ci
.hwndList
);
3561 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3565 NTSTATUS WINAPI
wow64_NtUserMessageCall( UINT
*args
)
3567 HWND hwnd
= get_handle( &args
);
3568 UINT msg
= get_ulong( &args
);
3569 LONG wparam
= get_ulong( &args
);
3570 LONG lparam
= get_ulong( &args
);
3571 void *result_info
= get_ptr( &args
);
3572 UINT type
= get_ulong ( &args
);
3573 BOOL ansi
= get_ulong( &args
);
3577 case NtUserGetDispatchParams
:
3578 case NtUserCallWindowProc
:
3580 struct win_proc_params32
*params32
= result_info
;
3581 struct win_proc_params params
;
3583 if (type
== NtUserCallWindowProc
) params
.func
= UlongToPtr( params32
->func
);
3585 if (!NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
))
3588 win_proc_params_64to32( ¶ms
, params32
);
3592 case NtUserSendMessage
:
3594 struct win_proc_params32
*params32
= result_info
;
3598 struct win_proc_params params
;
3602 ret
= message_call_32to64( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
);
3603 if (params
.hwnd
) win_proc_params_64to32( ¶ms
, params32
);
3607 return message_call_32to64( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3610 case NtUserSendMessageTimeout
:
3617 } *params32
= result_info
;
3618 struct send_message_timeout_params params
;
3621 params
.flags
= params32
->flags
;
3622 params
.timeout
= params32
->timeout
;
3623 ret
= message_call_32to64( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
);
3624 params32
->result
= params
.result
;
3628 case NtUserSendMessageCallback
:
3634 } *params32
= result_info
;
3635 struct send_message_callback_params params
;
3637 params
.callback
= UlongToPtr( params32
->callback
);
3638 params
.data
= params32
->data
;
3639 return message_call_32to64( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
);
3642 case NtUserSpyGetMsgName
:
3643 /* no argument conversion */
3644 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3646 case NtUserImeDriverCall
:
3653 } *params32
= result_info
;
3654 struct ime_driver_call_params params
;
3655 if (msg
== WINE_IME_POST_UPDATE
) ERR( "Unexpected WINE_IME_POST_UPDATE message\n" );
3656 params
.himc
= UlongToPtr( params32
->himc
);
3657 params
.state
= UlongToPtr( params32
->state
);
3658 params
.compstr
= UlongToPtr( params32
->compstr
);
3659 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
);
3662 case NtUserSystemTrayCall
:
3665 case WINE_SYSTRAY_NOTIFY_ICON
:
3673 UINT uCallbackMessage
;
3680 WCHAR szInfoTitle
[64];
3684 } *params32
= result_info
;
3686 NOTIFYICONDATAW params
= {.cbSize
= sizeof(params
)};
3687 params
.hWnd
= UlongToHandle( params32
->hWnd
);
3688 params
.uID
= params32
->uID
;
3689 params
.uFlags
= params32
->uFlags
;
3690 params
.uCallbackMessage
= params32
->uCallbackMessage
;
3691 params
.hIcon
= UlongToHandle( params32
->hIcon
);
3692 if (params
.uFlags
& NIF_TIP
) wcscpy( params
.szTip
, params32
->szTip
);
3693 params
.dwState
= params32
->dwState
;
3694 params
.dwStateMask
= params32
->dwStateMask
;
3696 if (params
.uFlags
& NIF_INFO
)
3698 wcscpy( params
.szInfoTitle
, params32
->szInfoTitle
);
3699 wcscpy( params
.szInfo
, params32
->szInfo
);
3700 params
.uTimeout
= params32
->uTimeout
;
3701 params
.dwInfoFlags
= params32
->dwInfoFlags
;
3704 params
.guidItem
= params32
->guidItem
;
3705 params
.hBalloonIcon
= UlongToHandle( params32
->hBalloonIcon
);
3707 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
);
3711 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3715 return message_call_32to64( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3718 NTSTATUS WINAPI
wow64_NtUserMoveWindow( UINT
*args
)
3720 HWND hwnd
= get_handle( &args
);
3721 INT x
= get_ulong( &args
);
3722 INT y
= get_ulong( &args
);
3723 INT cx
= get_ulong( &args
);
3724 INT cy
= get_ulong( &args
);
3725 BOOL repaint
= get_ulong( &args
);
3727 return NtUserMoveWindow( hwnd
, x
, y
, cx
, cy
, repaint
);
3730 NTSTATUS WINAPI
wow64_NtUserMsgWaitForMultipleObjectsEx( UINT
*args
)
3732 DWORD count
= get_ulong( &args
);
3733 const ULONG
*handles32
= get_ptr( &args
);
3734 DWORD timeout
= get_ulong( &args
);
3735 DWORD mask
= get_ulong( &args
);
3736 DWORD flags
= get_ulong( &args
);
3738 HANDLE handles
[MAXIMUM_WAIT_OBJECTS
];
3741 if (count
> ARRAYSIZE(handles
))
3743 set_last_error32( ERROR_INVALID_PARAMETER
);
3746 for (i
= 0; i
< count
; i
++) handles
[i
] = LongToHandle( handles32
[i
] );
3748 return NtUserMsgWaitForMultipleObjectsEx( count
, handles
, timeout
, mask
, flags
);
3751 NTSTATUS WINAPI
wow64_NtUserNotifyIMEStatus( UINT
*args
)
3753 HWND hwnd
= get_handle( &args
);
3754 ULONG status
= get_ulong( &args
);
3756 NtUserNotifyIMEStatus( hwnd
, status
);
3760 NTSTATUS WINAPI
wow64_NtUserNotifyWinEvent( UINT
*args
)
3762 DWORD event
= get_ulong( &args
);
3763 HWND hwnd
= get_handle( &args
);
3764 LONG object_id
= get_ulong( &args
);
3765 LONG child_id
= get_ulong( &args
);
3767 NtUserNotifyWinEvent( event
, hwnd
, object_id
, child_id
);
3771 NTSTATUS WINAPI
wow64_NtUserOpenClipboard( UINT
*args
)
3773 HWND hwnd
= get_handle( &args
);
3774 ULONG unk
= get_ulong( &args
);
3776 return NtUserOpenClipboard( hwnd
, unk
);
3779 NTSTATUS WINAPI
wow64_NtUserOpenDesktop( UINT
*args
)
3781 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
3782 DWORD flags
= get_ulong( &args
);
3783 ACCESS_MASK access
= get_ulong( &args
);
3785 struct object_attr64 attr
;
3788 ret
= NtUserOpenDesktop( objattr_32to64( &attr
, attr32
), flags
, access
);
3789 return HandleToUlong( ret
);
3792 NTSTATUS WINAPI
wow64_NtUserOpenInputDesktop( UINT
*args
)
3794 DWORD flags
= get_ulong( &args
);
3795 BOOL inherit
= get_ulong( &args
);
3796 ACCESS_MASK access
= get_ulong( &args
);
3798 return HandleToUlong( NtUserOpenInputDesktop( flags
, inherit
, access
));
3801 NTSTATUS WINAPI
wow64_NtUserOpenWindowStation( UINT
*args
)
3803 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
3804 ACCESS_MASK access
= get_ulong( &args
);
3806 struct object_attr64 attr
;
3808 return HandleToUlong( NtUserOpenWindowStation( objattr_32to64( &attr
, attr32
), access
));
3811 NTSTATUS WINAPI
wow64_NtUserPeekMessage( UINT
*args
)
3813 MSG32
*msg32
= get_ptr( &args
);
3814 HWND hwnd
= get_handle( &args
);
3815 UINT first
= get_ulong( &args
);
3816 UINT last
= get_ulong( &args
);
3817 UINT flags
= get_ulong( &args
);
3820 if (!NtUserPeekMessage( msg32
? &msg
: NULL
, hwnd
, first
, last
, flags
)) return FALSE
;
3821 msg_64to32( &msg
, msg32
);
3825 NTSTATUS WINAPI
wow64_NtUserPerMonitorDPIPhysicalToLogicalPoint( UINT
*args
)
3827 HWND hwnd
= get_handle( &args
);
3828 POINT
*pt
= get_ptr( &args
);
3830 return NtUserPerMonitorDPIPhysicalToLogicalPoint( hwnd
, pt
);
3833 NTSTATUS WINAPI
wow64_NtUserPostMessage( UINT
*args
)
3835 HWND hwnd
= get_handle( &args
);
3836 UINT msg
= get_ulong( &args
);
3837 WPARAM wparam
= get_ulong( &args
);
3838 LPARAM lparam
= get_ulong( &args
);
3840 return NtUserPostMessage( hwnd
, msg
, wparam
, lparam
);
3843 NTSTATUS WINAPI
wow64_NtUserPostThreadMessage( UINT
*args
)
3845 DWORD thread
= get_ulong( &args
);
3846 UINT msg
= get_ulong( &args
);
3847 WPARAM wparam
= get_ulong( &args
);
3848 LPARAM lparam
= get_ulong( &args
);
3850 return NtUserPostThreadMessage( thread
, msg
, wparam
, lparam
);
3853 NTSTATUS WINAPI
wow64_NtUserPrintWindow( UINT
*args
)
3855 HWND hwnd
= get_handle( &args
);
3856 HDC hdc
= get_handle( &args
);
3857 UINT flags
= get_ulong( &args
);
3859 return NtUserPrintWindow( hwnd
, hdc
, flags
);
3862 NTSTATUS WINAPI
wow64_NtUserQueryDisplayConfig( UINT
*args
)
3864 UINT32 flags
= get_ulong( &args
);
3865 UINT32
*paths_count
= get_ptr( &args
);
3866 DISPLAYCONFIG_PATH_INFO
*paths
= get_ptr( &args
);
3867 UINT32
*modes_count
= get_ptr( &args
);
3868 DISPLAYCONFIG_MODE_INFO
*modes
= get_ptr( &args
);
3869 DISPLAYCONFIG_TOPOLOGY_ID
*topology_id
= get_ptr( &args
);
3871 return NtUserQueryDisplayConfig( flags
, paths_count
, paths
, modes_count
, modes
, topology_id
);
3874 NTSTATUS WINAPI
wow64_NtUserQueryInputContext( UINT
*args
)
3876 HIMC handle
= get_handle( &args
);
3877 UINT attr
= get_ulong( &args
);
3879 return NtUserQueryInputContext( handle
, attr
);
3882 NTSTATUS WINAPI
wow64_NtUserRedrawWindow( UINT
*args
)
3884 HWND hwnd
= get_handle( &args
);
3885 const RECT
*rect
= get_ptr( &args
);
3886 HRGN hrgn
= get_handle( &args
);
3887 UINT flags
= get_ulong( &args
);
3889 return NtUserRedrawWindow( hwnd
, rect
, hrgn
, flags
);
3892 NTSTATUS WINAPI
wow64_NtUserRegisterHotKey( UINT
*args
)
3894 HWND hwnd
= get_handle( &args
);
3895 INT id
= get_ulong( &args
);
3896 UINT modifiers
= get_ulong( &args
);
3897 UINT vk
= get_ulong( &args
);
3899 return NtUserRegisterHotKey( hwnd
, id
, modifiers
, vk
);
3902 NTSTATUS WINAPI
wow64_NtUserRegisterRawInputDevices( UINT
*args
)
3904 const RAWINPUTDEVICE32
*devices32
= get_ptr( &args
);
3905 UINT count
= get_ulong( &args
);
3906 UINT size
= get_ulong( &args
);
3908 RAWINPUTDEVICE
*devices64
;
3911 if (size
!= sizeof(RAWINPUTDEVICE32
))
3913 set_last_error32( ERROR_INVALID_PARAMETER
);
3917 if (!(devices64
= Wow64AllocateTemp( count
* sizeof(*devices64
) )))
3919 set_last_error32( ERROR_NOT_ENOUGH_MEMORY
);
3923 for (i
= 0; i
< count
; ++i
)
3925 devices64
[i
].usUsagePage
= devices32
[i
].usUsagePage
;
3926 devices64
[i
].usUsage
= devices32
[i
].usUsage
;
3927 devices64
[i
].dwFlags
= devices32
[i
].dwFlags
;
3928 devices64
[i
].hwndTarget
= UlongToPtr( devices32
[i
].hwndTarget
);
3931 return NtUserRegisterRawInputDevices( devices64
, count
, sizeof(*devices64
) );
3934 NTSTATUS WINAPI
wow64_NtUserReleaseDC( UINT
*args
)
3936 HWND hwnd
= get_handle( &args
);
3937 HDC hdc
= get_handle( &args
);
3939 return NtUserReleaseDC( hwnd
, hdc
);
3942 NTSTATUS WINAPI
wow64_NtUserRemoveClipboardFormatListener( UINT
*args
)
3944 HWND hwnd
= get_handle( &args
);
3946 return NtUserRemoveClipboardFormatListener( hwnd
);
3949 NTSTATUS WINAPI
wow64_NtUserRemoveMenu( UINT
*args
)
3951 HMENU handle
= get_handle( &args
);
3952 UINT id
= get_ulong( &args
);
3953 UINT flags
= get_ulong( &args
);
3955 return NtUserRemoveMenu( handle
, id
, flags
);
3958 NTSTATUS WINAPI
wow64_NtUserRemoveProp( UINT
*args
)
3960 HWND hwnd
= get_handle( &args
);
3961 const WCHAR
*str
= get_ptr( &args
);
3963 return HandleToUlong( NtUserRemoveProp( hwnd
, str
));
3966 NTSTATUS WINAPI
wow64_NtUserScrollDC( UINT
*args
)
3968 HDC hdc
= get_handle( &args
);
3969 INT dx
= get_ulong( &args
);
3970 INT dy
= get_ulong( &args
);
3971 const RECT
*scroll
= get_ptr( &args
);
3972 const RECT
*clip
= get_ptr( &args
);
3973 HRGN ret_update_rgn
= get_handle( &args
);
3974 RECT
*update_rect
= get_ptr( &args
);
3976 return NtUserScrollDC( hdc
, dx
, dy
, scroll
, clip
, ret_update_rgn
, update_rect
);
3979 NTSTATUS WINAPI
wow64_NtUserScrollWindowEx( UINT
*args
)
3981 HWND hwnd
= get_handle( &args
);
3982 INT dx
= get_ulong( &args
);
3983 INT dy
= get_ulong( &args
);
3984 const RECT
*rect
= get_ptr( &args
);
3985 const RECT
*clip_rect
= get_ptr( &args
);
3986 HRGN update_rgn
= get_handle( &args
);
3987 RECT
*update_rect
= get_ptr( &args
);
3988 UINT flags
= get_ulong( &args
);
3990 return NtUserScrollWindowEx( hwnd
, dx
, dy
, rect
, clip_rect
, update_rgn
, update_rect
, flags
);
3993 NTSTATUS WINAPI
wow64_NtUserSelectPalette( UINT
*args
)
3995 HDC hdc
= get_handle( &args
);
3996 HPALETTE hpal
= get_handle( &args
);
3997 WORD bkg
= get_ulong( &args
);
3999 return HandleToUlong( NtUserSelectPalette( hdc
, hpal
, bkg
));
4002 NTSTATUS WINAPI
wow64_NtUserSendInput( UINT
*args
)
4004 UINT count
= get_ulong( &args
);
4005 INPUT32
*inputs32
= get_ptr( &args
);
4006 int size
= get_ulong( &args
);
4008 INPUT
*inputs
= NULL
;
4011 if (size
!= sizeof(*inputs32
) || !count
)
4013 set_last_error32( ERROR_INVALID_PARAMETER
);
4019 set_last_error32( ERROR_NOACCESS
);
4023 if (count
&& !(inputs
= Wow64AllocateTemp( count
* sizeof(*inputs
) )))
4026 for (i
= 0; i
< count
; i
++)
4028 inputs
[i
].type
= inputs32
[i
].type
;
4029 switch (inputs
[i
].type
)
4032 inputs
[i
].mi
.dx
= inputs32
[i
].mi
.dx
;
4033 inputs
[i
].mi
.dy
= inputs32
[i
].mi
.dy
;
4034 inputs
[i
].mi
.mouseData
= inputs32
[i
].mi
.mouseData
;
4035 inputs
[i
].mi
.dwFlags
= inputs32
[i
].mi
.dwFlags
;
4036 inputs
[i
].mi
.time
= inputs32
[i
].mi
.time
;
4037 inputs
[i
].mi
.dwExtraInfo
= inputs32
[i
].mi
.dwExtraInfo
;
4039 case INPUT_KEYBOARD
:
4040 inputs
[i
].ki
.wVk
= inputs32
[i
].ki
.wVk
;
4041 inputs
[i
].ki
.wScan
= inputs32
[i
].ki
.wScan
;
4042 inputs
[i
].ki
.dwFlags
= inputs32
[i
].ki
.dwFlags
;
4043 inputs
[i
].ki
.time
= inputs32
[i
].ki
.time
;
4044 inputs
[i
].ki
.dwExtraInfo
= inputs32
[i
].ki
.dwExtraInfo
;
4046 case INPUT_HARDWARE
:
4047 inputs
[i
].hi
= inputs32
[i
].hi
;
4052 return NtUserSendInput( count
, inputs
, sizeof(*inputs
) );
4055 NTSTATUS WINAPI
wow64_NtUserSetActiveWindow( UINT
*args
)
4057 HWND hwnd
= get_handle( &args
);
4059 return HandleToUlong( NtUserSetActiveWindow( hwnd
));
4062 NTSTATUS WINAPI
wow64_NtUserSetCapture( UINT
*args
)
4064 HWND hwnd
= get_handle( &args
);
4066 return HandleToUlong( NtUserSetCapture( hwnd
));
4069 NTSTATUS WINAPI
wow64_NtUserSetClassLong( UINT
*args
)
4071 HWND hwnd
= get_handle( &args
);
4072 INT offset
= get_ulong( &args
);
4073 LONG newval
= get_ulong( &args
);
4074 BOOL ansi
= get_ulong( &args
);
4076 return NtUserSetClassLong( hwnd
, offset
, newval
, ansi
);
4079 NTSTATUS WINAPI
wow64_NtUserSetClassLongPtr( UINT
*args
)
4081 HWND hwnd
= get_handle( &args
);
4082 INT offset
= get_ulong( &args
);
4083 LONG_PTR newval
= get_ulong( &args
);
4084 BOOL ansi
= get_ulong( &args
);
4086 if (offset
== GCLP_MENUNAME
)
4088 struct client_menu_name menu_name
;
4089 struct client_menu_name32
*menu_name32
= UlongToPtr( newval
);
4090 NtUserSetClassLongPtr( hwnd
, offset
,
4091 (UINT_PTR
)client_menu_name_32to64( &menu_name
, menu_name32
), ansi
);
4092 client_menu_name_64to32( &menu_name
, menu_name32
);
4096 return NtUserSetClassLongPtr( hwnd
, offset
, newval
, ansi
);
4099 NTSTATUS WINAPI
wow64_NtUserSetClassWord( UINT
*args
)
4101 HWND hwnd
= get_handle( &args
);
4102 INT offset
= get_ulong( &args
);
4103 WORD newval
= get_ulong( &args
);
4105 return NtUserSetClassWord( hwnd
, offset
, newval
);
4108 NTSTATUS WINAPI
wow64_NtUserSetClipboardData( UINT
*args
)
4110 UINT format
= get_ulong( &args
);
4111 HANDLE handle
= get_handle( &args
);
4118 } *params32
= get_ptr( &args
);
4120 struct set_clipboard_params params
;
4121 params
.data
= UlongToPtr( params32
->data
);
4122 params
.size
= params32
->size
;
4123 params
.cache_only
= params32
->cache_only
;
4124 params
.seqno
= params32
->seqno
;
4126 return NtUserSetClipboardData( format
, handle
, ¶ms
);
4129 NTSTATUS WINAPI
wow64_NtUserSetClipboardViewer( UINT
*args
)
4131 HWND hwnd
= get_handle( &args
);
4133 return HandleToUlong( NtUserSetClipboardViewer( hwnd
));
4136 NTSTATUS WINAPI
wow64_NtUserSetCursor( UINT
*args
)
4138 HCURSOR cursor
= get_handle( &args
);
4140 return HandleToUlong( NtUserSetCursor( cursor
));
4143 NTSTATUS WINAPI
wow64_NtUserSetCursorIconData( UINT
*args
)
4145 HCURSOR cursor
= get_handle( &args
);
4146 UNICODE_STRING32
*module32
= get_ptr( &args
);
4147 UNICODE_STRING32
*res_name32
= get_ptr( &args
);
4158 } *desc32
= get_ptr( &args
);
4167 } *frames32
= UlongToPtr( desc32
->frames
);
4169 UNICODE_STRING module
, res_name
;
4170 struct cursoricon_desc desc
;
4173 num_frames
= max( desc32
->num_frames
, 1 );
4174 if (!(desc
.frames
= Wow64AllocateTemp( num_frames
* sizeof(*desc
.frames
) ))) return FALSE
;
4175 desc
.flags
= desc32
->flags
;
4176 desc
.num_steps
= desc32
->num_steps
;
4177 desc
.num_frames
= desc32
->num_frames
;
4178 desc
.delay
= desc32
->delay
;
4179 desc
.frame_seq
= UlongToPtr( desc32
->frame_seq
);
4180 desc
.frame_rates
= UlongToPtr( desc32
->frame_rates
);
4181 desc
.rsrc
= UlongToPtr( desc32
->rsrc
);
4183 for (i
= 0; i
< num_frames
; i
++)
4185 desc
.frames
[i
].width
= frames32
[i
].width
;
4186 desc
.frames
[i
].height
= frames32
[i
].height
;
4187 desc
.frames
[i
].color
= UlongToHandle( frames32
[i
].color
);
4188 desc
.frames
[i
].alpha
= UlongToHandle( frames32
[i
].alpha
);
4189 desc
.frames
[i
].mask
= UlongToHandle( frames32
[i
].mask
);
4190 desc
.frames
[i
].hotspot
= frames32
[i
].hotspot
;
4193 return NtUserSetCursorIconData( cursor
, unicode_str_32to64( &module
, module32
),
4194 unicode_str_32to64( &res_name
, res_name32
), &desc
);
4197 NTSTATUS WINAPI
wow64_NtUserSetCursorPos( UINT
*args
)
4199 INT x
= get_ulong( &args
);
4200 INT y
= get_ulong( &args
);
4202 return NtUserSetCursorPos( x
, y
);
4205 NTSTATUS WINAPI
wow64_NtUserSetFocus( UINT
*args
)
4207 HWND hwnd
= get_handle( &args
);
4209 return HandleToUlong( NtUserSetFocus( hwnd
));
4212 NTSTATUS WINAPI
wow64_NtUserSetInternalWindowPos( UINT
*args
)
4214 HWND hwnd
= get_handle( &args
);
4215 UINT cmd
= get_ulong( &args
);
4216 RECT
*rect
= get_ptr( &args
);
4217 POINT
*pt
= get_ptr( &args
);
4219 NtUserSetInternalWindowPos( hwnd
, cmd
, rect
, pt
);
4223 NTSTATUS WINAPI
wow64_NtUserSetKeyboardState( UINT
*args
)
4225 BYTE
*state
= get_ptr( &args
);
4227 return NtUserSetKeyboardState( state
);
4230 NTSTATUS WINAPI
wow64_NtUserSetLayeredWindowAttributes( UINT
*args
)
4232 HWND hwnd
= get_handle( &args
);
4233 COLORREF key
= get_ulong( &args
);
4234 BYTE alpha
= get_ulong( &args
);
4235 DWORD flags
= get_ulong( &args
);
4237 return NtUserSetLayeredWindowAttributes( hwnd
, key
, alpha
, flags
);
4240 NTSTATUS WINAPI
wow64_NtUserSetMenu( UINT
*args
)
4242 HWND hwnd
= get_handle( &args
);
4243 HMENU menu
= get_handle( &args
);
4245 return NtUserSetMenu( hwnd
, menu
);
4248 NTSTATUS WINAPI
wow64_NtUserSetMenuContextHelpId( UINT
*args
)
4250 HMENU menu
= get_handle( &args
);
4251 DWORD id
= get_ulong( &args
);
4253 return NtUserSetMenuContextHelpId( menu
, id
);
4256 NTSTATUS WINAPI
wow64_NtUserSetMenuDefaultItem( UINT
*args
)
4258 HMENU handle
= get_handle( &args
);
4259 UINT item
= get_ulong( &args
);
4260 UINT bypos
= get_ulong( &args
);
4262 return NtUserSetMenuDefaultItem( handle
, item
, bypos
);
4265 NTSTATUS WINAPI
wow64_NtUserSetObjectInformation( UINT
*args
)
4267 HANDLE handle
= get_handle( &args
);
4268 INT index
= get_ulong( &args
);
4269 void *info
= get_ptr( &args
);
4270 DWORD len
= get_ulong( &args
);
4272 return NtUserSetObjectInformation( handle
, index
, info
, len
);
4275 NTSTATUS WINAPI
wow64_NtUserSetParent( UINT
*args
)
4277 HWND hwnd
= get_handle( &args
);
4278 HWND parent
= get_handle( &args
);
4280 return HandleToUlong( NtUserSetParent( hwnd
, parent
));
4283 NTSTATUS WINAPI
wow64_NtUserSetProcessDpiAwarenessContext( UINT
*args
)
4285 ULONG awareness
= get_ulong( &args
);
4286 ULONG unknown
= get_ulong( &args
);
4288 return NtUserSetProcessDpiAwarenessContext( awareness
, unknown
);
4291 NTSTATUS WINAPI
wow64_NtUserSetProcessWindowStation( UINT
*args
)
4293 HWINSTA handle
= get_handle( &args
);
4295 return NtUserSetProcessWindowStation( handle
);
4298 NTSTATUS WINAPI
wow64_NtUserSetProp( UINT
*args
)
4300 HWND hwnd
= get_handle( &args
);
4301 const WCHAR
*str
= get_ptr( &args
);
4302 HANDLE handle
= get_handle( &args
);
4304 return NtUserSetProp( hwnd
, str
, handle
);
4307 NTSTATUS WINAPI
wow64_NtUserSetScrollInfo( UINT
*args
)
4309 HWND hwnd
= get_handle( &args
);
4310 INT bar
= get_ulong( &args
);
4311 const SCROLLINFO
*info
= get_ptr( &args
);
4312 BOOL redraw
= get_ulong( &args
);
4314 return NtUserSetScrollInfo( hwnd
, bar
, info
, redraw
);
4317 NTSTATUS WINAPI
wow64_NtUserSetShellWindowEx( UINT
*args
)
4319 HWND shell
= get_handle( &args
);
4320 HWND list_view
= get_handle( &args
);
4322 return NtUserSetShellWindowEx( shell
, list_view
);
4325 NTSTATUS WINAPI
wow64_NtUserSetSysColors( UINT
*args
)
4327 INT count
= get_ulong( &args
);
4328 const INT
*colors
= get_ptr( &args
);
4329 const COLORREF
*values
= get_ptr( &args
);
4331 return NtUserSetSysColors( count
, colors
, values
);
4334 NTSTATUS WINAPI
wow64_NtUserSetSystemMenu( UINT
*args
)
4336 HWND hwnd
= get_handle( &args
);
4337 HMENU menu
= get_handle( &args
);
4339 return NtUserSetSystemMenu( hwnd
, menu
);
4342 NTSTATUS WINAPI
wow64_NtUserSetSystemTimer( UINT
*args
)
4344 HWND hwnd
= get_handle( &args
);
4345 UINT_PTR id
= get_ulong( &args
);
4346 UINT timeout
= get_ulong( &args
);
4348 return NtUserSetSystemTimer( hwnd
, id
, timeout
);
4351 NTSTATUS WINAPI
wow64_NtUserSetThreadDesktop( UINT
*args
)
4353 HDESK handle
= get_handle( &args
);
4355 return NtUserSetThreadDesktop( handle
);
4358 NTSTATUS WINAPI
wow64_NtUserSetTimer( UINT
*args
)
4360 HWND hwnd
= get_handle( &args
);
4361 UINT_PTR id
= get_ulong( &args
);
4362 UINT timeout
= get_ulong( &args
);
4363 TIMERPROC proc
= get_ptr( &args
);
4364 ULONG tolerance
= get_ulong( &args
);
4366 return NtUserSetTimer( hwnd
, id
, timeout
, proc
, tolerance
);
4369 NTSTATUS WINAPI
wow64_NtUserSetWinEventHook( UINT
*args
)
4371 DWORD event_min
= get_ulong( &args
);
4372 DWORD event_max
= get_ulong( &args
);
4373 HMODULE inst
= get_ptr( &args
);
4374 UNICODE_STRING32
*module32
= get_ptr( &args
);
4375 WINEVENTPROC proc
= get_ptr(&args
);
4376 DWORD pid
= get_ulong( &args
);
4377 DWORD tid
= get_ulong( &args
);
4378 DWORD flags
= get_ulong( &args
);
4379 UNICODE_STRING module
;
4382 ret
= NtUserSetWinEventHook( event_min
, event_max
, inst
,
4383 unicode_str_32to64( &module
, module32
),
4384 proc
, pid
, tid
, flags
);
4385 return HandleToUlong( ret
);
4388 NTSTATUS WINAPI
wow64_NtUserSetWindowLong( UINT
*args
)
4390 HWND hwnd
= get_handle( &args
);
4391 INT offset
= get_ulong( &args
);
4392 LONG newval
= get_ulong( &args
);
4393 BOOL ansi
= get_ulong( &args
);
4397 case GWLP_HINSTANCE
:
4399 return NtUserSetWindowLongPtr( hwnd
, offset
, (ULONG
)newval
, ansi
);
4402 return NtUserSetWindowLong( hwnd
, offset
, newval
, ansi
);
4405 NTSTATUS WINAPI
wow64_NtUserSetWindowLongPtr( UINT
*args
)
4407 HWND hwnd
= get_handle( &args
);
4408 INT offset
= get_ulong( &args
);
4409 LONG_PTR newval
= get_ulong( &args
);
4410 BOOL ansi
= get_ulong( &args
);
4412 return NtUserSetWindowLongPtr( hwnd
, offset
, newval
, ansi
);
4415 NTSTATUS WINAPI
wow64_NtUserSetWindowPlacement( UINT
*args
)
4417 HWND hwnd
= get_handle( &args
);
4418 const WINDOWPLACEMENT
*wpl
= get_ptr( &args
);
4420 return NtUserSetWindowPlacement( hwnd
, wpl
);
4423 NTSTATUS WINAPI
wow64_NtUserSetWindowPos( UINT
*args
)
4425 HWND hwnd
= get_handle( &args
);
4426 HWND after
= get_handle( &args
);
4427 INT x
= get_ulong( &args
);
4428 INT y
= get_ulong( &args
);
4429 INT cx
= get_ulong( &args
);
4430 INT cy
= get_ulong( &args
);
4431 UINT flags
= get_ulong( &args
);
4433 return NtUserSetWindowPos( hwnd
, after
, x
, y
, cx
, cy
, flags
);
4436 NTSTATUS WINAPI
wow64_NtUserSetWindowRgn( UINT
*args
)
4438 HWND hwnd
= get_handle( &args
);
4439 HRGN hrgn
= get_handle( &args
);
4440 BOOL redraw
= get_ulong( &args
);
4442 return NtUserSetWindowRgn( hwnd
, hrgn
, redraw
);
4445 NTSTATUS WINAPI
wow64_NtUserSetWindowWord( UINT
*args
)
4447 HWND hwnd
= get_handle( &args
);
4448 INT offset
= get_ulong( &args
);
4449 WORD newval
= get_ulong( &args
);
4451 return NtUserSetWindowWord( hwnd
, offset
, newval
);
4454 NTSTATUS WINAPI
wow64_NtUserSetWindowsHookEx( UINT
*args
)
4456 HINSTANCE inst
= get_ptr( &args
);
4457 UNICODE_STRING32
*module32
= get_ptr( &args
);
4458 DWORD tid
= get_ulong( &args
);
4459 INT id
= get_ulong( &args
);
4460 HOOKPROC proc
= get_ptr( &args
);
4461 BOOL ansi
= get_ulong( &args
);
4462 UNICODE_STRING module
;
4465 ret
= NtUserSetWindowsHookEx( inst
, unicode_str_32to64( &module
, module32
),
4466 tid
, id
, proc
, ansi
);
4467 return HandleToUlong( ret
);
4470 NTSTATUS WINAPI
wow64_NtUserShowCaret( UINT
*args
)
4472 HWND hwnd
= get_handle( &args
);
4474 return NtUserShowCaret( hwnd
);
4477 NTSTATUS WINAPI
wow64_NtUserShowCursor( UINT
*args
)
4479 BOOL show
= get_ulong( &args
);
4481 return NtUserShowCursor( show
);
4484 NTSTATUS WINAPI
wow64_NtUserShowScrollBar( UINT
*args
)
4486 HWND hwnd
= get_handle( &args
);
4487 INT bar
= get_ulong( &args
);
4488 BOOL show
= get_ulong( &args
);
4490 return NtUserShowScrollBar( hwnd
, bar
, show
);
4493 NTSTATUS WINAPI
wow64_NtUserShowWindow( UINT
*args
)
4495 HWND hwnd
= get_handle( &args
);
4496 INT cmd
= get_ulong( &args
);
4498 return NtUserShowWindow( hwnd
, cmd
);
4501 NTSTATUS WINAPI
wow64_NtUserShowWindowAsync( UINT
*args
)
4503 HWND hwnd
= get_handle( &args
);
4504 INT cmd
= get_ulong( &args
);
4506 return NtUserShowWindowAsync( hwnd
, cmd
);
4509 NTSTATUS WINAPI
wow64_NtUserSwitchDesktop( UINT
*args
)
4511 HDESK handle
= get_handle( &args
);
4513 return NtUserSwitchDesktop( handle
);
4516 NTSTATUS WINAPI
wow64_NtUserSystemParametersInfo( UINT
*args
)
4518 UINT action
= get_ulong( &args
);
4519 UINT val
= get_ulong( &args
);
4520 void *ptr
= get_ptr( &args
);
4521 UINT winini
= get_ulong( &args
);
4525 case SPI_GETSERIALKEYS
:
4532 ULONG lpszActivePort
;
4540 if (keys32
->cbSize
!= sizeof(*keys32
)) return FALSE
;
4541 keys
.cbSize
= sizeof(keys
);
4542 if (!NtUserSystemParametersInfo( action
, val
, &keys
, winini
)) return FALSE
;
4543 keys32
->dwFlags
= keys
.dwFlags
;
4544 keys32
->lpszActivePort
= PtrToUlong( keys
.lpszActivePort
);
4545 keys32
->lpszPort
= PtrToUlong( keys
.lpszPort
);
4546 keys32
->iBaudRate
= keys
.iBaudRate
;
4547 keys32
->iPortState
= keys
.iPortState
;
4548 keys32
->iActive
= keys
.iActive
;
4553 case SPI_GETSOUNDSENTRY
:
4560 DWORD iFSTextEffect
;
4561 DWORD iFSTextEffectMSec
;
4562 DWORD iFSTextEffectColorBits
;
4563 DWORD iFSGrafEffect
;
4564 DWORD iFSGrafEffectMSec
;
4565 DWORD iFSGrafEffectColor
;
4566 DWORD iWindowsEffect
;
4567 DWORD iWindowsEffectMSec
;
4568 ULONG lpszWindowsEffectDLL
;
4569 DWORD iWindowsEffectOrdinal
;
4573 if (entry32
->cbSize
!= sizeof(*entry32
)) return FALSE
;
4574 entry
.cbSize
= sizeof(entry
);
4575 if (!NtUserSystemParametersInfo( action
, val
, &entry
, winini
)) return FALSE
;
4576 entry32
->dwFlags
= entry
.dwFlags
;
4577 entry32
->iFSTextEffect
= entry
.iFSTextEffect
;
4578 entry32
->iFSTextEffectMSec
= entry
.iFSTextEffectMSec
;
4579 entry32
->iFSTextEffectColorBits
= entry
.iFSTextEffectColorBits
;
4580 entry32
->iFSGrafEffect
= entry
.iFSGrafEffect
;
4581 entry32
->iFSGrafEffectMSec
= entry
.iFSGrafEffectMSec
;
4582 entry32
->iFSGrafEffectColor
= entry
.iFSGrafEffectColor
;
4583 entry32
->iWindowsEffect
= entry
.iWindowsEffect
;
4584 entry32
->iWindowsEffectMSec
= entry
.iWindowsEffectMSec
;
4585 entry32
->lpszWindowsEffectDLL
= PtrToUlong( entry
.lpszWindowsEffectDLL
);
4586 entry32
->iWindowsEffectOrdinal
= entry
.iWindowsEffectOrdinal
;
4591 case SPI_GETHIGHCONTRAST
:
4598 ULONG lpszDefaultScheme
;
4602 if (info32
->cbSize
!= sizeof(*info32
)) return FALSE
;
4603 info
.cbSize
= sizeof(info
);
4604 if (!NtUserSystemParametersInfo( action
, val
, &info
, winini
)) return FALSE
;
4605 info32
->dwFlags
= info
.dwFlags
;
4606 info32
->lpszDefaultScheme
= PtrToUlong( info
.lpszDefaultScheme
);
4612 return NtUserSystemParametersInfo( action
, val
, ptr
, winini
);
4615 NTSTATUS WINAPI
wow64_NtUserSystemParametersInfoForDpi( UINT
*args
)
4617 UINT action
= get_ulong( &args
);
4618 UINT val
= get_ulong( &args
);
4619 void *ptr
= get_ptr( &args
);
4620 UINT winini
= get_ulong( &args
);
4621 UINT dpi
= get_ulong( &args
);
4623 return NtUserSystemParametersInfoForDpi( action
, val
, ptr
, winini
, dpi
);
4626 NTSTATUS WINAPI
wow64_NtUserThunkedMenuInfo( UINT
*args
)
4628 HMENU menu
= get_handle( &args
);
4629 MENUINFO32
*info32
= get_ptr( &args
);
4634 info
.cbSize
= sizeof(info
);
4635 info
.fMask
= info32
->fMask
;
4636 info
.dwStyle
= info32
->dwStyle
;
4637 info
.cyMax
= info32
->cyMax
;
4638 info
.hbrBack
= UlongToHandle( info32
->hbrBack
);
4639 info
.dwContextHelpID
= info32
->dwContextHelpID
;
4640 info
.dwMenuData
= info32
->dwMenuData
;
4643 return NtUserThunkedMenuInfo( menu
, info32
? &info
: NULL
);
4646 NTSTATUS WINAPI
wow64_NtUserThunkedMenuItemInfo( UINT
*args
)
4648 HMENU handle
= get_handle( &args
);
4649 UINT pos
= get_ulong( &args
);
4650 UINT flags
= get_ulong( &args
);
4651 UINT method
= get_ulong( &args
);
4652 MENUITEMINFOW32
*info32
= get_ptr( &args
);
4653 UNICODE_STRING32
*str32
= get_ptr( &args
);
4654 MENUITEMINFOW info
= { sizeof(info
) }, *info_ptr
;
4660 info
.cbSize
= sizeof(info
);
4661 info
.fMask
= info32
->fMask
;
4664 case NtUserSetMenuItemInfo
:
4665 case NtUserInsertMenuItem
:
4666 info
.fType
= info32
->fType
;
4667 info
.fState
= info32
->fState
;
4668 info
.wID
= info32
->wID
;
4669 info
.hSubMenu
= LongToHandle( info32
->hSubMenu
);
4670 info
.hbmpChecked
= UlongToHandle( info32
->hbmpChecked
);
4671 info
.hbmpUnchecked
= UlongToHandle( info32
->hbmpUnchecked
);
4672 info
.dwItemData
= info32
->dwItemData
;
4673 info
.dwTypeData
= UlongToPtr( info32
->dwTypeData
);
4674 info
.cch
= info32
->cch
;
4675 info
.hbmpItem
= UlongToHandle( info32
->hbmpItem
);
4677 case NtUserCheckMenuRadioItem
:
4678 info
.cch
= info32
->cch
;
4680 case NtUserGetMenuItemInfoA
:
4681 case NtUserGetMenuItemInfoW
:
4682 info
.dwTypeData
= UlongToPtr( info32
->dwTypeData
);
4683 info
.cch
= info32
->cch
;
4688 else info_ptr
= NULL
;
4690 ret
= NtUserThunkedMenuItemInfo( handle
, pos
, flags
, method
, info_ptr
,
4691 unicode_str_32to64( &str
, str32
));
4697 case NtUserGetMenuItemInfoA
:
4698 case NtUserGetMenuItemInfoW
:
4699 if (info
.fMask
& (MIIM_TYPE
| MIIM_STRING
| MIIM_FTYPE
))
4700 info32
->fType
= info
.fType
;
4701 if (info
.fMask
& (MIIM_TYPE
| MIIM_BITMAP
))
4702 info32
->hbmpItem
= HandleToUlong( info
.hbmpItem
);
4703 if (info
.fMask
& (MIIM_TYPE
| MIIM_STRING
))
4705 info32
->dwTypeData
= (UINT_PTR
)info
.dwTypeData
;
4706 info32
->cch
= info
.cch
;
4708 if (info
.fMask
& MIIM_STATE
) info32
->fState
= info
.fState
;
4709 if (info
.fMask
& MIIM_ID
) info32
->wID
= info
.wID
;
4710 info32
->hSubMenu
= HandleToUlong( info
.hSubMenu
);
4711 if (info
.fMask
& MIIM_CHECKMARKS
)
4713 info32
->hbmpChecked
= HandleToUlong( info
.hbmpChecked
);
4714 info32
->hbmpUnchecked
= HandleToUlong( info
.hbmpUnchecked
);
4716 if (info
.fMask
& MIIM_DATA
) info32
->dwItemData
= info
.dwItemData
;
4724 NTSTATUS WINAPI
wow64_NtUserToUnicodeEx( UINT
*args
)
4726 UINT virt
= get_ulong( &args
);
4727 UINT scan
= get_ulong( &args
);
4728 const BYTE
*state
= get_ptr( &args
);
4729 WCHAR
*str
= get_ptr( &args
);
4730 int size
= get_ulong( &args
);
4731 UINT flags
= get_ulong( &args
);
4732 HKL layout
= get_handle( &args
);
4734 return NtUserToUnicodeEx( virt
, scan
, state
, str
, size
, flags
, layout
);
4737 NTSTATUS WINAPI
wow64_NtUserTrackMouseEvent( UINT
*args
)
4745 } *info32
= get_ptr( &args
);
4746 TRACKMOUSEEVENT info
;
4749 if (info32
->cbSize
!= sizeof(*info32
))
4751 set_last_error32( ERROR_INVALID_PARAMETER
);
4755 info
.cbSize
= sizeof(info
);
4756 info
.dwFlags
= info32
->dwFlags
;
4757 info
.hwndTrack
= LongToHandle( info32
->hwndTrack
);
4758 info
.dwHoverTime
= info32
->dwHoverTime
;
4759 ret
= NtUserTrackMouseEvent( &info
);
4760 info32
->dwFlags
= info
.dwFlags
;
4761 info32
->hwndTrack
= HandleToUlong( info
.hwndTrack
);
4762 info32
->dwHoverTime
= info
.dwHoverTime
;
4766 NTSTATUS WINAPI
wow64_NtUserTrackPopupMenuEx( UINT
*args
)
4768 HMENU handle
= get_handle( &args
);
4769 UINT flags
= get_ulong( &args
);
4770 int x
= get_ulong( &args
);
4771 int y
= get_ulong( &args
);
4772 HWND hwnd
= get_handle( &args
);
4773 TPMPARAMS
*params
= get_ptr( &args
);
4775 return NtUserTrackPopupMenuEx( handle
, flags
, x
, y
, hwnd
, params
);
4778 NTSTATUS WINAPI
wow64_NtUserTranslateAccelerator( UINT
*args
)
4780 HWND hwnd
= get_handle( &args
);
4781 HACCEL accel
= get_handle( &args
);
4782 MSG32
*msg32
= get_ptr( &args
);
4786 return NtUserTranslateAccelerator( hwnd
, accel
, msg_32to64( &msg
, msg32
));
4789 NTSTATUS WINAPI
wow64_NtUserTranslateMessage( UINT
*args
)
4791 const MSG32
*msg32
= get_ptr( &args
);
4792 UINT flags
= get_ulong( &args
);
4795 return NtUserTranslateMessage( msg_32to64( &msg
, msg32
), flags
);
4798 NTSTATUS WINAPI
wow64_NtUserUnhookWinEvent( UINT
*args
)
4800 HWINEVENTHOOK handle
= get_handle( &args
);
4802 return NtUserUnhookWinEvent( handle
);
4805 NTSTATUS WINAPI
wow64_NtUserUnhookWindowsHookEx( UINT
*args
)
4807 HHOOK handle
= get_handle( &args
);
4809 return NtUserUnhookWindowsHookEx( handle
);
4812 NTSTATUS WINAPI
wow64_NtUserUnregisterClass( UINT
*args
)
4814 UNICODE_STRING32
*name32
= get_ptr( &args
);
4815 HINSTANCE instance
= get_ptr( &args
);
4816 struct client_menu_name32
*menu_name32
= get_ptr( &args
);
4818 UNICODE_STRING name
;
4819 struct client_menu_name menu_name
;
4822 ret
= NtUserUnregisterClass( unicode_str_32to64( &name
, name32
), instance
, &menu_name
);
4823 if (ret
) client_menu_name_64to32( &menu_name
, menu_name32
);
4827 NTSTATUS WINAPI
wow64_NtUserUnregisterHotKey( UINT
*args
)
4829 HWND hwnd
= get_handle( &args
);
4830 int id
= get_ulong( &args
);
4832 return NtUserUnregisterHotKey( hwnd
, id
);
4835 NTSTATUS WINAPI
wow64_NtUserUpdateInputContext( UINT
*args
)
4837 HIMC handle
= get_handle( &args
);
4838 UINT attr
= get_ulong( &args
);
4839 UINT_PTR value
= get_ulong( &args
);
4841 return NtUserUpdateInputContext( handle
, attr
, value
);
4844 NTSTATUS WINAPI
wow64_NtUserUpdateLayeredWindow( UINT
*args
)
4846 HWND hwnd
= get_handle( &args
);
4847 HDC hdc_dst
= get_handle( &args
);
4848 const POINT
*pts_dst
= get_ptr( &args
);
4849 const SIZE
*size
= get_ptr( &args
);
4850 HDC hdc_src
= get_handle( &args
);
4851 const POINT
*pts_src
= get_ptr( &args
);
4852 COLORREF key
= get_ulong( &args
);
4853 const BLENDFUNCTION
*blend
= get_ptr( &args
);
4854 DWORD flags
= get_ulong( &args
);
4855 const RECT
*dirty
= get_ptr( &args
);
4857 return NtUserUpdateLayeredWindow( hwnd
, hdc_dst
, pts_dst
, size
, hdc_src
, pts_src
,
4858 key
, blend
, flags
, dirty
);
4861 NTSTATUS WINAPI
wow64_NtUserValidateRect( UINT
*args
)
4863 HWND hwnd
= get_handle( &args
);
4864 const RECT
*rect
= get_ptr( &args
);
4866 return NtUserValidateRect( hwnd
, rect
);
4869 NTSTATUS WINAPI
wow64_NtUserVkKeyScanEx( UINT
*args
)
4871 WCHAR chr
= get_ulong( &args
);
4872 HKL layout
= get_handle( &args
);
4874 return NtUserVkKeyScanEx( chr
, layout
);
4877 NTSTATUS WINAPI
wow64_NtUserWaitForInputIdle( UINT
*args
)
4879 HANDLE process
= get_handle( &args
);
4880 DWORD timeout
= get_ulong( &args
);
4881 BOOL wow
= get_ulong( &args
);
4883 return NtUserWaitForInputIdle( process
, timeout
, wow
);
4886 NTSTATUS WINAPI
wow64_NtUserWaitMessage( UINT
*args
)
4888 return NtUserWaitMessage();
4891 NTSTATUS WINAPI
wow64_NtUserWindowFromDC( UINT
*args
)
4893 HDC hdc
= get_handle( &args
);
4895 return HandleToUlong( NtUserWindowFromDC( hdc
));
4898 NTSTATUS WINAPI
wow64_NtUserWindowFromPoint( UINT
*args
)
4900 LONG x
= get_ulong( &args
);
4901 LONG y
= get_ulong( &args
);
4903 return HandleToUlong( NtUserWindowFromPoint( x
, y
));
4906 NTSTATUS WINAPI
wow64_NtUserDisplayConfigGetDeviceInfo( UINT
*args
)
4908 DISPLAYCONFIG_DEVICE_INFO_HEADER
*packet
= get_ptr( &args
);
4910 return NtUserDisplayConfigGetDeviceInfo( packet
);