microsoft / wdkmetadata

Tooling to generate metadata for Win32 APIs in the Windows Driver Kit (WDK).
Other
96 stars 10 forks source link

Invalid function imports #30

Closed kennykerr closed 1 year ago

kennykerr commented 1 year ago

The latest build appears to include invalid function imports. Functions like:

[DllImport("CLFS", ExactSpelling = true, PreserveSig = false)]
public static extern void ClfsFinalize();

And also:

[DllImport("ksecdd", ExactSpelling = true, PreserveSig = false)]
public unsafe static extern SspiAsyncContext* SspiCreateAsyncContext();

To begin with, they lack a file extension so it's unclear how to link them.

Note that some of these may not even be DLLs to begin with (they may be .sys files) but I'm not sure how you determine that when generating the metadata.

Also, I though all library names should be lowercase but that doesn't appear to be enforced consistently across the Win32 and WDK metadata.

riverar commented 1 year ago

We closed the lowercase PR in favor of raw_dylib https://github.com/microsoft/win32metadata/issues/648. API to lib mappings is handled in libmappings.rsp and will need some corrections.

mikebattista commented 1 year ago

As @riverar said, libmappings.rsp is where these are defined.

7ab660565753342dd9f0d91737957c84692bdf62 was used to prepopulate this but the script and the output will need some scrutiny. The script was modified from the equivalent win32metadata script.

mikebattista commented 1 year ago

How should .exe., .drv, and .sys be handled? Should we just exclude those or can we support them?

kennykerr commented 1 year ago

They should work - we just need them to be explicit.

mikebattista commented 1 year ago

Thanks. It should be fixed now. Can you try it out first before I publish another release?

kennykerr commented 1 year ago

Thanks, checking now.

kennykerr commented 1 year ago

Yep, looks good - thanks!

mikebattista commented 1 year ago

Thanks. I published another update.