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.
NtOpenSymbolicLinkObject (ntdll)
.
C# Signature:
[DllImport("ntdll.dll")]
public static extern int NtOpenSymbolicLinkObject(
out SafeFileHandle LinkHandle,
uint DesiredAccess,
ref OBJECT_ATTRIBUTES ObjectAttributes);
static string GetSymbolicLinkTarget(string name)
{
SafeFileHandle h;
var attr = new OBJECT_ATTRIBUTES(name, 0);
var st = Win32.NtOpenSymbolicLinkObject(
out h, 0x80000000/*GENERIC_READ*/, ref attr);
if (st < 0) return null;
int len;
var buf = new UNICODE_STRING(new string(' ', 512));
st = Win32.NtQuerySymbolicLinkObject(h, ref buf, out len);
h.Dispose();
if (st < 0) return null;
return buf.ToString();
}
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
Creates a new file or directory, or opens an existing file, device, directory, or volume.
5/25/2008 1:48:36 PM - -219.111.155.239
Retrieves the target of a symbolic link.
5/25/2008 3:30:12 PM - anonymous
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).