How does one create an administrative network share [1] with read-only permissions from C/C++ or Python under Windows XP?
[1] Necessary in order to access C:\Program Files over the share.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First create the share with NetShareAdd(). This will share the directory with a
nullACL, which is equavalent to allowing everyone full access. It is not possible to configure permissions withNetShareAddon Windows.Once the share has been created, get the security descriptor for the share by calling GetNamedSecurityInfoW() passing in the share name,
SE_LMSHAREas theObjectType, andDACL_SECURITY_INFORMATIONas theSecurityInfo. Once you have the descriptor, use the normal Windows security calls to configure the ACL.