https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d3164a0f557bdc2cc9dfd…
commit d3164a0f557bdc2cc9dfd86612131f6cf180d462
Author: Joachim Henze <joachim.henze(a)reactos.org>
AuthorDate: Sun Jun 11 20:53:25 2023 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Jun 11 20:53:25 2023 +0200
[SHELL32] Strip leftover in CDefView::FillFileMenu() (#5330)
In 0.4.14-dev-955-g 1cf564c25f532c32f9fae891f17a70e62d5c1c14
Katayama experimented with populating explorers file-menu when no object is selected.
Later we found out, that none of the new entries introduced by that commit really
made sense and even created duplicates. So the commit was reverted by
0.4.15-dev-6039-g 0fa4edebd9125b9ca7a4256edbea7675e2152c7e 'Revert CDefView::FillFileMenu (#5278)' CORE-18429
But it seems that not all parts were properly reverted back then,
maybe because 6 lines of new code were written between the two lines in the meantime.
---
dll/win32/shell32/CDefView.cpp | 2 --
1 file changed, 2 deletions(-)
diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp
index 880afa6e457..ebcfa767090 100644
--- a/dll/win32/shell32/CDefView.cpp
+++ b/dll/win32/shell32/CDefView.cpp
@@ -1348,8 +1348,6 @@ HRESULT CDefView::FillFileMenu()
DeleteMenu(hFileMenu, i, MF_BYPOSITION);
}
- m_cidl = m_ListView.GetSelectedCount();
-
/* In case we still have this left over, clean it up! */
if (m_pFileMenu)
{
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0f9be539856b392b99dae…
commit 0f9be539856b392b99dae3d8bdecedb0b9de44fd
Author: George Bișoc <george.bisoc(a)reactos.org>
AuthorDate: Sun Jun 11 00:00:03 2023 +0200
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Sun Jun 11 18:14:02 2023 +0200
[WIN32K:NTUSER] Fix an unintialized user's token variable case
And remove the "!NT_SUCCESS(Status)" check which is excessive, the expected
status will always be STATUS_BUFFER_TOO_SMALL anyway. This should fix
some compilation warnings spotted by GCC. Courtesy goes to Hermes for letting
me know of these warnings.
---
win32ss/user/ntuser/security.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/win32ss/user/ntuser/security.c b/win32ss/user/ntuser/security.c
index 276d01bfe16..2ed4e1b66a0 100644
--- a/win32ss/user/ntuser/security.c
+++ b/win32ss/user/ntuser/security.c
@@ -2,7 +2,7 @@
* PROJECT: ReactOS Win32k subsystem
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Security infrastructure of NTUSER component of Win32k
- * COPYRIGHT: Copyright 2022 George Bișoc <george.bisoc(a)reactos.org>
+ * COPYRIGHT: Copyright 2022-2023 George Bișoc <george.bisoc(a)reactos.org>
*/
/* INCLUDES ******************************************************************/
@@ -170,7 +170,7 @@ IntQueryUserSecurityIdentification(
_Out_ PTOKEN_USER *User)
{
NTSTATUS Status;
- PTOKEN_USER UserToken;
+ PTOKEN_USER UserToken = NULL;
HANDLE Token;
ULONG BufferLength;
@@ -196,7 +196,7 @@ IntQueryUserSecurityIdentification(
NULL,
0,
&BufferLength);
- if (!NT_SUCCESS(Status) && Status == STATUS_BUFFER_TOO_SMALL)
+ if (Status == STATUS_BUFFER_TOO_SMALL)
{
/*
* Allocate some memory for the buffer
@@ -212,6 +212,12 @@ IntQueryUserSecurityIdentification(
return STATUS_NO_MEMORY;
}
}
+ else if (!NT_SUCCESS(Status))
+ {
+ ERR("IntQueryUserSecurityIdentification(): Failed to query the necessary length for the buffer (Status 0x%08lx)!\n", Status);
+ ZwClose(Token);
+ return Status;
+ }
/* Query the user now as we have plenty of space to hold it */
Status = ZwQueryInformationToken(Token,