Before getting into the point, I'll give you an overview of what I want to do. Because I don't know if using Windows Filesystem attributes is the right option to do that.
I have two components in the system. One of them is a ShellExtension that put an OverlayIcon when some condition is satisfied, and the other component is a Filesystem driver which provide information to Windows ( and therefore to the ShellExtension )
The FileSystem, using the name of the file make a network request to a remote server and depending on the result of this request, the overlay icon should appear or not.
The straightforward solution is to repeat the request from the OverlayIcon side, but this is not desirable. In the FileSystem side I have the request result, but I need to send it to the Overlay.
The first solution that came to my mind was use the Windows FileSystem attributes. I mean, in the Filesystem driver I will put a aparently-not-used attrubute ( for example 0x1000000 that appears not to be used according to MSDN ), and recover this information in the OverlayIcon, given that the explorer sends to the Shell Extension the file attribute as a parameter of "IsMemberOf". That is, use the Windows File Attributes to codify information from the FileSystem side to the ShellExtension one.
This solution doesn't work, it seems that in some part of the flow, this attribute is removed. It makes sense because this attribute appears not to be valid. If I replace the attribute value to one like HIDDEN, it works perfectly.
The obvious solution ( but it has more work to do ) is to use some IPC Mechanism.
But as I am on the both sides of the game It would be better if I could use the Windows Filesystem information.
What do you suggest?
Thank you!