mpr: Correct usage of dwScope and dwEnumScopes.

oldstable
Konstantin Kondratyuk 2007-09-26 13:15:36 +04:00 committed by Alexandre Julliard
parent 333451411b
commit 227966402b
2 changed files with 11 additions and 4 deletions

View File

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

View File

@ -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