Re: mpr: Changes comparison of dwScope in WNetOpenEnum function
Hi Konstantin, - providerTable->table[index].dwEnumScopes & dwScope) + providerTable->table[index].dwEnumScopes & WNNC_ENUM_GLOBAL) This change looks correct, but it should be changed in the next block as well: ret = providerTable->table[index].openEnum( dwScope, dwType, dwUsage, lpNet, &handle); It also looks incorrect in _enumerateGlobalPassthroughW: ret = providerTable->table[enumerator->providerIndex]. openEnum(enumerator->dwScope, enumerator->dwType, enumerator->dwUsage, enumerator->lpNet, &enumerator->handle); In fact, all of these usages of dwScope look to confuse the two meanings. (D'oh.) --Juan
Hello, Juan!
Hi Konstantin,
- providerTable->table[index].dwEnumScopes & dwScope) + providerTable->table[index].dwEnumScopes & WNNC_ENUM_GLOBAL)
This change looks correct, but it should be changed in the next block as well:
ret = providerTable->table[index].openEnum( dwScope, dwType, dwUsage, lpNet, &handle);
It also looks incorrect in _enumerateGlobalPassthroughW: ret = providerTable->table[enumerator->providerIndex]. openEnum(enumerator->dwScope, enumerator->dwType, enumerator->dwUsage, enumerator->lpNet, &enumerator->handle);
In fact, all of these usages of dwScope look to confuse the two meanings. (D'oh.) --Juan
Well, I have looked all code in mpr/wnet.c The following condition in _globalEnumeratorAdvance() looks incorrect: for (; enumerator->providerIndex < providerTable->numProviders && !(enumerator->dwScope & providerTable->table [enumerator->providerIndex].dwEnumScopes); enumerator->providerIndex++) Other conditions and parameters look correctly. For example, function NPOpenEnum() expects a dwScope, containing RESOURCE_CONNECTED, RESOURCE_GLOBALNET or RESOURCE_CONTEXT. Correct for me if I am not right. -- Best regards, Konstantin Kondratyuk.
The following condition in _globalEnumeratorAdvance() looks incorrect:
for (; enumerator->providerIndex < providerTable->numProviders && !(enumerator->dwScope & providerTable->table [enumerator->providerIndex].dwEnumScopes); enumerator->providerIndex++)
I agree, that's not correct.
Other conditions and parameters look correctly. For example, function NPOpenEnum() expects a dwScope, containing RESOURCE_CONNECTED, RESOURCE_GLOBALNET or RESOURCE_CONTEXT.
Ah, you're right. It's only where dwEnumScopes is used that it's being used incorrectly. Your patch should probably fix both of those, then (and please ignore my earlier comment.) Thanks, --Juan
Hello!
Your patch should probably fix both of those, then (and please ignore my earlier comment.)
I have resent my patch, having added in it the passed corrections. I have one more question. To add realization of new function, I can add it in struct WNetProvider? For example: typedef struct _WNetProvider { HMODULE hLib; PWSTR name; PF_NPGetCaps getCaps; DWORD dwSpecVersion; DWORD dwNetType; DWORD dwEnumScopes; PF_NPOpenEnum openEnum; PF_NPEnumResource enumResource; PF_NPCloseEnum closeEnum; PF_NPGetResourceInformation getResourceInformation; //my added function } WNetProvider, *PWNetProvider; It is correct? -- Best regards, Konstantin Kondratyuk.
Hi Konstantin,
I have one more question. To add realization of new function, I can add it in struct WNetProvider? For example:
typedef struct _WNetProvider (snip) PF_NPGetResourceInformation getResourceInformation; //my added function } WNetProvider, *PWNetProvider;
It is correct?
Yes, precisely correct. --Juan
participants (2)
-
Juan Lang -
Konstantin Kondratyuk