Sample Download : http://code.msdn.microsoft.com/CppCheckSD-6bac6d3a
The sample demonstrates how to obtain and display the security descriptor for various Kernel Objects in Windows. The sample by default only obtains the Access Allowed Aces (DACLs) and NOT the System Audit Acess (SACLs) although Integrity Aces are SACLs so these will be displayed as well. By default the Security Descriptor is displayed in Security Descriptor Definition Language (SDDL) format. There is a switch to get more detailed information on the security descriptor.
You can obtain the security descriptor for the following kernel objects:
* service control manager
* memory mapped file
* job object
* named pipe
* process access token
* registry key
* network share
* window station
You can find more code samples that demonstrate the most typical programming scenarios by using Microsoft All-In-One Code Framework Sample Browser or Sample Browser Visual Studio extension. They give you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about sample updates. If it is the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on Microsoft Showcase, or read the introduction on our homepage http://1code.codeplex.com/.