Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Vista Property Handler for each file stored on mapped drive

941 views
Skip to first unread message

xddev

unread,
May 3, 2007, 10:29:04 AM5/3/07
to
We need to show additional column in detail view of Windows Explorer. We used
Column Handler (IColumnHandler) on Win2k and WinXP platform, but it was
removed in Vista. This column is not related to file type/class, but more it
concerns each file on the mapped drive. Mapped drive is legacy network
redirector for WebDAV. We need to show properties for file like Locked,
Checked out, Lock owner, ...

AFAIK on vista we must implement property handler. I have implemented simple
Property Handler in ATL (using VS2005). The class implements interfaces
IInitializeWithFile, IPropertyStore and IPropertyStoreCapabilities. After I
have registered property schema with PSRegisterPropertySchema() I was able to
select my column in column selection dialog box. Column doesn't contain
values although, but so far so good. For test purposes my column handler
IPropertyStore::GetValue returns hard coded string. To verify that property
handler works I have registered my CLSID to some file extension under key:

HKEY_LM\SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.xdspec (Default) = {MY_CLSID}

I can see that property handler works fine, hard coded string is shown for
files with extension .xdspec, but my goal is show it for all files. I am
trying to register it with '*' and AllFileSystemObjects with no success. In
process monitor (sysinternal tool) I have verified that system (propsys.dll)
uses RegOpenKeyEx() for accessing of HKEY above with appended file extension,
so system doesn't evaluate "file classes" of the file, that’s reason why
AllFileSystemObjects doesn’t work.

My properties are similar to file system properties like
System.FileAttributes. They are not related to file type/extension, but they
are properties of each file (with different extensions) stored on mapped
drive. Note that I don't want to implement special shell namespace, because
it would counterwork the whole file system redirector concept.

Can I somehow register property handler, so it is called for each file?
Do you have any other hint?

Thanks in advance.
--xddev

Walter Wang [MSFT]

unread,
May 4, 2007, 2:56:31 AM5/4/07
to
Hi,

This is a quick note to let you know that I am performing research on this
issue and will get back to you as soon as possible. I appreciate your
patience.


Sincerely,
Walter Wang (waw...@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Walter Wang [MSFT]

unread,
May 7, 2007, 1:32:36 AM5/7/07
to
Hi,

Sorry for the delay. I've been consulting your question with product team.
Here's the information so far:

<quote>
Properties are not specific to any item type. They are registered globally
to the system.

It is not possible to register a property handler for all files. There is a
one to one relationship between file extension and handler CLSID.
<quote>

Regards,


Walter Wang (waw...@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

xddev

unread,
May 8, 2007, 7:30:02 PM5/8/07
to
Hi Walter,

Thank you for your effort.

We can hardly explain our customers that something what was possible on XP
is not possible on vista. They will think that we are unable to do it. Do you
think that opening of MSDN incident ticket can help us? Maybe support
engineer can suggest some workaround.

My thoughts are very ugly like hooking of property system API, concretely
the PSLookupPropertyHandlerCLSID() function. When it fails it means that file
type has no property handler, so we return our one. In case of success we can
probably wrap existing property handler by one created by
PSCreateDelayedMultiplexPropertyStore() API, which would combine our property
store and wrapped property store. The question is how hard would be hooking
of API on vista. I guess that code pages of loaded module are kept in
consistency with file by some vista security feature. I am sure that
restricted token by UAC cannot modify code pages, so it would need some
cooperation of service running in session 0, so solution becomes to be very
difficult.

Maybe we can somehow use temporary property store (see GETPROPERTYSTOREFLAGS
Constants). We can register for SHChangeNotify() changes in our DLL which is
loaded into explorer process context and write properties into temporary
property store on the SHCNE_UPDATEDIR event. In all cases it needs some
research how temporary property store works. I have no idea right now.

Other hacking solution is register property schema, so user can add column
by standard way, and fill it in message hook procedure registered by
SetWindowsHookEx(). All ways are quite expensive for research with risky
result because of UAC.


Thanks in advance for some suggests.
--xddev

Walter Wang [MSFT]

unread,
May 9, 2007, 7:10:30 AM5/9/07
to
Hi,

I'm not sure if hooking property system API is supported or not. One
supported way to achieve your objective is to implement a shell folder:

<quote>
If they're implementing a shell folder, they may be able to override
IShellItem2::GetPropertyStore (or perhaps IShellFolder::BindToObject,
depending on how the binding is plumbed) and add their own custom property
store to the property store returned by creating a MUX
(PSCreateMultiplexPropertyStore); this is how the Shell FS folder
implementation exposes file system properties like System.Size and
System.DateModified, aggregated with the per-item properties exposed by the
item's filetype-specific property handler.
</quote>

However, this might not work for your scenario since your objective is to
let explorer show additional properties.

Please feel free to open a MSDN support incident for it.

h.wulff

unread,
May 28, 2007, 6:39:13 AM5/28/07
to
Hi!

I'm facing exactly the same problem: Showing additional file attributes of
a remote file system on vista. Have you found a workaround?

Thanks!
--
h.wulff

xddev

unread,
May 28, 2007, 7:49:00 AM5/28/07
to
We have opened MSDN incident for this problem, but unfortunately suggested
workarounds are not appropriate for us. Here is conclusion of support
engineer:

>• Problem - IColumnHandler no longer works on Vista
>• Environment - Vista
>• Root Cause (if known) – This has been replaced by the Property System
>• Resolution – Implement a namespace extension or use IconOverlays.
>I know that neither of these are easy or equivalent solutions.
>If you have any suggestions about how you would the Property System to
>change in the future, feel free to let me know and I forward your feedback
>to the appropriate group. I know that you are not the only ones who have >encountered this issue.

Other quotation from my private communication with support engineer:

>The only supported alternatives I can propose are implementing you own >namespace extension or IconOverlays.
>
>Your scenario is not the only scenario that extending a files
>properties would be useful.
>I will file a DCR for the next version of Windows, for the
>extended functionality of the property system.

>Beyond that there is little else I can help with.
>I’m sorry you had to open a case to find out what you already knew.

So it seems that there is not legal way how to add column for all files on
mapped drive. It makes you consider hacking like hooking of COM vtable or
Property System API, hooking of windows messages (LVM_XXX), ...

Good luck!
-xddev

0 new messages