mirror of
https://github.com/reactos/reactos.git
synced 2024-07-04 11:44:33 +00:00
[Win32k|User32]
- Fix broadcast message, pass all wine tests. Code consolidation next round. svn path=/trunk/; revision=54376
This commit is contained in:
parent
d14aee58bb
commit
37fe8c8eff
|
@ -2728,7 +2728,7 @@ User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength)
|
||||||
|
|
||||||
if (pci->CallbackWnd.hWnd == UMMsg.hwnd)
|
if (pci->CallbackWnd.hWnd == UMMsg.hwnd)
|
||||||
pWnd = pci->CallbackWnd.pWnd;
|
pWnd = pci->CallbackWnd.pWnd;
|
||||||
|
|
||||||
CallbackArgs->Result = IntCallWindowProcW( CallbackArgs->IsAnsiProc,
|
CallbackArgs->Result = IntCallWindowProcW( CallbackArgs->IsAnsiProc,
|
||||||
CallbackArgs->Proc,
|
CallbackArgs->Proc,
|
||||||
pWnd,
|
pWnd,
|
||||||
|
@ -3059,16 +3059,13 @@ IntBroadcastSystemMessage(
|
||||||
|
|
||||||
if (dwflags & BSF_LUID) parm.luid = pBSMInfo->luid;
|
if (dwflags & BSF_LUID) parm.luid = pBSMInfo->luid;
|
||||||
|
|
||||||
if (*lpdwRecipients & BSM_APPLICATIONS)
|
ret = NtUserMessageCall(GetDesktopWindow(),
|
||||||
{
|
uiMessage,
|
||||||
ret = NtUserMessageCall(GetDesktopWindow(),
|
wParam,
|
||||||
uiMessage,
|
lParam,
|
||||||
wParam,
|
(ULONG_PTR)&parm,
|
||||||
lParam,
|
FNID_BROADCASTSYSTEMMESSAGE,
|
||||||
(ULONG_PTR)&parm,
|
Ansi);
|
||||||
FNID_BROADCASTSYSTEMMESSAGE,
|
|
||||||
Ansi);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2066,7 +2066,7 @@ NtUserMessageCall( HWND hWnd,
|
||||||
break;
|
break;
|
||||||
case FNID_BROADCASTSYSTEMMESSAGE:
|
case FNID_BROADCASTSYSTEMMESSAGE:
|
||||||
{
|
{
|
||||||
BROADCASTPARM parm;
|
BROADCASTPARM parm, *retparam;
|
||||||
DWORD_PTR RetVal = 0;
|
DWORD_PTR RetVal = 0;
|
||||||
|
|
||||||
if (ResultInfo)
|
if (ResultInfo)
|
||||||
|
@ -2086,53 +2086,286 @@ NtUserMessageCall( HWND hWnd,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if ( parm.recipients & BSM_ALLDESKTOPS ||
|
if ( parm.recipients & BSM_ALLDESKTOPS ||
|
||||||
parm.recipients == BSM_ALLCOMPONENTS )
|
parm.recipients == BSM_ALLCOMPONENTS )
|
||||||
{
|
{
|
||||||
|
PLIST_ENTRY DesktopEntry;
|
||||||
|
PDESKTOP rpdesk;
|
||||||
|
HWND *List, hwndDenied = NULL;
|
||||||
|
HDESK hDesk = NULL;
|
||||||
|
PWND pwnd, pwndDesk;
|
||||||
|
ULONG i;
|
||||||
|
UINT fuFlags;
|
||||||
|
|
||||||
|
for (DesktopEntry = InputWindowStation->DesktopListHead.Flink;
|
||||||
|
DesktopEntry != &InputWindowStation->DesktopListHead;
|
||||||
|
DesktopEntry = DesktopEntry->Flink)
|
||||||
|
{
|
||||||
|
rpdesk = CONTAINING_RECORD(DesktopEntry, DESKTOP, ListEntry);
|
||||||
|
pwndDesk = rpdesk->pDeskInfo->spwnd;
|
||||||
|
List = IntWinListChildren(pwndDesk);
|
||||||
|
|
||||||
|
if (parm.flags & BSF_QUERY)
|
||||||
|
{
|
||||||
|
if (List != NULL)
|
||||||
|
{
|
||||||
|
if (parm.flags & BSF_FORCEIFHUNG || parm.flags & BSF_NOHANG)
|
||||||
|
{
|
||||||
|
fuFlags = SMTO_ABORTIFHUNG;
|
||||||
|
}
|
||||||
|
else if (parm.flags & BSF_NOTIMEOUTIFNOTHUNG)
|
||||||
|
{
|
||||||
|
fuFlags = SMTO_NOTIMEOUTIFNOTHUNG;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fuFlags = SMTO_NORMAL;
|
||||||
|
}
|
||||||
|
co_IntSendMessageTimeout( UserHMGetHandle(pwndDesk),
|
||||||
|
Msg,
|
||||||
|
wParam,
|
||||||
|
lParam,
|
||||||
|
fuFlags,
|
||||||
|
2000,
|
||||||
|
&RetVal);
|
||||||
|
Ret = TRUE;
|
||||||
|
for (i = 0; List[i]; i++)
|
||||||
|
{
|
||||||
|
pwnd = UserGetWindowObject(List[i]);
|
||||||
|
if (!pwnd) continue;
|
||||||
|
|
||||||
|
if ( pwnd->fnid == FNID_MENU ||
|
||||||
|
pwnd->pcls->atomClassName == gpsi->atomSysClass[ICLS_SWITCH] )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( parm.flags & BSF_IGNORECURRENTTASK )
|
||||||
|
{
|
||||||
|
if ( pwnd->head.pti->MessageQueue == gptiCurrent->MessageQueue )
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
co_IntSendMessageTimeout( List[i],
|
||||||
|
Msg,
|
||||||
|
wParam,
|
||||||
|
lParam,
|
||||||
|
fuFlags,
|
||||||
|
2000,
|
||||||
|
&RetVal);
|
||||||
|
|
||||||
|
if (!RetVal && EngGetLastError() == ERROR_TIMEOUT)
|
||||||
|
{
|
||||||
|
if (!(parm.flags & BSF_FORCEIFHUNG))
|
||||||
|
Ret = FALSE;
|
||||||
|
}
|
||||||
|
if (RetVal == BROADCAST_QUERY_DENY)
|
||||||
|
{
|
||||||
|
hwndDenied = List[i];
|
||||||
|
hDesk = UserHMGetHandle(pwndDesk);
|
||||||
|
Ret = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
|
||||||
|
_SEH2_TRY
|
||||||
|
{
|
||||||
|
retparam = (PBROADCASTPARM) ResultInfo;
|
||||||
|
retparam->hDesk = hDesk;
|
||||||
|
retparam->hWnd = hwndDenied;
|
||||||
|
}
|
||||||
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
_SEH2_YIELD(break);
|
||||||
|
}
|
||||||
|
_SEH2_END;
|
||||||
|
if (!Ret) break; // Have a hit! Let everyone know!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (parm.flags & BSF_POSTMESSAGE)
|
||||||
|
{
|
||||||
|
if (List != NULL)
|
||||||
|
{
|
||||||
|
UserPostMessage(UserHMGetHandle(pwndDesk), Msg, wParam, lParam);
|
||||||
|
|
||||||
|
for (i = 0; List[i]; i++)
|
||||||
|
{
|
||||||
|
pwnd = UserGetWindowObject(List[i]);
|
||||||
|
if (!pwnd) continue;
|
||||||
|
|
||||||
|
if ( pwnd->fnid == FNID_MENU ||
|
||||||
|
pwnd->pcls->atomClassName == gpsi->atomSysClass[ICLS_SWITCH] )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( parm.flags & BSF_IGNORECURRENTTASK )
|
||||||
|
{
|
||||||
|
if ( pwnd->head.pti->MessageQueue == gptiCurrent->MessageQueue )
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
UserPostMessage(List[i], Msg, wParam, lParam);
|
||||||
|
}
|
||||||
|
ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
|
||||||
|
}
|
||||||
|
Ret = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (List != NULL)
|
||||||
|
{
|
||||||
|
UserSendNotifyMessage(UserHMGetHandle(pwndDesk), Msg, wParam, lParam);
|
||||||
|
|
||||||
|
for (i = 0; List[i]; i++)
|
||||||
|
{
|
||||||
|
pwnd = UserGetWindowObject(List[i]);
|
||||||
|
if (!pwnd) continue;
|
||||||
|
|
||||||
|
if ( pwnd->fnid == FNID_MENU ||
|
||||||
|
pwnd->pcls->atomClassName == gpsi->atomSysClass[ICLS_SWITCH] )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( parm.flags & BSF_IGNORECURRENTTASK )
|
||||||
|
{
|
||||||
|
if ( pwnd->head.pti->MessageQueue == gptiCurrent->MessageQueue )
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
UserSendNotifyMessage(List[i], Msg, wParam, lParam);
|
||||||
|
}
|
||||||
|
ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
|
||||||
|
}
|
||||||
|
Ret = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (parm.recipients & BSM_APPLICATIONS)
|
else if (parm.recipients & BSM_APPLICATIONS)
|
||||||
{
|
{
|
||||||
if (parm.flags & BSF_QUERY)
|
HWND *List, hwndDenied = NULL;
|
||||||
{
|
HDESK hDesk = NULL;
|
||||||
if (parm.flags & BSF_FORCEIFHUNG || parm.flags & BSF_NOHANG)
|
PWND pwnd, pwndDesk;
|
||||||
{
|
ULONG i;
|
||||||
co_IntSendMessageTimeout( HWND_BROADCAST,
|
UINT fuFlags;
|
||||||
|
|
||||||
|
pwndDesk = UserGetWindowObject(IntGetDesktopWindow());
|
||||||
|
List = IntWinListChildren(pwndDesk);
|
||||||
|
|
||||||
|
if (parm.flags & BSF_QUERY)
|
||||||
|
{
|
||||||
|
if (List != NULL)
|
||||||
|
{
|
||||||
|
if (parm.flags & BSF_FORCEIFHUNG || parm.flags & BSF_NOHANG)
|
||||||
|
{
|
||||||
|
fuFlags = SMTO_ABORTIFHUNG;
|
||||||
|
}
|
||||||
|
else if (parm.flags & BSF_NOTIMEOUTIFNOTHUNG)
|
||||||
|
{
|
||||||
|
fuFlags = SMTO_NOTIMEOUTIFNOTHUNG;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fuFlags = SMTO_NORMAL;
|
||||||
|
}
|
||||||
|
co_IntSendMessageTimeout( UserHMGetHandle(pwndDesk),
|
||||||
|
Msg,
|
||||||
|
wParam,
|
||||||
|
lParam,
|
||||||
|
fuFlags,
|
||||||
|
2000,
|
||||||
|
&RetVal);
|
||||||
|
Ret = TRUE;
|
||||||
|
for (i = 0; List[i]; i++)
|
||||||
|
{
|
||||||
|
pwnd = UserGetWindowObject(List[i]);
|
||||||
|
if (!pwnd) continue;
|
||||||
|
|
||||||
|
if ( pwnd->fnid == FNID_MENU ||
|
||||||
|
pwnd->pcls->atomClassName == gpsi->atomSysClass[ICLS_SWITCH] )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( parm.flags & BSF_IGNORECURRENTTASK )
|
||||||
|
{
|
||||||
|
if ( pwnd->head.pti->MessageQueue == gptiCurrent->MessageQueue )
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
co_IntSendMessageTimeout( List[i],
|
||||||
Msg,
|
Msg,
|
||||||
wParam,
|
wParam,
|
||||||
lParam,
|
lParam,
|
||||||
SMTO_ABORTIFHUNG,
|
fuFlags,
|
||||||
2000,
|
2000,
|
||||||
&RetVal);
|
&RetVal);
|
||||||
}
|
|
||||||
else if (parm.flags & BSF_NOTIMEOUTIFNOTHUNG)
|
if (!RetVal && EngGetLastError() == ERROR_TIMEOUT)
|
||||||
{
|
{
|
||||||
co_IntSendMessageTimeout( HWND_BROADCAST,
|
if (!(parm.flags & BSF_FORCEIFHUNG))
|
||||||
Msg,
|
Ret = FALSE;
|
||||||
wParam,
|
}
|
||||||
lParam,
|
if (RetVal == BROADCAST_QUERY_DENY)
|
||||||
SMTO_NOTIMEOUTIFNOTHUNG,
|
{
|
||||||
2000,
|
hwndDenied = List[i];
|
||||||
&RetVal);
|
hDesk = UserHMGetHandle(pwndDesk);
|
||||||
}
|
Ret = FALSE;
|
||||||
else
|
}
|
||||||
{
|
}
|
||||||
co_IntSendMessageTimeout( HWND_BROADCAST,
|
ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
|
||||||
Msg,
|
_SEH2_TRY
|
||||||
wParam,
|
{
|
||||||
lParam,
|
retparam = (PBROADCASTPARM) ResultInfo;
|
||||||
SMTO_NORMAL,
|
retparam->hDesk = hDesk;
|
||||||
2000,
|
retparam->hWnd = hwndDenied;
|
||||||
&RetVal);
|
}
|
||||||
}
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
Ret = RetVal;
|
{
|
||||||
}
|
_SEH2_YIELD(break);
|
||||||
else if (parm.flags & BSF_POSTMESSAGE)
|
}
|
||||||
{
|
_SEH2_END;
|
||||||
Ret = UserPostMessage(HWND_BROADCAST, Msg, wParam, lParam);
|
}
|
||||||
}
|
}
|
||||||
else //Everything else,,,, if ( parm.flags & BSF_SENDNOTIFYMESSAGE)
|
else if (parm.flags & BSF_POSTMESSAGE)
|
||||||
{
|
{
|
||||||
Ret = UserSendNotifyMessage(HWND_BROADCAST, Msg, wParam, lParam);
|
if (List != NULL)
|
||||||
}
|
{
|
||||||
|
UserPostMessage(UserHMGetHandle(pwndDesk), Msg, wParam, lParam);
|
||||||
|
|
||||||
|
for (i = 0; List[i]; i++)
|
||||||
|
{
|
||||||
|
pwnd = UserGetWindowObject(List[i]);
|
||||||
|
if (!pwnd) continue;
|
||||||
|
|
||||||
|
if ( pwnd->fnid == FNID_MENU ||
|
||||||
|
pwnd->pcls->atomClassName == gpsi->atomSysClass[ICLS_SWITCH] )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( parm.flags & BSF_IGNORECURRENTTASK )
|
||||||
|
{
|
||||||
|
if ( pwnd->head.pti->MessageQueue == gptiCurrent->MessageQueue )
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
UserPostMessage(List[i], Msg, wParam, lParam);
|
||||||
|
}
|
||||||
|
ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
|
||||||
|
}
|
||||||
|
Ret = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (List != NULL)
|
||||||
|
{
|
||||||
|
UserSendNotifyMessage(UserHMGetHandle(pwndDesk), Msg, wParam, lParam);
|
||||||
|
|
||||||
|
for (i = 0; List[i]; i++)
|
||||||
|
{
|
||||||
|
pwnd = UserGetWindowObject(List[i]);
|
||||||
|
if (!pwnd) continue;
|
||||||
|
|
||||||
|
if ( pwnd->fnid == FNID_MENU ||
|
||||||
|
pwnd->pcls->atomClassName == gpsi->atomSysClass[ICLS_SWITCH] )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( parm.flags & BSF_IGNORECURRENTTASK )
|
||||||
|
{
|
||||||
|
if ( pwnd->head.pti->MessageQueue == gptiCurrent->MessageQueue )
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
UserSendNotifyMessage(List[i], Msg, wParam, lParam);
|
||||||
|
}
|
||||||
|
ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
|
||||||
|
}
|
||||||
|
Ret = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue