mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
[WIN32SS:ENG/NTUSER] Use shared locks for display list lookups (#9090)
- Use shared locks for the display device and PDEV lookup paths. These functions only walk existing lists and take references, while list updates and mode-switch paths still use exclusive locking. This avoids serializing read-only display queries unnecessarily. - Use shared locks for other read-only NtUser calls.
This commit is contained in:
@@ -6315,7 +6315,7 @@ NtUserMenuItemFromPoint(
|
||||
int Ret = -1;
|
||||
|
||||
TRACE("Enter NtUserMenuItemFromPoint\n");
|
||||
UserEnterExclusive();
|
||||
UserEnterShared();
|
||||
|
||||
if (!(Menu = UserGetMenuObject(hMenu)))
|
||||
{
|
||||
|
||||
@@ -61,7 +61,19 @@ NtUserCallNoParam(DWORD Routine)
|
||||
DWORD_PTR Result = 0;
|
||||
|
||||
TRACE("Enter NtUserCallNoParam\n");
|
||||
UserEnterExclusive();
|
||||
|
||||
/* Read-only routines only need a shared lock; the rest stay exclusive */
|
||||
switch (Routine)
|
||||
{
|
||||
case NOPARAM_ROUTINE_GETMSESSAGEPOS:
|
||||
case NOPARAM_ROUTINE_GETIMESHOWSTATUS:
|
||||
case NOPARAM_ROUTINE_ISCONSOLEMODE:
|
||||
UserEnterShared();
|
||||
break;
|
||||
default:
|
||||
UserEnterExclusive();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (Routine)
|
||||
{
|
||||
@@ -158,7 +170,22 @@ NtUserCallOneParam(
|
||||
|
||||
TRACE("Enter NtUserCallOneParam\n");
|
||||
|
||||
UserEnterExclusive();
|
||||
/* Read-only routines only need a shared lock; the rest stay exclusive */
|
||||
switch (Routine)
|
||||
{
|
||||
case ONEPARAM_ROUTINE_GETDESKTOPMAPPING:
|
||||
case ONEPARAM_ROUTINE_WINDOWFROMDC:
|
||||
case ONEPARAM_ROUTINE_GETKEYBOARDTYPE:
|
||||
case ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT:
|
||||
case ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS:
|
||||
case ONEPARAM_ROUTINE_GETCURSORPOS:
|
||||
case ONEPARAM_ROUTINE_GETPROCDEFLAYOUT:
|
||||
UserEnterShared();
|
||||
break;
|
||||
default:
|
||||
UserEnterExclusive();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (Routine)
|
||||
{
|
||||
@@ -319,7 +346,6 @@ NtUserCallOneParam(
|
||||
}
|
||||
|
||||
case ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS:
|
||||
/* FIXME: Should use UserEnterShared */
|
||||
Result = UserEnumClipboardFormats(Param);
|
||||
break;
|
||||
|
||||
|
||||
@@ -1527,7 +1527,7 @@ NtUserBuildHwndList(
|
||||
if (pcHwndNeeded == NULL)
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
||||
UserEnterExclusive();
|
||||
UserEnterShared();
|
||||
|
||||
if (hwndParent || !dwThreadId)
|
||||
{
|
||||
|
||||
@@ -3283,7 +3283,7 @@ NtUserChildWindowFromPointEx(HWND hwndParent,
|
||||
{
|
||||
PWND pwndParent;
|
||||
TRACE("Enter NtUserChildWindowFromPointEx\n");
|
||||
UserEnterExclusive();
|
||||
UserEnterShared();
|
||||
if ((pwndParent = UserGetWindowObject(hwndParent)))
|
||||
{
|
||||
pwndParent = IntChildWindowFromPointEx(pwndParent, x, y, uiFlags);
|
||||
|
||||
Reference in New Issue
Block a user