RE: how can i change access permission in vista c/c++ code please
- From: jetan@xxxxxxxxxxxxxxxxxxxx ("Jeffrey Tan[MSFT]")
- Date: Fri, 15 Jun 2007 06:24:05 GMT
Hi Ashnah,
The basic logic of modifying DACL of a directory involves:
1. First retrieving the existing security descriptor from an object with
GetSecurityInfo or GetNamedSecurityInfo function
2. Calling various low-level ACL APIs to constructs a new DACL with proper
order.(Deny ACE in the front of Allow ACE)
3. Call the SetSecurityInfo or SetNamedSecurityInfo function to attach the
new ACL to the object's security descriptor.
The link below documented the steps:
http://msdn2.microsoft.com/en-us/library/aa446596.aspx
If you need the sample code snippet to demonstrate the usage of various ACL
APIs, I recommend you read the MSDN API help document. Also, the link below
contains sample code snippet regarding above logic:
"Modifying the ACLs of an Object in C++"
http://msdn2.microsoft.com/En-US/library/aa379283.aspx
I am not an installer expert, however, based on my discussion with an
installer expert in our team, it seems that MSI has build-in feature to
modify directory permissions. See the KB below:
"How To Set Permissions Using the LockPermissions Table"
http://support.microsoft.com/?id=288975
"LockPermissions Table"
http://msdn2.microsoft.com/En-US/library/aa369774.aspx
Hope this helps.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Prev by Date: RE: folder virtualisation
- Next by Date: Performing tasks on user login/logout
- Previous by thread: RE: folder virtualisation
- Next by thread: Performing tasks on user login/logout
- Index(es):
Relevant Pages
|