Paul Gofman : nsiproxy.sys: Update interface table only if find_entry_from_{luid|index} fails.

Alexandre Julliard julliard at winehq.org
Tue May 17 15:37:23 CDT 2022


Module: wine
Branch: master
Commit: 42bf76686633acee8453dbfe65e842e4c6d465ec
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=42bf76686633acee8453dbfe65e842e4c6d465ec

Author: Paul Gofman <pgofman at codeweavers.com>
Date:   Mon May 16 15:32:04 2022 -0500

nsiproxy.sys: Update interface table only if find_entry_from_{luid|index} fails.

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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;




More information about the wine-cvs mailing list