Over to C# Interop and Some Native Code

It has been a little while since I’ve gone diving into Win32. I’m looking in there a bit now though. I’ve been using mklink on the command line to create NTFS symbolic links for various purposes. Once those show up (and volume mounts), file management tools suddenly need real confidence that they’re looking at real duplicate files and not multiple links into the same file.

This quickly leads into areas of the Win32 API that haven’t been directly exposed in C#. The

GetFileInformationByHandleEx() with FILE_ID_INFO

API exposes the required information. There are other bits of information in the GetFileInfo* APIs that may also be important. I’m looking at Interop again as a way to gateway this sort of information across.

I’m not all that happy with PInvoke as it narrows everything down to a C style interface. The COM interop mechanisms are clunky and tied to coclass rather than interfaces in ways that seem to subvert the basic design tenets of COM. C++/CLI is close to the sort of connection I’d like, but is complex and I question whether it will remain stable in the long term as it is a bit of a fringe technology.

At this point I’m refreshing my memory and considering. I’d very much like to build a capable and safe tool for managing (and cleaning up) duplicate data. File uniqueness is going to be one of the key features here…

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.