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

AccessCheck (advapi32)
 
.
Summary
The AccessCheck function determines whether a security descriptor grants a specified set of access rights to the client identified by an access token. Typically, server applications use this function to check access to a private object.

C# Signature:

  [DllImport("advapi32", SetLastError=true)]
  static extern bool AccessCheck(
    [MarshalAs(UnmanagedType.LPArray)]
    byte [] pSecurityDescriptor,
    IntPtr ClientToken,
    uint DesiredAccess,
    [In] ref GENERIC_MAPPING GenericMapping,
    IntPtr PrivilegeSet,
    ref uint PrivilegeSetLength,
    out uint GrantedAccess,
    out bool AccessStatus);

VB Signature:

  ' Declare Function AccessCheck Lib "advapi32.dll" (TODO) As TODO

  <DllImport("advapi32", SetLastError:=True)> _
  Declare Function Function AccessCheck( _
    ByVal pSecurityDescriptor As IntPtr, _
    ByVal ClientToken As IntPtr, _
    ByVal DesiredAccess As Integer, _
    ByRef GenericMapping As GENERIC_MAPPING, _
    ByRef PrivilegeSet As IntPtr, _
    ByRef PrivilegeSetLength As Integer, _
    <Out()> ByRef GrantedAccess As Integer, _
    <Out()> ByRef AccessStatus As Boolean) As Boolean
  End Function

User-Defined Types:

GENERIC_MAPPING

VB Signature:

  Private Structure GENERIC_MAPPING
    Dim GenericRead As Integer 'UInt32
    Dim GenericWrite As Integer 'UInt32
    Dim GenericExecute As Integer 'UInt32
    Dim GenericAll As Integer 'UInt32
  End Structure

PRIVILEGE_SET

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation
AccessCheck on MSDN

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).

 
Access PInvoke.net directly from VS:
Terms of Use
Find References
Show Printable Version
Revisions