well I got a problem using NetServerDiskEnum and other functions.
I got 3 computers at home but I ain't running a domain controller.
now the problem is that NetServerDiskEnum requires admin privs on the remote computer, but doesnt give me the option to call it with username and password.
nStatus = NetServerDiskEnum(pszServerName,
dwLevel,
(LPBYTE *) &pBuf,
dwPrefMaxLen,
&dwEntriesRead,
&dwTotalEntries,
NULL);
I'm not going to add an admin user with the same username and password on all machines just to be able to use this type of functions.
Is there any way around this? I tried to add a connection with WNetAddConnection2 first
netres.dwType = RESOURCETYPE_DISK;
netres.lpLocalName = NULL;
netres.lpRemoteName = remote_addr;
netres.lpProvider = NULL;
WNetAddConnection2(&netres, password, username, FALSE);
this did not work though.
I didn't want to use WMI for this simple task, but it looks like it isnt that simple.
