microsoft / wdkmetadata

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

how to use it #45

Closed kouzhudong closed 1 year ago

kouzhudong commented 1 year ago

I did not find it can give an example

mikebattista commented 1 year ago

Language projections like https://github.com/microsoft/CsWin32 and https://github.com/microsoft/windows-rs produce bindings based on this metadata.

kouzhudong commented 1 year ago

add [dependencies.wdkmetadata] in Cargo.toml cargo build:error: no matching package named wdkmetadata found

kouzhudong commented 1 year ago

C:\Users\Administrator>dotnet add package Microsoft.Windows.WDK.Win32Metadata --version 0.7.3-experimental “C:\Users\Administrator\”中找不到任何项目。

C:\Users\Administrator>

kouzhudong commented 1 year ago

There is no rust code here, a tool should be used to convert the header file to rust code.

mikebattista commented 1 year ago

You shouldn't be using the metadata directly. Use https://github.com/microsoft/windows-rs.

kouzhudong commented 1 year ago

like this? [dependencies.windows-sys] version = "0.48"

kouzhudong commented 1 year ago

PS D:\git\github\WinDrv> cargo build Compiling windows_x86_64_msvc v0.48.0 error: linking with link.exe failed: exit code: 1120

riverar commented 1 year ago

Hi @kouzhudong, this repository hosts Windows Driver Kit (WDK) metadata. This is a work in progress and currently being incorporated into the windows-rs crate linked above. For additional information, see https://learn.microsoft.com/windows/dev-environment/rust/rust-for-windows. Thanks!