[PATCH v5 1/3] mpr: Implement remembered connection enumeration.

Pierre Schweitzer pierre at reactos.org
Mon Nov 19 12:20:36 CST 2018


You're right, I basically copied/pasted the previous enumerator, which
is not correct either. I may submit a patch to address this later on, if
we consider this critical.
I also removed the providertable check here that makes no sense
regarding to the context.

Find attached a patch that fixes it.

Le 19/11/2018 à 19:12, Alexandre Julliard a écrit :
> Pierre Schweitzer <pierre at reactos.org> writes:
> 
>> +static DWORD _enumeratorRememberedW(PWNetEnumerator enumerator, DWORD* user_count,
>> +                                    void* user_buffer, DWORD* user_size)
>> +{
>> +    HKEY registry, connection;
>> +    WCHAR buffer[255];
>> +    DWORD index, ret, type, len, size, provider_size, remote_size, full_size, total_count, size_left = *user_size;
>> +    NETRESOURCEW * net_buffer = user_buffer;
>> +    WCHAR * str;
>> +
>> +    if (!enumerator)
>> +        return WN_BAD_POINTER;
>> +    if (enumerator->enumType != WNET_ENUMERATOR_TYPE_REMEMBERED)
>> +        return WN_BAD_VALUE;
>> +    if (!user_count || !user_buffer || !user_size)
>> +        return WN_BAD_POINTER;
>> +    if (!providerTable)
>> +        return WN_NO_NETWORK;
> 
> Please don't add unnecessary checks. enumerator can't be null, the type
> has already been checked, and at least user_size has been dereferenced
> already. You should only add checks for things that a real app is
> triggering.
> 


-- 
Pierre Schweitzer <pierre at reactos.org>
System & Network Administrator
Senior Kernel Developer
ReactOS Deutschland e.V.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mpr-Implement-remembered-connection-enumeration.patch
Type: text/x-patch
Size: 11223 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20181119/81014ae8/attachment-0001.bin>


More information about the wine-devel mailing list