Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "SECURITY_DESCRIPTOR" in [All]

user32

.

   pSIRequested, [MarshalAs(UnmanagedType.LPStruct)] SECURITY_DESCRIPTOR pSD);

.

SECURITY_DESCRIPTOR

Structures

.
Summary
The SECURITY_DESCRIPTOR structure contains the security information associated with an object. Applications use this structure to set and query an object's security status.
.

struct SECURITY_DESCRIPTOR {

.

  Public Structure SECURITY_DESCRIPTOR

.
Documentation
[SECURITY_DESCRIPTOR] on MSDN
.

        public IntPtr shi502_security_descriptor;

.

    public IntPtr shi503_security_descriptor;

Constants

.

    public static PropertyKey PKEY_Device_Security = new PropertyKey(0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 25);    // DEVPROP_TYPE_SECURITY_DESCRIPTOR

.

    public static PropertyKey PKEY_Device_SecuritySDS = new PropertyKey(0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 26);    // DEVPROP_TYPE_SECURITY_DESCRIPTOR_STRING

.

    public static PropertyKey PKEY_DeviceClass_Security = new PropertyKey(0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 25);    // DEVPROP_TYPE_SECURITY_DESCRIPTOR

.

    public static PropertyKey PKEY_DeviceClass_SecuritySDS = new PropertyKey(0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 26);    // DEVPROP_TYPE_SECURITY_DESCRIPTOR_STRING

Enums

.
Summary
The SECURITY_DESCRIPTOR_CONTROL data type is a set of bit flags that qualify the meaning of a security descriptor or its components. Each security descriptor has a Control member that stores the SECURITY_DESCRIPTOR_CONTROL bits.
.

enum SECURITY_DESCRIPTOR_CONTROL : uint

.

Enum SECURITY_DESCRIPTOR_CONTROL

.
Documentation
[SECURITY_DESCRIPTOR_CONTROL] on MSDN

mqrt

.

        public const uint MQ_ERROR_SECURITY_DESCRIPTOR_TOO_SMALL = 0xC00E0023;

.

            if (mqrt.MQ_ERROR_SECURITY_DESCRIPTOR_TOO_SMALL == result) {

.

        public const uint MQ_ERROR_SECURITY_DESCRIPTOR_TOO_SMALL = 0xC00E0023;

.

            advapi32.SECURITY_DESCRIPTOR sd = new advapi32.SECURITY_DESCRIPTOR();

advapi32

.

        public IntPtr shi502_security_descriptor;

.

            GetSecurityDescriptorDacl(shareInfo.shi502_security_descriptor, out bDaclPresent, ref pAcl, out bDaclDefaulted);

.

static extern bool InitializeSecurityDescriptor(out SECURITY_DESCRIPTOR SecurityDescriptor, uint dwRevision);

.

Private Shared Function InitializeSecurityDescriptor(ByRef SecurityDescriptor As SECURITY_DESCRIPTOR, dwRevision As UInteger) As Boolean

.

SECURITY_DESCRIPTOR

.

The dwRevision parameter must be SECURITY_DESCRIPTOR_REVISION (1).

.

SECURITY_DESCRIPTOR securityDesc = new SECURITY_DESCRIPTOR();

.

static extern bool QueryServiceObjectSecurity(IntPtr serviceHandle, System.Security.AccessControl.SecurityInfos secInfo, ref SECURITY_DESCRIPTOR lpSecDesrBuf, uint bufSize, out uint bufSizeNeeded);

.

SECURITY_DESCRIPTOR

.

New in .NET v2.0: Security.AccessControl namespace, including gems to manipulate DACLs in raw (binary) form. So rather than using a ref SECURITY_DESCRIPTOR I'd advocate using a byte[] and RawSecurityDescriptor(byte[], 0). See sample code below.

.

        out SECURITY_DESCRIPTOR pSecurityDescriptor,

.

SECURITY_DESCRIPTOR

.

        ref SECURITY_DESCRIPTOR pSecurityDescriptor);

.

SECURITY_DESCRIPTOR

.

static extern bool SetSecurityDescriptorDacl(ref SECURITY_DESCRIPTOR sd, bool daclPresent, IntPtr dacl, bool daclDefaulted);

.

Private Shared Function SetSecurityDescriptorDacl(ByRef pSecurityDescriptor As SECURITY_DESCRIPTOR, <MarshalAsAttribute(UnmanagedType.Bool)> ByVal bDaclPresent As Boolean, <InAttribute()> ByVal pDacl As System.IntPtr, <MarshalAsAttribute(UnmanagedType.Bool)> ByVal bDaclDefaulted As Boolean) As UInteger

.

SECURITY_DESCRIPTOR

.

SECURITY_DESCRIPTOR securityDesc = new SECURITY_DESCRIPTOR();

netapi32

.

            public IntPtr shi502_security_descriptor;

.

    info.shi502_security_descriptor = IntPtr.Zero;

.

            public IntPtr shi502_security_descriptor;

kernel32

.

        public static extern bool SetSecurityDescriptorDacl(ref SECURITY_DESCRIPTOR securityDescriptor, bool daclPresent, IntPtr dacl, bool daclDefaulted);

.

        public static extern bool InitializeSecurityDescriptor(out SECURITY_DESCRIPTOR securityDescriptor, uint dwRevision);

.

        public struct SECURITY_DESCRIPTOR

.

                    Native.SECURITY_DESCRIPTOR securityDesc;


 
Access PInvoke.net directly from VS: