Possibly simplify dlls/netapi32/nbt.c

Gerald Pfeifer gerald at pfeifer.com
Sat Sep 19 14:21:39 CDT 2009


I will admit I am not sure this is the best approach here.

MAX_QUERY_TIMEOUT is #defined as 0xffffffff so dword <= MAX_QUERY_TIMEOUT
always holds.  I guess if MAX_QUERY_TIMEOUT is really set correctly, the
patch below makes sense...

Gerald

ChangeLog:
Remove two conditions which always hold true.

diff --git a/dlls/netapi32/nbt.c b/dlls/netapi32/nbt.c
index 0bddd94..8c76b6e 100644
--- a/dlls/netapi32/nbt.c
+++ b/dlls/netapi32/nbt.c
@@ -1478,8 +1478,7 @@ void NetBTInit(void)
             gBCastQueries = dword;
         size = sizeof(dword);
         if (RegQueryValueExW(hKey, BcastNameQueryTimeoutW, NULL, NULL,
-         (LPBYTE)&dword, &size) == ERROR_SUCCESS && dword >= MIN_QUERY_TIMEOUT
-         && dword <= MAX_QUERY_TIMEOUT)
+         (LPBYTE)&dword, &size) == ERROR_SUCCESS && dword >= MIN_QUERY_TIMEOUT)
             gBCastQueryTimeout = dword;
         size = sizeof(dword);
         if (RegQueryValueExW(hKey, NameSrvQueryCountW, NULL, NULL,
@@ -1488,8 +1487,7 @@ void NetBTInit(void)
             gWINSQueries = dword;
         size = sizeof(dword);
         if (RegQueryValueExW(hKey, NameSrvQueryTimeoutW, NULL, NULL,
-         (LPBYTE)&dword, &size) == ERROR_SUCCESS && dword >= MIN_QUERY_TIMEOUT
-         && dword <= MAX_QUERY_TIMEOUT)
+         (LPBYTE)&dword, &size) == ERROR_SUCCESS && dword >= MIN_QUERY_TIMEOUT)
             gWINSQueryTimeout = dword;
         size = sizeof(gScopeID) - 1;
         if (RegQueryValueExW(hKey, ScopeIDW, NULL, NULL, (LPBYTE)gScopeID + 1, &size)



More information about the wine-patches mailing list