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

OBJECT_ATTRIBUTES (Structures)
 
.
Summary
The OBJECT_ATTRIBUTES structure specifies attributes that can be applied to objects or object handles by routines that create objects and/or return handles to objects.

C# Definition:

[StructLayout(LayoutKind.Sequential)]
public struct OBJECT_ATTRIBUTES : IDisposable
{
   public int Length;
   public IntPtr RootDirectory;
   private IntPtr objectName;
   public uint Attributes;
   public IntPtr SecurityDescriptor;
   public IntPtr SecurityQualityOfService;

   public OBJECT_ATTRIBUTES(string name, uint attrs)
   {
     Length = 0;
     RootDirectory = IntPtr.Zero;
     objectName = IntPtr.Zero;
     Attributes = attrs;
     SecurityDescriptor = IntPtr.Zero;
     SecurityQualityOfService = IntPtr.Zero;

     Length = Marshal.SizeOf(this);
     ObjectName = new UNICODE_STRING(name);
   }

   public UNICODE_STRING ObjectName
   {
     get
     {
       return (UNICODE_STRING)Marshal.PtrToStructure(
     objectName, typeof(UNICODE_STRING));
     }

     set
     {
       bool fDeleteOld = objectName != IntPtr.Zero;
       if (!fDeleteOld)
     objectName = Marshal.AllocHGlobal(Marshal.SizeOf(value));
       Marshal.StructureToPtr(value, objectName, fDeleteOld);
     }
   }

   public void Dispose()
   {
     if (objectName != IntPtr.Zero)
     {
       Marshal.DestroyStructure(objectName, typeof(UNICODE_STRING));
       Marshal.FreeHGlobal(objectName);
       objectName = IntPtr.Zero;
     }
   }
}

User-Defined Field Types:

None.

Notes:

None.

Documentation

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

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