Dependencies icon indicating copy to clipboard operation
Dependencies copied to clipboard

Rewrite DependenciesLib in C

Open TheNicker opened this issue 5 years ago • 4 comments

The tool is stand alone and forces one to use the CLR. Having the DependenciesLib in C language would make it possible to integrate the core features of the tool to virtually every implementation in every programming language under Windows.

Imagine a use case where you have a program installed and for some reason a dll went missing, it would be possible to integrate the library into the implementation and provide a detailed analysis of the issue or even further, auto correcting the issue.

TheNicker avatar Apr 26 '19 22:04 TheNicker

Funny, I entertained the tought to rewrite everyting in C# in order to get rid of native code ! But I admit your proposition has some merit.

Anyway, I'll keep in the back of my mind, but it will be low priority

lucasg avatar May 05 '19 08:05 lucasg

A bit being the devils' advocate here.

I get the idea of having a pure managed implementation. Do you believe it's possible rewriting everything in .net elegantly? as usually, low level calls are flattered by a low level language. If so, it might be worth to do so and perhaps open a parallel project just for the C implementation instead of having here two projects, DependenciesLib (C) and DependenciesLibWrapper (.net).

It's worth taking into consideration that Microsoft probably won't make major changes in the API if at all in the foreseen versions of Windows, and that this software is Windows specific, so the language being used for invoking WINAPI calls is a matter of convenience.

TheNicker avatar May 05 '19 17:05 TheNicker

Actually, the SxS manifest is parsed pretty elegantly via the C# XmlDocument/XPath API, which way easier to use than it's C counterpart XmlReader.

Other than that, I agree most of the features are adherent to the native Windows API and can be accessed naturally in C.

lucasg avatar May 05 '19 19:05 lucasg

For what it's worth, I seem to remember the original depends.exe was written in C++.

ranolfi avatar Sep 22 '19 05:09 ranolfi