[PATCH v2] mpr: Implement connected resources enumeration.
Alexandre Julliard
julliard at winehq.org
Thu Sep 15 10:34:42 CDT 2016
Pierre Schweitzer <pierre at reactos.org> writes:
> @@ -97,7 +99,11 @@ typedef struct _WNetEnumerator
> DWORD dwScope;
> DWORD dwType;
> DWORD dwUsage;
> - LPNETRESOURCEW lpNet;
> + union
> + {
> + NETRESOURCEW* net;
> + HANDLE* handles;
> + };
Please don't use anonymous unions.
> @@ -1211,6 +1240,126 @@ static DWORD _enumerateContextW(PWNetEnumerator enumerator, LPDWORD lpcCount,
> return ret;
> }
>
> +static DWORD _copyStringToEnumW(WCHAR* source, DWORD* left, void** end)
> +{
> + DWORD len;
> + void* local = *end;
> +
> + len = strlenW(source) + 1;
> + len *= sizeof(WCHAR);
> + if (*left < len)
> + return WN_MORE_DATA;
> +
> + local = (PVOID)((ULONG_PTR)local - len);
Please try to use proper pointer arithmetic instead of casting to
integer types.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list