4 * Copyright 2021 Jacek Caban for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #define WIN32_NO_STATUS
28 #include "wow64win_private.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(wow
);
40 DWORD dwContextHelpID
;
90 } RAWINPUTDEVICELIST32
;
137 BYTE rgbReserved
[32];
142 ULONG lpCreateParams
;
188 ULONG hwndInsertAfter
;
200 } NCCALCSIZE_PARAMS32
;
212 } COMPAREITEMSTRUCT32
;
239 } MEASUREITEMSTRUCT32
;
280 } MOUSEHOOKSTRUCTEX32
;
313 } CBTACTIVATESTRUCT32
;
322 } DELETEITEMSTRUCT32
;
340 struct client_menu_name32
347 struct win_proc_params32
356 enum wm_char_mapping mapping
;
362 struct win_hook_params32
377 struct win_event_hook_params32
387 WCHAR module
[MAX_PATH
];
390 struct draw_text_params32
399 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_awareness
= HandleToUlong( src
->dpi_awareness
);
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
);
857 const NCCALCSIZE_PARAMS32
*ncp32
= params32
;
858 NCCALCSIZE_PARAMS
*ncp64
= params64
;
860 ncp64
->rgrc
[0] = ncp32
->rgrc
[0];
861 ncp64
->rgrc
[1] = ncp32
->rgrc
[1];
862 ncp64
->rgrc
[2] = ncp32
->rgrc
[2];
863 winpos_32to64( (WINDOWPOS
*)(ncp64
+ 1), (const WINDOWPOS32
*)(ncp32
+ 1) );
864 return sizeof(*ncp64
) + sizeof(WINDOWPOS
);
870 const MEASUREITEMSTRUCT32
*mis32
= params32
;
871 MEASUREITEMSTRUCT
*mis64
= params64
;
873 mis64
->CtlType
= mis32
->CtlType
;
874 mis64
->CtlID
= mis32
->CtlID
;
875 mis64
->itemID
= mis32
->itemID
;
876 mis64
->itemWidth
= mis32
->itemWidth
;
877 mis64
->itemHeight
= mis32
->itemHeight
;
878 mis64
->itemData
= mis32
->itemData
;
879 return sizeof(*mis64
);
882 case WM_WINDOWPOSCHANGING
:
883 case WM_WINDOWPOSCHANGED
:
884 winpos_32to64( params64
, params32
);
885 return sizeof(WINDOWPOS
);
889 const MDINEXTMENU32
*next32
= params32
;
890 MDINEXTMENU
*next64
= params64
;
892 next64
->hmenuIn
= LongToHandle( next32
->hmenuIn
);
893 next64
->hmenuNext
= LongToHandle( next32
->hmenuNext
);
894 next64
->hwndNext
= LongToHandle( next32
->hwndNext
);
895 return sizeof(*next64
);
898 case CB_GETCOMBOBOXINFO
:
900 const COMBOBOXINFO32
*ci32
= params32
;
901 COMBOBOXINFO
*ci64
= params64
;
903 ci64
->cbSize
= sizeof(*ci32
);
904 ci64
->rcItem
= ci32
->rcItem
;
905 ci64
->rcButton
= ci32
->rcButton
;
906 ci64
->stateButton
= ci32
->stateButton
;
907 ci64
->hwndCombo
= LongToHandle( ci32
->hwndCombo
);
908 ci64
->hwndItem
= LongToHandle( ci32
->hwndItem
);
909 ci64
->hwndList
= LongToHandle( ci32
->hwndList
);
910 return sizeof(*ci64
);
914 case WM_ASKCBFORMATNAME
:
915 case WM_GETMINMAXINFO
:
916 case WM_STYLECHANGING
:
917 case SBM_SETSCROLLINFO
:
918 case SBM_GETSCROLLINFO
:
919 case SBM_GETSCROLLBARINFO
:
927 case CB_GETDROPPEDCONTROLRECT
:
934 case WM_MDIGETACTIVE
:
941 if (size
) memcpy( params64
, params32
, size
);
945 static NTSTATUS WINAPI
wow64_NtUserCallWinProc( void *arg
, ULONG size
)
947 struct win_proc_params
*params
= arg
;
948 struct win_proc_params32
*params32
= arg
;
949 size_t lparam_size
= 0, offset32
= sizeof(*params32
);
955 win_proc_params_64to32( params
, params32
);
956 if (size
> sizeof(*params
))
958 const size_t offset64
= (sizeof(*params
) + 15) & ~15;
959 offset32
= (offset32
+ 15) & ~15;
960 lparam_size
= packed_message_64to32( params32
->msg
, params32
->wparam
,
961 (char *)params
+ offset64
,
962 (char *)params32
+ offset32
,
966 status
= Wow64KiUserCallbackDispatcher( NtUserCallWinProc
, params32
,
967 offset32
+ lparam_size
,
968 &ret_ptr
, &ret_len
);
970 if (ret_len
>= sizeof(LONG
))
972 LRESULT
*result_ptr
= arg
;
973 result
= *(LONG
*)ret_ptr
;
974 ret_len
= packed_result_32to64( params32
->msg
, params32
->wparam
, (LONG
*)ret_ptr
+ 1,
975 ret_len
- sizeof(LONG
), result_ptr
+ 1 );
976 *result_ptr
= result
;
977 return NtCallbackReturn( result_ptr
, sizeof(*result_ptr
) + ret_len
, status
);
980 return NtCallbackReturn( &result
, sizeof(result
), status
);
983 static UINT
hook_lparam_64to32( int id
, int code
, const void *lp
, size_t size
, void *lp32
)
989 case WH_SYSMSGFILTER
:
992 msg_64to32( lp
, lp32
);
993 return sizeof(MSG32
);
999 return packed_message_64to32( WM_CREATE
, 0, lp
, lp32
, size
);
1003 const CBTACTIVATESTRUCT
*cbt
= lp
;
1004 CBTACTIVATESTRUCT32 cbt32
;
1005 cbt32
.fMouse
= cbt
->fMouse
;
1006 cbt32
.hWndActive
= HandleToUlong( cbt
->hWndActive
);
1007 memcpy( lp32
, &cbt32
, sizeof(cbt32
) );
1008 return sizeof(cbt32
);
1011 case HCBT_CLICKSKIPPED
:
1012 mousehookstruct_64to32( lp
, lp32
);
1013 return sizeof(MOUSEHOOKSTRUCTEX32
);
1017 case WH_CALLWNDPROC
:
1019 const CWPSTRUCT
*cwp
= lp
;
1021 cwp32
.lParam
= cwp
->lParam
;
1022 cwp32
.wParam
= cwp
->wParam
;
1023 cwp32
.message
= cwp
->message
;
1024 cwp32
.hwnd
= HandleToUlong( cwp
->hwnd
);
1025 memcpy( lp32
, &cwp32
, sizeof(cwp32
) );
1026 if (size
> sizeof(*cwp
))
1028 const size_t offset64
= (sizeof(*cwp
) + 15) & ~15;
1029 const size_t offset32
= (sizeof(cwp32
) + 15) & ~15;
1030 size
= packed_message_64to32( cwp32
.message
, cwp32
.wParam
,
1031 (const char *)lp
+ offset64
,
1032 (char *)lp32
+ offset32
, size
- offset64
);
1033 return offset32
+ size
;
1035 return sizeof(cwp32
);
1038 case WH_CALLWNDPROCRET
:
1040 const CWPRETSTRUCT
*cwpret
= lp
;
1041 CWPRETSTRUCT32 cwpret32
;
1042 cwpret32
.lResult
= cwpret
->lResult
;
1043 cwpret32
.lParam
= cwpret
->lParam
;
1044 cwpret32
.wParam
= cwpret
->wParam
;
1045 cwpret32
.message
= cwpret
->message
;
1046 cwpret32
.hwnd
= HandleToUlong( cwpret
->hwnd
);
1047 memcpy( lp32
, &cwpret32
, sizeof(cwpret32
) );
1048 if (size
> sizeof(*cwpret
))
1050 const size_t offset64
= (sizeof(*cwpret
) + 15) & ~15;
1051 const size_t offset32
= (sizeof(cwpret32
) + 15) & ~15;
1052 size
= packed_message_64to32( cwpret32
.message
, cwpret32
.wParam
,
1053 (const char *)lp
+ offset64
,
1054 (char *)lp32
+ offset32
, size
- offset64
);
1055 return offset32
+ size
;
1057 return sizeof(cwpret32
);
1061 mousehookstruct_64to32( lp
, lp32
);
1062 return sizeof(MOUSEHOOKSTRUCTEX32
);
1066 const MSLLHOOKSTRUCT
*hook
= lp
;
1067 MSLLHOOKSTRUCT32 hook32
;
1068 hook32
.pt
= hook
->pt
;
1069 hook32
.mouseData
= hook
->mouseData
;
1070 hook32
.flags
= hook
->flags
;
1071 hook32
.time
= hook
->time
;
1072 hook32
.dwExtraInfo
= hook
->dwExtraInfo
;
1073 memcpy( lp32
, &hook32
, sizeof(hook32
) );
1074 return sizeof(hook32
);
1077 case WH_KEYBOARD_LL
:
1079 const KBDLLHOOKSTRUCT
*hook
= lp
;
1080 KBDLLHOOKSTRUCT32 hook32
;
1081 hook32
.vkCode
= hook
->vkCode
;
1082 hook32
.scanCode
= hook
->scanCode
;
1083 hook32
.flags
= hook
->flags
;
1084 hook32
.time
= hook
->time
;
1085 hook32
.dwExtraInfo
= hook
->dwExtraInfo
;
1086 memcpy( lp32
, &hook32
, sizeof(hook32
) );
1087 return sizeof(hook32
);
1090 case WH_JOURNALRECORD
:
1092 const EVENTMSG
*event
= lp
;
1095 event32
.message
= event
->message
;
1096 event32
.paramL
= event
->paramL
;
1097 event32
.paramH
= event
->paramH
;
1098 event32
.time
= event
->time
;
1099 event32
.hwnd
= HandleToUlong( event
->hwnd
);
1100 memcpy( lp32
, &event32
, sizeof(event32
) );
1101 return sizeof(event32
);
1105 memmove( lp32
, lp
, size
);
1109 static NTSTATUS WINAPI
wow64_NtUserCallWindowsHook( void *arg
, ULONG size
)
1111 struct win_hook_params
*params
= arg
;
1112 struct win_hook_params32 params32
;
1113 UINT module_len
, size32
, offset
;
1118 module_len
= wcslen( params
->module
);
1119 size32
= FIELD_OFFSET( struct win_hook_params32
, module
[module_len
+ 1] );
1120 offset
= FIELD_OFFSET( struct win_hook_params
, module
[module_len
+ 1] );
1122 params32
.proc
= PtrToUlong( params
->proc
);
1123 params32
.handle
= HandleToUlong( params
->handle
);
1124 params32
.pid
= params
->pid
;
1125 params32
.tid
= params
->tid
;
1126 params32
.id
= params
->id
;
1127 params32
.code
= params
->code
;
1128 params32
.wparam
= params
->wparam
;
1129 params32
.lparam
= params
->lparam
;
1130 params32
.prev_unicode
= params
->prev_unicode
;
1131 params32
.next_unicode
= params
->next_unicode
;
1132 memcpy( arg
, ¶ms32
, FIELD_OFFSET( struct win_hook_params32
, module
));
1133 memmove( ((struct win_hook_params32
*)arg
)->module
, params
->module
,
1134 (module_len
+ 1) * sizeof(WCHAR
) );
1138 size32
= (size32
+ 15) & ~15;
1139 offset
= (offset
+ 15) & ~15;
1140 size32
+= hook_lparam_64to32( params32
.id
, params32
.code
, (char *)params
+ offset
,
1141 size
- offset
, (char *)arg
+ size32
);
1144 ret
= Wow64KiUserCallbackDispatcher( NtUserCallWindowsHook
, arg
, size32
, &ret_ptr
, &ret_len
);
1146 switch (params32
.id
)
1148 case WH_SYSMSGFILTER
:
1151 if (ret_len
== sizeof(MSG32
))
1154 msg_32to64( &msg
, ret_ptr
);
1155 return NtCallbackReturn( &msg
, sizeof(msg
), ret
);
1162 static NTSTATUS WINAPI
wow64_NtUserCopyImage( void *arg
, ULONG size
)
1164 struct copy_image_params
*params
= arg
;
1174 params32
.hwnd
= HandleToUlong( params
->hwnd
);
1175 params32
.type
= params
->type
;
1176 params32
.dx
= params
->dx
;
1177 params32
.dy
= params
->dy
;
1178 params32
.flags
= params
->flags
;
1179 return dispatch_callback( NtUserCopyImage
, ¶ms32
, sizeof(params32
) );
1182 static NTSTATUS WINAPI
wow64_NtUserDrawNonClientButton( void *arg
, ULONG size
)
1184 struct draw_non_client_button_params
*params
= arg
;
1189 enum NONCLIENT_BUTTON_TYPE type
;
1195 params32
.hwnd
= HandleToUlong( params
->hwnd
);
1196 params32
.hdc
= HandleToUlong( params
->hdc
);
1197 params32
.type
= params
->type
;
1198 params32
.rect
= params
->rect
;
1199 params32
.down
= params
->down
;
1200 params32
.grayed
= params
->grayed
;
1201 return dispatch_callback( NtUserDrawNonClientButton
, ¶ms32
, sizeof(params32
) );
1204 static NTSTATUS WINAPI
wow64_NtUserDrawScrollBar( void *arg
, ULONG size
)
1206 struct draw_scroll_bar_params
*params
= arg
;
1220 enum SCROLL_HITTEST hit_test
;
1232 params32
.hwnd
= HandleToUlong( params
->hwnd
);
1233 params32
.hdc
= HandleToUlong( params
->hdc
);
1234 params32
.bar
= params
->bar
;
1235 params32
.hit_test
= params
->hit_test
;
1236 params32
.tracking_info
.win
= HandleToUlong( params
->tracking_info
.win
);
1237 params32
.tracking_info
.bar
= params
->tracking_info
.bar
;
1238 params32
.tracking_info
.thumb_pos
= params
->tracking_info
.thumb_pos
;
1239 params32
.tracking_info
.thumb_val
= params
->tracking_info
.thumb_val
;
1240 params32
.tracking_info
.vertical
= params
->tracking_info
.vertical
;
1241 params32
.tracking_info
.hit_test
= params
->tracking_info
.hit_test
;
1242 params32
.arrows
= params
->arrows
;
1243 params32
.interior
= params
->interior
;
1244 params32
.rect
= params
->rect
;
1245 params32
.enable_flags
= params
->enable_flags
;
1246 params32
.arrow_size
= params
->arrow_size
;
1247 params32
.thumb_pos
= params
->thumb_pos
;
1248 params32
.thumb_size
= params
->thumb_size
;
1249 params32
.vertical
= params
->vertical
;
1250 return dispatch_callback( NtUserDrawScrollBar
, ¶ms32
, sizeof(params32
) );
1253 static NTSTATUS WINAPI
wow64_NtUserDrawText( void *arg
, ULONG size
)
1255 struct draw_text_params
*params
= arg
;
1256 struct draw_text_params32
*params32
;
1257 ULONG offset
= offsetof( struct draw_text_params
, str
) - offsetof( struct draw_text_params32
, str
);
1262 params32
= (struct draw_text_params32
*)((char *)params
+ offset
);
1263 params32
->flags
= params
->flags
;
1264 params32
->rect
= params
->rect
;
1265 params32
->count
= params
->count
;
1266 params32
->hdc
= HandleToUlong( params
->hdc
);
1268 ret
= Wow64KiUserCallbackDispatcher( NtUserDrawText
, params32
, size
- offset
, &ret_ptr
, &ret_len
);
1269 return NtCallbackReturn( ret_ptr
, ret_len
, ret
);
1272 static NTSTATUS WINAPI
wow64_NtUserFreeCachedClipboardData( void *arg
, ULONG size
)
1274 struct free_cached_data_params
*params
= arg
;
1281 params32
.format
= params
->format
;
1282 params32
.handle
= HandleToUlong( params
->handle
);
1283 return dispatch_callback( NtUserFreeCachedClipboardData
, ¶ms32
, sizeof(params32
) );
1286 static NTSTATUS WINAPI
wow64_NtUserImmProcessKey( void *arg
, ULONG size
)
1288 struct imm_process_key_params
*params
= arg
;
1297 params32
.hwnd
= HandleToUlong( params
->hwnd
);
1298 params32
.hkl
= HandleToUlong( params
->hkl
);
1299 params32
.vkey
= params
->vkey
;
1300 params32
.key_data
= params
->key_data
;
1301 return dispatch_callback( NtUserImmProcessKey
, ¶ms32
, sizeof(params32
) );
1304 static NTSTATUS WINAPI
wow64_NtUserImmTranslateMessage( void *arg
, ULONG size
)
1306 struct imm_translate_message_params
*params
= arg
;
1315 params32
.hwnd
= HandleToLong( params
->hwnd
);
1316 params32
.msg
= params
->msg
;
1317 params32
.wparam
= params
->wparam
;
1318 params32
.key_data
= params
->key_data
;
1319 return dispatch_callback( NtUserImmTranslateMessage
, ¶ms32
, sizeof(params32
) );
1322 static NTSTATUS WINAPI
wow64_NtUserInitBuiltinClasses( void *arg
, ULONG size
)
1324 return dispatch_callback( NtUserInitBuiltinClasses
, arg
, size
);
1327 static NTSTATUS WINAPI
wow64_NtUserLoadDriver( void *arg
, ULONG size
)
1329 return dispatch_callback( NtUserLoadDriver
, arg
, size
);
1332 static NTSTATUS WINAPI
wow64_NtUserLoadImage( void *arg
, ULONG size
)
1334 struct load_image_params
*params
= arg
;
1345 params32
.hinst
= PtrToUlong( params
->hinst
);
1346 params32
.name
= PtrToUlong( params
->name
);
1347 params32
.type
= params
->type
;
1348 params32
.dx
= params
->dx
;
1349 params32
.dy
= params
->dy
;
1350 params32
.flags
= params
->flags
;
1351 return dispatch_callback( NtUserLoadImage
, ¶ms32
, sizeof(params32
) );
1354 static NTSTATUS WINAPI
wow64_NtUserLoadSysMenu( void *arg
, ULONG size
)
1356 return dispatch_callback( NtUserLoadSysMenu
, arg
, size
);
1359 static NTSTATUS WINAPI
wow64_NtUserPostDDEMessage( void *arg
, ULONG size
)
1361 struct post_dde_message_params
*params
= arg
;
1372 params32
.hwnd
= HandleToUlong( params
->hwnd
);
1373 params32
.msg
= params
->msg
;
1374 params32
.wparam
= params
->wparam
;
1375 params32
.lparam
= params
->lparam
;
1376 params32
.dest_tid
= params
->dest_tid
;
1377 params32
.type
= params
->type
;
1378 return dispatch_callback( NtUserPostDDEMessage
, ¶ms32
, sizeof(params32
) );
1381 static NTSTATUS WINAPI
wow64_NtUserRenderSynthesizedFormat( void *arg
, ULONG size
)
1383 return dispatch_callback( NtUserRenderSynthesizedFormat
, arg
, size
);
1386 static NTSTATUS WINAPI
wow64_NtUserUnpackDDEMessage( void *arg
, ULONG size
)
1388 struct unpack_dde_message_params
*params
= arg
;
1389 struct unpack_dde_message_params32
*params32
;
1390 struct unpack_dde_message_result result
;
1399 size
-= FIELD_OFFSET( struct unpack_dde_message_params
, data
);
1400 if (!(params32
= Wow64AllocateTemp( FIELD_OFFSET( struct unpack_dde_message_params32
, data
[size
] ))))
1403 params32
->result
= 0;
1404 params32
->hwnd
= HandleToUlong( params
->hwnd
);
1405 params32
->message
= params
->message
;
1406 params32
->wparam
= params
->wparam
;
1407 params32
->lparam
= params
->lparam
;
1408 if (size
) memcpy( params32
->data
, params
->data
, size
);
1409 size
= FIELD_OFFSET( struct unpack_dde_message_params32
, data
[size
] );
1411 if (!Wow64KiUserCallbackDispatcher( NtUserUnpackDDEMessage
, params32
, size
, &ret_ptr
, &ret_len
))
1413 if (ret_len
== sizeof(*result32
))
1416 result
.wparam
= result32
->wparam
;
1417 result
.lparam
= result32
->lparam
;
1420 if (!params
->result
) NtCallbackReturn( &result
, sizeof(result
), TRUE
);
1421 *params
->result
= result
;
1425 static NTSTATUS WINAPI
wow64_NtUserCallFreeIcon( void *arg
, ULONG size
)
1427 return dispatch_callback( NtUserCallFreeIcon
, arg
, size
);
1430 static NTSTATUS WINAPI
wow64_NtUserThunkLock( void *arg
, ULONG size
)
1432 return dispatch_callback( NtUserThunkLock
, arg
, size
);
1435 static NTSTATUS WINAPI
wow64_NtUserCallVulkanDebugReportCallback( void *arg
, ULONG size
)
1441 static NTSTATUS WINAPI
wow64_NtUserCallVulkanDebugUtilsCallback( void *arg
, ULONG size
)
1447 static NTSTATUS WINAPI
wow64_NtUserCallOpenGLDebugMessageCallback( void *arg
, ULONG size
)
1453 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst0( void *arg
, ULONG size
)
1455 return dispatch_callback( NtUserDriverCallbackFirst
+ 0, arg
, size
);
1458 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst1( void *arg
, ULONG size
)
1460 return dispatch_callback( NtUserDriverCallbackFirst
+ 1, arg
, size
);
1463 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst2( void *arg
, ULONG size
)
1465 return dispatch_callback( NtUserDriverCallbackFirst
+ 2, arg
, size
);
1468 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst3( void *arg
, ULONG size
)
1470 return dispatch_callback( NtUserDriverCallbackFirst
+ 3, arg
, size
);
1473 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst4( void *arg
, ULONG size
)
1475 return dispatch_callback( NtUserDriverCallbackFirst
+ 4, arg
, size
);
1478 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst5( void *arg
, ULONG size
)
1480 return dispatch_callback( NtUserDriverCallbackFirst
+ 5, arg
, size
);
1483 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst6( void *arg
, ULONG size
)
1485 return dispatch_callback( NtUserDriverCallbackFirst
+ 6, arg
, size
);
1488 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst7( void *arg
, ULONG size
)
1490 return dispatch_callback( NtUserDriverCallbackFirst
+ 7, arg
, size
);
1493 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst8( void *arg
, ULONG size
)
1495 return dispatch_callback( NtUserDriverCallbackFirst
+ 8, arg
, size
);
1498 static NTSTATUS WINAPI
wow64_NtUserDriverCallbackFirst9( void *arg
, ULONG size
)
1500 return dispatch_callback( NtUserDriverCallbackFirst
+ 9, arg
, size
);
1503 user_callback user_callbacks
[] =
1505 /* user32 callbacks */
1506 wow64_NtUserCallEnumDisplayMonitor
,
1507 wow64_NtUserCallSendAsyncCallback
,
1508 wow64_NtUserCallWinEventHook
,
1509 wow64_NtUserCallWinProc
,
1510 wow64_NtUserCallWindowsHook
,
1511 wow64_NtUserCopyImage
,
1512 wow64_NtUserDrawNonClientButton
,
1513 wow64_NtUserDrawScrollBar
,
1514 wow64_NtUserDrawText
,
1515 wow64_NtUserFreeCachedClipboardData
,
1516 wow64_NtUserImmProcessKey
,
1517 wow64_NtUserImmTranslateMessage
,
1518 wow64_NtUserInitBuiltinClasses
,
1519 wow64_NtUserLoadDriver
,
1520 wow64_NtUserLoadImage
,
1521 wow64_NtUserLoadSysMenu
,
1522 wow64_NtUserPostDDEMessage
,
1523 wow64_NtUserRenderSynthesizedFormat
,
1524 wow64_NtUserUnpackDDEMessage
,
1526 wow64_NtUserCallFreeIcon
,
1527 wow64_NtUserThunkLock
,
1528 /* Vulkan support */
1529 wow64_NtUserCallVulkanDebugReportCallback
,
1530 wow64_NtUserCallVulkanDebugUtilsCallback
,
1531 /* OpenGL support */
1532 wow64_NtUserCallOpenGLDebugMessageCallback
,
1533 /* Driver-specific callbacks */
1534 wow64_NtUserDriverCallbackFirst0
,
1535 wow64_NtUserDriverCallbackFirst1
,
1536 wow64_NtUserDriverCallbackFirst2
,
1537 wow64_NtUserDriverCallbackFirst3
,
1538 wow64_NtUserDriverCallbackFirst4
,
1539 wow64_NtUserDriverCallbackFirst5
,
1540 wow64_NtUserDriverCallbackFirst6
,
1541 wow64_NtUserDriverCallbackFirst7
,
1542 wow64_NtUserDriverCallbackFirst8
,
1543 wow64_NtUserDriverCallbackFirst9
,
1546 C_ASSERT( ARRAYSIZE(user_callbacks
) == NtUserCallCount
);
1548 NTSTATUS WINAPI
wow64_NtUserActivateKeyboardLayout( UINT
*args
)
1550 HKL layout
= get_handle( &args
);
1551 UINT flags
= get_ulong( &args
);
1553 return HandleToUlong( NtUserActivateKeyboardLayout( layout
, flags
));
1556 NTSTATUS WINAPI
wow64_NtUserAddClipboardFormatListener( UINT
*args
)
1558 HWND hwnd
= get_handle( &args
);
1560 return NtUserAddClipboardFormatListener( hwnd
);
1563 NTSTATUS WINAPI
wow64_NtUserAssociateInputContext( UINT
*args
)
1565 HWND hwnd
= get_handle( &args
);
1566 HIMC ctx
= get_handle( &args
);
1567 ULONG flags
= get_ulong( &args
);
1569 return NtUserAssociateInputContext( hwnd
, ctx
, flags
);
1572 NTSTATUS WINAPI
wow64_NtUserAttachThreadInput( UINT
*args
)
1574 DWORD from
= get_ulong( &args
);
1575 DWORD to
= get_ulong( &args
);
1576 BOOL attach
= get_ulong( &args
);
1578 return NtUserAttachThreadInput( from
, to
, attach
);
1581 NTSTATUS WINAPI
wow64_NtUserBeginPaint( UINT
*args
)
1583 HWND hwnd
= get_handle( &args
);
1584 PAINTSTRUCT32
*ps32
= get_ptr( &args
);
1589 ret
= NtUserBeginPaint( hwnd
, ps32
? & ps
: NULL
);
1592 ps32
->hdc
= HandleToUlong( ps
.hdc
);
1593 ps32
->fErase
= ps
.fErase
;
1594 ps32
->rcPaint
= ps
.rcPaint
;
1596 return HandleToUlong( ret
);
1599 NTSTATUS WINAPI
wow64_NtUserBuildHimcList( UINT
*args
)
1601 ULONG thread_id
= get_ulong( &args
);
1602 ULONG count
= get_ulong( &args
);
1603 UINT32
*buffer32
= get_ptr( &args
);
1604 UINT
*size
= get_ptr( &args
);
1606 HIMC
*buffer
= NULL
;
1610 if (buffer32
&& !(buffer
= Wow64AllocateTemp( count
* sizeof(*buffer
) )))
1611 return STATUS_NO_MEMORY
;
1613 if ((status
= NtUserBuildHimcList( thread_id
, count
, buffer
, size
))) return status
;
1615 for (i
= 0; i
< *size
; i
++) buffer32
[i
] = HandleToUlong( buffer
[i
] );
1619 NTSTATUS WINAPI
wow64_NtUserBuildHwndList( UINT
*args
)
1621 HDESK desktop
= get_handle( &args
);
1622 ULONG unk2
= get_ulong( &args
);
1623 ULONG unk3
= get_ulong( &args
);
1624 ULONG unk4
= get_ulong( &args
);
1625 ULONG thread_id
= get_ulong( &args
);
1626 ULONG count
= get_ulong( &args
);
1627 UINT32
*buffer32
= get_ptr( &args
);
1628 ULONG
*size
= get_ptr( &args
);
1634 if (!(buffer
= Wow64AllocateTemp( count
* sizeof(*buffer
) ))) return STATUS_NO_MEMORY
;
1636 if ((status
= NtUserBuildHwndList( desktop
, unk2
, unk3
, unk4
, thread_id
, count
, buffer
, size
)))
1639 for (i
= 0; i
< *size
; i
++)
1640 buffer32
[i
] = HandleToUlong( buffer
[i
] );
1644 NTSTATUS WINAPI
wow64_NtUserCallHwnd( UINT
*args
)
1646 HWND hwnd
= get_handle( &args
);
1647 DWORD code
= get_ulong( &args
);
1649 return NtUserCallHwnd( hwnd
, code
);
1652 NTSTATUS WINAPI
wow64_NtUserCallHwndParam( UINT
*args
)
1654 HWND hwnd
= get_handle( &args
);
1655 DWORD_PTR param
= get_ulong( &args
);
1656 DWORD code
= get_ulong( &args
);
1660 case NtUserCallHwndParam_GetScrollInfo
:
1666 } *info32
= UlongToPtr( param
);
1667 struct get_scroll_info_params info
;
1669 info
.bar
= info32
->bar
;
1670 info
.info
= UlongToPtr( info32
->info
);
1671 return NtUserCallHwndParam( hwnd
, (UINT_PTR
)&info
, code
);
1674 case NtUserCallHwndParam_MapWindowPoints
:
1681 } *params32
= UlongToPtr( param
);
1682 struct map_window_points_params params
;
1684 params
.hwnd_to
= LongToHandle( params32
->hwnd_to
);
1685 params
.points
= UlongToPtr( params32
->points
);
1686 params
.count
= params32
->count
;
1687 return NtUserCallHwndParam( hwnd
, (UINT_PTR
)¶ms
, code
);
1691 return NtUserCallHwndParam( hwnd
, param
, code
);
1695 NTSTATUS WINAPI
wow64_NtUserCallMsgFilter( UINT
*args
)
1697 MSG32
*msg32
= get_ptr( &args
);
1698 INT code
= get_ulong( &args
);
1702 ret
= NtUserCallMsgFilter( msg_32to64( &msg
, msg32
), code
);
1703 msg_64to32( &msg
, msg32
);
1707 NTSTATUS WINAPI
wow64_NtUserCallNextHookEx( UINT
*args
)
1709 HHOOK hhook
= get_handle( &args
);
1710 INT code
= get_ulong( &args
);
1711 WPARAM wparam
= get_ulong( &args
);
1712 LPARAM lparam
= get_ulong( &args
);
1714 return NtUserCallNextHookEx( hhook
, code
, wparam
, lparam
);
1717 NTSTATUS WINAPI
wow64_NtUserCallNoParam( UINT
*args
)
1719 ULONG code
= get_ulong( &args
);
1721 return NtUserCallNoParam( code
);
1724 NTSTATUS WINAPI
wow64_NtUserCallOneParam( UINT
*args
)
1726 ULONG_PTR arg
= get_ulong( &args
);
1727 ULONG code
= get_ulong( &args
);
1729 return NtUserCallOneParam( arg
, code
);
1732 NTSTATUS WINAPI
wow64_NtUserCallTwoParam( UINT
*args
)
1734 ULONG_PTR arg1
= get_ulong( &args
);
1735 ULONG_PTR arg2
= get_ulong( &args
);
1736 ULONG code
= get_ulong( &args
);
1740 case NtUserCallTwoParam_GetMenuInfo
:
1742 MENUINFO32
*info32
= UlongToPtr( arg2
);
1745 if (!info32
|| info32
->cbSize
!= sizeof(*info32
))
1747 set_last_error32( ERROR_INVALID_PARAMETER
);
1751 info
.cbSize
= sizeof(info
);
1752 info
.fMask
= info32
->fMask
;
1753 if (!NtUserCallTwoParam( arg1
, (UINT_PTR
)&info
, code
)) return FALSE
;
1754 if (info
.fMask
& MIM_BACKGROUND
) info32
->hbrBack
= HandleToUlong( info
.hbrBack
);
1755 if (info
.fMask
& MIM_HELPID
) info32
->dwContextHelpID
= info
.dwContextHelpID
;
1756 if (info
.fMask
& MIM_MAXHEIGHT
) info32
->cyMax
= info
.cyMax
;
1757 if (info
.fMask
& MIM_MENUDATA
) info32
->dwMenuData
= info
.dwMenuData
;
1758 if (info
.fMask
& MIM_STYLE
) info32
->dwStyle
= info
.dwStyle
;
1763 return NtUserCallTwoParam( arg1
, arg2
, code
);
1767 NTSTATUS WINAPI
wow64_NtUserChangeClipboardChain( UINT
*args
)
1769 HWND hwnd
= get_handle( &args
);
1770 HWND next
= get_handle( &args
);
1772 return NtUserChangeClipboardChain( hwnd
, next
);
1775 NTSTATUS WINAPI
wow64_NtUserChangeDisplaySettings( UINT
*args
)
1777 UNICODE_STRING32
*devname32
= get_ptr( &args
);
1778 DEVMODEW
*devmode
= get_ptr( &args
);
1779 HWND hwnd
= get_handle( &args
);
1780 DWORD flags
= get_ulong( &args
);
1781 void *lparam
= get_ptr( &args
);
1783 UNICODE_STRING devname
;
1785 return NtUserChangeDisplaySettings( unicode_str_32to64( &devname
, devname32
),
1786 devmode
, hwnd
, flags
, lparam
);
1789 NTSTATUS WINAPI
wow64_NtUserCheckMenuItem( UINT
*args
)
1791 HMENU handle
= get_handle( &args
);
1792 UINT id
= get_ulong( &args
);
1793 UINT flags
= get_ulong( &args
);
1795 return NtUserCheckMenuItem( handle
, id
, flags
);
1798 NTSTATUS WINAPI
wow64_NtUserChildWindowFromPointEx( UINT
*args
)
1800 HWND parent
= get_handle( &args
);
1801 LONG x
= get_ulong( &args
);
1802 LONG y
= get_ulong( &args
);
1803 UINT flags
= get_ulong( &args
);
1805 return HandleToUlong( NtUserChildWindowFromPointEx( parent
, x
, y
, flags
));
1808 NTSTATUS WINAPI
wow64_NtUserClipCursor( UINT
*args
)
1810 const RECT
*rect
= get_ptr( &args
);
1812 return NtUserClipCursor( rect
);
1815 NTSTATUS WINAPI
wow64_NtUserCloseClipboard( UINT
*args
)
1817 return NtUserCloseClipboard();
1820 NTSTATUS WINAPI
wow64_NtUserCloseDesktop( UINT
*args
)
1822 HDESK handle
= get_handle( &args
);
1824 return NtUserCloseDesktop( handle
);
1827 NTSTATUS WINAPI
wow64_NtUserCloseWindowStation( UINT
*args
)
1829 HWINSTA handle
= get_handle( &args
);
1831 return NtUserCloseWindowStation( handle
);
1834 NTSTATUS WINAPI
wow64_NtUserCopyAcceleratorTable( UINT
*args
)
1836 HACCEL src
= get_handle( &args
);
1837 ACCEL
*dst
= get_ptr( &args
);
1838 INT count
= get_ulong( &args
);
1840 return NtUserCopyAcceleratorTable( src
, dst
, count
);
1843 NTSTATUS WINAPI
wow64_NtUserCountClipboardFormats( UINT
*args
)
1845 return NtUserCountClipboardFormats();
1848 NTSTATUS WINAPI
wow64_NtUserCreateAcceleratorTable( UINT
*args
)
1850 ACCEL
*table
= get_ptr( &args
);
1851 INT count
= get_ulong( &args
);
1853 return HandleToUlong( NtUserCreateAcceleratorTable( table
, count
));
1856 NTSTATUS WINAPI
wow64_NtUserCreateCaret( UINT
*args
)
1858 HWND hwnd
= get_handle( &args
);
1859 HBITMAP bitmap
= get_handle( &args
);
1860 int width
= get_ulong( &args
);
1861 int height
= get_ulong( &args
);
1863 return NtUserCreateCaret( hwnd
, bitmap
, width
, height
);
1866 NTSTATUS WINAPI
wow64_NtUserCreateDesktopEx( UINT
*args
)
1868 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
1869 UNICODE_STRING32
*device32
= get_ptr( &args
);
1870 DEVMODEW
*devmode
= get_ptr( &args
);
1871 DWORD flags
= get_ulong( &args
);
1872 ACCESS_MASK access
= get_ulong( &args
);
1873 ULONG heap_size
= get_ulong( &args
);
1875 struct object_attr64 attr
;
1876 UNICODE_STRING device
;
1879 ret
= NtUserCreateDesktopEx( objattr_32to64( &attr
, attr32
),
1880 unicode_str_32to64( &device
, device32
),
1881 devmode
, flags
, access
, heap_size
);
1882 return HandleToUlong( ret
);
1885 NTSTATUS WINAPI
wow64_NtUserCreateInputContext( UINT
*args
)
1887 UINT_PTR client_ptr
= get_ulong( &args
);
1889 return HandleToUlong( NtUserCreateInputContext( client_ptr
));
1892 NTSTATUS WINAPI
wow64_NtUserCreateWindowEx( UINT
*args
)
1894 DWORD ex_style
= get_ulong( &args
);
1895 UNICODE_STRING32
*class_name32
= get_ptr( &args
);
1896 UNICODE_STRING32
*version32
= get_ptr( &args
);
1897 UNICODE_STRING32
*window_name32
= get_ptr( &args
);
1898 DWORD style
= get_ulong( &args
);
1899 int x
= get_ulong( &args
);
1900 int y
= get_ulong( &args
);
1901 int width
= get_ulong( &args
);
1902 int height
= get_ulong( &args
);
1903 HWND parent
= get_handle( &args
);
1904 HMENU menu
= get_handle( &args
);
1905 HINSTANCE instance
= get_ptr( &args
);
1906 void *params
= get_ptr( &args
);
1907 DWORD flags
= get_ulong( &args
);
1908 HINSTANCE client_instance
= get_ptr( &args
);
1909 DWORD unk
= get_ulong( &args
);
1910 BOOL ansi
= get_ulong( &args
);
1912 UNICODE_STRING class_name
, version
, window_name
;
1915 ret
= NtUserCreateWindowEx( ex_style
,
1916 unicode_str_32to64( &class_name
, class_name32
),
1917 unicode_str_32to64( &version
, version32
),
1918 unicode_str_32to64( &window_name
, window_name32
),
1919 style
, x
, y
, width
, height
, parent
, menu
,
1920 instance
, params
, flags
, client_instance
, unk
, ansi
);
1921 return HandleToUlong( ret
);
1924 NTSTATUS WINAPI
wow64_NtUserCreateWindowStation( UINT
*args
)
1926 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
1927 ACCESS_MASK access
= get_ulong( &args
);
1928 ULONG arg3
= get_ulong( &args
);
1929 ULONG arg4
= get_ulong( &args
);
1930 ULONG arg5
= get_ulong( &args
);
1931 ULONG arg6
= get_ulong( &args
);
1932 ULONG arg7
= get_ulong( &args
);
1934 struct object_attr64 attr
;
1936 return HandleToUlong( NtUserCreateWindowStation( objattr_32to64( &attr
, attr32
), access
,
1937 arg3
, arg4
, arg5
, arg6
, arg7
));
1940 NTSTATUS WINAPI
wow64_NtUserDeferWindowPosAndBand( UINT
*args
)
1942 HDWP hdwp
= get_handle( &args
);
1943 HWND hwnd
= get_handle( &args
);
1944 HWND after
= get_handle( &args
);
1945 INT x
= get_ulong( &args
);
1946 INT y
= get_ulong( &args
);
1947 INT cx
= get_ulong( &args
);
1948 INT cy
= get_ulong( &args
);
1949 UINT flags
= get_ulong( &args
);
1950 UINT unk1
= get_ulong( &args
);
1951 UINT unk2
= get_ulong( &args
);
1953 HDWP ret
= NtUserDeferWindowPosAndBand( hdwp
, hwnd
, after
, x
, y
, cx
, cy
, flags
, unk1
, unk2
);
1954 return HandleToUlong( ret
);
1957 NTSTATUS WINAPI
wow64_NtUserDeleteMenu( UINT
*args
)
1959 HMENU menu
= get_handle( &args
);
1960 UINT id
= get_ulong( &args
);
1961 UINT flags
= get_ulong( &args
);
1963 return NtUserDeleteMenu( menu
, id
, flags
);
1966 NTSTATUS WINAPI
wow64_NtUserDestroyAcceleratorTable( UINT
*args
)
1968 HACCEL handle
= get_handle( &args
);
1970 return NtUserDestroyAcceleratorTable( handle
);
1973 NTSTATUS WINAPI
wow64_NtUserDestroyCursor( UINT
*args
)
1975 HCURSOR cursor
= get_handle( &args
);
1976 ULONG arg
= get_ulong( &args
);
1978 return NtUserDestroyCursor( cursor
, arg
);
1981 NTSTATUS WINAPI
wow64_NtUserDestroyInputContext( UINT
*args
)
1983 HIMC handle
= get_handle( &args
);
1985 return NtUserDestroyInputContext( handle
);
1988 NTSTATUS WINAPI
wow64_NtUserDestroyMenu( UINT
*args
)
1990 HMENU handle
= get_handle( &args
);
1992 return NtUserDestroyMenu( handle
);
1995 NTSTATUS WINAPI
wow64_NtUserDestroyWindow( UINT
*args
)
1997 HWND hwnd
= get_handle( &args
);
1999 return NtUserDestroyWindow( hwnd
);
2002 NTSTATUS WINAPI
wow64_NtUserDisableThreadIme( UINT
*args
)
2004 DWORD thread_id
= get_ulong( &args
);
2006 return NtUserDisableThreadIme( thread_id
);
2009 NTSTATUS WINAPI
wow64_NtUserDispatchMessage( UINT
*args
)
2011 const MSG32
*msg32
= get_ptr( &args
);
2014 return NtUserDispatchMessage( msg_32to64( &msg
, msg32
));
2017 NTSTATUS WINAPI
wow64_NtUserDragDetect( UINT
*args
)
2019 HWND hwnd
= get_handle( &args
);
2020 int x
= get_ulong( &args
);
2021 int y
= get_ulong( &args
);
2023 return NtUserDragDetect( hwnd
, x
, y
);
2026 NTSTATUS WINAPI
wow64_NtUserDragObject( UINT
*args
)
2028 HWND parent
= get_handle( &args
);
2029 HWND hwnd
= get_handle( &args
);
2030 UINT fmt
= get_ulong( &args
);
2031 ULONG_PTR data
= get_ulong( &args
);
2032 HCURSOR hcursor
= get_handle( &args
);
2034 return NtUserDragObject( parent
, hwnd
, fmt
, data
, hcursor
);
2037 NTSTATUS WINAPI
wow64_NtUserDrawCaptionTemp( UINT
*args
)
2039 HWND hwnd
= get_handle( &args
);
2040 HDC hdc
= get_handle( &args
);
2041 const RECT
*rect
= get_ptr( &args
);
2042 HFONT font
= get_handle( &args
);
2043 HICON icon
= get_handle( &args
);
2044 const WCHAR
*str
= get_ptr( &args
);
2045 UINT flags
= get_ulong( &args
);
2047 return NtUserDrawCaptionTemp( hwnd
, hdc
, rect
, font
, icon
, str
, flags
);
2050 NTSTATUS WINAPI
wow64_NtUserDrawIconEx( UINT
*args
)
2052 HDC hdc
= get_handle( &args
);
2053 int x0
= get_ulong( &args
);
2054 int y0
= get_ulong( &args
);
2055 HICON icon
= get_handle( &args
);
2056 int width
= get_ulong( &args
);
2057 int height
= get_ulong( &args
);
2058 UINT istep
= get_ulong( &args
);
2059 HBRUSH hbr
= get_handle( &args
);
2060 UINT flags
= get_ulong( &args
);
2062 return NtUserDrawIconEx( hdc
, x0
, y0
, icon
, width
, height
, istep
, hbr
, flags
);
2065 NTSTATUS WINAPI
wow64_NtUserDrawMenuBarTemp( UINT
*args
)
2067 HWND hwnd
= get_handle( &args
);
2068 HDC hdc
= get_handle( &args
);
2069 RECT
*rect
= get_ptr( &args
);
2070 HMENU handle
= get_handle( &args
);
2071 HFONT font
= get_handle( &args
);
2073 return NtUserDrawMenuBarTemp( hwnd
, hdc
, rect
, handle
, font
);
2076 NTSTATUS WINAPI
wow64_NtUserEmptyClipboard( UINT
*args
)
2078 return NtUserEmptyClipboard();
2081 NTSTATUS WINAPI
wow64_NtUserEnableMenuItem( UINT
*args
)
2083 HMENU handle
= get_handle( &args
);
2084 UINT id
= get_ulong( &args
);
2085 UINT flags
= get_ulong( &args
);
2087 return NtUserEnableMenuItem( handle
, id
, flags
);
2090 NTSTATUS WINAPI
wow64_NtUserEnableMouseInPointer( UINT
*args
)
2092 UINT enable
= get_ulong( &args
);
2094 return NtUserEnableMouseInPointer( enable
);
2097 NTSTATUS WINAPI
wow64_NtUserEnableScrollBar( UINT
*args
)
2099 HWND hwnd
= get_handle( &args
);
2100 UINT bar
= get_ulong( &args
);
2101 UINT flags
= get_ulong( &args
);
2103 return NtUserEnableScrollBar( hwnd
, bar
, flags
);
2106 NTSTATUS WINAPI
wow64_NtUserEndDeferWindowPosEx( UINT
*args
)
2108 HDWP hdwp
= get_handle( &args
);
2109 BOOL async
= get_ulong( &args
);
2111 return NtUserEndDeferWindowPosEx( hdwp
, async
);
2114 NTSTATUS WINAPI
wow64_NtUserEndMenu( UINT
*args
)
2116 return NtUserEndMenu();
2119 NTSTATUS WINAPI
wow64_NtUserEndPaint( UINT
*args
)
2121 HWND hwnd
= get_handle( &args
);
2122 const PAINTSTRUCT32
*ps32
= get_ptr( &args
);
2125 return NtUserEndPaint( hwnd
, paintstruct_32to64( &ps
, ps32
));
2128 NTSTATUS WINAPI
wow64_NtUserEnumDisplayDevices( UINT
*args
)
2130 UNICODE_STRING32
*device32
= get_ptr( &args
);
2131 DWORD index
= get_ulong( &args
);
2132 DISPLAY_DEVICEW
*info
= get_ptr( &args
);
2133 DWORD flags
= get_ulong( &args
);
2135 UNICODE_STRING device
;
2137 return NtUserEnumDisplayDevices( unicode_str_32to64( &device
, device32
), index
, info
, flags
);
2140 NTSTATUS WINAPI
wow64_NtUserEnumDisplayMonitors( UINT
*args
)
2142 HDC hdc
= get_handle( &args
);
2143 RECT
*rect
= get_ptr( &args
);
2144 MONITORENUMPROC proc
= get_ptr( &args
);
2145 LPARAM lp
= get_ulong( &args
);
2147 return NtUserEnumDisplayMonitors( hdc
, rect
, proc
, lp
);
2150 NTSTATUS WINAPI
wow64_NtUserEnumDisplaySettings( UINT
*args
)
2152 UNICODE_STRING32
*device32
= get_ptr( &args
);
2153 DWORD mode
= get_ulong( &args
);
2154 DEVMODEW
*dev_mode
= get_ptr( &args
);
2155 DWORD flags
= get_ulong( &args
);
2157 UNICODE_STRING device
;
2159 return NtUserEnumDisplaySettings( unicode_str_32to64( &device
, device32
),
2160 mode
, dev_mode
, flags
);
2163 NTSTATUS WINAPI
wow64_NtUserExcludeUpdateRgn( UINT
*args
)
2165 HDC hdc
= get_handle( &args
);
2166 HWND hwnd
= get_handle( &args
);
2168 return NtUserExcludeUpdateRgn( hdc
, hwnd
);
2171 NTSTATUS WINAPI
wow64_NtUserFindExistingCursorIcon( UINT
*args
)
2173 UNICODE_STRING32
*module32
= get_ptr( &args
);
2174 UNICODE_STRING32
*res_name32
= get_ptr( &args
);
2175 void *desc
= get_ptr( &args
);
2177 UNICODE_STRING module
;
2178 UNICODE_STRING res_name
;
2181 ret
= NtUserFindExistingCursorIcon( unicode_str_32to64( &module
, module32
),
2182 unicode_str_32to64( &res_name
, res_name32
), desc
);
2183 return HandleToUlong( ret
);
2186 NTSTATUS WINAPI
wow64_NtUserFindWindowEx( UINT
*args
)
2188 HWND parent
= get_handle( &args
);
2189 HWND child
= get_handle( &args
);
2190 UNICODE_STRING32
*class32
= get_ptr( &args
);
2191 UNICODE_STRING32
*title32
= get_ptr( &args
);
2192 ULONG unk
= get_ulong( &args
);
2194 UNICODE_STRING
class, title
;
2197 ret
= NtUserFindWindowEx( parent
, child
, unicode_str_32to64( &class, class32
),
2198 unicode_str_32to64( &title
, title32
), unk
);
2199 return HandleToUlong( ret
);
2202 NTSTATUS WINAPI
wow64_NtUserFlashWindowEx( UINT
*args
)
2211 } *info32
= get_ptr( &args
);
2217 set_last_error32( ERROR_NOACCESS
);
2221 if (info32
->cbSize
!= sizeof(*info32
))
2223 set_last_error32( ERROR_INVALID_PARAMETER
);
2227 info
.cbSize
= sizeof(info
);
2228 info
.hwnd
= LongToHandle( info32
->hwnd
);
2229 info
.dwFlags
= info32
->dwFlags
;
2230 info
.uCount
= info32
->uCount
;
2231 info
.dwTimeout
= info32
->dwTimeout
;
2232 return NtUserFlashWindowEx( &info
);
2235 NTSTATUS WINAPI
wow64_NtUserGetAncestor( UINT
*args
)
2237 HWND hwnd
= get_handle( &args
);
2238 UINT type
= get_ulong( &args
);
2240 return HandleToUlong( NtUserGetAncestor( hwnd
, type
));
2243 NTSTATUS WINAPI
wow64_NtUserGetAsyncKeyState( UINT
*args
)
2245 INT key
= get_ulong( &args
);
2247 return NtUserGetAsyncKeyState( key
);
2250 NTSTATUS WINAPI
wow64_NtUserGetAtomName( UINT
*args
)
2252 ATOM atom
= get_ulong( &args
);
2253 UNICODE_STRING32
*str32
= get_ptr( &args
);
2257 return NtUserGetAtomName( atom
, unicode_str_32to64( &str
, str32
));
2260 NTSTATUS WINAPI
wow64_NtUserGetCaretBlinkTime( UINT
*args
)
2262 return NtUserGetCaretBlinkTime();
2265 NTSTATUS WINAPI
wow64_NtUserGetCaretPos( UINT
*args
)
2267 POINT
*pt
= get_ptr( &args
);
2269 return NtUserGetCaretPos( pt
);
2272 NTSTATUS WINAPI
wow64_NtUserGetClassInfoEx( UINT
*args
)
2274 HINSTANCE instance
= get_ptr( &args
);
2275 UNICODE_STRING32
*name32
= get_ptr( &args
);
2276 WNDCLASSEXW32
*wc32
= get_ptr( &args
);
2277 struct client_menu_name32
*client_name32
= get_ptr( &args
);
2278 BOOL ansi
= get_ulong( &args
);
2280 struct client_menu_name client_name
;
2281 UNICODE_STRING name
;
2285 wc
.cbSize
= sizeof(wc
);
2286 if (!(ret
= NtUserGetClassInfoEx( instance
, unicode_str_32to64( &name
, name32
), &wc
,
2287 &client_name
, ansi
)))
2290 wc32
->style
= wc
.style
;
2291 wc32
->lpfnWndProc
= PtrToUlong( wc
.lpfnWndProc
);
2292 wc32
->cbClsExtra
= wc
.cbClsExtra
;
2293 wc32
->cbWndExtra
= wc
.cbWndExtra
;
2294 wc32
->hInstance
= PtrToUlong( wc
.hInstance
);
2295 wc32
->hIcon
= HandleToUlong( wc
.hIcon
);
2296 wc32
->hCursor
= HandleToUlong( wc
.hCursor
);
2297 wc32
->hbrBackground
= HandleToUlong( wc
.hbrBackground
);
2298 wc32
->lpszMenuName
= PtrToUlong( wc
.lpszMenuName
);
2299 wc32
->lpszClassName
= PtrToUlong( wc
.lpszClassName
);
2300 wc32
->hIconSm
= HandleToUlong( wc
.hIconSm
);
2301 client_menu_name_64to32( &client_name
, client_name32
);
2305 NTSTATUS WINAPI
wow64_NtUserGetClassName( UINT
*args
)
2307 HWND hwnd
= get_handle( &args
);
2308 BOOL real
= get_ulong( &args
);
2309 UNICODE_STRING32
*str32
= get_ptr( &args
);
2313 return NtUserGetClassName( hwnd
, real
, unicode_str_32to64( &str
, str32
));
2316 NTSTATUS WINAPI
wow64_NtUserGetClipboardData( UINT
*args
)
2318 UINT format
= get_ulong( &args
);
2326 } *params32
= get_ptr( &args
);
2328 struct get_clipboard_params params
;
2331 params
.data
= UlongToPtr( params32
->data
);
2332 params
.size
= params32
->size
;
2333 params
.data_size
= params32
->data_size
;
2334 params
.data_only
= params32
->data_only
;
2336 ret
= NtUserGetClipboardData( format
, ¶ms
);
2338 params32
->size
= params
.size
;
2339 params32
->data_size
= params
.data_size
;
2340 params32
->seqno
= params
.seqno
;
2341 return HandleToUlong( ret
);
2344 NTSTATUS WINAPI
wow64_NtUserGetClipboardFormatName( UINT
*args
)
2346 UINT format
= get_ulong( &args
);
2347 WCHAR
*buffer
= get_ptr( &args
);
2348 INT maxlen
= get_ulong( &args
);
2350 return NtUserGetClipboardFormatName( format
, buffer
, maxlen
);
2353 NTSTATUS WINAPI
wow64_NtUserGetClipboardOwner( UINT
*args
)
2355 return HandleToUlong( NtUserGetClipboardOwner() );
2358 NTSTATUS WINAPI
wow64_NtUserGetClipboardSequenceNumber( UINT
*args
)
2360 return NtUserGetClipboardSequenceNumber();
2363 NTSTATUS WINAPI
wow64_NtUserGetClipboardViewer( UINT
*args
)
2365 return HandleToUlong( NtUserGetClipboardViewer() );
2368 NTSTATUS WINAPI
wow64_NtUserGetCursor( UINT
*args
)
2370 return HandleToUlong( NtUserGetCursor() );
2373 NTSTATUS WINAPI
wow64_NtUserGetCursorFrameInfo( UINT
*args
)
2375 HCURSOR cursor
= get_ptr( &args
);
2376 DWORD istep
= get_ulong( &args
);
2377 DWORD
*rate_jiffies
= get_ptr( &args
);
2378 DWORD
*num_steps
= get_ptr( &args
);
2380 return HandleToUlong( NtUserGetCursorFrameInfo( cursor
, istep
, rate_jiffies
, num_steps
));
2383 NTSTATUS WINAPI
wow64_NtUserGetCursorInfo( UINT
*args
)
2391 } *info32
= get_ptr( &args
);
2394 if (!info32
) return FALSE
;
2395 info
.cbSize
= sizeof(info
);
2396 if (!NtUserGetCursorInfo( &info
)) return FALSE
;
2397 info32
->flags
= info
.flags
;
2398 info32
->hCursor
= HandleToUlong( info
.hCursor
);
2399 info32
->ptScreenPos
= info
.ptScreenPos
;
2403 NTSTATUS WINAPI
wow64_NtUserGetDC( UINT
*args
)
2405 HWND hwnd
= get_handle( &args
);
2407 return HandleToUlong( NtUserGetDC( hwnd
));
2410 NTSTATUS WINAPI
wow64_NtUserGetDCEx( UINT
*args
)
2412 HWND hwnd
= get_handle( &args
);
2413 HRGN clip_rgn
= get_handle( &args
);
2414 DWORD flags
= get_ulong( &args
);
2416 return HandleToUlong( NtUserGetDCEx( hwnd
, clip_rgn
, flags
));
2419 NTSTATUS WINAPI
wow64_NtUserGetDisplayConfigBufferSizes( UINT
*args
)
2421 UINT32 flags
= get_ulong( &args
);
2422 UINT32
*num_path_info
= get_ptr( &args
);
2423 UINT32
*num_mode_info
= get_ptr( &args
);
2425 return NtUserGetDisplayConfigBufferSizes( flags
, num_path_info
, num_mode_info
);
2428 NTSTATUS WINAPI
wow64_NtUserGetDoubleClickTime( UINT
*args
)
2430 return NtUserGetDoubleClickTime();
2433 NTSTATUS WINAPI
wow64_NtUserGetDpiForMonitor( UINT
*args
)
2435 HMONITOR monitor
= get_handle( &args
);
2436 UINT type
= get_ulong( &args
);
2437 UINT
*x
= get_ptr( &args
);
2438 UINT
*y
= get_ptr( &args
);
2440 return NtUserGetDpiForMonitor( monitor
, type
, x
, y
);
2443 NTSTATUS WINAPI
wow64_NtUserGetForegroundWindow( UINT
*args
)
2445 return HandleToUlong( NtUserGetForegroundWindow() );
2448 NTSTATUS WINAPI
wow64_NtUserGetGUIThreadInfo( UINT
*args
)
2450 DWORD id
= get_ulong( &args
);
2458 ULONG hwndMenuOwner
;
2462 } *info32
= get_ptr( &args
);
2465 if (info32
->cbSize
!= sizeof(*info32
))
2467 set_last_error32( ERROR_INVALID_PARAMETER
);
2471 info
.cbSize
= sizeof(info
);
2472 if (!NtUserGetGUIThreadInfo( id
, &info
)) return FALSE
;
2473 info32
->flags
= info
.flags
;
2474 info32
->hwndActive
= HandleToUlong( info
.hwndActive
);
2475 info32
->hwndFocus
= HandleToUlong( info
.hwndFocus
);
2476 info32
->hwndCapture
= HandleToUlong( info
.hwndCapture
);
2477 info32
->hwndMenuOwner
= HandleToUlong( info
.hwndMenuOwner
);
2478 info32
->hwndMoveSize
= HandleToUlong( info
.hwndMoveSize
);
2479 info32
->hwndCaret
= HandleToUlong( info
.hwndCaret
);
2480 info32
->rcCaret
= info
.rcCaret
;
2484 NTSTATUS WINAPI
wow64_NtUserGetIconInfo( UINT
*args
)
2486 HICON icon
= get_handle( &args
);
2494 } *info32
= get_ptr( &args
);
2495 UNICODE_STRING32
*module32
= get_ptr( &args
);
2496 UNICODE_STRING32
*res_name32
= get_ptr( &args
);
2497 DWORD
*bpp
= get_ptr( &args
);
2498 LONG unk
= get_ulong( &args
);
2501 UNICODE_STRING module
, res_name
;
2503 if (!NtUserGetIconInfo( icon
, &info
, unicode_str_32to64( &module
, module32
),
2504 unicode_str_32to64( &res_name
, res_name32
), bpp
, unk
))
2507 info32
->fIcon
= info
.fIcon
;
2508 info32
->xHotspot
= info
.xHotspot
;
2509 info32
->yHotspot
= info
.yHotspot
;
2510 info32
->hbmMask
= HandleToUlong( info
.hbmMask
);
2511 info32
->hbmColor
= HandleToUlong( info
.hbmColor
);
2514 module32
->Buffer
= PtrToUlong( module
.Buffer
);
2515 module32
->Length
= module
.Length
;
2519 res_name32
->Buffer
= PtrToUlong( res_name
.Buffer
);
2520 res_name32
->Length
= res_name
.Length
;
2525 NTSTATUS WINAPI
wow64_NtUserGetIconSize( UINT
*args
)
2527 HICON handle
= get_handle( &args
);
2528 UINT step
= get_ulong( &args
);
2529 LONG
*width
= get_ptr( &args
);
2530 LONG
*height
= get_ptr( &args
);
2532 return NtUserGetIconSize( handle
, step
, width
, height
);
2535 NTSTATUS WINAPI
wow64_NtUserGetInternalWindowPos( UINT
*args
)
2537 HWND hwnd
= get_handle( &args
);
2538 RECT
*rect
= get_ptr( &args
);
2539 POINT
*pt
= get_ptr( &args
);
2541 return NtUserGetInternalWindowPos( hwnd
, rect
, pt
);
2544 NTSTATUS WINAPI
wow64_NtUserGetKeyNameText( UINT
*args
)
2546 LONG lparam
= get_ulong( &args
);
2547 WCHAR
*buffer
= get_ptr( &args
);
2548 INT size
= get_ulong( &args
);
2550 return NtUserGetKeyNameText( lparam
, buffer
, size
);
2553 NTSTATUS WINAPI
wow64_NtUserGetKeyState( UINT
*args
)
2555 INT vkey
= get_ulong( &args
);
2557 return NtUserGetKeyState( vkey
);
2560 NTSTATUS WINAPI
wow64_NtUserGetKeyboardLayout( UINT
*args
)
2562 DWORD tid
= get_ulong( &args
);
2564 return HandleToUlong( NtUserGetKeyboardLayout( tid
));
2567 NTSTATUS WINAPI
wow64_NtUserGetKeyboardLayoutList( UINT
*args
)
2569 INT size
= get_ulong( &args
);
2570 UINT32
*layouts32
= get_ptr( &args
);
2571 HKL
*layouts
= NULL
;
2574 if (layouts32
&& size
&& !(layouts
= Wow64AllocateTemp( size
* sizeof(*layouts
) )))
2577 ret
= NtUserGetKeyboardLayoutList( size
, layouts
);
2579 for (i
= 0; i
< ret
; i
++) layouts32
[i
] = HandleToUlong( layouts
[i
] );
2583 NTSTATUS WINAPI
wow64_NtUserGetKeyboardLayoutName( UINT
*args
)
2585 WCHAR
*name
= get_ptr( &args
);
2587 return NtUserGetKeyboardLayoutName( name
);
2590 NTSTATUS WINAPI
wow64_NtUserGetKeyboardState( UINT
*args
)
2592 BYTE
*state
= get_ptr( &args
);
2594 return NtUserGetKeyboardState( state
);
2597 NTSTATUS WINAPI
wow64_NtUserGetLayeredWindowAttributes( UINT
*args
)
2599 HWND hwnd
= get_handle( &args
);
2600 COLORREF
*key
= get_ptr( &args
);
2601 BYTE
*alpha
= get_ptr( &args
);
2602 DWORD
*flags
= get_ptr( &args
);
2604 return NtUserGetLayeredWindowAttributes( hwnd
, key
, alpha
, flags
);
2607 NTSTATUS WINAPI
wow64_NtUserGetMenuBarInfo( UINT
*args
)
2609 HWND hwnd
= get_handle( &args
);
2610 LONG id
= get_ulong( &args
);
2611 LONG item
= get_ulong( &args
);
2620 } *info32
= get_ptr( &args
);
2624 if (info32
->cbSize
!= sizeof(*info32
))
2626 set_last_error32( ERROR_INVALID_PARAMETER
);
2630 info
.cbSize
= sizeof(info
);
2631 if (!NtUserGetMenuBarInfo( hwnd
, id
, item
, &info
)) return FALSE
;
2632 info32
->rcBar
= info
.rcBar
;
2633 info32
->hMenu
= HandleToUlong( info
.hMenu
);
2634 info32
->hwndMenu
= HandleToUlong( info
.hwndMenu
);
2635 info32
->fBarFocused
= info
.fBarFocused
;
2636 info32
->fFocused
= info
.fFocused
;
2640 NTSTATUS WINAPI
wow64_NtUserGetMenuItemRect( UINT
*args
)
2642 HWND hwnd
= get_handle( &args
);
2643 HMENU handle
= get_handle( &args
);
2644 UINT item
= get_ulong( &args
);
2645 RECT
*rect
= get_ptr( &args
);
2647 return NtUserGetMenuItemRect( hwnd
, handle
, item
, rect
);
2650 NTSTATUS WINAPI
wow64_NtUserGetMessage( UINT
*args
)
2652 MSG32
*msg32
= get_ptr( &args
);
2653 HWND hwnd
= get_handle( &args
);
2654 UINT first
= get_ulong( &args
);
2655 UINT last
= get_ulong( &args
);
2659 ret
= NtUserGetMessage( &msg
, hwnd
, first
, last
);
2660 if (ret
!= -1) msg_64to32( &msg
, msg32
);
2664 NTSTATUS WINAPI
wow64_NtUserGetMouseMovePointsEx( UINT
*args
)
2666 UINT size
= get_ulong( &args
);
2667 MOUSEMOVEPOINT32
*ptin32
= get_ptr( &args
);
2668 MOUSEMOVEPOINT32
*ptout32
= get_ptr( &args
);
2669 int count
= get_ulong( &args
);
2670 DWORD resolution
= get_ulong( &args
);
2672 MOUSEMOVEPOINT ptin
[64], ptout
[64];
2675 if (size
!= sizeof(MOUSEMOVEPOINT32
) || count
< 0 || count
> ARRAYSIZE( ptin
))
2677 set_last_error32( ERROR_INVALID_PARAMETER
);
2681 if (!ptin32
|| (!ptout32
&& count
))
2683 set_last_error32( ERROR_NOACCESS
);
2687 for (i
= 0; i
< count
; i
++)
2689 ptin
[i
].x
= ptin32
[i
].x
;
2690 ptin
[i
].y
= ptin32
[i
].y
;
2691 ptin
[i
].time
= ptin32
[i
].time
;
2692 ptin
[i
].dwExtraInfo
= ptin32
[i
].dwExtraInfo
;
2695 ret
= NtUserGetMouseMovePointsEx( sizeof(MOUSEMOVEPOINT
), ptin
, ptout
, count
, resolution
);
2697 for (i
= 0; i
< ret
; i
++)
2699 ptout32
[i
].x
= ptout
[i
].x
;
2700 ptout32
[i
].y
= ptout
[i
].y
;
2701 ptout32
[i
].time
= ptout
[i
].time
;
2702 ptout32
[i
].dwExtraInfo
= ptout
[i
].dwExtraInfo
;
2708 NTSTATUS WINAPI
wow64_NtUserGetObjectInformation( UINT
*args
)
2710 HANDLE handle
= get_handle( &args
);
2711 INT index
= get_ulong( &args
);
2712 void *info
= get_ptr( &args
);
2713 DWORD len
= get_ulong( &args
);
2714 DWORD
*needed
= get_ptr( &args
);
2716 return NtUserGetObjectInformation( handle
, index
, info
, len
, needed
);
2719 NTSTATUS WINAPI
wow64_NtUserGetOpenClipboardWindow( UINT
*args
)
2721 return HandleToUlong( NtUserGetOpenClipboardWindow() );
2724 NTSTATUS WINAPI
wow64_NtUserGetPointerInfoList( UINT
*args
)
2726 UINT id
= get_ulong( &args
);
2727 UINT type
= get_ulong( &args
);
2728 UINT unk0
= get_ulong( &args
);
2729 UINT unk1
= get_ulong( &args
);
2730 UINT size
= get_ulong( &args
);
2731 void *entry_count
= get_ptr( &args
);
2732 void *pointer_count
= get_ptr( &args
);
2733 void *pointer_info
= get_ptr( &args
);
2735 return NtUserGetPointerInfoList( id
, type
, unk0
, unk1
, size
, entry_count
, pointer_count
, pointer_info
);
2738 NTSTATUS WINAPI
wow64_NtUserGetPriorityClipboardFormat( UINT
*args
)
2740 UINT
*list
= get_ptr( &args
);
2741 INT count
= get_ulong( &args
);
2743 return NtUserGetPriorityClipboardFormat( list
, count
);
2746 NTSTATUS WINAPI
wow64_NtUserGetProcessDpiAwarenessContext( UINT
*args
)
2748 HANDLE process
= get_handle( &args
);
2750 return NtUserGetProcessDpiAwarenessContext( process
);
2753 NTSTATUS WINAPI
wow64_NtUserGetProcessWindowStation( UINT
*args
)
2755 return HandleToUlong( NtUserGetProcessWindowStation() );
2758 NTSTATUS WINAPI
wow64_NtUserGetProp( UINT
*args
)
2760 HWND hwnd
= get_handle( &args
);
2761 const WCHAR
*str
= get_ptr( &args
);
2763 return HandleToUlong( NtUserGetProp( hwnd
, str
));
2766 NTSTATUS WINAPI
wow64_NtUserGetQueueStatus( UINT
*args
)
2768 UINT flags
= get_ulong( &args
);
2770 return NtUserGetQueueStatus( flags
);
2773 NTSTATUS WINAPI
wow64_NtUserGetRawInputBuffer( UINT
*args
)
2775 RAWINPUT
*data
= get_ptr( &args
);
2776 UINT
*data_size
= get_ptr( &args
);
2777 UINT header_size
= get_ulong( &args
);
2779 if (header_size
!= sizeof(RAWINPUTHEADER32
))
2781 set_last_error32( ERROR_INVALID_PARAMETER
);
2785 /* RAWINPUT has different sizes on 32-bit and 64-bit, but no translation is
2786 * done. The function actually returns different structures depending on
2787 * whether it's operating under WoW64 or not. */
2788 return NtUserGetRawInputBuffer( data
, data_size
, sizeof(RAWINPUTHEADER
) );
2791 NTSTATUS WINAPI
wow64_NtUserGetRawInputData( UINT
*args
)
2793 HRAWINPUT handle
= get_handle( &args
);
2794 UINT command
= get_ulong( &args
);
2795 void *data
= get_ptr( &args
);
2796 UINT
*data_size
= get_ptr( &args
);
2797 UINT header_size
= get_ulong( &args
);
2799 if (header_size
!= sizeof(RAWINPUTHEADER32
))
2801 set_last_error32( ERROR_INVALID_PARAMETER
);
2810 UINT data_size64
, body_size
, ret
;
2811 RAWINPUTHEADER32
*data32
= data
;
2812 RAWINPUTHEADER
*data64
= NULL
;
2814 data_size64
= *data_size
+ sizeof(RAWINPUTHEADER
);
2815 if (!(data64
= Wow64AllocateTemp( data_size64
)))
2817 set_last_error32( STATUS_NO_MEMORY
);
2821 ret
= NtUserGetRawInputData( handle
, command
, data64
, &data_size64
, sizeof(RAWINPUTHEADER
) );
2822 if (ret
== ~0u) return ret
;
2824 body_size
= ret
- sizeof(RAWINPUTHEADER
);
2825 if (*data_size
< sizeof(RAWINPUTHEADER32
) + body_size
)
2827 set_last_error32( ERROR_INSUFFICIENT_BUFFER
);
2831 data32
->dwType
= data64
->dwType
;
2832 data32
->dwSize
= sizeof(RAWINPUTHEADER32
) + body_size
;
2833 data32
->hDevice
= (UINT_PTR
)data64
->hDevice
;
2834 data32
->wParam
= data64
->wParam
;
2835 memcpy( data32
+ 1, data64
+ 1, body_size
);
2836 return sizeof(RAWINPUTHEADER32
) + body_size
;
2840 UINT data_size64
, ret
;
2842 ret
= NtUserGetRawInputData( handle
, command
, NULL
, &data_size64
, sizeof(RAWINPUTHEADER
) );
2843 if (ret
== ~0u) return ret
;
2844 *data_size
= data_size64
- sizeof(RAWINPUTHEADER
) + sizeof(RAWINPUTHEADER32
);
2850 UINT data_size64
= sizeof(RAWINPUTHEADER
);
2851 RAWINPUTHEADER32
*data32
= data
;
2852 RAWINPUTHEADER data64
;
2857 *data_size
= sizeof(RAWINPUTHEADER32
);
2861 if (*data_size
< sizeof(RAWINPUTHEADER32
))
2863 set_last_error32( ERROR_INSUFFICIENT_BUFFER
);
2867 ret
= NtUserGetRawInputData( handle
, command
, &data64
, &data_size64
, sizeof(RAWINPUTHEADER
) );
2868 if (ret
== ~0u) return ret
;
2869 data32
->dwType
= data64
.dwType
;
2870 data32
->dwSize
= data64
.dwSize
- sizeof(RAWINPUTHEADER
) + sizeof(RAWINPUTHEADER32
);
2871 data32
->hDevice
= (UINT_PTR
)data64
.hDevice
;
2872 data32
->wParam
= data64
.wParam
;
2873 return sizeof(RAWINPUTHEADER32
);
2877 set_last_error32( ERROR_INVALID_PARAMETER
);
2882 NTSTATUS WINAPI
wow64_NtUserGetRawInputDeviceInfo( UINT
*args
)
2884 HANDLE handle
= get_handle( &args
);
2885 UINT command
= get_ulong( &args
);
2886 void *data
= get_ptr( &args
);
2887 UINT
*data_size
= get_ptr( &args
);
2889 return NtUserGetRawInputDeviceInfo( handle
, command
, data
, data_size
);
2892 NTSTATUS WINAPI
wow64_NtUserGetRawInputDeviceList( UINT
*args
)
2894 RAWINPUTDEVICELIST32
*devices32
= get_ptr( &args
);
2895 UINT
*count
= get_ptr( &args
);
2896 UINT size
= get_ulong( &args
);
2898 if (size
!= sizeof(RAWINPUTDEVICELIST32
))
2900 set_last_error32( ERROR_INVALID_PARAMETER
);
2906 RAWINPUTDEVICELIST
*devices64
;
2907 unsigned int ret
, i
;
2909 if (!(devices64
= Wow64AllocateTemp( (*count
) * sizeof(*devices64
) )))
2911 set_last_error32( ERROR_NOT_ENOUGH_MEMORY
);
2915 ret
= NtUserGetRawInputDeviceList( devices64
, count
, sizeof(RAWINPUTDEVICELIST
) );
2916 if (ret
== ~0u) return ret
;
2918 for (i
= 0; i
< *count
; ++i
)
2920 devices32
[i
].hDevice
= (UINT_PTR
)devices64
[i
].hDevice
;
2921 devices32
[i
].dwType
= devices64
[i
].dwType
;
2927 return NtUserGetRawInputDeviceList( NULL
, count
, sizeof(RAWINPUTDEVICELIST
) );
2931 NTSTATUS WINAPI
wow64_NtUserRealChildWindowFromPoint( UINT
*args
)
2933 HWND parent
= get_handle( &args
);
2934 LONG x
= get_ulong( &args
);
2935 LONG y
= get_ulong( &args
);
2937 return HandleToUlong( NtUserRealChildWindowFromPoint( parent
, x
, y
));
2940 NTSTATUS WINAPI
wow64_NtUserRegisterClassExWOW( UINT
*args
)
2942 const WNDCLASSEXW32
*wc32
= get_ptr( &args
);
2943 UNICODE_STRING32
*name32
= get_ptr( &args
);
2944 UNICODE_STRING32
*version32
= get_ptr( &args
);
2945 struct client_menu_name32
*client_name32
= get_ptr( &args
);
2946 DWORD fnid
= get_ulong( &args
);
2947 DWORD flags
= get_ulong( &args
);
2948 DWORD
*wow
= get_ptr( &args
);
2950 struct client_menu_name client_name
;
2951 UNICODE_STRING name
, version
;
2954 if (wc32
->cbSize
!= sizeof(*wc32
))
2956 set_last_error32( ERROR_INVALID_PARAMETER
);
2960 wc
.cbSize
= sizeof(wc
);
2961 wc
.style
= wc32
->style
;
2962 wc
.lpfnWndProc
= UlongToPtr( wc32
->lpfnWndProc
);
2963 wc
.cbClsExtra
= wc32
->cbClsExtra
;
2964 wc
.cbWndExtra
= wc32
->cbWndExtra
;
2965 wc
.hInstance
= UlongToPtr( wc32
->hInstance
);
2966 wc
.hIcon
= LongToHandle( wc32
->hIcon
);
2967 wc
.hCursor
= LongToHandle( wc32
->hCursor
);
2968 wc
.hbrBackground
= UlongToHandle( wc32
->hbrBackground
);
2969 wc
.lpszMenuName
= UlongToPtr( wc32
->lpszMenuName
);
2970 wc
.lpszClassName
= UlongToPtr( wc32
->lpszClassName
);
2971 wc
.hIconSm
= LongToHandle( wc32
->hIconSm
);
2973 return NtUserRegisterClassExWOW( &wc
,
2974 unicode_str_32to64( &name
, name32
),
2975 unicode_str_32to64( &version
, version32
),
2976 client_menu_name_32to64( &client_name
, client_name32
),
2980 NTSTATUS WINAPI
wow64_NtUserGetRegisteredRawInputDevices( UINT
*args
)
2982 RAWINPUTDEVICE32
*devices32
= get_ptr( &args
);
2983 UINT
*count
= get_ptr( &args
);
2984 UINT size
= get_ulong( &args
);
2986 if (size
!= sizeof(RAWINPUTDEVICE32
))
2988 set_last_error32( ERROR_INVALID_PARAMETER
);
2994 RAWINPUTDEVICE
*devices64
;
2995 unsigned int ret
, i
;
2997 if (!(devices64
= Wow64AllocateTemp( (*count
) * sizeof(*devices64
) )))
2999 set_last_error32( ERROR_NOT_ENOUGH_MEMORY
);
3003 ret
= NtUserGetRegisteredRawInputDevices( devices64
, count
, sizeof(RAWINPUTDEVICE
) );
3004 if (ret
== ~0u) return ret
;
3006 for (i
= 0; i
< *count
; ++i
)
3008 devices32
[i
].usUsagePage
= devices64
[i
].usUsagePage
;
3009 devices32
[i
].usUsage
= devices64
[i
].usUsage
;
3010 devices32
[i
].dwFlags
= devices64
[i
].dwFlags
;
3011 devices32
[i
].hwndTarget
= (ULONG_PTR
)devices64
[i
].hwndTarget
;
3017 return NtUserGetRegisteredRawInputDevices( NULL
, count
, sizeof(RAWINPUTDEVICE
) );
3021 NTSTATUS WINAPI
wow64_NtUserGetScrollBarInfo( UINT
*args
)
3023 HWND hwnd
= get_handle( &args
);
3024 LONG id
= get_ulong( &args
);
3025 SCROLLBARINFO
*info
= get_ptr( &args
);
3027 return NtUserGetScrollBarInfo( hwnd
, id
, info
);
3030 NTSTATUS WINAPI
wow64_NtUserGetSystemDpiForProcess( UINT
*args
)
3032 HANDLE process
= get_handle( &args
);
3034 return NtUserGetSystemDpiForProcess( process
);
3037 NTSTATUS WINAPI
wow64_NtUserGetSystemMenu( UINT
*args
)
3039 HWND hwnd
= get_handle( &args
);
3040 BOOL revert
= get_ulong( &args
);
3042 return HandleToUlong( NtUserGetSystemMenu( hwnd
, revert
));
3045 NTSTATUS WINAPI
wow64_NtUserGetThreadDesktop( UINT
*args
)
3047 DWORD thread
= get_ulong( &args
);
3049 return HandleToUlong( NtUserGetThreadDesktop( thread
));
3052 NTSTATUS WINAPI
wow64_NtUserGetTitleBarInfo( UINT
*args
)
3054 HWND hwnd
= get_handle( &args
);
3055 TITLEBARINFO
*info
= get_ptr( &args
);
3057 return NtUserGetTitleBarInfo( hwnd
, info
);
3060 NTSTATUS WINAPI
wow64_NtUserGetUpdateRect( UINT
*args
)
3062 HWND hwnd
= get_handle( &args
);
3063 RECT
*rect
= get_ptr( &args
);
3064 BOOL erase
= get_ulong( &args
);
3066 return NtUserGetUpdateRect( hwnd
, rect
, erase
);
3069 NTSTATUS WINAPI
wow64_NtUserGetUpdateRgn( UINT
*args
)
3071 HWND hwnd
= get_handle( &args
);
3072 HRGN hrgn
= get_handle( &args
);
3073 BOOL erase
= get_ulong( &args
);
3075 return NtUserGetUpdateRgn( hwnd
, hrgn
, erase
);
3078 NTSTATUS WINAPI
wow64_NtUserGetUpdatedClipboardFormats( UINT
*args
)
3080 UINT
*formats
= get_ptr( &args
);
3081 UINT size
= get_ulong( &args
);
3082 UINT
*out_size
= get_ptr( &args
);
3084 return NtUserGetUpdatedClipboardFormats( formats
, size
, out_size
);
3087 NTSTATUS WINAPI
wow64_NtUserGetWindowDC( UINT
*args
)
3089 HWND hwnd
= get_handle( &args
);
3091 return HandleToUlong( NtUserGetWindowDC( hwnd
));
3094 NTSTATUS WINAPI
wow64_NtUserGetWindowPlacement( UINT
*args
)
3096 HWND hwnd
= get_handle( &args
);
3097 WINDOWPLACEMENT
*placement
= get_ptr( &args
);
3099 return NtUserGetWindowPlacement( hwnd
, placement
);
3102 NTSTATUS WINAPI
wow64_NtUserGetWindowRgnEx( UINT
*args
)
3104 HWND hwnd
= get_handle( &args
);
3105 HRGN hrgn
= get_handle( &args
);
3106 UINT unk
= get_ulong( &args
);
3108 return NtUserGetWindowRgnEx( hwnd
, hrgn
, unk
);
3111 NTSTATUS WINAPI
wow64_NtUserHideCaret( UINT
*args
)
3113 HWND hwnd
= get_handle( &args
);
3115 return NtUserHideCaret( hwnd
);
3118 NTSTATUS WINAPI
wow64_NtUserHiliteMenuItem( UINT
*args
)
3120 HWND hwnd
= get_handle( &args
);
3121 HMENU handle
= get_handle( &args
);
3122 UINT item
= get_ulong( &args
);
3123 UINT hilite
= get_ulong( &args
);
3125 return NtUserHiliteMenuItem( hwnd
, handle
, item
, hilite
);
3128 struct user_client_procs32
3130 ULONG pButtonWndProc
;
3131 ULONG pComboWndProc
;
3132 ULONG pDefWindowProc
;
3135 ULONG pListBoxWndProc
;
3136 ULONG pMDIClientWndProc
;
3137 ULONG pScrollBarWndProc
;
3138 ULONG pStaticWndProc
;
3140 ULONG pDesktopWndProc
;
3141 ULONG pIconTitleWndProc
;
3142 ULONG pPopupMenuWndProc
;
3143 ULONG pMessageWndProc
;
3146 static struct user_client_procs
*user_client_procs_32to64( struct user_client_procs
*procs
,
3147 const struct user_client_procs32
*procs32
)
3149 if (!procs32
) return NULL
;
3151 procs
->pButtonWndProc
= UlongToPtr( procs32
->pButtonWndProc
);
3152 procs
->pComboWndProc
= UlongToPtr( procs32
->pComboWndProc
);
3153 procs
->pDefWindowProc
= UlongToPtr( procs32
->pDefWindowProc
);
3154 procs
->pDefDlgProc
= UlongToPtr( procs32
->pDefDlgProc
);
3155 procs
->pEditWndProc
= UlongToPtr( procs32
->pEditWndProc
);
3156 procs
->pListBoxWndProc
= UlongToPtr( procs32
->pListBoxWndProc
);
3157 procs
->pMDIClientWndProc
= UlongToPtr( procs32
->pMDIClientWndProc
);
3158 procs
->pScrollBarWndProc
= UlongToPtr( procs32
->pScrollBarWndProc
);
3159 procs
->pStaticWndProc
= UlongToPtr( procs32
->pStaticWndProc
);
3160 procs
->pImeWndProc
= UlongToPtr( procs32
->pImeWndProc
);
3161 procs
->pDesktopWndProc
= UlongToPtr( procs32
->pDesktopWndProc
);
3162 procs
->pIconTitleWndProc
= UlongToPtr( procs32
->pIconTitleWndProc
);
3163 procs
->pPopupMenuWndProc
= UlongToPtr( procs32
->pPopupMenuWndProc
);
3164 procs
->pMessageWndProc
= UlongToPtr( procs32
->pMessageWndProc
);
3168 NTSTATUS WINAPI
wow64_NtUserInitializeClientPfnArrays( UINT
*args
)
3170 const struct user_client_procs32
*procsA32
= get_ptr( &args
);
3171 const struct user_client_procs32
*procsW32
= get_ptr( &args
);
3172 void *workers
= get_ptr( &args
);
3173 HINSTANCE user_module
= get_ptr( &args
);
3175 struct user_client_procs procsA
, procsW
;
3176 return NtUserInitializeClientPfnArrays( user_client_procs_32to64( &procsA
, procsA32
),
3177 user_client_procs_32to64( &procsW
, procsW32
),
3178 workers
, user_module
);
3181 NTSTATUS WINAPI
wow64_NtUserInternalGetWindowIcon( UINT
*args
)
3183 HWND hwnd
= get_handle( &args
);
3184 UINT type
= get_ulong( &args
);
3186 return HandleToUlong( NtUserInternalGetWindowIcon( hwnd
, type
));
3189 NTSTATUS WINAPI
wow64_NtUserInternalGetWindowText( UINT
*args
)
3191 HWND hwnd
= get_handle( &args
);
3192 WCHAR
*text
= get_ptr( &args
);
3193 INT count
= get_ulong( &args
);
3195 return NtUserInternalGetWindowText( hwnd
, text
, count
);
3198 NTSTATUS WINAPI
wow64_NtUserInvalidateRect( UINT
*args
)
3200 HWND hwnd
= get_handle( &args
);
3201 const RECT
*rect
= get_ptr( &args
);
3202 BOOL erase
= get_ulong( &args
);
3204 return NtUserInvalidateRect( hwnd
, rect
, erase
);
3207 NTSTATUS WINAPI
wow64_NtUserInvalidateRgn( UINT
*args
)
3209 HWND hwnd
= get_handle( &args
);
3210 HRGN hrgn
= get_handle( &args
);
3211 BOOL erase
= get_ulong( &args
);
3213 return NtUserInvalidateRgn( hwnd
, hrgn
, erase
);
3216 NTSTATUS WINAPI
wow64_NtUserIsClipboardFormatAvailable( UINT
*args
)
3218 UINT format
= get_ulong( &args
);
3220 return NtUserIsClipboardFormatAvailable( format
);
3223 NTSTATUS WINAPI
wow64_NtUserIsMouseInPointerEnabled( UINT
*args
)
3225 return NtUserIsMouseInPointerEnabled();
3228 NTSTATUS WINAPI
wow64_NtUserKillTimer( UINT
*args
)
3230 HWND hwnd
= get_handle( &args
);
3231 UINT_PTR id
= get_ulong( &args
);
3233 return NtUserKillTimer( hwnd
, id
);
3236 NTSTATUS WINAPI
wow64_NtUserLockWindowUpdate( UINT
*args
)
3238 HWND hwnd
= get_handle( &args
);
3240 return NtUserLockWindowUpdate( hwnd
);
3243 NTSTATUS WINAPI
wow64_NtUserLogicalToPerMonitorDPIPhysicalPoint( UINT
*args
)
3245 HWND hwnd
= get_handle( &args
);
3246 POINT
*pt
= get_ptr( &args
);
3248 return NtUserLogicalToPerMonitorDPIPhysicalPoint( hwnd
, pt
);
3251 NTSTATUS WINAPI
wow64_NtUserMapVirtualKeyEx( UINT
*args
)
3253 UINT code
= get_ulong( &args
);
3254 UINT type
= get_ulong( &args
);
3255 HKL layout
= get_handle( &args
);
3257 return NtUserMapVirtualKeyEx( code
, type
, layout
);
3260 NTSTATUS WINAPI
wow64_NtUserMenuItemFromPoint( UINT
*args
)
3262 HWND hwnd
= get_handle( &args
);
3263 HMENU handle
= get_handle( &args
);
3264 int x
= get_ulong( &args
);
3265 int y
= get_ulong( &args
);
3267 return NtUserMenuItemFromPoint( hwnd
, handle
, x
, y
);
3270 static LRESULT
message_call_32to64( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
,
3271 void *result_info
, DWORD type
, BOOL ansi
)
3281 CREATESTRUCT32
*cs32
= (void *)lparam
;
3284 createstruct_32to64( cs32
, &cs
);
3285 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&cs
, result_info
, type
, ansi
);
3286 cs32
->lpCreateParams
= PtrToUlong( cs
.lpCreateParams
);
3287 cs32
->hInstance
= PtrToUlong( cs
.hInstance
);
3288 cs32
->hMenu
= HandleToLong( cs
.hMenu
);
3289 cs32
->hwndParent
= HandleToLong( cs
.hwndParent
);
3294 cs32
->style
= cs
.style
;
3295 cs32
->dwExStyle
= cs
.dwExStyle
;
3298 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3302 MDICREATESTRUCT32
*cs32
= (void *)lparam
;
3303 MDICREATESTRUCTW cs
;
3305 cs
.szClass
= UlongToPtr( cs32
->szClass
);
3306 cs
.szTitle
= UlongToPtr( cs32
->szTitle
);
3307 cs
.hOwner
= LongToHandle( cs32
->hOwner
);
3312 cs
.style
= cs32
->style
;
3313 cs
.lParam
= cs32
->lParam
;
3315 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&cs
, result_info
, type
, ansi
);
3318 case WM_WINDOWPOSCHANGING
:
3319 case WM_WINDOWPOSCHANGED
:
3321 WINDOWPOS32
*winpos32
= (void *)lparam
;
3324 winpos_32to64( &winpos
, winpos32
);
3325 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&winpos
, result_info
, type
, ansi
);
3326 winpos_64to32( &winpos
, winpos32
);
3333 NCCALCSIZE_PARAMS32
*params32
= (void *)lparam
;
3334 NCCALCSIZE_PARAMS params
;
3337 params
.rgrc
[0] = params32
->rgrc
[0];
3338 params
.rgrc
[1] = params32
->rgrc
[1];
3339 params
.rgrc
[2] = params32
->rgrc
[2];
3340 params
.lppos
= &winpos
;
3341 winpos_32to64( &winpos
, UlongToPtr( params32
->lppos
));
3342 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)¶ms
, result_info
, type
, ansi
);
3343 params32
->rgrc
[0] = params
.rgrc
[0];
3344 params32
->rgrc
[1] = params
.rgrc
[1];
3345 params32
->rgrc
[2] = params
.rgrc
[2];
3346 winpos_64to32( &winpos
, UlongToPtr( params32
->lppos
));
3349 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3351 case WM_COMPAREITEM
:
3353 COMPAREITEMSTRUCT32
*cis32
= (void *)lparam
;
3354 COMPAREITEMSTRUCT cis
;
3356 cis
.CtlType
= cis32
->CtlType
;
3357 cis
.CtlID
= cis32
->CtlID
;
3358 cis
.hwndItem
= LongToHandle( cis32
->hwndItem
);
3359 cis
.itemID1
= cis32
->itemID1
;
3360 cis
.itemData1
= cis32
->itemData1
;
3361 cis
.itemID2
= cis32
->itemID2
;
3362 cis
.itemData2
= cis32
->itemData2
;
3363 cis
.dwLocaleId
= cis32
->dwLocaleId
;
3364 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&cis
, result_info
, type
, ansi
);
3369 DELETEITEMSTRUCT32
*dis32
= (void *)lparam
;
3370 DELETEITEMSTRUCT dis
;
3372 dis
.CtlType
= dis32
->CtlType
;
3373 dis
.CtlID
= dis32
->CtlID
;
3374 dis
.itemID
= dis32
->itemID
;
3375 dis
.hwndItem
= LongToHandle( dis32
->hwndItem
);
3376 dis
.itemData
= dis32
->itemData
;
3377 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&dis
, result_info
, type
, ansi
);
3380 case WM_MEASUREITEM
:
3382 MEASUREITEMSTRUCT32
*mis32
= (void *)lparam
;
3383 MEASUREITEMSTRUCT mis
;
3385 mis
.CtlType
= mis32
->CtlType
;
3386 mis
.CtlID
= mis32
->CtlID
;
3387 mis
.itemID
= mis32
->itemID
;
3388 mis
.itemWidth
= mis32
->itemWidth
;
3389 mis
.itemHeight
= mis32
->itemHeight
;
3390 mis
.itemData
= mis32
->itemData
;
3391 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&mis
, result_info
, type
, ansi
);
3392 mis32
->CtlType
= mis
.CtlType
;
3393 mis32
->CtlID
= mis
.CtlID
;
3394 mis32
->itemID
= mis
.itemID
;
3395 mis32
->itemWidth
= mis
.itemWidth
;
3396 mis32
->itemHeight
= mis
.itemHeight
;
3397 mis32
->itemData
= mis
.itemData
;
3403 DRAWITEMSTRUCT32
*dis32
= (void *)lparam
;
3406 dis
.CtlType
= dis32
->CtlType
;
3407 dis
.CtlID
= dis32
->CtlID
;
3408 dis
.itemID
= dis32
->itemID
;
3409 dis
.itemAction
= dis32
->itemAction
;
3410 dis
.itemState
= dis32
->itemState
;
3411 dis
.hwndItem
= LongToHandle( dis32
->hwndItem
);
3412 dis
.hDC
= LongToHandle( dis32
->hDC
);
3413 dis
.itemData
= dis32
->itemData
;
3414 dis
.rcItem
.left
= dis32
->rcItem
.left
;
3415 dis
.rcItem
.top
= dis32
->rcItem
.top
;
3416 dis
.rcItem
.right
= dis32
->rcItem
.right
;
3417 dis
.rcItem
.bottom
= dis32
->rcItem
.bottom
;
3418 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&dis
, result_info
, type
, ansi
);
3423 COPYDATASTRUCT32
*cds32
= (void *)lparam
;
3426 cds
.dwData
= cds32
->dwData
;
3427 cds
.cbData
= cds32
->cbData
;
3428 cds
.lpData
= UlongToPtr( cds32
->lpData
);
3429 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&cds
, result_info
, type
, ansi
);
3434 HELPINFO32
*hi32
= (void *)lparam
;
3437 hi64
.cbSize
= sizeof(hi64
);
3438 hi64
.iContextType
= hi32
->iContextType
;
3439 hi64
.iCtrlId
= hi32
->iCtrlId
;
3440 hi64
.hItemHandle
= LongToHandle( hi32
->hItemHandle
);
3441 hi64
.dwContextId
= hi32
->dwContextId
;
3442 hi64
.MousePos
= hi32
->MousePos
;
3443 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&hi64
, result_info
, type
, ansi
);
3449 MSG32
*msg32
= (MSG32
*)lparam
;
3452 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)msg_32to64( &msg64
, msg32
),
3453 result_info
, type
, ansi
);
3455 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3459 MDINEXTMENU32
*next32
= (void *)lparam
;
3462 next
.hmenuIn
= LongToHandle( next32
->hmenuIn
);
3463 next
.hmenuNext
= LongToHandle( next32
->hmenuNext
);
3464 next
.hwndNext
= LongToHandle( next32
->hwndNext
);
3465 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&next
, result_info
, type
, ansi
);
3466 next32
->hmenuIn
= HandleToLong( next
.hmenuIn
);
3467 next32
->hmenuNext
= HandleToLong( next
.hmenuNext
);
3468 next32
->hwndNext
= HandleToLong( next
.hwndNext
);
3472 case WM_PAINTCLIPBOARD
:
3476 paintstruct_32to64( &ps
, (PAINTSTRUCT32
*)lparam
);
3477 return NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&ps
, result_info
, type
, ansi
);
3480 case CB_GETCOMBOBOXINFO
:
3482 COMBOBOXINFO32
*ci32
= (COMBOBOXINFO32
*)lparam
;
3485 ci
.cbSize
= ci32
->cbSize
;
3486 ci
.rcItem
= ci32
->rcItem
;
3487 ci
.rcButton
= ci32
->rcButton
;
3488 ci
.stateButton
= ci32
->stateButton
;
3489 ci
.hwndCombo
= LongToHandle( ci32
->hwndCombo
);
3490 ci
.hwndItem
= LongToHandle( ci32
->hwndItem
);
3491 ci
.hwndList
= LongToHandle( ci32
->hwndList
);
3492 ret
= NtUserMessageCall( hwnd
, msg
, wparam
, (LPARAM
)&ci
, result_info
, type
, ansi
);
3493 ci32
->cbSize
= ci
.cbSize
;
3494 ci32
->rcItem
= ci
.rcItem
;
3495 ci32
->rcButton
= ci
.rcButton
;
3496 ci32
->stateButton
= ci
.stateButton
;
3497 ci32
->hwndCombo
= HandleToLong( ci
.hwndCombo
);
3498 ci32
->hwndItem
= HandleToLong( ci
.hwndItem
);
3499 ci32
->hwndList
= HandleToLong( ci
.hwndList
);
3504 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3508 NTSTATUS WINAPI
wow64_NtUserMessageCall( UINT
*args
)
3510 HWND hwnd
= get_handle( &args
);
3511 UINT msg
= get_ulong( &args
);
3512 LONG wparam
= get_ulong( &args
);
3513 LONG lparam
= get_ulong( &args
);
3514 void *result_info
= get_ptr( &args
);
3515 UINT type
= get_ulong ( &args
);
3516 BOOL ansi
= get_ulong( &args
);
3520 case NtUserGetDispatchParams
:
3521 case NtUserCallWindowProc
:
3523 struct win_proc_params32
*params32
= result_info
;
3524 struct win_proc_params params
;
3526 if (type
== NtUserCallWindowProc
) params
.func
= UlongToPtr( params32
->func
);
3528 if (!NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
))
3531 win_proc_params_64to32( ¶ms
, params32
);
3535 case NtUserSendMessage
:
3537 struct win_proc_params32
*params32
= result_info
;
3541 struct win_proc_params params
;
3545 ret
= message_call_32to64( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
);
3546 if (params
.hwnd
) win_proc_params_64to32( ¶ms
, params32
);
3550 return message_call_32to64( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3553 case NtUserSendMessageTimeout
:
3560 } *params32
= result_info
;
3561 struct send_message_timeout_params params
;
3564 params
.flags
= params32
->flags
;
3565 params
.timeout
= params32
->timeout
;
3566 ret
= message_call_32to64( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
);
3567 params32
->result
= params
.result
;
3571 case NtUserSendMessageCallback
:
3577 } *params32
= result_info
;
3578 struct send_message_callback_params params
;
3580 params
.callback
= UlongToPtr( params32
->callback
);
3581 params
.data
= params32
->data
;
3582 return message_call_32to64( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
);
3585 case NtUserSpyGetMsgName
:
3586 /* no argument conversion */
3587 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3589 case NtUserImeDriverCall
:
3596 } *params32
= result_info
;
3597 struct ime_driver_call_params params
;
3598 params
.himc
= UlongToPtr( params32
->himc
);
3599 params
.state
= UlongToPtr( params32
->state
);
3600 params
.compstr
= UlongToPtr( params32
->compstr
);
3601 return NtUserMessageCall( hwnd
, msg
, wparam
, lparam
, ¶ms
, type
, ansi
);
3605 return message_call_32to64( hwnd
, msg
, wparam
, lparam
, result_info
, type
, ansi
);
3608 NTSTATUS WINAPI
wow64_NtUserMoveWindow( UINT
*args
)
3610 HWND hwnd
= get_handle( &args
);
3611 INT x
= get_ulong( &args
);
3612 INT y
= get_ulong( &args
);
3613 INT cx
= get_ulong( &args
);
3614 INT cy
= get_ulong( &args
);
3615 BOOL repaint
= get_ulong( &args
);
3617 return NtUserMoveWindow( hwnd
, x
, y
, cx
, cy
, repaint
);
3620 NTSTATUS WINAPI
wow64_NtUserMsgWaitForMultipleObjectsEx( UINT
*args
)
3622 DWORD count
= get_ulong( &args
);
3623 const ULONG
*handles32
= get_ptr( &args
);
3624 DWORD timeout
= get_ulong( &args
);
3625 DWORD mask
= get_ulong( &args
);
3626 DWORD flags
= get_ulong( &args
);
3628 HANDLE handles
[MAXIMUM_WAIT_OBJECTS
];
3631 if (count
> ARRAYSIZE(handles
))
3633 set_last_error32( ERROR_INVALID_PARAMETER
);
3636 for (i
= 0; i
< count
; i
++) handles
[i
] = LongToHandle( handles32
[i
] );
3638 return NtUserMsgWaitForMultipleObjectsEx( count
, handles
, timeout
, mask
, flags
);
3641 NTSTATUS WINAPI
wow64_NtUserNotifyIMEStatus( UINT
*args
)
3643 HWND hwnd
= get_handle( &args
);
3644 ULONG status
= get_ulong( &args
);
3646 NtUserNotifyIMEStatus( hwnd
, status
);
3650 NTSTATUS WINAPI
wow64_NtUserNotifyWinEvent( UINT
*args
)
3652 DWORD event
= get_ulong( &args
);
3653 HWND hwnd
= get_handle( &args
);
3654 LONG object_id
= get_ulong( &args
);
3655 LONG child_id
= get_ulong( &args
);
3657 NtUserNotifyWinEvent( event
, hwnd
, object_id
, child_id
);
3661 NTSTATUS WINAPI
wow64_NtUserOpenClipboard( UINT
*args
)
3663 HWND hwnd
= get_handle( &args
);
3664 ULONG unk
= get_ulong( &args
);
3666 return NtUserOpenClipboard( hwnd
, unk
);
3669 NTSTATUS WINAPI
wow64_NtUserOpenDesktop( UINT
*args
)
3671 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
3672 DWORD flags
= get_ulong( &args
);
3673 ACCESS_MASK access
= get_ulong( &args
);
3675 struct object_attr64 attr
;
3678 ret
= NtUserOpenDesktop( objattr_32to64( &attr
, attr32
), flags
, access
);
3679 return HandleToUlong( ret
);
3682 NTSTATUS WINAPI
wow64_NtUserOpenInputDesktop( UINT
*args
)
3684 DWORD flags
= get_ulong( &args
);
3685 BOOL inherit
= get_ulong( &args
);
3686 ACCESS_MASK access
= get_ulong( &args
);
3688 return HandleToUlong( NtUserOpenInputDesktop( flags
, inherit
, access
));
3691 NTSTATUS WINAPI
wow64_NtUserOpenWindowStation( UINT
*args
)
3693 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
3694 ACCESS_MASK access
= get_ulong( &args
);
3696 struct object_attr64 attr
;
3698 return HandleToUlong( NtUserOpenWindowStation( objattr_32to64( &attr
, attr32
), access
));
3701 NTSTATUS WINAPI
wow64_NtUserPeekMessage( UINT
*args
)
3703 MSG32
*msg32
= get_ptr( &args
);
3704 HWND hwnd
= get_handle( &args
);
3705 UINT first
= get_ulong( &args
);
3706 UINT last
= get_ulong( &args
);
3707 UINT flags
= get_ulong( &args
);
3710 if (!NtUserPeekMessage( msg32
? &msg
: NULL
, hwnd
, first
, last
, flags
)) return FALSE
;
3711 msg_64to32( &msg
, msg32
);
3715 NTSTATUS WINAPI
wow64_NtUserPerMonitorDPIPhysicalToLogicalPoint( UINT
*args
)
3717 HWND hwnd
= get_handle( &args
);
3718 POINT
*pt
= get_ptr( &args
);
3720 return NtUserPerMonitorDPIPhysicalToLogicalPoint( hwnd
, pt
);
3723 NTSTATUS WINAPI
wow64_NtUserPostMessage( UINT
*args
)
3725 HWND hwnd
= get_handle( &args
);
3726 UINT msg
= get_ulong( &args
);
3727 WPARAM wparam
= get_ulong( &args
);
3728 LPARAM lparam
= get_ulong( &args
);
3730 return NtUserPostMessage( hwnd
, msg
, wparam
, lparam
);
3733 NTSTATUS WINAPI
wow64_NtUserPostThreadMessage( UINT
*args
)
3735 DWORD thread
= get_ulong( &args
);
3736 UINT msg
= get_ulong( &args
);
3737 WPARAM wparam
= get_ulong( &args
);
3738 LPARAM lparam
= get_ulong( &args
);
3740 return NtUserPostThreadMessage( thread
, msg
, wparam
, lparam
);
3743 NTSTATUS WINAPI
wow64_NtUserPrintWindow( UINT
*args
)
3745 HWND hwnd
= get_handle( &args
);
3746 HDC hdc
= get_handle( &args
);
3747 UINT flags
= get_ulong( &args
);
3749 return NtUserPrintWindow( hwnd
, hdc
, flags
);
3752 NTSTATUS WINAPI
wow64_NtUserQueryDisplayConfig( UINT
*args
)
3754 UINT32 flags
= get_ulong( &args
);
3755 UINT32
*paths_count
= get_ptr( &args
);
3756 DISPLAYCONFIG_PATH_INFO
*paths
= get_ptr( &args
);
3757 UINT32
*modes_count
= get_ptr( &args
);
3758 DISPLAYCONFIG_MODE_INFO
*modes
= get_ptr( &args
);
3759 DISPLAYCONFIG_TOPOLOGY_ID
*topology_id
= get_ptr( &args
);
3761 return NtUserQueryDisplayConfig( flags
, paths_count
, paths
, modes_count
, modes
, topology_id
);
3764 NTSTATUS WINAPI
wow64_NtUserQueryInputContext( UINT
*args
)
3766 HIMC handle
= get_handle( &args
);
3767 UINT attr
= get_ulong( &args
);
3769 return NtUserQueryInputContext( handle
, attr
);
3772 NTSTATUS WINAPI
wow64_NtUserRedrawWindow( UINT
*args
)
3774 HWND hwnd
= get_handle( &args
);
3775 const RECT
*rect
= get_ptr( &args
);
3776 HRGN hrgn
= get_handle( &args
);
3777 UINT flags
= get_ulong( &args
);
3779 return NtUserRedrawWindow( hwnd
, rect
, hrgn
, flags
);
3782 NTSTATUS WINAPI
wow64_NtUserRegisterHotKey( UINT
*args
)
3784 HWND hwnd
= get_handle( &args
);
3785 INT id
= get_ulong( &args
);
3786 UINT modifiers
= get_ulong( &args
);
3787 UINT vk
= get_ulong( &args
);
3789 return NtUserRegisterHotKey( hwnd
, id
, modifiers
, vk
);
3792 NTSTATUS WINAPI
wow64_NtUserRegisterRawInputDevices( UINT
*args
)
3794 const RAWINPUTDEVICE32
*devices32
= get_ptr( &args
);
3795 UINT count
= get_ulong( &args
);
3796 UINT size
= get_ulong( &args
);
3798 RAWINPUTDEVICE
*devices64
;
3801 if (size
!= sizeof(RAWINPUTDEVICE32
))
3803 set_last_error32( ERROR_INVALID_PARAMETER
);
3807 if (!(devices64
= Wow64AllocateTemp( count
* sizeof(*devices64
) )))
3809 set_last_error32( ERROR_NOT_ENOUGH_MEMORY
);
3813 for (i
= 0; i
< count
; ++i
)
3815 devices64
[i
].usUsagePage
= devices32
[i
].usUsagePage
;
3816 devices64
[i
].usUsage
= devices32
[i
].usUsage
;
3817 devices64
[i
].dwFlags
= devices32
[i
].dwFlags
;
3818 devices64
[i
].hwndTarget
= UlongToPtr( devices32
[i
].hwndTarget
);
3821 return NtUserRegisterRawInputDevices( devices64
, count
, sizeof(*devices64
) );
3824 NTSTATUS WINAPI
wow64_NtUserReleaseDC( UINT
*args
)
3826 HWND hwnd
= get_handle( &args
);
3827 HDC hdc
= get_handle( &args
);
3829 return NtUserReleaseDC( hwnd
, hdc
);
3832 NTSTATUS WINAPI
wow64_NtUserRemoveClipboardFormatListener( UINT
*args
)
3834 HWND hwnd
= get_handle( &args
);
3836 return NtUserRemoveClipboardFormatListener( hwnd
);
3839 NTSTATUS WINAPI
wow64_NtUserRemoveMenu( UINT
*args
)
3841 HMENU handle
= get_handle( &args
);
3842 UINT id
= get_ulong( &args
);
3843 UINT flags
= get_ulong( &args
);
3845 return NtUserRemoveMenu( handle
, id
, flags
);
3848 NTSTATUS WINAPI
wow64_NtUserRemoveProp( UINT
*args
)
3850 HWND hwnd
= get_handle( &args
);
3851 const WCHAR
*str
= get_ptr( &args
);
3853 return HandleToUlong( NtUserRemoveProp( hwnd
, str
));
3856 NTSTATUS WINAPI
wow64_NtUserScrollDC( UINT
*args
)
3858 HDC hdc
= get_handle( &args
);
3859 INT dx
= get_ulong( &args
);
3860 INT dy
= get_ulong( &args
);
3861 const RECT
*scroll
= get_ptr( &args
);
3862 const RECT
*clip
= get_ptr( &args
);
3863 HRGN ret_update_rgn
= get_handle( &args
);
3864 RECT
*update_rect
= get_ptr( &args
);
3866 return NtUserScrollDC( hdc
, dx
, dy
, scroll
, clip
, ret_update_rgn
, update_rect
);
3869 NTSTATUS WINAPI
wow64_NtUserScrollWindowEx( UINT
*args
)
3871 HWND hwnd
= get_handle( &args
);
3872 INT dx
= get_ulong( &args
);
3873 INT dy
= get_ulong( &args
);
3874 const RECT
*rect
= get_ptr( &args
);
3875 const RECT
*clip_rect
= get_ptr( &args
);
3876 HRGN update_rgn
= get_handle( &args
);
3877 RECT
*update_rect
= get_ptr( &args
);
3878 UINT flags
= get_ulong( &args
);
3880 return NtUserScrollWindowEx( hwnd
, dx
, dy
, rect
, clip_rect
, update_rgn
, update_rect
, flags
);
3883 NTSTATUS WINAPI
wow64_NtUserSelectPalette( UINT
*args
)
3885 HDC hdc
= get_handle( &args
);
3886 HPALETTE hpal
= get_handle( &args
);
3887 WORD bkg
= get_ulong( &args
);
3889 return HandleToUlong( NtUserSelectPalette( hdc
, hpal
, bkg
));
3892 NTSTATUS WINAPI
wow64_NtUserSendInput( UINT
*args
)
3894 UINT count
= get_ulong( &args
);
3895 INPUT32
*inputs32
= get_ptr( &args
);
3896 int size
= get_ulong( &args
);
3898 INPUT
*inputs
= NULL
;
3901 if (size
!= sizeof(*inputs32
) || !count
)
3903 set_last_error32( ERROR_INVALID_PARAMETER
);
3909 set_last_error32( ERROR_NOACCESS
);
3913 if (count
&& !(inputs
= Wow64AllocateTemp( count
* sizeof(*inputs
) )))
3916 for (i
= 0; i
< count
; i
++)
3918 inputs
[i
].type
= inputs32
[i
].type
;
3919 switch (inputs
[i
].type
)
3922 inputs
[i
].mi
.dx
= inputs32
[i
].mi
.dx
;
3923 inputs
[i
].mi
.dy
= inputs32
[i
].mi
.dy
;
3924 inputs
[i
].mi
.mouseData
= inputs32
[i
].mi
.mouseData
;
3925 inputs
[i
].mi
.dwFlags
= inputs32
[i
].mi
.dwFlags
;
3926 inputs
[i
].mi
.time
= inputs32
[i
].mi
.time
;
3927 inputs
[i
].mi
.dwExtraInfo
= inputs32
[i
].mi
.dwExtraInfo
;
3929 case INPUT_KEYBOARD
:
3930 inputs
[i
].ki
.wVk
= inputs32
[i
].ki
.wVk
;
3931 inputs
[i
].ki
.wScan
= inputs32
[i
].ki
.wScan
;
3932 inputs
[i
].ki
.dwFlags
= inputs32
[i
].ki
.dwFlags
;
3933 inputs
[i
].ki
.time
= inputs32
[i
].ki
.time
;
3934 inputs
[i
].ki
.dwExtraInfo
= inputs32
[i
].ki
.dwExtraInfo
;
3936 case INPUT_HARDWARE
:
3937 inputs
[i
].hi
= inputs32
[i
].hi
;
3942 return NtUserSendInput( count
, inputs
, sizeof(*inputs
) );
3945 NTSTATUS WINAPI
wow64_NtUserSetActiveWindow( UINT
*args
)
3947 HWND hwnd
= get_handle( &args
);
3949 return HandleToUlong( NtUserSetActiveWindow( hwnd
));
3952 NTSTATUS WINAPI
wow64_NtUserSetCapture( UINT
*args
)
3954 HWND hwnd
= get_handle( &args
);
3956 return HandleToUlong( NtUserSetCapture( hwnd
));
3959 NTSTATUS WINAPI
wow64_NtUserSetClassLong( UINT
*args
)
3961 HWND hwnd
= get_handle( &args
);
3962 INT offset
= get_ulong( &args
);
3963 LONG newval
= get_ulong( &args
);
3964 BOOL ansi
= get_ulong( &args
);
3966 return NtUserSetClassLong( hwnd
, offset
, newval
, ansi
);
3969 NTSTATUS WINAPI
wow64_NtUserSetClassLongPtr( UINT
*args
)
3971 HWND hwnd
= get_handle( &args
);
3972 INT offset
= get_ulong( &args
);
3973 LONG_PTR newval
= get_ulong( &args
);
3974 BOOL ansi
= get_ulong( &args
);
3976 if (offset
== GCLP_MENUNAME
)
3978 struct client_menu_name menu_name
;
3979 struct client_menu_name32
*menu_name32
= UlongToPtr( newval
);
3980 NtUserSetClassLongPtr( hwnd
, offset
,
3981 (UINT_PTR
)client_menu_name_32to64( &menu_name
, menu_name32
), ansi
);
3982 client_menu_name_64to32( &menu_name
, menu_name32
);
3986 return NtUserSetClassLongPtr( hwnd
, offset
, newval
, ansi
);
3989 NTSTATUS WINAPI
wow64_NtUserSetClassWord( UINT
*args
)
3991 HWND hwnd
= get_handle( &args
);
3992 INT offset
= get_ulong( &args
);
3993 WORD newval
= get_ulong( &args
);
3995 return NtUserSetClassWord( hwnd
, offset
, newval
);
3998 NTSTATUS WINAPI
wow64_NtUserSetClipboardData( UINT
*args
)
4000 UINT format
= get_ulong( &args
);
4001 HANDLE handle
= get_handle( &args
);
4008 } *params32
= get_ptr( &args
);
4010 struct set_clipboard_params params
;
4011 params
.data
= UlongToPtr( params32
->data
);
4012 params
.size
= params32
->size
;
4013 params
.cache_only
= params32
->cache_only
;
4014 params
.seqno
= params32
->seqno
;
4016 return NtUserSetClipboardData( format
, handle
, ¶ms
);
4019 NTSTATUS WINAPI
wow64_NtUserSetClipboardViewer( UINT
*args
)
4021 HWND hwnd
= get_handle( &args
);
4023 return HandleToUlong( NtUserSetClipboardViewer( hwnd
));
4026 NTSTATUS WINAPI
wow64_NtUserSetCursor( UINT
*args
)
4028 HCURSOR cursor
= get_handle( &args
);
4030 return HandleToUlong( NtUserSetCursor( cursor
));
4033 NTSTATUS WINAPI
wow64_NtUserSetCursorIconData( UINT
*args
)
4035 HCURSOR cursor
= get_handle( &args
);
4036 UNICODE_STRING32
*module32
= get_ptr( &args
);
4037 UNICODE_STRING32
*res_name32
= get_ptr( &args
);
4048 } *desc32
= get_ptr( &args
);
4057 } *frames32
= UlongToPtr( desc32
->frames
);
4059 UNICODE_STRING module
, res_name
;
4060 struct cursoricon_desc desc
;
4063 num_frames
= max( desc32
->num_frames
, 1 );
4064 if (!(desc
.frames
= Wow64AllocateTemp( num_frames
* sizeof(*desc
.frames
) ))) return FALSE
;
4065 desc
.flags
= desc32
->flags
;
4066 desc
.num_steps
= desc32
->num_steps
;
4067 desc
.num_frames
= desc32
->num_frames
;
4068 desc
.delay
= desc32
->delay
;
4069 desc
.frame_seq
= UlongToPtr( desc32
->frame_seq
);
4070 desc
.frame_rates
= UlongToPtr( desc32
->frame_rates
);
4071 desc
.rsrc
= UlongToPtr( desc32
->rsrc
);
4073 for (i
= 0; i
< num_frames
; i
++)
4075 desc
.frames
[i
].width
= frames32
[i
].width
;
4076 desc
.frames
[i
].height
= frames32
[i
].height
;
4077 desc
.frames
[i
].color
= UlongToHandle( frames32
[i
].color
);
4078 desc
.frames
[i
].alpha
= UlongToHandle( frames32
[i
].alpha
);
4079 desc
.frames
[i
].mask
= UlongToHandle( frames32
[i
].mask
);
4080 desc
.frames
[i
].hotspot
= frames32
[i
].hotspot
;
4083 return NtUserSetCursorIconData( cursor
, unicode_str_32to64( &module
, module32
),
4084 unicode_str_32to64( &res_name
, res_name32
), &desc
);
4087 NTSTATUS WINAPI
wow64_NtUserSetCursorPos( UINT
*args
)
4089 INT x
= get_ulong( &args
);
4090 INT y
= get_ulong( &args
);
4092 return NtUserSetCursorPos( x
, y
);
4095 NTSTATUS WINAPI
wow64_NtUserSetFocus( UINT
*args
)
4097 HWND hwnd
= get_handle( &args
);
4099 return HandleToUlong( NtUserSetFocus( hwnd
));
4102 NTSTATUS WINAPI
wow64_NtUserSetInternalWindowPos( UINT
*args
)
4104 HWND hwnd
= get_handle( &args
);
4105 UINT cmd
= get_ulong( &args
);
4106 RECT
*rect
= get_ptr( &args
);
4107 POINT
*pt
= get_ptr( &args
);
4109 NtUserSetInternalWindowPos( hwnd
, cmd
, rect
, pt
);
4113 NTSTATUS WINAPI
wow64_NtUserSetKeyboardState( UINT
*args
)
4115 BYTE
*state
= get_ptr( &args
);
4117 return NtUserSetKeyboardState( state
);
4120 NTSTATUS WINAPI
wow64_NtUserSetLayeredWindowAttributes( UINT
*args
)
4122 HWND hwnd
= get_handle( &args
);
4123 COLORREF key
= get_ulong( &args
);
4124 BYTE alpha
= get_ulong( &args
);
4125 DWORD flags
= get_ulong( &args
);
4127 return NtUserSetLayeredWindowAttributes( hwnd
, key
, alpha
, flags
);
4130 NTSTATUS WINAPI
wow64_NtUserSetMenu( UINT
*args
)
4132 HWND hwnd
= get_handle( &args
);
4133 HMENU menu
= get_handle( &args
);
4135 return NtUserSetMenu( hwnd
, menu
);
4138 NTSTATUS WINAPI
wow64_NtUserSetMenuContextHelpId( UINT
*args
)
4140 HMENU menu
= get_handle( &args
);
4141 DWORD id
= get_ulong( &args
);
4143 return NtUserSetMenuContextHelpId( menu
, id
);
4146 NTSTATUS WINAPI
wow64_NtUserSetMenuDefaultItem( UINT
*args
)
4148 HMENU handle
= get_handle( &args
);
4149 UINT item
= get_ulong( &args
);
4150 UINT bypos
= get_ulong( &args
);
4152 return NtUserSetMenuDefaultItem( handle
, item
, bypos
);
4155 NTSTATUS WINAPI
wow64_NtUserSetObjectInformation( UINT
*args
)
4157 HANDLE handle
= get_handle( &args
);
4158 INT index
= get_ulong( &args
);
4159 void *info
= get_ptr( &args
);
4160 DWORD len
= get_ulong( &args
);
4162 return NtUserSetObjectInformation( handle
, index
, info
, len
);
4165 NTSTATUS WINAPI
wow64_NtUserSetParent( UINT
*args
)
4167 HWND hwnd
= get_handle( &args
);
4168 HWND parent
= get_handle( &args
);
4170 return HandleToUlong( NtUserSetParent( hwnd
, parent
));
4173 NTSTATUS WINAPI
wow64_NtUserSetProcessDpiAwarenessContext( UINT
*args
)
4175 ULONG awareness
= get_ulong( &args
);
4176 ULONG unknown
= get_ulong( &args
);
4178 return NtUserSetProcessDpiAwarenessContext( awareness
, unknown
);
4181 NTSTATUS WINAPI
wow64_NtUserSetProcessWindowStation( UINT
*args
)
4183 HWINSTA handle
= get_handle( &args
);
4185 return NtUserSetProcessWindowStation( handle
);
4188 NTSTATUS WINAPI
wow64_NtUserSetProp( UINT
*args
)
4190 HWND hwnd
= get_handle( &args
);
4191 const WCHAR
*str
= get_ptr( &args
);
4192 HANDLE handle
= get_handle( &args
);
4194 return NtUserSetProp( hwnd
, str
, handle
);
4197 NTSTATUS WINAPI
wow64_NtUserSetScrollInfo( UINT
*args
)
4199 HWND hwnd
= get_handle( &args
);
4200 INT bar
= get_ulong( &args
);
4201 const SCROLLINFO
*info
= get_ptr( &args
);
4202 BOOL redraw
= get_ulong( &args
);
4204 return NtUserSetScrollInfo( hwnd
, bar
, info
, redraw
);
4207 NTSTATUS WINAPI
wow64_NtUserSetShellWindowEx( UINT
*args
)
4209 HWND shell
= get_handle( &args
);
4210 HWND list_view
= get_handle( &args
);
4212 return NtUserSetShellWindowEx( shell
, list_view
);
4215 NTSTATUS WINAPI
wow64_NtUserSetSysColors( UINT
*args
)
4217 INT count
= get_ulong( &args
);
4218 const INT
*colors
= get_ptr( &args
);
4219 const COLORREF
*values
= get_ptr( &args
);
4221 return NtUserSetSysColors( count
, colors
, values
);
4224 NTSTATUS WINAPI
wow64_NtUserSetSystemMenu( UINT
*args
)
4226 HWND hwnd
= get_handle( &args
);
4227 HMENU menu
= get_handle( &args
);
4229 return NtUserSetSystemMenu( hwnd
, menu
);
4232 NTSTATUS WINAPI
wow64_NtUserSetSystemTimer( UINT
*args
)
4234 HWND hwnd
= get_handle( &args
);
4235 UINT_PTR id
= get_ulong( &args
);
4236 UINT timeout
= get_ulong( &args
);
4238 return NtUserSetSystemTimer( hwnd
, id
, timeout
);
4241 NTSTATUS WINAPI
wow64_NtUserSetThreadDesktop( UINT
*args
)
4243 HDESK handle
= get_handle( &args
);
4245 return NtUserSetThreadDesktop( handle
);
4248 NTSTATUS WINAPI
wow64_NtUserSetTimer( UINT
*args
)
4250 HWND hwnd
= get_handle( &args
);
4251 UINT_PTR id
= get_ulong( &args
);
4252 UINT timeout
= get_ulong( &args
);
4253 TIMERPROC proc
= get_ptr( &args
);
4254 ULONG tolerance
= get_ulong( &args
);
4256 return NtUserSetTimer( hwnd
, id
, timeout
, proc
, tolerance
);
4259 NTSTATUS WINAPI
wow64_NtUserSetWinEventHook( UINT
*args
)
4261 DWORD event_min
= get_ulong( &args
);
4262 DWORD event_max
= get_ulong( &args
);
4263 HMODULE inst
= get_ptr( &args
);
4264 UNICODE_STRING32
*module32
= get_ptr( &args
);
4265 WINEVENTPROC proc
= get_ptr(&args
);
4266 DWORD pid
= get_ulong( &args
);
4267 DWORD tid
= get_ulong( &args
);
4268 DWORD flags
= get_ulong( &args
);
4269 UNICODE_STRING module
;
4272 ret
= NtUserSetWinEventHook( event_min
, event_max
, inst
,
4273 unicode_str_32to64( &module
, module32
),
4274 proc
, pid
, tid
, flags
);
4275 return HandleToUlong( ret
);
4278 NTSTATUS WINAPI
wow64_NtUserSetWindowLong( UINT
*args
)
4280 HWND hwnd
= get_handle( &args
);
4281 INT offset
= get_ulong( &args
);
4282 LONG newval
= get_ulong( &args
);
4283 BOOL ansi
= get_ulong( &args
);
4287 case GWLP_HINSTANCE
:
4289 return NtUserSetWindowLongPtr( hwnd
, offset
, (ULONG
)newval
, ansi
);
4292 return NtUserSetWindowLong( hwnd
, offset
, newval
, ansi
);
4295 NTSTATUS WINAPI
wow64_NtUserSetWindowLongPtr( UINT
*args
)
4297 HWND hwnd
= get_handle( &args
);
4298 INT offset
= get_ulong( &args
);
4299 LONG_PTR newval
= get_ulong( &args
);
4300 BOOL ansi
= get_ulong( &args
);
4302 return NtUserSetWindowLongPtr( hwnd
, offset
, newval
, ansi
);
4305 NTSTATUS WINAPI
wow64_NtUserSetWindowPlacement( UINT
*args
)
4307 HWND hwnd
= get_handle( &args
);
4308 const WINDOWPLACEMENT
*wpl
= get_ptr( &args
);
4310 return NtUserSetWindowPlacement( hwnd
, wpl
);
4313 NTSTATUS WINAPI
wow64_NtUserSetWindowPos( UINT
*args
)
4315 HWND hwnd
= get_handle( &args
);
4316 HWND after
= get_handle( &args
);
4317 INT x
= get_ulong( &args
);
4318 INT y
= get_ulong( &args
);
4319 INT cx
= get_ulong( &args
);
4320 INT cy
= get_ulong( &args
);
4321 UINT flags
= get_ulong( &args
);
4323 return NtUserSetWindowPos( hwnd
, after
, x
, y
, cx
, cy
, flags
);
4326 NTSTATUS WINAPI
wow64_NtUserSetWindowRgn( UINT
*args
)
4328 HWND hwnd
= get_handle( &args
);
4329 HRGN hrgn
= get_handle( &args
);
4330 BOOL redraw
= get_ulong( &args
);
4332 return NtUserSetWindowRgn( hwnd
, hrgn
, redraw
);
4335 NTSTATUS WINAPI
wow64_NtUserSetWindowWord( UINT
*args
)
4337 HWND hwnd
= get_handle( &args
);
4338 INT offset
= get_ulong( &args
);
4339 WORD newval
= get_ulong( &args
);
4341 return NtUserSetWindowWord( hwnd
, offset
, newval
);
4344 NTSTATUS WINAPI
wow64_NtUserSetWindowsHookEx( UINT
*args
)
4346 HINSTANCE inst
= get_ptr( &args
);
4347 UNICODE_STRING32
*module32
= get_ptr( &args
);
4348 DWORD tid
= get_ulong( &args
);
4349 INT id
= get_ulong( &args
);
4350 HOOKPROC proc
= get_ptr( &args
);
4351 BOOL ansi
= get_ulong( &args
);
4352 UNICODE_STRING module
;
4355 ret
= NtUserSetWindowsHookEx( inst
, unicode_str_32to64( &module
, module32
),
4356 tid
, id
, proc
, ansi
);
4357 return HandleToUlong( ret
);
4360 NTSTATUS WINAPI
wow64_NtUserShowCaret( UINT
*args
)
4362 HWND hwnd
= get_handle( &args
);
4364 return NtUserShowCaret( hwnd
);
4367 NTSTATUS WINAPI
wow64_NtUserShowCursor( UINT
*args
)
4369 BOOL show
= get_ulong( &args
);
4371 return NtUserShowCursor( show
);
4374 NTSTATUS WINAPI
wow64_NtUserShowScrollBar( UINT
*args
)
4376 HWND hwnd
= get_handle( &args
);
4377 INT bar
= get_ulong( &args
);
4378 BOOL show
= get_ulong( &args
);
4380 return NtUserShowScrollBar( hwnd
, bar
, show
);
4383 NTSTATUS WINAPI
wow64_NtUserShowWindow( UINT
*args
)
4385 HWND hwnd
= get_handle( &args
);
4386 INT cmd
= get_ulong( &args
);
4388 return NtUserShowWindow( hwnd
, cmd
);
4391 NTSTATUS WINAPI
wow64_NtUserShowWindowAsync( UINT
*args
)
4393 HWND hwnd
= get_handle( &args
);
4394 INT cmd
= get_ulong( &args
);
4396 return NtUserShowWindowAsync( hwnd
, cmd
);
4399 NTSTATUS WINAPI
wow64_NtUserSystemParametersInfo( UINT
*args
)
4401 UINT action
= get_ulong( &args
);
4402 UINT val
= get_ulong( &args
);
4403 void *ptr
= get_ptr( &args
);
4404 UINT winini
= get_ulong( &args
);
4408 case SPI_GETSERIALKEYS
:
4415 ULONG lpszActivePort
;
4423 if (keys32
->cbSize
!= sizeof(*keys32
)) return FALSE
;
4424 keys
.cbSize
= sizeof(keys
);
4425 if (!NtUserSystemParametersInfo( action
, val
, &keys
, winini
)) return FALSE
;
4426 keys32
->dwFlags
= keys
.dwFlags
;
4427 keys32
->lpszActivePort
= PtrToUlong( keys
.lpszActivePort
);
4428 keys32
->lpszPort
= PtrToUlong( keys
.lpszPort
);
4429 keys32
->iBaudRate
= keys
.iBaudRate
;
4430 keys32
->iPortState
= keys
.iPortState
;
4431 keys32
->iActive
= keys
.iActive
;
4436 case SPI_GETSOUNDSENTRY
:
4443 DWORD iFSTextEffect
;
4444 DWORD iFSTextEffectMSec
;
4445 DWORD iFSTextEffectColorBits
;
4446 DWORD iFSGrafEffect
;
4447 DWORD iFSGrafEffectMSec
;
4448 DWORD iFSGrafEffectColor
;
4449 DWORD iWindowsEffect
;
4450 DWORD iWindowsEffectMSec
;
4451 ULONG lpszWindowsEffectDLL
;
4452 DWORD iWindowsEffectOrdinal
;
4456 if (entry32
->cbSize
!= sizeof(*entry32
)) return FALSE
;
4457 entry
.cbSize
= sizeof(entry
);
4458 if (!NtUserSystemParametersInfo( action
, val
, &entry
, winini
)) return FALSE
;
4459 entry32
->dwFlags
= entry
.dwFlags
;
4460 entry32
->iFSTextEffect
= entry
.iFSTextEffect
;
4461 entry32
->iFSTextEffectMSec
= entry
.iFSTextEffectMSec
;
4462 entry32
->iFSTextEffectColorBits
= entry
.iFSTextEffectColorBits
;
4463 entry32
->iFSGrafEffect
= entry
.iFSGrafEffect
;
4464 entry32
->iFSGrafEffectMSec
= entry
.iFSGrafEffectMSec
;
4465 entry32
->iFSGrafEffectColor
= entry
.iFSGrafEffectColor
;
4466 entry32
->iWindowsEffect
= entry
.iWindowsEffect
;
4467 entry32
->iWindowsEffectMSec
= entry
.iWindowsEffectMSec
;
4468 entry32
->lpszWindowsEffectDLL
= PtrToUlong( entry
.lpszWindowsEffectDLL
);
4469 entry32
->iWindowsEffectOrdinal
= entry
.iWindowsEffectOrdinal
;
4474 case SPI_GETHIGHCONTRAST
:
4481 ULONG lpszDefaultScheme
;
4485 if (info32
->cbSize
!= sizeof(*info32
)) return FALSE
;
4486 info
.cbSize
= sizeof(info
);
4487 if (!NtUserSystemParametersInfo( action
, val
, &info
, winini
)) return FALSE
;
4488 info32
->dwFlags
= info
.dwFlags
;
4489 info32
->lpszDefaultScheme
= PtrToUlong( info
.lpszDefaultScheme
);
4495 return NtUserSystemParametersInfo( action
, val
, ptr
, winini
);
4498 NTSTATUS WINAPI
wow64_NtUserSystemParametersInfoForDpi( UINT
*args
)
4500 UINT action
= get_ulong( &args
);
4501 UINT val
= get_ulong( &args
);
4502 void *ptr
= get_ptr( &args
);
4503 UINT winini
= get_ulong( &args
);
4504 UINT dpi
= get_ulong( &args
);
4506 return NtUserSystemParametersInfoForDpi( action
, val
, ptr
, winini
, dpi
);
4509 NTSTATUS WINAPI
wow64_NtUserThunkedMenuInfo( UINT
*args
)
4511 HMENU menu
= get_handle( &args
);
4512 MENUINFO32
*info32
= get_ptr( &args
);
4517 info
.cbSize
= sizeof(info
);
4518 info
.fMask
= info32
->fMask
;
4519 info
.dwStyle
= info32
->dwStyle
;
4520 info
.cyMax
= info32
->cyMax
;
4521 info
.hbrBack
= UlongToHandle( info32
->hbrBack
);
4522 info
.dwContextHelpID
= info32
->dwContextHelpID
;
4523 info
.dwMenuData
= info32
->dwMenuData
;
4526 return NtUserThunkedMenuInfo( menu
, info32
? &info
: NULL
);
4529 NTSTATUS WINAPI
wow64_NtUserThunkedMenuItemInfo( UINT
*args
)
4531 HMENU handle
= get_handle( &args
);
4532 UINT pos
= get_ulong( &args
);
4533 UINT flags
= get_ulong( &args
);
4534 UINT method
= get_ulong( &args
);
4535 MENUITEMINFOW32
*info32
= get_ptr( &args
);
4536 UNICODE_STRING32
*str32
= get_ptr( &args
);
4537 MENUITEMINFOW info
= { sizeof(info
) }, *info_ptr
;
4543 info
.cbSize
= sizeof(info
);
4544 info
.fMask
= info32
->fMask
;
4547 case NtUserSetMenuItemInfo
:
4548 case NtUserInsertMenuItem
:
4549 info
.fType
= info32
->fType
;
4550 info
.fState
= info32
->fState
;
4551 info
.wID
= info32
->wID
;
4552 info
.hSubMenu
= LongToHandle( info32
->hSubMenu
);
4553 info
.hbmpChecked
= UlongToHandle( info32
->hbmpChecked
);
4554 info
.hbmpUnchecked
= UlongToHandle( info32
->hbmpUnchecked
);
4555 info
.dwItemData
= info32
->dwItemData
;
4556 info
.dwTypeData
= UlongToPtr( info32
->dwTypeData
);
4557 info
.cch
= info32
->cch
;
4558 info
.hbmpItem
= UlongToHandle( info32
->hbmpItem
);
4560 case NtUserCheckMenuRadioItem
:
4561 info
.cch
= info32
->cch
;
4563 case NtUserGetMenuItemInfoA
:
4564 case NtUserGetMenuItemInfoW
:
4565 info
.dwTypeData
= UlongToPtr( info32
->dwTypeData
);
4566 info
.cch
= info32
->cch
;
4571 else info_ptr
= NULL
;
4573 ret
= NtUserThunkedMenuItemInfo( handle
, pos
, flags
, method
, info_ptr
,
4574 unicode_str_32to64( &str
, str32
));
4580 case NtUserGetMenuItemInfoA
:
4581 case NtUserGetMenuItemInfoW
:
4582 if (info
.fMask
& (MIIM_TYPE
| MIIM_STRING
| MIIM_FTYPE
))
4583 info32
->fType
= info
.fType
;
4584 if (info
.fMask
& (MIIM_TYPE
| MIIM_BITMAP
))
4585 info32
->hbmpItem
= HandleToUlong( info
.hbmpItem
);
4586 if (info
.fMask
& (MIIM_TYPE
| MIIM_STRING
))
4588 info32
->dwTypeData
= (UINT_PTR
)info
.dwTypeData
;
4589 info32
->cch
= info
.cch
;
4591 if (info
.fMask
& MIIM_STATE
) info32
->fState
= info
.fState
;
4592 if (info
.fMask
& MIIM_ID
) info32
->wID
= info
.wID
;
4593 info32
->hSubMenu
= HandleToUlong( info
.hSubMenu
);
4594 if (info
.fMask
& MIIM_CHECKMARKS
)
4596 info32
->hbmpChecked
= HandleToUlong( info
.hbmpChecked
);
4597 info32
->hbmpUnchecked
= HandleToUlong( info
.hbmpUnchecked
);
4599 if (info
.fMask
& MIIM_DATA
) info32
->dwItemData
= info
.dwItemData
;
4607 NTSTATUS WINAPI
wow64_NtUserToUnicodeEx( UINT
*args
)
4609 UINT virt
= get_ulong( &args
);
4610 UINT scan
= get_ulong( &args
);
4611 const BYTE
*state
= get_ptr( &args
);
4612 WCHAR
*str
= get_ptr( &args
);
4613 int size
= get_ulong( &args
);
4614 UINT flags
= get_ulong( &args
);
4615 HKL layout
= get_handle( &args
);
4617 return NtUserToUnicodeEx( virt
, scan
, state
, str
, size
, flags
, layout
);
4620 NTSTATUS WINAPI
wow64_NtUserTrackMouseEvent( UINT
*args
)
4628 } *info32
= get_ptr( &args
);
4629 TRACKMOUSEEVENT info
;
4632 if (info32
->cbSize
!= sizeof(*info32
))
4634 set_last_error32( ERROR_INVALID_PARAMETER
);
4638 info
.cbSize
= sizeof(info
);
4639 info
.dwFlags
= info32
->dwFlags
;
4640 info
.hwndTrack
= LongToHandle( info32
->hwndTrack
);
4641 info
.dwHoverTime
= info32
->dwHoverTime
;
4642 ret
= NtUserTrackMouseEvent( &info
);
4643 info32
->dwFlags
= info
.dwFlags
;
4644 info32
->hwndTrack
= HandleToUlong( info
.hwndTrack
);
4645 info32
->dwHoverTime
= info
.dwHoverTime
;
4649 NTSTATUS WINAPI
wow64_NtUserTrackPopupMenuEx( UINT
*args
)
4651 HMENU handle
= get_handle( &args
);
4652 UINT flags
= get_ulong( &args
);
4653 int x
= get_ulong( &args
);
4654 int y
= get_ulong( &args
);
4655 HWND hwnd
= get_handle( &args
);
4656 TPMPARAMS
*params
= get_ptr( &args
);
4658 return NtUserTrackPopupMenuEx( handle
, flags
, x
, y
, hwnd
, params
);
4661 NTSTATUS WINAPI
wow64_NtUserTranslateAccelerator( UINT
*args
)
4663 HWND hwnd
= get_handle( &args
);
4664 HACCEL accel
= get_handle( &args
);
4665 MSG32
*msg32
= get_ptr( &args
);
4669 return NtUserTranslateAccelerator( hwnd
, accel
, msg_32to64( &msg
, msg32
));
4672 NTSTATUS WINAPI
wow64_NtUserTranslateMessage( UINT
*args
)
4674 const MSG32
*msg32
= get_ptr( &args
);
4675 UINT flags
= get_ulong( &args
);
4678 return NtUserTranslateMessage( msg_32to64( &msg
, msg32
), flags
);
4681 NTSTATUS WINAPI
wow64_NtUserUnhookWinEvent( UINT
*args
)
4683 HWINEVENTHOOK handle
= get_handle( &args
);
4685 return NtUserUnhookWinEvent( handle
);
4688 NTSTATUS WINAPI
wow64_NtUserUnhookWindowsHookEx( UINT
*args
)
4690 HHOOK handle
= get_handle( &args
);
4692 return NtUserUnhookWindowsHookEx( handle
);
4695 NTSTATUS WINAPI
wow64_NtUserUnregisterClass( UINT
*args
)
4697 UNICODE_STRING32
*name32
= get_ptr( &args
);
4698 HINSTANCE instance
= get_ptr( &args
);
4699 struct client_menu_name32
*menu_name32
= get_ptr( &args
);
4701 UNICODE_STRING name
;
4702 struct client_menu_name menu_name
;
4705 ret
= NtUserUnregisterClass( unicode_str_32to64( &name
, name32
), instance
, &menu_name
);
4706 if (ret
) client_menu_name_64to32( &menu_name
, menu_name32
);
4710 NTSTATUS WINAPI
wow64_NtUserUnregisterHotKey( UINT
*args
)
4712 HWND hwnd
= get_handle( &args
);
4713 int id
= get_ulong( &args
);
4715 return NtUserUnregisterHotKey( hwnd
, id
);
4718 NTSTATUS WINAPI
wow64_NtUserUpdateInputContext( UINT
*args
)
4720 HIMC handle
= get_handle( &args
);
4721 UINT attr
= get_ulong( &args
);
4722 UINT_PTR value
= get_ulong( &args
);
4724 return NtUserUpdateInputContext( handle
, attr
, value
);
4727 NTSTATUS WINAPI
wow64_NtUserUpdateLayeredWindow( UINT
*args
)
4729 HWND hwnd
= get_handle( &args
);
4730 HDC hdc_dst
= get_handle( &args
);
4731 const POINT
*pts_dst
= get_ptr( &args
);
4732 const SIZE
*size
= get_ptr( &args
);
4733 HDC hdc_src
= get_handle( &args
);
4734 const POINT
*pts_src
= get_ptr( &args
);
4735 COLORREF key
= get_ulong( &args
);
4736 const BLENDFUNCTION
*blend
= get_ptr( &args
);
4737 DWORD flags
= get_ulong( &args
);
4738 const RECT
*dirty
= get_ptr( &args
);
4740 return NtUserUpdateLayeredWindow( hwnd
, hdc_dst
, pts_dst
, size
, hdc_src
, pts_src
,
4741 key
, blend
, flags
, dirty
);
4744 NTSTATUS WINAPI
wow64_NtUserValidateRect( UINT
*args
)
4746 HWND hwnd
= get_handle( &args
);
4747 const RECT
*rect
= get_ptr( &args
);
4749 return NtUserValidateRect( hwnd
, rect
);
4752 NTSTATUS WINAPI
wow64_NtUserVkKeyScanEx( UINT
*args
)
4754 WCHAR chr
= get_ulong( &args
);
4755 HKL layout
= get_handle( &args
);
4757 return NtUserVkKeyScanEx( chr
, layout
);
4760 NTSTATUS WINAPI
wow64_NtUserWaitForInputIdle( UINT
*args
)
4762 HANDLE process
= get_handle( &args
);
4763 DWORD timeout
= get_ulong( &args
);
4764 BOOL wow
= get_ulong( &args
);
4766 return NtUserWaitForInputIdle( process
, timeout
, wow
);
4769 NTSTATUS WINAPI
wow64_NtUserWaitMessage( UINT
*args
)
4771 return NtUserWaitMessage();
4774 NTSTATUS WINAPI
wow64_NtUserWindowFromDC( UINT
*args
)
4776 HDC hdc
= get_handle( &args
);
4778 return HandleToUlong( NtUserWindowFromDC( hdc
));
4781 NTSTATUS WINAPI
wow64_NtUserWindowFromPoint( UINT
*args
)
4783 LONG x
= get_ulong( &args
);
4784 LONG y
= get_ulong( &args
);
4786 return HandleToUlong( NtUserWindowFromPoint( x
, y
));
4789 NTSTATUS WINAPI
wow64_NtUserDisplayConfigGetDeviceInfo( UINT
*args
)
4791 DISPLAYCONFIG_DEVICE_INFO_HEADER
*packet
= get_ptr( &args
);
4793 return NtUserDisplayConfigGetDeviceInfo( packet
);
4796 NTSTATUS WINAPI
wow64___wine_send_input( UINT
*args
)
4798 ERR( "not supported\n" );