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.
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.
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
\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.
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.
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.
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)