Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than advapi32, prefix the name with the module name and a period.
GetNamedSecurityInfo (advapi32)
.
C# Signature:
[DllImport("advapi32.dll", SetLastError=true)]
static extern TODO GetNamedSecurityInfo(TODO);
VB Signature:
Declare Function GetNamedSecurityInfo Lib "advapi32.dll" ( _
ByVal pObjectName As String, _
ByVal ObjectType As Integer, _
ByVal SecurityInfo As Integer, _
ByRef ppsidOwner As IntPtr, _
ByRef ppsidGroup As IntPtr, _
ByRef ppDacl As IntPtr, _
ByRef ppSacl As IntPtr, _
ByRef ppSecurityDescriptor As IntPtr) As Integer
' Type of Securable Object we are operating in this sample code
Private Const SE_FILE_OBJECT = 1&
' The Security Information constants required
Private Const DACL_SECURITY_INFORMATION = 4&
Dim pSecDesc, pOldDACL As IntPtr
Dim Win32Error As Win32Exception
Dim ret As Integer
' get the Security Descriptor and DACL
ret = GetNamedSecurityInfo(strPath, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, Nothing, Nothing, pOldDACL, Nothing, pSecDesc)
If ret <> 0 Then
Win32Error = New Win32Exception(ret)
Throw New Exception(Win32Error.Message)
End If
Alternative Managed API:
Do you know one? Please contribute it!
The GetNamedSecurityInfo function retrieves a copy of the security descriptor for an object specified by name.
4/22/2014 1:00:11 PM - 192.168.101.2
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).