How to list contents of Win32 namespaces?
Asked Answered
B

1

8

Is there a way to list the contents of the Win32 Device Namespaces (UNC path prefix: \\.\) and the Win32 File Namespaces (UNC path prefix: \\?\)?

The goal would be to have an application suitable as a command line(1) tool that can navigate them with UNC (universal naming convention). Are there tools already written for this? I'm aware of WinObj but that is not open source and a GUI tool.

Similarly, how to list what namespaces are available under the NT namespace?

Are there windows API calls that deal with these? Update 2 WinApi is not suitable for this, NT Native API is, as pointed out in the comments by Hans Passant and Roger Lipscombe.

Update 1 If they are not exposed by the winapi, how does WinObj list them?

Reference: http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx#paths


(1): Win32 Console

Beanfeast answered 14/11, 2012 at 13:10 Comment(3)
It is a native operating system implementation detail and not exposed through the winapi. You can explore it with SysInternals' WinObj, at least useful to see there's little of interest there.Kaufman
WinObj probably uses undocumented NT API calls. The NT API is not the Win32 API.Molybdenous
@Beanfeast ObjectManagerBrowser, WinObjEx64 (also uses a KMD) and ntobjx are three open source solutions that show nicely how to do it.Dwight
R
0

As mentioned in comments, you can look at WinObjEx64 code for example. Just look at ListObjectDirectoryTree code there.

NtOpenDirectoryObject, NtQueryDirectoryObject, NtOpenSymbolicLinkObject and NtQuerySymbolicLinkObject are the main API's that will help to enum NT objects.

Also, this old article describes how to use Object Manager Interface APIs: https://www.drdobbs.com/using-nts-undocumented-object-manager-in/184416468

Ruttger answered 11/8, 2023 at 21:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.