https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a55d7c692ba0215e97663…
commit a55d7c692ba0215e976630df88782c1ca20e792e
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Apr 22 22:56:16 2018 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Apr 22 23:00:55 2018 +0200
[WIN32K] Implement UOI_FLAGS in NtUserGetObjectInformation(). Based from a patch by
Jérôme Gardou.
CORE-13447 CORE-14422
This fixes closing nLite 1.4.9.3 (.NET2) application, as well as any
other program that expects that the interactive window station is
reported as being visible. I thank Mark Jansen and Joachim Henze for
help and testing.
---
win32ss/user/ntuser/winsta.c | 35 +++++++++++++++++++++++++++++++----
1 file changed, 31 insertions(+), 4 deletions(-)
diff --git a/win32ss/user/ntuser/winsta.c b/win32ss/user/ntuser/winsta.c
index 1187e44055..d9ca3ca999 100644
--- a/win32ss/user/ntuser/winsta.c
+++ b/win32ss/user/ntuser/winsta.c
@@ -717,22 +717,49 @@ NtUserGetObjectInformation(
goto Exit;
}
- TRACE("WinSta or Desktop opened!!\n");
+ TRACE("WinSta or Desktop opened!\n");
/* Get data */
switch (nIndex)
{
case UOI_FLAGS:
{
- /* This is a default implementation that does almost nothing */
- ObjectFlags.fInherit = FALSE;
+ OBJECT_HANDLE_ATTRIBUTE_INFORMATION HandleInfo;
+ ULONG BytesWritten;
+
ObjectFlags.fReserved = FALSE;
+
+ /* Check whether this handle is inheritable */
+ Status = ZwQueryObject(hObject,
+ ObjectHandleFlagInformation,
+ &HandleInfo,
+ sizeof(OBJECT_HANDLE_ATTRIBUTE_INFORMATION),
+ &BytesWritten);
+ if (!NT_SUCCESS(Status))
+ {
+ ERR("ZwQueryObject failed, Status 0x%08lx\n", Status);
+ break;
+ }
+ ObjectFlags.fInherit = HandleInfo.Inherit;
+
ObjectFlags.dwFlags = 0;
+ if (WinStaObject != NULL)
+ {
+ if (!(WinStaObject->Flags & WSS_NOIO))
+ ObjectFlags.dwFlags |= WSF_VISIBLE;
+ }
+ else if (DesktopObject != NULL)
+ {
+ FIXME("Setting DF_ALLOWOTHERACCOUNTHOOK is unimplemented.\n");
+ }
+ else
+ {
+ ERR("No associated WinStaObject nor DesktopObject!\n");
+ }
pvData = &ObjectFlags;
nDataSize = sizeof(ObjectFlags);
Status = STATUS_SUCCESS;
- ERR("UOI_FLAGS unimplemented!\n");
break;
}