https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bd027c9de4dca4ef53f9d…
commit bd027c9de4dca4ef53f9d8f3233749de3d25a4f2
Author: Doug Lyons <douglyons(a)douglyons.com>
AuthorDate: Mon Oct 3 17:26:02 2022 -0500
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Oct 4 00:26:02 2022 +0200
[NTUSER] Fix 'Trying to link windows to itself' (#4478) CORE-18132
Fix 'Trying to link windows to itself' on DestroyWindow. Patch by I_Kill_Bugs.
This fixes a potential BSOD 0x50 observable in the app Localizer Editor"
---
win32ss/user/ntuser/winpos.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/win32ss/user/ntuser/winpos.c b/win32ss/user/ntuser/winpos.c
index 7795f0293b6..25c13b48102 100644
--- a/win32ss/user/ntuser/winpos.c
+++ b/win32ss/user/ntuser/winpos.c
@@ -1393,8 +1393,34 @@ WinPosDoOwnedPopups(PWND Window, HWND hWndInsertAfter)
if (List[i] == Owner)
{
- if (i > 0) hWndInsertAfter = List[i-1];
- else hWndInsertAfter = topmost ? HWND_TOPMOST : HWND_TOP;
+ /* We found its Owner, so we must handle it here. */
+ if (i > 0)
+ {
+ if (List[i - 1] != UserHMGetHandle(Window))
+ {
+ /*
+ * If the popup to be inserted is not already just
+ * before the Owner, insert it there. The modified
+ * hWndInsertAfter will be handled below.
+ *
+ * (NOTE: Do not allow hWndInsertAfter to become equal
+ * to the popup's window handle, as this would cause
+ * the popup to link to itself).
+ */
+ hWndInsertAfter = List[i - 1];
+ }
+ else
+ {
+ /* If the popup to be inserted is already
+ * before the Owner, we are done. */
+ ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
+ return hWndInsertAfter;
+ }
+ }
+ else
+ {
+ hWndInsertAfter = topmost ? HWND_TOPMOST : HWND_TOP;
+ }
break;
}
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=311fcc612e6acbc10fed0…
commit 311fcc612e6acbc10fed0e388468df8bddb3201a
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Sat Oct 1 14:56:01 2022 +0300
Commit: Stanislav Motylkov <x86corez(a)gmail.com>
CommitDate: Sun Oct 2 15:36:45 2022 +0300
[WLANCONF] Fix getting the interface GUID value
GetInterfaceInfo returns interface name in Windows XP and 2003
in this format: `\DEVICE\TCPIP_{GUID}`.
MSDN says that the `Name` member of the `IP_ADAPTER_INDEX_MAP`
may start with '{' character on Windows Vista and later.
https://docs.microsoft.com/en-us/windows/win32/api/ipexport/ns-ipexport-ip_…
Change the code to support both cases. CORE-18032
---
base/applications/network/wlanconf/wlanconf.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/base/applications/network/wlanconf/wlanconf.c b/base/applications/network/wlanconf/wlanconf.c
index 15a4de177f5..2cfb2887351 100644
--- a/base/applications/network/wlanconf/wlanconf.c
+++ b/base/applications/network/wlanconf/wlanconf.c
@@ -1,9 +1,8 @@
/*
* PROJECT: ReactOS WLAN command-line configuration utility
- * LICENSE: GPL - See COPYING in the top level directory
- * FILE: base/applications/network/wlanconf/wlanconf.c
+ * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Allows WLAN configuration via the command prompt
- * COPYRIGHT: Copyright 2012 Cameron Gutman (cameron.gutman(a)reactos.org)
+ * COPYRIGHT: Copyright 2012 Cameron Gutman <cameron.gutman(a)reactos.org>
*/
#include <stdio.h>
@@ -183,8 +182,13 @@ OpenAdapterHandle(DWORD Index, HANDLE *hAdapter, IP_ADAPTER_INDEX_MAP *IpInfo)
for (i = 0; i < InterfaceInfo->NumAdapters; i++)
{
+ PWCHAR InterfaceGuid = wcschr(InterfaceInfo->Adapter[i].Name, L'{');
+
+ if (InterfaceGuid == NULL)
+ continue;
+
if (wcsstr((PWCHAR)((PUCHAR)QueryBinding + QueryBinding->DeviceNameOffset),
- InterfaceInfo->Adapter[i].Name))
+ InterfaceGuid))
{
*IpInfo = InterfaceInfo->Adapter[i];
*hAdapter = hDriver;