[PATCH 3/6] nsiproxy.sys: Update interface table only if LUID is not found in convert_luid_to_unix_name().

Paul Gofman wine at gitlab.winehq.org
Mon May 16 19:03:16 CDT 2022


From: Paul Gofman <pgofman at codeweavers.com>

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
 dlls/nsiproxy.sys/ndis.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c
index 929bda9cd90..4d21588fbe2 100644
--- a/dlls/nsiproxy.sys/ndis.c
+++ b/dlls/nsiproxy.sys/ndis.c
@@ -637,8 +637,6 @@ BOOL convert_luid_to_unix_name( const NET_LUID *luid, const char **unix_name )
 
     pthread_mutex_lock( &if_list_lock );
 
-    update_if_table();
-
     LIST_FOR_EACH_ENTRY( entry, &if_list, struct if_entry, entry )
         if (entry->if_luid.Value == luid->Value)
         {
@@ -646,6 +644,21 @@ BOOL convert_luid_to_unix_name( const NET_LUID *luid, const char **unix_name )
             ret = TRUE;
             break;
         }
+
+    if (!ret)
+    {
+        update_if_table();
+        while (&entry->entry != &if_list)
+        {
+            if (entry->if_luid.Value == luid->Value)
+            {
+                *unix_name = entry->if_unix_name;
+                ret = TRUE;
+                break;
+            }
+            entry = LIST_ENTRY(entry->entry.next, struct if_entry, entry);
+        }
+    }
     pthread_mutex_unlock( &if_list_lock );
 
     return ret;
-- 
GitLab


https://gitlab.winehq.org/wine/wine/-/merge_requests/78



More information about the wine-devel mailing list