mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[WIN32SS:NTUSER] Use shared locks for read-only queries (#9088)
Some win32k syscalls were still taking the exclusive user lock even though they only read existing state. This switches a few simple query paths to the shared user lock instead: foreground window lookup, IME hotkey/context queries, layered window attributes, and title bar info. The goal is to avoid taking the writer lock for read-only work while keeping the same behavior.
This commit is contained in:
@@ -2956,7 +2956,7 @@ NtUserGetWOWClass(
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
UserEnterExclusive();
|
||||
UserEnterShared();
|
||||
|
||||
pi = GetW32ProcessInfo();
|
||||
|
||||
|
||||
@@ -1645,7 +1645,7 @@ NtUserGetForegroundWindow(VOID)
|
||||
HWND Ret;
|
||||
|
||||
TRACE("Enter NtUserGetForegroundWindow\n");
|
||||
UserEnterExclusive();
|
||||
UserEnterShared();
|
||||
|
||||
Ret = UserGetForegroundWindow();
|
||||
|
||||
|
||||
@@ -434,7 +434,7 @@ NtUserGetImeHotKey(
|
||||
{
|
||||
PIMEHOTKEY pNode = NULL;
|
||||
|
||||
UserEnterExclusive();
|
||||
UserEnterShared();
|
||||
|
||||
_SEH2_TRY
|
||||
{
|
||||
@@ -1897,7 +1897,7 @@ NtUserQueryInputContext(HIMC hIMC, DWORD dwType)
|
||||
PTHREADINFO ptiIMC;
|
||||
DWORD_PTR ret = 0;
|
||||
|
||||
UserEnterExclusive();
|
||||
UserEnterShared();
|
||||
|
||||
if (!IS_IMM_MODE())
|
||||
goto Quit;
|
||||
|
||||
@@ -249,7 +249,7 @@ NtUserGetLayeredWindowAttributes(
|
||||
BOOL Ret = FALSE;
|
||||
|
||||
TRACE("Enter NtUserGetLayeredWindowAttributes\n");
|
||||
UserEnterExclusive();
|
||||
UserEnterShared();
|
||||
|
||||
if (!(pWnd = UserGetWindowObject(hwnd)) ||
|
||||
!(pWnd->ExStyle & WS_EX_LAYERED) )
|
||||
|
||||
@@ -5765,7 +5765,7 @@ NtUserGetTitleBarInfo(
|
||||
BOOLEAN retValue = FALSE;
|
||||
|
||||
TRACE("Enter NtUserGetTitleBarInfo\n");
|
||||
UserEnterExclusive();
|
||||
UserEnterShared();
|
||||
|
||||
/* Validate the window handle */
|
||||
if (!(WindowObject = UserGetWindowObject(hwnd)))
|
||||
|
||||
Reference in New Issue
Block a user