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

Improve metadata annotations #38

Open
MarijnS95 opened this issue Dec 21, 2023 · 1 comment
Open

Improve metadata annotations #38

MarijnS95 opened this issue Dec 21, 2023 · 1 comment

Comments

@MarijnS95
Copy link

MarijnS95 commented Dec 21, 2023

It's great to have winmd metadata available 🎉 but a few type annotations are missing.

IDStorageFactory::SetDebugFlags::flags should be DSTORAGE_DEBUG. And IDStorageQueue has non-optional output pointers, that don't seem to be properly represented in the metadata and cause windows-rs to generate a by-mutable-reference getter rather than allocating and returning the object.

All of that is solved with the following mapping.

--memberRemap
IDStorageFactory::SetDebugFlags::flags=[AssociatedEnum("DSTORAGE_DEBUG")]
IDStorageQueue::RetrieveErrorRecord::record=[RetVal]
IDStorageQueue::Query::info=[RetVal]

Tsukisoft/direct-storage-rs@6a7f8c5

@MarijnS95
Copy link
Author

Note that when generating custom metadata (link above), the #defines from dstorageerr.h disappear. Were these mapped manually as enum constants when Microsoft generated the published .winmd?

There's a request to push the headers to this repo somewhere for convenient access, can the same be done for the (supposedly minimal) .csproj and emitter.settings.rsp (and other filtes) related to the .winmd build so that users can repro a similar file and contribute improvements like the ones suggested in the OP?

MarijnS95 added a commit to MarijnS95/direct-storage-rs that referenced this issue Jan 16, 2024
The winmd shipped with the NuGet package has an [indecisive license][1],
as it's intended to fall under the MIT license just like other code
files, but is strictly a binary blob.  At the same time the metadata
[isn't representing the headers as conveniently and completely][2] as
we'd like in our Rust bindings, but unfortunately there is no upstream
source available to reference or contribute to, where we can tweak and
improve how the NuGet `winmd` is generated.

The metadata description introduced here tries to reproduce the original
metadata as closely as possible, while following the improvements
[that I requested upstream][2] and [maintaining the `int` type for
`DSTORAGE_DEBUG`][3].

[1]: microsoft/DirectStorage#8 (comment)
[2]: microsoft/DirectStorage#38
[3]: microsoft/win32metadata#1822 (comment)
MarijnS95 added a commit to MarijnS95/direct-storage-rs that referenced this issue Jan 17, 2024
The winmd shipped with the NuGet package has an [indecisive license][1],
as it's intended to fall under the MIT license just like other code
files, but is strictly a binary blob.  At the same time the metadata
[isn't representing the headers as conveniently and completely][2] as
we'd like in our Rust bindings, but unfortunately there is no upstream
source available to reference or contribute to, where we can tweak and
improve how the NuGet `winmd` is generated.

The metadata description introduced here tries to reproduce the original
metadata as closely as possible, while following the improvements
[that I requested upstream][2] and [maintaining the `int` type for
`DSTORAGE_DEBUG`][3].

[1]: microsoft/DirectStorage#8 (comment)
[2]: microsoft/DirectStorage#38
[3]: microsoft/win32metadata#1822 (comment)
MarijnS95 added a commit to MarijnS95/direct-storage-rs that referenced this issue Jan 17, 2024
The winmd shipped with the NuGet package has an [indecisive license][1],
as it's intended to fall under the MIT license just like other code
files, but is strictly a binary blob.  At the same time the metadata
[isn't representing the headers as conveniently and completely][2] as
we'd like in our Rust bindings, but unfortunately there is no upstream
source available to reference or contribute to, where we can tweak and
improve how the NuGet `winmd` is generated.

The metadata description introduced here tries to reproduce the original
metadata as closely as possible, while following the improvements
[that I requested upstream][2] and [maintaining the `int` type for
`DSTORAGE_DEBUG`][3].

[1]: microsoft/DirectStorage#8 (comment)
[2]: microsoft/DirectStorage#38
[3]: microsoft/win32metadata#1822 (comment)
MarijnS95 added a commit to MarijnS95/direct-storage-rs that referenced this issue Jan 17, 2024
The winmd shipped with the NuGet package has an [indecisive license][1],
as it's intended to fall under the MIT license just like other code
files, but is strictly a binary blob.  At the same time the metadata
[isn't representing the headers as conveniently and completely][2] as
we'd like in our Rust bindings, but unfortunately there is no upstream
source available to reference or contribute to, where we can tweak and
improve how the NuGet `winmd` is generated.

The metadata description introduced here tries to reproduce the original
metadata as closely as possible, while following the improvements
[that I requested upstream][2] and [maintaining the `int` type for
`DSTORAGE_DEBUG`][3].

[1]: microsoft/DirectStorage#8 (comment)
[2]: microsoft/DirectStorage#38
[3]: microsoft/win32metadata#1822 (comment)
MarijnS95 added a commit to MarijnS95/direct-storage-rs that referenced this issue Jan 17, 2024
The winmd shipped with the NuGet package has an [indecisive license][1],
as it's intended to fall under the MIT license just like other code
files, but is strictly a binary blob.  At the same time the metadata
[isn't representing the headers as conveniently and completely][2] as
we'd like in our Rust bindings, but unfortunately there is no upstream
source available to reference or contribute to, where we can tweak and
improve how the NuGet `winmd` is generated.

The metadata description introduced here tries to reproduce the original
metadata as closely as possible, while following the improvements
[that I requested upstream][2] and [maintaining the `int` type for
`DSTORAGE_DEBUG`][3].

[1]: microsoft/DirectStorage#8 (comment)
[2]: microsoft/DirectStorage#38
[3]: microsoft/win32metadata#1822 (comment)
MarijnS95 added a commit to MarijnS95/direct-storage-rs that referenced this issue Jan 17, 2024
The winmd shipped with the NuGet package has an [indecisive license][1],
as it's intended to fall under the MIT license just like other code
files, but is strictly a binary blob.  At the same time the metadata
[isn't representing the headers as conveniently and completely][2] as
we'd like in our Rust bindings, but unfortunately there is no upstream
source available to reference or contribute to, where we can tweak and
improve how the NuGet `winmd` is generated.

The metadata description introduced here tries to reproduce the original
metadata as closely as possible, while following the improvements
[that I requested upstream][2] and [maintaining the `int` type for
`DSTORAGE_DEBUG`][3].

[1]: microsoft/DirectStorage#8 (comment)
[2]: microsoft/DirectStorage#38
[3]: microsoft/win32metadata#1822 (comment)
MarijnS95 added a commit to MarijnS95/direct-storage-rs that referenced this issue Jan 22, 2024
The winmd shipped with the NuGet package has an [indecisive license][1],
as it's intended to fall under the MIT license just like other code
files, but is strictly a binary blob.  At the same time the metadata
[isn't representing the headers as conveniently and completely][2] as
we'd like in our Rust bindings, but unfortunately there is no upstream
source available to reference or contribute to, where we can tweak and
improve how the NuGet `winmd` is generated.

The metadata description introduced here tries to reproduce the original
metadata as closely as possible, while following the improvements
[that I requested upstream][2] and [maintaining the `int` type for
`DSTORAGE_DEBUG`][3].

[1]: microsoft/DirectStorage#8 (comment)
[2]: microsoft/DirectStorage#38
[3]: microsoft/win32metadata#1822 (comment)
hasenbanck pushed a commit to Tsukisoft/direct-storage-rs that referenced this issue Jan 26, 2024
The winmd shipped with the NuGet package has an [indecisive license][1],
as it's intended to fall under the MIT license just like other code
files, but is strictly a binary blob.  At the same time the metadata
[isn't representing the headers as conveniently and completely][2] as
we'd like in our Rust bindings, but unfortunately there is no upstream
source available to reference or contribute to, where we can tweak and
improve how the NuGet `winmd` is generated.

The metadata description introduced here tries to reproduce the original
metadata as closely as possible, while following the improvements
[that I requested upstream][2] and [maintaining the `int` type for
`DSTORAGE_DEBUG`][3].

[1]: microsoft/DirectStorage#8 (comment)
[2]: microsoft/DirectStorage#38
[3]: microsoft/win32metadata#1822 (comment)
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

1 participant