What is the correct way to implement a Managed Property Handler Shell Extension?

☆樱花仙子☆ 提交于 2019-12-05 09:07:38

Yes, you have to AddRef() the stream to keep it open and to keep the reference alive correctly.

Note that the indexer will use your property handler to open the file as well. So if you leak the stream object, the file will remain open. You can use the sysinternals procexp to tell what process has the file open, or procmon to tell what calls and parameters it used.

Explorer tries to ensure that it doesn't interfere with other applications that may have the file open. Could the file be legitimately in use by another application? Is there a preview handler open?

Sometimes, we see property handlers that keep their streams open longer than necessary (or file-based handlers that open the file with restrictive permissions). Can you verify if you are releasing the stream in a timely manner?

Finally, I don't think this is related to your immediate problem, but using .NET shell extensions is unsupported. We recommend that this not be incorporated into any product.

-Ben

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!