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 ntdll, prefix the name with the module name and a period.
NtOpenDirectoryObject (ntdll)
.
C# Signature:
[DllImport("ntdll.dll")]
public static extern int NtOpenDirectoryObject(
out SafeFileHandle DirectoryHandle,
uint DesiredAccess,
ref OBJECT_ATTRIBUTES ObjectAttributes);
static void ObjectManagerTest()
{
SafeFileHandle h;
var attr = new OBJECT_ATTRIBUTES("\\", 0);
var st = Win32.NtOpenDirectoryObject(
out h, 1, ref attr);
if (st < 0) return;
var bufsz = 1024;
var buf = Marshal.AllocHGlobal(bufsz);
uint context = 0, len;
for (; ; )
{
st = Win32.NtQueryDirectoryObject(h, buf, bufsz,
true, context == 0, ref context, out len);
if (st < 0) break;
var odi = (OBJECT_DIRECTORY_INFORMATION)
Marshal.PtrToStructure(buf, typeof(OBJECT_DIRECTORY_INFORMATION));
System.Diagnostics.Debug.Print(
"0x{0:X2}:{1,-25}{2}", context, odi.TypeName, odi.Name);
}
Marshal.FreeHGlobal(buf);
h.Dispose();
}
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.
10/7/2014 6:47:44 AM - -113.200.84.43
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).