AdvApi32GetKernelObjectSecurity Method
Retrieves a copy of the security descriptor that protects a kernel object.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("AdvApi32.dll", SetLastError = true)]
public static bool GetKernelObjectSecurity(
IntPtr handle,
SecurityInformation securityInformation,
byte[] securityDescriptor,
uint length,
ref uint refLengthNeeded
)
<DllImportAttribute("AdvApi32.dll", SetLastError := true>]
Public Shared Function GetKernelObjectSecurity (
handle As IntPtr,
securityInformation As SecurityInformation,
<OutAttribute> securityDescriptor As Byte(),
length As UInteger,
ByRef refLengthNeeded As UInteger
) As Boolean
Dim handle As IntPtr
Dim securityInformation As SecurityInformation
Dim securityDescriptor As Byte()
Dim length As UInteger
Dim refLengthNeeded As UInteger
Dim returnValue As Boolean
returnValue = AdvApi32.GetKernelObjectSecurity(handle,
securityInformation, securityDescriptor,
length, refLengthNeeded)
public:
[DllImportAttribute(L"AdvApi32.dll", SetLastError = true)]
static bool GetKernelObjectSecurity(
IntPtr handle,
SecurityInformation securityInformation,
[OutAttribute] array<unsigned char>^ securityDescriptor,
unsigned int length,
unsigned int% refLengthNeeded
)
[<DllImportAttribute("AdvApi32.dll", SetLastError = true)>]
static member GetKernelObjectSecurity :
handle : IntPtr *
securityInformation : SecurityInformation *
securityDescriptor : byte[] byref *
length : uint32 *
refLengthNeeded : uint32 byref -> bool
No code example is currently available or this language may not be supported.
- handle IntPtr
-
A handle to a kernel object.
- securityInformation SecurityInformation
-
Specifies a SecurityInformation value that identifies the security information being requested.
- securityDescriptor Byte
-
A pointer to a buffer the function fills with a copy of the security descriptor of the specified object.
The calling process must have the right to view the specified aspects of the object's security status.
The SECURITY_DESCRIPTOR structure is returned in self-relative format.
- length UInt32
-
Specifies the size, in bytes, of the buffer pointed to by the securityDescriptor parameter.
- refLengthNeeded UInt32
-
A pointer to a variable that receives the number of bytes required for the buffer pointed to by the
securityDescriptor parameter.
If this variable's value is greater than the value of the nLength parameter when the function returns,
none of the security descriptor is copied to the buffer.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
To get extended error information, call
GetLastWin32Error.