Winsysbee, Thanks for the reply.
I have one question:
Ret = NetDfsEnum(DfsName(0), 3, MAX_PREFERRED_LENGTH, pBuffer,
lngEntriesRead, resumehandle)
What does DfsName(0) represent ?
1] Is DfsName a string having name of the computer for example
\\machineName
OR
2] Is DfsName name of DFS Root for example, \\MachineName\<Dfs Root
Name> ?
On Windows 2003 Server with more than one DFS roots (Standalone
roots):
-----------------------------------------------------------------------
1] Passing machine name to NetDfsEnum as first parameter, gives the
error ERROR_DEVICE_NOT_AVAILABLE
2] If its a DFS Root name how do I get names of all DFS Roots defined
?
Thanks again,
Neel.
You can try to use the DFSCore.dll COM object.
It works fine, and should give you the answer.
Otherwise, you can use NetDfsEnum like that:
Private Type DFS_STORAGE_INFO
State As Long
servername As Long
ShareName As Long
End Type
Private Type DFS_INFO_3
EntryPath As Long
Comment As Long
State As Long
NumberOfStorages As Long
Storage As DFS_STORAGE_INFO
End Type
Ret = NetDfsEnum(DfsName(0), 3, MAX_PREFERRED_LENGTH, pBuffer,
lngEntriesRead, resumehandle)
To enum the collection:
For i = 0 To lngEntriesRead - 1
CopyMemory DFSInfo3, ByVal pBuffer + (i) * Len(DFSInfo3),
Len(DFSInfo3)
Next i
WinSysBee Support Team
http://www.winsysbee.com
nntp://news.free.fr/microsoft.public.win2000.file_system/ >
After I create multiple DFS roots on windows 2003, NetDfsEnum does not
work. Returns error 4319 ( ERROR_DEVICE_NOT_AVAILABLE ).
If I pass name of DFS root instead of only name of the machine for
example \\\ to NetDfsEnum then it enums all the
links in that root, which I believe its supposed to do.
Is there a way to enum MULTIPLE DFS roots on Windows 2003 ?
Thanks,
Neel