[PATCH v3 1/6] nsiproxy.sys: Update interface table only if find_entry_from_{luid|index} fails.

Paul Gofman wine at gitlab.winehq.org
Tue May 17 09:17:38 CDT 2022


From: Paul Gofman <pgofman at codeweavers.com>

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

diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c
index ba4933ff16b..a3a10148109 100644
--- a/dlls/nsiproxy.sys/ndis.c
+++ b/dlls/nsiproxy.sys/ndis.c
@@ -495,9 +495,11 @@ static NTSTATUS ifinfo_get_all_parameters( const void *key, UINT key_size, void
 
     pthread_mutex_lock( &if_list_lock );
 
-    update_if_table();
-
-    entry = find_entry_from_luid( (const NET_LUID *)key );
+    if (!(entry = find_entry_from_luid( (const NET_LUID *)key )))
+    {
+        update_if_table();
+        entry = find_entry_from_luid( (const NET_LUID *)key );
+    }
     if (entry)
     {
         ifinfo_fill_entry( entry, NULL, rw_data, dynamic_data, static_data );
@@ -557,9 +559,11 @@ static NTSTATUS ifinfo_get_parameter( const void *key, UINT key_size, UINT param
 
     pthread_mutex_lock( &if_list_lock );
 
-    update_if_table();
-
-    entry = find_entry_from_luid( (const NET_LUID *)key );
+    if (!(entry = find_entry_from_luid( (const NET_LUID *)key )))
+    {
+        update_if_table();
+        entry = find_entry_from_luid( (const NET_LUID *)key );
+    }
     if (entry)
     {
         switch (param_type)
@@ -591,9 +595,11 @@ static NTSTATUS index_luid_get_parameter( const void *key, UINT key_size, UINT p
 
     pthread_mutex_lock( &if_list_lock );
 
-    update_if_table();
-
-    entry = find_entry_from_index( *(UINT *)key );
+    if (!(entry = find_entry_from_index( *(UINT *)key )))
+    {
+        update_if_table();
+        entry = find_entry_from_index( *(UINT *)key );
+    }
     if (entry)
     {
         *(NET_LUID *)data = entry->if_luid;
-- 
GitLab


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



More information about the wine-devel mailing list