Pierre Schweitzer pierre@reactos.org writes:
- ret = WNetUseConnectionW(hwndOwner, pRes, passW, userIDW, dwFlags,
accessNameW, lpBufferSize, lpResult);
- if (lpAccessName && lpBufferSize && *lpBufferSize && accessNameW)
- {
len = WideCharToMultiByte(CP_ACP, 0, accessNameW, -1, NULL, 0, NULL, NULL);
if (len && len <= *lpBufferSize)
WideCharToMultiByte(CP_ACP, 0, accessNameW, -1, lpAccessName, len, NULL, NULL);
- }
You need to handle failures, and a possibly different lpBufferSize for the W function. It could also use some test cases, which would probably require the W function to do something useful first.