[PATCH] netprofm: set *ret=NULL if no more connections

Alex Xu (Hello71) alex_y_xu at yahoo.ca
Sat Jan 23 16:51:55 CST 2021


Qt 5.14+ tries to check network connection suitability when any network
connection is made. Unfortunately, this is done incorrectly. The return
value of IEnumNetworkConnections::Next is only checked for failure, not
for S_FALSE. Instead, !*ret is used to quit the loop.

Apparently, Windows puts NULL in the output in this case. It is possible
that all of the non-populated slots are actually set to NULL, but Qt
only uses count=1. To work around the issue, make Wine set NULL too.

Signed-off-by: Alex Xu (Hello71) <alex_y_xu at yahoo.ca>
---
 dlls/netprofm/list.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/netprofm/list.c b/dlls/netprofm/list.c
index f9b9e2e..833236a 100644
--- a/dlls/netprofm/list.c
+++ b/dlls/netprofm/list.c
@@ -1013,6 +1013,7 @@ static HRESULT WINAPI connections_enum_Next(
         i++;
     }
     if (fetched) *fetched = i;
+    if (!i) ret[0] = NULL;
 
     return i < count ? S_FALSE : S_OK;
 }
-- 
2.30.0




More information about the wine-devel mailing list