Improve metadata annotations
Opened this issue ยท 1 comments
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]
Note that when generating custom metadata (link above), the #define
s 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?