static DWORD _enumerateConnectedW(PWNetEnumerator enumerator, DWORD* user_count,
void* user_buffer, DWORD* user_size)
{
- DWORD ret, index, count, size, i, left;
+ DWORD ret, index, count, total_count, size, i, left;
void* end;
NETRESOURCEW* curr, * buffer;
HANDLE* handles;
curr = user_buffer;
end = (char *)user_buffer + size;
count = *user_count;
+ total_count = 0;
ret = WN_NO_MORE_ENTRIES;
for (index = 0; index < providerTable->numProviders; index++)
ret = providerTable->table[index].enumResource(handles[index],
&count, buffer,
&size);
+ total_count += count;
if (ret == WN_MORE_DATA)
break;
++curr;
}
- count = *user_count - count;
size = left;
}
- if (ret != WN_SUCCESS || count == 0)
- break;
+ if (*user_count != -1)
+ count = *user_count - total_count;
+ else
+ count = *user_count;
}
}
- if (count == 0)
+ if (total_count == 0)
ret = WN_NO_MORE_ENTRIES;
- *user_count = *user_count - count;
+ *user_count = total_count;
if (ret != WN_MORE_DATA && ret != WN_NO_MORE_ENTRIES)
ret = WN_SUCCESS;
*/
DWORD WINAPI WNetConnectionDialog( HWND hwnd, DWORD dwType )
{
- FIXME( "(%p, %08X): stub\n", hwnd, dwType );
+ CONNECTDLGSTRUCTW conn_dlg;
+ NETRESOURCEW net_res;
- SetLastError(WN_NO_NETWORK);
- return WN_NO_NETWORK;
+ ZeroMemory(&conn_dlg, sizeof(conn_dlg));
+ ZeroMemory(&net_res, sizeof(net_res));
+
+ conn_dlg.cbStructure = sizeof(conn_dlg);
+ conn_dlg.lpConnRes = &net_res;
+ conn_dlg.hwndOwner = hwnd;
+ net_res.dwType = dwType;
+
+ return WNetConnectionDialog1W(&conn_dlg);
}
/*********************************************************************