https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a6c838299c7014f8674e6623856179514f9eedb3

commit a6c838299c7014f8674e6623856179514f9eedb3
Author:     Whindmar Saksit <whinds...@proton.me>
AuthorDate: Sat Nov 4 15:19:10 2023 +0100
Commit:     GitHub <nore...@github.com>
CommitDate: Sat Nov 4 15:19:10 2023 +0100

    [NETSHELL] Call ReleaseWriteLock. Fixes CORE-18349 (#5881)
---
 dll/shellext/netshell/lanconnectui.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dll/shellext/netshell/lanconnectui.cpp 
b/dll/shellext/netshell/lanconnectui.cpp
index 3d9e0f48a50..d0c5b0b2e28 100644
--- a/dll/shellext/netshell/lanconnectui.cpp
+++ b/dll/shellext/netshell/lanconnectui.cpp
@@ -17,6 +17,10 @@ CNetConnectionPropertyUi::~CNetConnectionPropertyUi()
     if (m_pNCfg)
         m_pNCfg->Uninitialize();
 
+    // Note: MSDN says we can only unlock after INetCfg::Uninitialize
+    if (m_NCfgLock)
+        m_NCfgLock->ReleaseWriteLock();
+
     if (m_pProperties)
         NcFreeNetconProperties(m_pProperties);
 }
@@ -181,7 +185,10 @@ 
CNetConnectionPropertyUi::InitializeLANPropertiesUIDlg(HWND hwndDlg)
 
     hr = pNCfg->Initialize(NULL);
     if (FAILED_UNEXPECTEDLY(hr))
+    {
+        pNCfgLock->ReleaseWriteLock();
         return;
+    }
 
     m_pNCfg = pNCfg;
     m_NCfgLock = pNCfgLock;

Reply via email to