Commit 22796640 authored by Konstantin Kondratyuk's avatar Konstantin Kondratyuk Committed by Alexandre Julliard

mpr: Correct usage of dwScope and dwEnumScopes.

parent 33345141
...@@ -731,7 +731,7 @@ DWORD WINAPI WNetOpenEnumW( DWORD dwScope, DWORD dwType, DWORD dwUsage, ...@@ -731,7 +731,7 @@ DWORD WINAPI WNetOpenEnumW( DWORD dwScope, DWORD dwType, DWORD dwUsage,
if (index != BAD_PROVIDER_INDEX) if (index != BAD_PROVIDER_INDEX)
{ {
if (providerTable->table[index].openEnum && if (providerTable->table[index].openEnum &&
providerTable->table[index].dwEnumScopes & dwScope) providerTable->table[index].dwEnumScopes & WNNC_ENUM_GLOBAL)
{ {
HANDLE handle; HANDLE handle;
...@@ -964,6 +964,7 @@ static DWORD _globalEnumeratorAdvance(PWNetEnumerator enumerator) ...@@ -964,6 +964,7 @@ static DWORD _globalEnumeratorAdvance(PWNetEnumerator enumerator)
if (enumerator->providerDone) if (enumerator->providerDone)
{ {
DWORD dwEnum = 0;
enumerator->providerDone = FALSE; enumerator->providerDone = FALSE;
if (enumerator->handle) if (enumerator->handle)
{ {
...@@ -972,10 +973,15 @@ static DWORD _globalEnumeratorAdvance(PWNetEnumerator enumerator) ...@@ -972,10 +973,15 @@ static DWORD _globalEnumeratorAdvance(PWNetEnumerator enumerator)
enumerator->handle = NULL; enumerator->handle = NULL;
enumerator->providerIndex++; 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 && for (; enumerator->providerIndex < providerTable->numProviders &&
!(enumerator->dwScope & providerTable->table !(providerTable->table[enumerator->providerIndex].dwEnumScopes
[enumerator->providerIndex].dwEnumScopes); & dwEnum); enumerator->providerIndex++)
enumerator->providerIndex++)
; ;
} }
return enumerator->providerIndex < providerTable->numProviders ? return enumerator->providerIndex < providerTable->numProviders ?
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#define WNNC_ENUMERATION 0x0000000b #define WNNC_ENUMERATION 0x0000000b
#define WNNC_ENUM_GLOBAL 0x00000001 #define WNNC_ENUM_GLOBAL 0x00000001
#define WNNC_ENUM_LOCAL 0x00000002 #define WNNC_ENUM_LOCAL 0x00000002
#define WNNC_ENUM_CONTEXT 0x00000004
#define WNNC_START 0x0000000c #define WNNC_START 0x0000000c
#define WNNC_WAIT_FOR_START 0x00000001 #define WNNC_WAIT_FOR_START 0x00000001
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment