Using C++ (VS2008) I need to be able to enumerate all shared folders on the current machine and get or construct the local and remote names.
We've been using NetShareEnum
for this fairly successfully, but have hit a problem where we need to run with a user account with low privileges.
To get the local path using NetShareEnum
we need to retrieve at least SHARE_INFO_2
structures - but that requires "Administrator, Power User, Print Operator, or Server Operator group membership".
I've been trying to use WNetOpenEnum
and WNetEnumResource
instead but I don't seem to be getting the local name back for that for shares either. AFAICS it only enumerates the shares from an external perspective.
So I'd either like help on where I'm going wrong with WNetEnumResource
, or a suggestion as to another way of doing this. Any suggestions are much appreciated.