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

The API "Gdi32" is ambiguous #1201

Closed
luo-ross opened this issue Jun 5, 2024 · 4 comments · Fixed by #1202
Closed

The API "Gdi32" is ambiguous #1201

luo-ross opened this issue Jun 5, 2024 · 4 comments · Fixed by #1202
Assignees
Labels
bug Something isn't working

Comments

@luo-ross
Copy link

luo-ross commented Jun 5, 2024

all

NativeMethods.txt
User32.*
Gdi32.*
DwmAPI.*
Kernel32.*
WM_*
SC_*
S_*
CW_*
MSGFLTINFO_*

my config above but second line Gdi32.* trigger exception :The API "Gdi32" is ambiguous
how could i fix it,anyone can help?

@luo-ross luo-ross added the bug Something isn't working label Jun 5, 2024
@AArnott
Copy link
Member

AArnott commented Jun 6, 2024

This is because gdi32.dll contains methods that are expressed both in the "SDK" and the "WDK". I think we'll just fix this by generating from both.

@AArnott
Copy link
Member

AArnott commented Jun 6, 2024

In the meantime, the workaround would be to ask for the specific functions you need. That's the recommended approach anyway since it will result in far less code generated, and less bloat in your dll.

@luo-ross
Copy link
Author

luo-ross commented Jun 6, 2024

Thank you very much for your reply.
way 1: lower the version to 0.02.188-beta,
way 2: As per your prompt, config the specified method name, which also solved the problem

for someone like me who is lazy, sometimes I want to produce all the methods at once so that I can easily retrieve a method, even if I only remember the approximate name. Otherwise, I have to search for the Win32 API ,try to copy and paste the complete method name, which feels very inconvenient.

Another area of confusion is why this issue occurs in higher versions and not in lower versions?

@AArnott
Copy link
Member

AArnott commented Jun 6, 2024

Lower versions used older metadata and (if you go back far enough) didn't include the WDK metadata at all. So the ambiguity is introduced when you have more metadata that describes more functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants