unganisha.org
Home :: The Workshop :: Adding shares using the Win32 API

Adding shares using the Win32 API

This is some sample code , to share folders and drives via the Win32 API . Contrary to what one might be made to believe the API set for NETAPI32.DLL remains one of the most poorly documented ones from microsoft.
Specific information like converting all strings to wide chars etc. is completely missing. For eg :

This sample adds a user name called : IUSR_SRVMGR & shares all the drives on a PC with a sequential naming convention, like : 1sysadm$, 2sysadm$ , etc...
You will need Visual C++ 6 to compile (Visual Studio 97 or 4.2 also should do).

Download code here : fileshare.zip