Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

awsome! universal support possible? #11

Open
Dogan1938 opened this issue Oct 1, 2018 · 1 comment
Open

awsome! universal support possible? #11

Dogan1938 opened this issue Oct 1, 2018 · 1 comment

Comments

@Dogan1938
Copy link

Can you make it generic so that any dll can be used?

there is a software called dependencywalker, i am assume you made use of some similar principle to get the functions of the dll's, but if it can be made universal to get all functions of any dll and make them usable via intellisense it would save you adding the dll's manually i guess.

just an idea, don't know if it is possible or too much work 😄

@sancarn
Copy link

sancarn commented Dec 30, 2019

I'm fairly certain, that with dependency walker (or even walking through a dll in general) you can only get the function names, and not the named parameters and parameter types.

Quote from dependency walker page:

For most functions, this information is simply not present in the module. The Windows' module file format only provides a single text string to identify each function. There is no structured way to list the number of parameters, the parameter types, or the return type. However, some languages do something called function "decoration" or "mangling", which is the process of encoding information into the text string. For example, a function like int Foo(int, int) encoded with simple decoration might be exported as _Foo@8. The 8 refers to the number of bytes used by the parameters. If C++ decoration is used, the function would be exported as:
?Foo@@YGHHH@Z
, which can be directly decoded back to the function's original prototype: 
int Foo(int, int)
. Dependency Walker supports C++ undecoration by using the Undecorate C++ Functions Command.

The Win32 APIs aren't decorated. If one wanted to automate the definition of FFI calls the best way would be data driven via MSDN (though mind even these are sparsely documented) or an open source documentation site like pinvoke.

It could also in theory be built off of source code from windows compatible systems or off of wine entries (which could either be extracted via HTTP request or directly if possible...).


Edit: to be honest, wine source code is probably the best place to start:

User32 Wine Spec. User32 Wine Src

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants