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
);
59 static MSG
*msg_32to64( MSG
*msg
, MSG32
*msg32
)
61 if (!msg32
) return NULL
;
63 msg
->hwnd
= UlongToHandle( msg32
->hwnd
);
64 msg
->message
= msg32
->message
;
65 msg
->wParam
= msg32
->wParam
;
66 msg
->lParam
= msg32
->lParam
;
67 msg
->time
= msg32
->time
;
72 static MSG32
*msg_64to32( MSG
*msg
, MSG32
*msg32
)
74 if (!msg32
) return NULL
;
76 msg32
->hwnd
= HandleToUlong( msg
->hwnd
);
77 msg32
->message
= msg
->message
;
78 msg32
->wParam
= msg
->wParam
;
79 msg32
->lParam
= msg
->lParam
;
80 msg32
->time
= msg
->time
;
85 NTSTATUS WINAPI
wow64_NtUserInitializeClientPfnArrays( UINT
*args
)
88 return STATUS_NOT_SUPPORTED
;
91 NTSTATUS WINAPI
wow64_NtUserCreateWindowStation( UINT
*args
)
93 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
94 ACCESS_MASK access
= get_ulong( &args
);
95 ULONG arg3
= get_ulong( &args
);
96 ULONG arg4
= get_ulong( &args
);
97 ULONG arg5
= get_ulong( &args
);
98 ULONG arg6
= get_ulong( &args
);
99 ULONG arg7
= get_ulong( &args
);
101 struct object_attr64 attr
;
103 return HandleToUlong( NtUserCreateWindowStation( objattr_32to64( &attr
, attr32
), access
,
104 arg3
, arg4
, arg5
, arg6
, arg7
));
107 NTSTATUS WINAPI
wow64_NtUserOpenWindowStation( UINT
*args
)
109 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
110 ACCESS_MASK access
= get_ulong( &args
);
112 struct object_attr64 attr
;
114 return HandleToUlong( NtUserOpenWindowStation( objattr_32to64( &attr
, attr32
), access
));
117 NTSTATUS WINAPI
wow64_NtUserCloseWindowStation( UINT
*args
)
119 HWINSTA handle
= get_handle( &args
);
121 return NtUserCloseWindowStation( handle
);
124 NTSTATUS WINAPI
wow64_NtUserGetProcessWindowStation( UINT
*args
)
126 return HandleToUlong( NtUserGetProcessWindowStation() );
129 NTSTATUS WINAPI
wow64_NtUserSetProcessWindowStation( UINT
*args
)
131 HWINSTA handle
= get_handle( &args
);
133 return NtUserSetProcessWindowStation( handle
);
136 NTSTATUS WINAPI
wow64_NtUserCreateDesktopEx( UINT
*args
)
138 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
139 UNICODE_STRING32
*device32
= get_ptr( &args
);
140 DEVMODEW
*devmode
= get_ptr( &args
);
141 DWORD flags
= get_ulong( &args
);
142 ACCESS_MASK access
= get_ulong( &args
);
143 ULONG heap_size
= get_ulong( &args
);
145 struct object_attr64 attr
;
146 UNICODE_STRING device
;
149 ret
= NtUserCreateDesktopEx( objattr_32to64( &attr
, attr32
),
150 unicode_str_32to64( &device
, device32
),
151 devmode
, flags
, access
, heap_size
);
152 return HandleToUlong( ret
);
155 NTSTATUS WINAPI
wow64_NtUserOpenDesktop( UINT
*args
)
157 OBJECT_ATTRIBUTES32
*attr32
= get_ptr( &args
);
158 DWORD flags
= get_ulong( &args
);
159 ACCESS_MASK access
= get_ulong( &args
);
161 struct object_attr64 attr
;
164 ret
= NtUserOpenDesktop( objattr_32to64( &attr
, attr32
), flags
, access
);
165 return HandleToUlong( ret
);
168 NTSTATUS WINAPI
wow64_NtUserCloseDesktop( UINT
*args
)
170 HDESK handle
= get_handle( &args
);
172 return NtUserCloseDesktop( handle
);
175 NTSTATUS WINAPI
wow64_NtUserGetThreadDesktop( UINT
*args
)
177 DWORD thread
= get_ulong( &args
);
179 return HandleToUlong( NtUserGetThreadDesktop( thread
));
182 NTSTATUS WINAPI
wow64_NtUserSetThreadDesktop( UINT
*args
)
184 HDESK handle
= get_handle( &args
);
186 return NtUserSetThreadDesktop( handle
);
189 NTSTATUS WINAPI
wow64_NtUserOpenInputDesktop( UINT
*args
)
191 DWORD flags
= get_ulong( &args
);
192 BOOL inherit
= get_ulong( &args
);
193 ACCESS_MASK access
= get_ulong( &args
);
195 return HandleToUlong( NtUserOpenInputDesktop( flags
, inherit
, access
));
198 NTSTATUS WINAPI
wow64_NtUserGetObjectInformation( UINT
*args
)
200 HANDLE handle
= get_handle( &args
);
201 INT index
= get_ulong( &args
);
202 void *info
= get_ptr( &args
);
203 DWORD len
= get_ulong( &args
);
204 DWORD
*needed
= get_ptr( &args
);
206 return NtUserGetObjectInformation( handle
, index
, info
, len
, needed
);
209 NTSTATUS WINAPI
wow64_NtUserSetObjectInformation( UINT
*args
)
211 HANDLE handle
= get_handle( &args
);
212 INT index
= get_ulong( &args
);
213 void *info
= get_ptr( &args
);
214 DWORD len
= get_ulong( &args
);
216 return NtUserSetObjectInformation( handle
, index
, info
, len
);
219 NTSTATUS WINAPI
wow64_NtUserGetProp( UINT
*args
)
221 HWND hwnd
= get_handle( &args
);
222 const WCHAR
*str
= get_ptr( &args
);
224 return HandleToUlong( NtUserGetProp( hwnd
, str
));
227 NTSTATUS WINAPI
wow64_NtUserSetProp( UINT
*args
)
229 HWND hwnd
= get_handle( &args
);
230 const WCHAR
*str
= get_ptr( &args
);
231 HANDLE handle
= get_handle( &args
);
233 return NtUserSetProp( hwnd
, str
, handle
);
236 NTSTATUS WINAPI
wow64_NtUserRemoveProp( UINT
*args
)
238 HWND hwnd
= get_handle( &args
);
239 const WCHAR
*str
= get_ptr( &args
);
241 return HandleToUlong( NtUserRemoveProp( hwnd
, str
));
244 NTSTATUS WINAPI
wow64_NtUserGetAtomName( UINT
*args
)
246 ATOM atom
= get_ulong( &args
);
247 UNICODE_STRING32
*str32
= get_ptr( &args
);
251 return NtUserGetAtomName( atom
, unicode_str_32to64( &str
, str32
));
254 NTSTATUS WINAPI
wow64_NtUserGetClassName( UINT
*args
)
256 HWND hwnd
= get_handle( &args
);
257 BOOL real
= get_ulong( &args
);
258 UNICODE_STRING32
*str32
= get_ptr( &args
);
262 return NtUserGetClassName( hwnd
, real
, unicode_str_32to64( &str
, str32
));
265 NTSTATUS WINAPI
wow64_NtUserGetAncestor( UINT
*args
)
267 HWND hwnd
= get_handle( &args
);
268 UINT type
= get_ulong( &args
);
270 return HandleToUlong( NtUserGetAncestor( hwnd
, type
));
273 NTSTATUS WINAPI
wow64_NtUserGetWindowRgnEx( UINT
*args
)
275 HWND hwnd
= get_handle( &args
);
276 HRGN hrgn
= get_handle( &args
);
277 UINT unk
= get_ulong( &args
);
279 return NtUserGetWindowRgnEx( hwnd
, hrgn
, unk
);
282 NTSTATUS WINAPI
wow64_NtUserWindowFromDC( UINT
*args
)
284 HDC hdc
= get_handle( &args
);
286 return HandleToUlong( NtUserWindowFromDC( hdc
));
289 NTSTATUS WINAPI
wow64_NtUserBuildHwndList( UINT
*args
)
291 HDESK desktop
= get_handle( &args
);
292 ULONG unk2
= get_ulong( &args
);
293 ULONG unk3
= get_ulong( &args
);
294 ULONG unk4
= get_ulong( &args
);
295 ULONG thread_id
= get_ulong( &args
);
296 ULONG count
= get_ulong( &args
);
297 UINT32
*buffer32
= get_ptr( &args
);
298 ULONG
*size
= get_ptr( &args
);
304 if (!(buffer
= Wow64AllocateTemp( count
* sizeof(*buffer
) ))) return STATUS_NO_MEMORY
;
306 if ((status
= NtUserBuildHwndList( desktop
, unk2
, unk3
, unk4
, thread_id
, count
, buffer
, size
)))
309 for (i
= 0; i
< *size
; i
++)
310 buffer32
[i
] = HandleToUlong( buffer
[i
] );
314 NTSTATUS WINAPI
wow64_NtUserFindWindowEx( UINT
*args
)
316 HWND parent
= get_handle( &args
);
317 HWND child
= get_handle( &args
);
318 UNICODE_STRING32
*class32
= get_ptr( &args
);
319 UNICODE_STRING32
*title32
= get_ptr( &args
);
320 ULONG unk
= get_ulong( &args
);
322 UNICODE_STRING
class, title
;
325 ret
= NtUserFindWindowEx( parent
, child
, unicode_str_32to64( &class, class32
),
326 unicode_str_32to64( &title
, title32
), unk
);
327 return HandleToUlong( ret
);
330 NTSTATUS WINAPI
wow64_NtUserInternalGetWindowText( UINT
*args
)
332 HWND hwnd
= get_handle( &args
);
333 WCHAR
*text
= get_ptr( &args
);
334 INT count
= get_ulong( &args
);
336 return NtUserInternalGetWindowText( hwnd
, text
, count
);
339 NTSTATUS WINAPI
wow64_NtUserGetLayeredWindowAttributes( UINT
*args
)
341 HWND hwnd
= get_handle( &args
);
342 COLORREF
*key
= get_ptr( &args
);
343 BYTE
*alpha
= get_ptr( &args
);
344 DWORD
*flags
= get_ptr( &args
);
346 return NtUserGetLayeredWindowAttributes( hwnd
, key
, alpha
, flags
);
349 NTSTATUS WINAPI
wow64_NtUserGetClipboardFormatName( UINT
*args
)
351 UINT format
= get_ulong( &args
);
352 WCHAR
*buffer
= get_ptr( &args
);
353 INT maxlen
= get_ulong( &args
);
355 return NtUserGetClipboardFormatName( format
, buffer
, maxlen
);
358 NTSTATUS WINAPI
wow64_NtUserGetClipboardOwner( UINT
*args
)
360 return HandleToUlong( NtUserGetClipboardOwner() );
363 NTSTATUS WINAPI
wow64_NtUserGetOpenClipboardWindow( UINT
*args
)
365 return HandleToUlong( NtUserGetOpenClipboardWindow() );
368 NTSTATUS WINAPI
wow64_NtUserGetClipboardSequenceNumber( UINT
*args
)
370 return NtUserGetClipboardSequenceNumber();
373 NTSTATUS WINAPI
wow64_NtUserGetClipboardViewer( UINT
*args
)
375 return HandleToUlong( NtUserGetClipboardViewer() );
378 NTSTATUS WINAPI
wow64_NtUserAddClipboardFormatListener( UINT
*args
)
380 HWND hwnd
= get_handle( &args
);
382 return NtUserAddClipboardFormatListener( hwnd
);
385 NTSTATUS WINAPI
wow64_NtUserRemoveClipboardFormatListener( UINT
*args
)
387 HWND hwnd
= get_handle( &args
);
389 return NtUserRemoveClipboardFormatListener( hwnd
);
392 NTSTATUS WINAPI
wow64_NtUserGetCursor( UINT
*args
)
394 return HandleToUlong( NtUserGetCursor() );
397 NTSTATUS WINAPI
wow64_NtUserFindExistingCursorIcon( UINT
*args
)
399 UNICODE_STRING32
*module32
= get_ptr( &args
);
400 UNICODE_STRING32
*res_name32
= get_ptr( &args
);
401 void *desc
= get_ptr( &args
);
403 UNICODE_STRING module
;
404 UNICODE_STRING res_name
;
407 ret
= NtUserFindExistingCursorIcon( unicode_str_32to64( &module
, module32
),
408 unicode_str_32to64( &res_name
, res_name32
), desc
);
409 return HandleToUlong( ret
);
412 NTSTATUS WINAPI
wow64_NtUserGetIconSize( UINT
*args
)
414 HICON handle
= get_handle( &args
);
415 UINT step
= get_ulong( &args
);
416 LONG
*width
= get_ptr( &args
);
417 LONG
*height
= get_ptr( &args
);
419 return NtUserGetIconSize( handle
, step
, width
, height
);
422 NTSTATUS WINAPI
wow64_NtUserGetCursorFrameInfo( UINT
*args
)
424 HCURSOR cursor
= get_ptr( &args
);
425 DWORD istep
= get_ulong( &args
);
426 DWORD
*rate_jiffies
= get_ptr( &args
);
427 DWORD
*num_steps
= get_ptr( &args
);
429 return HandleToUlong( NtUserGetCursorFrameInfo( cursor
, istep
, rate_jiffies
, num_steps
));
432 NTSTATUS WINAPI
wow64_NtUserAttachThreadInput( UINT
*args
)
434 DWORD from
= get_ulong( &args
);
435 DWORD to
= get_ulong( &args
);
436 BOOL attach
= get_ulong( &args
);
438 return NtUserAttachThreadInput( from
, to
, attach
);
441 NTSTATUS WINAPI
wow64_NtUserGetKeyState( UINT
*args
)
443 INT vkey
= get_ulong( &args
);
445 return NtUserGetKeyState( vkey
);
448 NTSTATUS WINAPI
wow64_NtUserGetKeyboardLayout( UINT
*args
)
450 DWORD tid
= get_ulong( &args
);
452 return HandleToUlong( NtUserGetKeyboardLayout( tid
));
455 NTSTATUS WINAPI
wow64_NtUserGetKeyboardLayoutName( UINT
*args
)
457 WCHAR
*name
= get_ptr( &args
);
459 return NtUserGetKeyboardLayoutName( name
);
462 NTSTATUS WINAPI
wow64_NtUserGetKeyboardState( UINT
*args
)
464 BYTE
*state
= get_ptr( &args
);
466 return NtUserGetKeyboardState( state
);
469 NTSTATUS WINAPI
wow64_NtUserSetKeyboardState( UINT
*args
)
471 BYTE
*state
= get_ptr( &args
);
473 return NtUserSetKeyboardState( state
);
476 NTSTATUS WINAPI
wow64_NtUserGetMouseMovePointsEx( UINT
*args
)
478 UINT size
= get_ulong( &args
);
479 MOUSEMOVEPOINT
*ptin
= get_ptr( &args
);
480 MOUSEMOVEPOINT
*ptout
= get_ptr( &args
);
481 int count
= get_ulong( &args
);
482 DWORD resolution
= get_ulong( &args
);
484 return NtUserGetMouseMovePointsEx( size
, ptin
, ptout
, count
, resolution
);
487 NTSTATUS WINAPI
wow64_NtUserChildWindowFromPointEx( UINT
*args
)
489 HWND parent
= get_handle( &args
);
490 LONG x
= get_ulong( &args
);
491 LONG y
= get_ulong( &args
);
492 UINT flags
= get_ulong( &args
);
494 return HandleToUlong( NtUserChildWindowFromPointEx( parent
, x
, y
, flags
));
497 NTSTATUS WINAPI
wow64_NtUserSetProcessDpiAwarenessContext( UINT
*args
)
499 ULONG awareness
= get_ulong( &args
);
500 ULONG unknown
= get_ulong( &args
);
502 return NtUserSetProcessDpiAwarenessContext( awareness
, unknown
);
505 NTSTATUS WINAPI
wow64_NtUserGetProcessDpiAwarenessContext( UINT
*args
)
507 HANDLE process
= get_handle( &args
);
509 return NtUserGetProcessDpiAwarenessContext( process
);
512 NTSTATUS WINAPI
wow64_NtUserGetSystemDpiForProcess( UINT
*args
)
514 HANDLE process
= get_handle( &args
);
516 return NtUserGetSystemDpiForProcess( process
);
519 NTSTATUS WINAPI
wow64_NtUserGetDpiForMonitor( UINT
*args
)
521 HMONITOR monitor
= get_handle( &args
);
522 UINT type
= get_ulong( &args
);
523 UINT
*x
= get_ptr( &args
);
524 UINT
*y
= get_ptr( &args
);
526 return NtUserGetDpiForMonitor( monitor
, type
, x
, y
);
529 NTSTATUS WINAPI
wow64_NtUserGetDoubleClickTime( UINT
*args
)
531 return NtUserGetDoubleClickTime();
534 NTSTATUS WINAPI
wow64_NtUserNotifyWinEvent( UINT
*args
)
536 DWORD event
= get_ulong( &args
);
537 HWND hwnd
= get_handle( &args
);
538 LONG object_id
= get_ulong( &args
);
539 LONG child_id
= get_ulong( &args
);
541 NtUserNotifyWinEvent( event
, hwnd
, object_id
, child_id
);
545 NTSTATUS WINAPI
wow64_NtUserSetWinEventHook( UINT
*args
)
547 DWORD event_min
= get_ulong( &args
);
548 DWORD event_max
= get_ulong( &args
);
549 HMODULE inst
= get_handle( &args
);
550 UNICODE_STRING32
*module32
= get_ptr( &args
);
551 WINEVENTPROC proc
= get_ptr(&args
);
552 DWORD pid
= get_ulong( &args
);
553 DWORD tid
= get_ulong( &args
);
554 DWORD flags
= get_ulong( &args
);
555 UNICODE_STRING module
;
558 ret
= NtUserSetWinEventHook( event_min
, event_max
, inst
,
559 unicode_str_32to64( &module
, module32
),
560 proc
, pid
, tid
, flags
);
561 return HandleToUlong( ret
);
564 NTSTATUS WINAPI
wow64_NtUserUnhookWinEvent( UINT
*args
)
566 HWINEVENTHOOK handle
= get_handle( &args
);
568 return NtUserUnhookWinEvent( handle
);
571 NTSTATUS WINAPI
wow64_NtUserSetWindowsHookEx( UINT
*args
)
573 HINSTANCE inst
= get_handle( &args
);
574 UNICODE_STRING32
*module32
= get_ptr( &args
);
575 DWORD tid
= get_ulong( &args
);
576 INT id
= get_ulong( &args
);
577 HOOKPROC proc
= get_ptr( &args
);
578 BOOL ansi
= get_ulong( &args
);
579 UNICODE_STRING module
;
582 ret
= NtUserSetWindowsHookEx( inst
, unicode_str_32to64( &module
, module32
),
583 tid
, id
, proc
, ansi
);
584 return HandleToUlong( ret
);
587 NTSTATUS WINAPI
wow64_NtUserUnhookWindowsHookEx( UINT
*args
)
589 HHOOK handle
= get_handle( &args
);
591 return NtUserUnhookWindowsHookEx( handle
);
594 NTSTATUS WINAPI
wow64_NtUserCallMsgFilter( UINT
*args
)
596 MSG32
*msg32
= get_ptr( &args
);
597 INT code
= get_ulong( &args
);
601 ret
= NtUserCallMsgFilter( msg_32to64( &msg
, msg32
), code
);
602 msg_64to32( &msg
, msg32
);
606 NTSTATUS WINAPI
wow64_NtUserGetForegroundWindow( UINT
*args
)
608 return HandleToUlong( NtUserGetForegroundWindow() );
611 NTSTATUS WINAPI
wow64_NtUserGetGUIThreadInfo( UINT
*args
)
613 DWORD id
= get_ulong( &args
);
625 } *info32
= get_ptr( &args
);
628 if (info32
->cbSize
!= sizeof(*info32
))
630 SetLastError( ERROR_INVALID_PARAMETER
);
634 info
.cbSize
= sizeof(info
);
635 if (!NtUserGetGUIThreadInfo( id
, &info
)) return FALSE
;
636 info32
->flags
= info
.flags
;
637 info32
->hwndActive
= HandleToUlong( info
.hwndActive
);
638 info32
->hwndFocus
= HandleToUlong( info
.hwndFocus
);
639 info32
->hwndCapture
= HandleToUlong( info
.hwndCapture
);
640 info32
->hwndMenuOwner
= HandleToUlong( info
.hwndMenuOwner
);
641 info32
->hwndMoveSize
= HandleToUlong( info
.hwndMoveSize
);
642 info32
->hwndCaret
= HandleToUlong( info
.hwndCaret
);
643 info32
->rcCaret
= info
.rcCaret
;
647 NTSTATUS WINAPI
wow64_NtUserSetSystemTimer( UINT
*args
)
649 HWND hwnd
= get_handle( &args
);
650 UINT_PTR id
= get_ulong( &args
);
651 UINT timeout
= get_ulong( &args
);
653 return NtUserSetSystemTimer( hwnd
, id
, timeout
);
656 NTSTATUS WINAPI
wow64_NtUserSetTimer( UINT
*args
)
658 HWND hwnd
= get_handle( &args
);
659 UINT_PTR id
= get_ulong( &args
);
660 UINT timeout
= get_ulong( &args
);
661 TIMERPROC proc
= get_ptr( &args
);
662 ULONG tolerance
= get_ulong( &args
);
664 return NtUserSetTimer( hwnd
, id
, timeout
, proc
, tolerance
);
667 NTSTATUS WINAPI
wow64_NtUserKillTimer( UINT
*args
)
669 HWND hwnd
= get_handle( &args
);
670 UINT_PTR id
= get_ulong( &args
);
672 return NtUserKillTimer( hwnd
, id
);
675 NTSTATUS WINAPI
wow64_NtUserGetCaretBlinkTime( UINT
*args
)
677 return NtUserGetCaretBlinkTime();
680 NTSTATUS WINAPI
wow64_NtUserGetCaretPos( UINT
*args
)
682 POINT
*pt
= get_ptr( &args
);
684 return NtUserGetCaretPos( pt
);
687 NTSTATUS WINAPI
wow64_NtUserCopyAcceleratorTable( UINT
*args
)
689 HACCEL src
= get_handle( &args
);
690 ACCEL
*dst
= get_ptr( &args
);
691 INT count
= get_ulong( &args
);
693 return NtUserCopyAcceleratorTable( src
, dst
, count
);
696 NTSTATUS WINAPI
wow64_NtUserCreateAcceleratorTable( UINT
*args
)
698 ACCEL
*table
= get_ptr( &args
);
699 INT count
= get_ulong( &args
);
701 return HandleToUlong( NtUserCreateAcceleratorTable( table
, count
));
704 NTSTATUS WINAPI
wow64_NtUserDestroyAcceleratorTable( UINT
*args
)
706 HACCEL handle
= get_handle( &args
);
708 return NtUserDestroyAcceleratorTable( handle
);
711 NTSTATUS WINAPI
wow64_NtUserCheckMenuItem( UINT
*args
)
713 HMENU handle
= get_handle( &args
);
714 UINT id
= get_ulong( &args
);
715 UINT flags
= get_ulong( &args
);
717 return NtUserCheckMenuItem( handle
, id
, flags
);
720 NTSTATUS WINAPI
wow64_NtUserDeleteMenu( UINT
*args
)
722 HMENU menu
= get_handle( &args
);
723 UINT id
= get_ulong( &args
);
724 UINT flags
= get_ulong( &args
);
726 return NtUserDeleteMenu( menu
, id
, flags
);
729 NTSTATUS WINAPI
wow64_NtUserEndMenu( UINT
*args
)
731 return NtUserEndMenu();
734 NTSTATUS WINAPI
wow64_NtUserGetMenuItemRect( UINT
*args
)
736 HWND hwnd
= get_handle( &args
);
737 HMENU handle
= get_handle( &args
);
738 UINT item
= get_ulong( &args
);
739 RECT
*rect
= get_ptr( &args
);
741 return NtUserGetMenuItemRect( hwnd
, handle
, item
, rect
);
744 NTSTATUS WINAPI
wow64_NtUserMenuItemFromPoint( UINT
*args
)
746 HWND hwnd
= get_handle( &args
);
747 HMENU handle
= get_handle( &args
);
748 int x
= get_ulong( &args
);
749 int y
= get_ulong( &args
);
751 return NtUserMenuItemFromPoint( hwnd
, handle
, x
, y
);
754 NTSTATUS WINAPI
wow64_NtUserSetMenuContextHelpId( UINT
*args
)
756 HMENU menu
= get_handle( &args
);
757 DWORD id
= get_ulong( &args
);
759 return NtUserSetMenuContextHelpId( menu
, id
);
762 NTSTATUS WINAPI
wow64_NtUserSetMenuDefaultItem( UINT
*args
)
764 HMENU handle
= get_handle( &args
);
765 UINT item
= get_ulong( &args
);
766 UINT bypos
= get_ulong( &args
);
768 return NtUserSetMenuDefaultItem( handle
, item
, bypos
);
771 NTSTATUS WINAPI
wow64_NtUserThunkedMenuInfo( UINT
*args
)
773 HMENU menu
= get_handle( &args
);
781 DWORD dwContextHelpID
;
783 } *info32
= get_ptr( &args
);
788 info
.cbSize
= sizeof(info
);
789 info
.fMask
= info32
->fMask
;
790 info
.dwStyle
= info32
->dwStyle
;
791 info
.cyMax
= info32
->cyMax
;
792 info
.hbrBack
= UlongToHandle( info32
->hbrBack
);
793 info
.dwContextHelpID
= info32
->dwContextHelpID
;
794 info
.dwMenuData
= info32
->dwMenuData
;
797 return NtUserThunkedMenuInfo( menu
, info32
? &info
: NULL
);
800 NTSTATUS WINAPI
wow64_NtUserThunkedMenuItemInfo( UINT
*args
)
802 HMENU handle
= get_handle( &args
);
803 UINT pos
= get_ulong( &args
);
804 UINT flags
= get_ulong( &args
);
805 UINT method
= get_ulong( &args
);
806 MENUITEMINFOW32
*info32
= get_ptr( &args
);
807 UNICODE_STRING32
*str32
= get_ptr( &args
);
808 MENUITEMINFOW info
= { sizeof(info
) }, *info_ptr
;
813 info
.cbSize
= sizeof(info
);
814 info
.fMask
= info32
->fMask
;
817 case NtUserSetMenuItemInfo
:
818 case NtUserInsertMenuItem
:
819 info
.fType
= info32
->fType
;
820 info
.fState
= info32
->fState
;
821 info
.wID
= info32
->wID
;
822 info
.hSubMenu
= UlongToHandle( info32
->hSubMenu
);
823 info
.hbmpChecked
= UlongToHandle( info32
->hbmpUnchecked
);
824 info
.dwItemData
= info32
->dwItemData
;
825 info
.dwTypeData
= UlongToPtr( info32
->dwTypeData
);
826 info
.cch
= info32
->cch
;
827 info
.hbmpItem
= UlongToHandle( info32
->hbmpItem
);
832 else info_ptr
= NULL
;
834 return NtUserThunkedMenuItemInfo( handle
, pos
, flags
, method
, info_ptr
,
835 unicode_str_32to64( &str
, str32
));
838 NTSTATUS WINAPI
wow64_NtUserRemoveMenu( UINT
*args
)
840 HMENU handle
= get_handle( &args
);
841 UINT id
= get_ulong( &args
);
842 UINT flags
= get_ulong( &args
);
844 return NtUserRemoveMenu( handle
, id
, flags
);
847 NTSTATUS WINAPI
wow64_NtUserLockWindowUpdate( UINT
*args
)
849 HWND hwnd
= get_handle( &args
);
851 return NtUserLockWindowUpdate( hwnd
);
854 NTSTATUS WINAPI
wow64_NtUserGetTitleBarInfo( UINT
*args
)
856 HWND hwnd
= get_handle( &args
);
857 TITLEBARINFO
*info
= get_ptr( &args
);
859 return NtUserGetTitleBarInfo( hwnd
, info
);