[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:
Ahmed Arif
2026-06-26 13:51:48 +02:00
committed by GitHub
parent 4320065009
commit a45e91cb3d
5 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -2956,7 +2956,7 @@ NtUserGetWOWClass(
return FALSE;
}
UserEnterExclusive();
UserEnterShared();
pi = GetW32ProcessInfo();
+1 -1
View File
@@ -1645,7 +1645,7 @@ NtUserGetForegroundWindow(VOID)
HWND Ret;
TRACE("Enter NtUserGetForegroundWindow\n");
UserEnterExclusive();
UserEnterShared();
Ret = UserGetForegroundWindow();
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -249,7 +249,7 @@ NtUserGetLayeredWindowAttributes(
BOOL Ret = FALSE;
TRACE("Enter NtUserGetLayeredWindowAttributes\n");
UserEnterExclusive();
UserEnterShared();
if (!(pWnd = UserGetWindowObject(hwnd)) ||
!(pWnd->ExStyle & WS_EX_LAYERED) )
+1 -1
View File
@@ -5765,7 +5765,7 @@ NtUserGetTitleBarInfo(
BOOLEAN retValue = FALSE;
TRACE("Enter NtUserGetTitleBarInfo\n");
UserEnterExclusive();
UserEnterShared();
/* Validate the window handle */
if (!(WindowObject = UserGetWindowObject(hwnd)))