LOCAL\GLOBAL??

Hello all.

Just a small clarification. In CreateProcessNotify routine I get pathnames prefixed with "??" symbols. Is it legitimate to assume that ?? always refers to \GLOBAL?? directory?

The goal is to dereference symbolic links in the pathname.

Thanks.

No, that wouldn’t always be the case. As an example, someone might run an
EXE from a mapped network drive. This would give you the following in your
Ps callback:

“??\z:\foo.exe”

-scott
OSR

wrote in message news:xxxxx@ntdev…

Hello all.

Just a small clarification. In CreateProcessNotify routine I get pathnames
prefixed with "??" symbols. Is it legitimate to assume that ?? always
refers to \GLOBAL?? directory?

The goal is to dereference symbolic links in the pathname.

Thanks.

> Hello all.

Just a small clarification. In CreateProcessNotify routine I get pathnames
prefixed with "??" symbols. Is it legitimate to assume that ?? always
refers to \GLOBAL?? directory?

The goal is to dereference symbolic links in the pathname.

Thanks.

Note that, for some odd reason, the names “Global” and “Local” are
case-sensitive. I belive ?? is the same as \Global, because the concept
of \Local is per-session, a concept without much meaning to drivers.
joe


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

I feel a bit more confused : ).

\DosDevices now points to ??, which does not exist. How does OS handle this situation? What is the most correct way to dereference the link?

Scott, getting “??\z:\foo.exe” is Ok. The goal is to “dereference” the whole path, so ?? (probably) should point to \GLOBAL??, and z: (probably) should point to LanmanRedirector.

When the obj manager gets a ??\ prefix, it first attempts to resolve the following item using the per-session directory (think terminal server, where a user can have a drive letter mapped to a local or remote drive that is not shared by other terminal server users). If that does not succeed, the obj manger then tries to use the \Global??\ directory.

Peter
OSR

Thanks, Peter. So I need to prepend ?? with Global in the case when call to ZwOpenSymbolicLink fails. Does this rule apply only to ?? link?

> Scott, getting “??\z:\foo.exe” is Ok. The goal is to “dereference” the whole path

I think there was ZwQuerySymbolicLink object, which can be used to get the final path with all symlinks resolved.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

>to prepend ?? with Global

I meant to replace ?? with Global??.

Maxim, I don’t think that ZwQuerySymbolicLink would resolve let’s say “c:\windows” to “\Device\HarddiskVolume1\Windows”. Didn’t try though. Let me check.

A few more questions about pathnames in Ob.

Does the rule “MAX_PATH per path component” also apply here? Or Ob supports longer names in its path components?

Do links always point to absolute pathnames? Or it’s possible to create a link which value is relative to the current directory?

Well, if ZwQUerySymbolicLink is able to dereference the whole path, then the questions above are irrelevant. Though it’s interesting to know in any case.

> Maxim, I don’t think that ZwQuerySymbolicLink would resolve let’s say “c:\windows” to

“\Device\HarddiskVolume1\Windows”. Didn’t try though. Let me check.

“C:” is a symlink. So, it should work.

Well, if ZwQUerySymbolicLink is able to dereference the whole path

I have major doubts in it. You need to subtract parts from the end of the path, till the remainder will be a valid symlink.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

And after each successful translation you need to start all over. A symlink can point to another symlink.

I have had no issues with ??.

 

Bill Wandel

 

on Dec 22, 2013, Maxim S. Shatskih wrote:

> Maxim, I don’t think that ZwQuerySymbolicLink would resolve let’s say “c:\windows” to
>“\Device\HarddiskVolume1\Windows”. Didn’t try though. Let me check.

“C:” is a symlink. So, it should work.

> Well, if ZwQUerySymbolicLink is able to dereference the whole path

I have major doubts in it. You need to subtract parts from the end of the path, till the remainder will be a valid symlink.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com



NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


 

Maxim,

You need to subtract parts from the end of the path, till the remainder will be a valid symlink.

That’s almost what I do. The difference is that I start with the beginning of the path and dereference each component unless it’s dereferenceable. (To handle the case of link pointing to a link).

Assuming that links always point to absolute pathnames your approach is better: it’s possible to start from the end, find the 1st dereferenceable path component, dereference it unless getting the device name, and then stop.

Bill,

(OSR Online does not support single-part messages with Content-Type: text/html)

OSR dislikes your message.