How do I programmatically create a read-only network share?
First, create a share using NetShareAdd () . This will share the directory with the null
ACL, which is the same as allowing all users full access. Unable to configure permissions using NetShareAdd
in Windows.
Once the resource has been created, get the security descriptor for the share by calling GetNamedSecurityInfoW () , passing in the name of the share, SE_LMSHARE
how ObjectType
and DACL_SECURITY_INFORMATION
how SecurityInfo
. Once you have the handle, use normal Windows security calls to configure the ACL.
source to share