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,
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 ?
......
......@@ -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
......
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