Shared folders.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello. How can I determine if a folder is shared? if it is shared, how can I
retrieve the resource shared name?

I have:
Folder name ==> C:\WORKS\DOCS
Resoure shared name ==> DOCUMENTS

With 'WNetOpenEnum()' and 'WNetEnumResource()' I can get '\\MYPC\DOCUMENTS'
but there is not relation with real name folder.

Thanks in advance,
William GS
 
You can use SHGetFileInfo and look at the attributes in the SHFILEINFO
object. If SFGAO_SHARE is set then the file or folder or device is shared.

Tom
 
William,
Hello. How can I determine if a folder is shared? if it is shared, how can
I
retrieve the resource shared name?

I have:
Folder name ==> C:\WORKS\DOCS
Resoure shared name ==> DOCUMENTS

With 'WNetOpenEnum()' and 'WNetEnumResource()' I can get
'\\MYPC\DOCUMENTS'
but there is not relation with real name folder.

Having the shared name you can get the local folder path using
NetShareGetInfo(), but more useful in your case is WNetGetUniversalName(),
which can do the opposite. Here's an example of NetShareGetInfo(), btw:
http://win32.mvps.org/network/nsgi.cpp
 
Hi Tomas, it works fine in Win2000/XP, but I need it in Win98/ME too.
'NetShareGetInfo()' in linked to 'netapi32.lib' in NT/XP and 'svrapi.lib' in
98/ME, 'NetApiBufferFree()' is linked to 'netapi32.lib'.

My app compiles fine in Win98, but it searches 'NetShareGetInfo()' in
netapi32.dll and my app does not run.

Please, some advice to solve this.
Thansk in advance.
William GS
 
Back
Top