mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 01:12:06 +00:00
[User32|Win32k]
- Working on wine win test_capture_4, pass all the tests in test_capture_4_proc but still waiting forever in MenuTrackMenu:WaitMessage! svn path=/trunk/; revision=51248
This commit is contained in:
parent
594dd8de49
commit
7a18540a92
|
@ -3207,8 +3207,10 @@ static INT FASTCALL MenuTrackMenu(HMENU hmenu, UINT wFlags, INT x, INT y,
|
|||
fEndMenu = !fRemove;
|
||||
}
|
||||
|
||||
SetCapture(mt.OwnerWnd);
|
||||
(void)NtUserSetGUIThreadHandle(MSQ_STATE_MENUOWNER, mt.OwnerWnd);
|
||||
/* owner may not be visible when tracking a popup, so use the menu itself */
|
||||
capture_win = (wFlags & TPM_POPUPMENU) ? MenuInfo.Wnd : mt.OwnerWnd;
|
||||
(void)NtUserSetGUIThreadHandle(MSQ_STATE_MENUOWNER, capture_win); // 1
|
||||
SetCapture(capture_win); // 2
|
||||
|
||||
FIXME("MenuTrackMenu 1\n");
|
||||
while (! fEndMenu)
|
||||
|
|
|
@ -2380,8 +2380,9 @@ GetCapture(VOID)
|
|||
BOOL WINAPI
|
||||
ReleaseCapture(VOID)
|
||||
{
|
||||
NtUserSetCapture(NULL);
|
||||
return(TRUE);
|
||||
HWND hwndPrev = NtUserSetCapture(NULL);
|
||||
return(hwndPrev ? TRUE : FALSE);
|
||||
// return (BOOL)NtUserCallNoParam(NOPARAM_ROUTINE_RELEASECAPTURE);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -546,6 +546,9 @@ co_UserSetCapture(HWND hWnd)
|
|||
pti = PsGetCurrentThreadWin32Thread();
|
||||
ThreadQueue = pti->MessageQueue;
|
||||
|
||||
if (ThreadQueue->QF_flags & QF_CAPTURELOCKED)
|
||||
return NULL;
|
||||
|
||||
if ((Window = UserGetWindowObject(hWnd)))
|
||||
{
|
||||
if (Window->head.pti->MessageQueue != ThreadQueue)
|
||||
|
@ -553,7 +556,7 @@ co_UserSetCapture(HWND hWnd)
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
hWndPrev = MsqSetStateWindow(ThreadQueue, MSQ_STATE_CAPTURE, hWnd);
|
||||
|
||||
if (hWndPrev)
|
||||
|
@ -563,19 +566,28 @@ co_UserSetCapture(HWND hWnd)
|
|||
IntNotifyWinEvent(EVENT_SYSTEM_CAPTUREEND, pWnd, OBJID_WINDOW, CHILDID_SELF, WEF_SETBYWNDPTI);
|
||||
}
|
||||
|
||||
if (Window)
|
||||
IntNotifyWinEvent(EVENT_SYSTEM_CAPTURESTART, Window, OBJID_WINDOW, CHILDID_SELF, WEF_SETBYWNDPTI);
|
||||
|
||||
if (hWndPrev && hWndPrev != hWnd)
|
||||
{
|
||||
if (ThreadQueue->MenuOwner && Window) ThreadQueue->QF_flags |= QF_CAPTURELOCKED;
|
||||
|
||||
co_IntPostOrSendMessage(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd);
|
||||
|
||||
ThreadQueue->QF_flags &= ~QF_CAPTURELOCKED;
|
||||
}
|
||||
|
||||
ThreadQueue->CaptureWindow = hWnd;
|
||||
|
||||
/// These are hacks!
|
||||
/* also remove other windows if not capturing anymore */
|
||||
if (hWnd == NULL)
|
||||
{
|
||||
MsqSetStateWindow(ThreadQueue, MSQ_STATE_MENUOWNER, NULL);
|
||||
MsqSetStateWindow(ThreadQueue, MSQ_STATE_MOVESIZE, NULL);
|
||||
}
|
||||
|
||||
if (Window)
|
||||
IntNotifyWinEvent(EVENT_SYSTEM_CAPTURESTART, Window, OBJID_WINDOW, CHILDID_SELF, WEF_SETBYWNDPTI);
|
||||
|
||||
co_IntPostOrSendMessage(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd);
|
||||
ThreadQueue->CaptureWindow = hWnd;
|
||||
|
||||
///
|
||||
return hWndPrev;
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,9 @@ NtUserGetGUIThreadInfo(
|
|||
GUITHREADINFO SafeGui;
|
||||
PDESKTOP Desktop;
|
||||
PUSER_MESSAGE_QUEUE MsgQueue;
|
||||
PTHREADINFO W32Thread;
|
||||
PETHREAD Thread = NULL;
|
||||
|
||||
DECLARE_RETURN(BOOLEAN);
|
||||
|
||||
DPRINT("Enter NtUserGetGUIThreadInfo\n");
|
||||
|
@ -198,7 +200,7 @@ NtUserGetGUIThreadInfo(
|
|||
RETURN( FALSE);
|
||||
}
|
||||
|
||||
if(idThread)
|
||||
if (idThread)
|
||||
{
|
||||
Status = PsLookupThreadByThreadId((HANDLE)(DWORD_PTR)idThread, &Thread);
|
||||
if(!NT_SUCCESS(Status))
|
||||
|
@ -206,24 +208,17 @@ NtUserGetGUIThreadInfo(
|
|||
EngSetLastError(ERROR_ACCESS_DENIED);
|
||||
RETURN( FALSE);
|
||||
}
|
||||
Desktop = ((PTHREADINFO)Thread->Tcb.Win32Thread)->rpdesk;
|
||||
W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread;
|
||||
Desktop = W32Thread->rpdesk;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* get the foreground thread */
|
||||
PTHREADINFO W32Thread = (PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread;
|
||||
{ /* get the foreground thread */
|
||||
Thread = PsGetCurrentThread();
|
||||
W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread;
|
||||
Desktop = W32Thread->rpdesk;
|
||||
if(Desktop)
|
||||
{
|
||||
MsgQueue = Desktop->ActiveMessageQueue;
|
||||
if(MsgQueue)
|
||||
{
|
||||
Thread = MsgQueue->Thread;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!Thread || !Desktop)
|
||||
if (!Thread || !Desktop )
|
||||
{
|
||||
if(idThread && Thread)
|
||||
ObDereferenceObject(Thread);
|
||||
|
@ -231,13 +226,21 @@ NtUserGetGUIThreadInfo(
|
|||
RETURN( FALSE);
|
||||
}
|
||||
|
||||
MsgQueue = (PUSER_MESSAGE_QUEUE)Desktop->ActiveMessageQueue;
|
||||
if ( W32Thread->MessageQueue )
|
||||
MsgQueue = W32Thread->MessageQueue;
|
||||
else
|
||||
{
|
||||
if ( Desktop ) MsgQueue = Desktop->ActiveMessageQueue;
|
||||
}
|
||||
|
||||
CaretInfo = MsgQueue->CaretInfo;
|
||||
|
||||
SafeGui.flags = (CaretInfo->Visible ? GUI_CARETBLINKING : 0);
|
||||
if(MsgQueue->MenuOwner)
|
||||
|
||||
if (MsgQueue->MenuOwner)
|
||||
SafeGui.flags |= GUI_INMENUMODE | MsgQueue->MenuState;
|
||||
if(MsgQueue->MoveSize)
|
||||
|
||||
if (MsgQueue->MoveSize)
|
||||
SafeGui.flags |= GUI_INMOVESIZE;
|
||||
|
||||
/* FIXME add flag GUI_16BITTASK */
|
||||
|
@ -254,7 +257,7 @@ NtUserGetGUIThreadInfo(
|
|||
SafeGui.rcCaret.right = SafeGui.rcCaret.left + CaretInfo->Size.cx;
|
||||
SafeGui.rcCaret.bottom = SafeGui.rcCaret.top + CaretInfo->Size.cy;
|
||||
|
||||
if(idThread)
|
||||
if (idThread)
|
||||
ObDereferenceObject(Thread);
|
||||
|
||||
Status = MmCopyToCaller(lpgui, &SafeGui, sizeof(GUITHREADINFO));
|
||||
|
|
Loading…
Reference in a new issue