Konstantin Kondratyuk : mpr: Correct usage of dwScope and dwEnumScopes.

Alexandre Julliard julliard at winehq.org
Thu Sep 27 09:27:31 CDT 2007


Module: wine
Branch: master
Commit: 227966402b599a6ba41ee159ac6a8499eb067dc1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=227966402b599a6ba41ee159ac6a8499eb067dc1

Author: Konstantin Kondratyuk <kondratyuk at etersoft.ru>
Date:   Wed Sep 26 13:15:36 2007 +0400

mpr: Correct usage of dwScope and dwEnumScopes.

---

 dlls/mpr/wnet.c |   14 ++++++++++----
 include/npapi.h |    1 +
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/dlls/mpr/wnet.c b/dlls/mpr/wnet.c
index 9a6a9ef..6d08692 100644
--- a/dlls/mpr/wnet.c
+++ b/dlls/mpr/wnet.c
@@ -731,7 +731,7 @@ DWORD WINAPI WNetOpenEnumW( DWORD dwScope, DWORD dwType, DWORD dwUsage,
                         if (index != BAD_PROVIDER_INDEX)
                         {
                             if (providerTable->table[index].openEnum &&
-                             providerTable->table[index].dwEnumScopes & dwScope)
+                             providerTable->table[index].dwEnumScopes & WNNC_ENUM_GLOBAL)
                             {
                                 HANDLE handle;
 
@@ -964,6 +964,7 @@ static DWORD _globalEnumeratorAdvance(PWNetEnumerator enumerator)
 
     if (enumerator->providerDone)
     {
+        DWORD dwEnum = 0;
         enumerator->providerDone = FALSE;
         if (enumerator->handle)
         {
@@ -972,10 +973,15 @@ static DWORD _globalEnumeratorAdvance(PWNetEnumerator enumerator)
             enumerator->handle = NULL;
             enumerator->providerIndex++;
         }
+        if (enumerator->dwScope == RESOURCE_CONNECTED)
+            dwEnum = WNNC_ENUM_LOCAL;
+        else if (enumerator->dwScope == RESOURCE_GLOBALNET)
+            dwEnum = WNNC_ENUM_GLOBAL;
+        else if (enumerator->dwScope == RESOURCE_CONTEXT)
+            dwEnum = WNNC_ENUM_CONTEXT;
         for (; enumerator->providerIndex < providerTable->numProviders &&
-         !(enumerator->dwScope & providerTable->table
-         [enumerator->providerIndex].dwEnumScopes);
-         enumerator->providerIndex++)
+         !(providerTable->table[enumerator->providerIndex].dwEnumScopes
+         & dwEnum); enumerator->providerIndex++)
             ;
     }
     return enumerator->providerIndex < providerTable->numProviders ?
diff --git a/include/npapi.h b/include/npapi.h
index 39244da..cbe23f5 100644
--- a/include/npapi.h
+++ b/include/npapi.h
@@ -48,6 +48,7 @@
 #define WNNC_ENUMERATION           0x0000000b
 #define WNNC_ENUM_GLOBAL           0x00000001
 #define WNNC_ENUM_LOCAL            0x00000002
+#define WNNC_ENUM_CONTEXT          0x00000004
 
 #define WNNC_START                 0x0000000c
 #define WNNC_WAIT_FOR_START        0x00000001




More information about the wine-cvs mailing list