microsoft / win32metadata

Tooling to generate metadata for Win32 APIs in the Windows SDK.
Other
1.32k stars 113 forks source link

IPropertyStoreCapabilities has no way to return its value #1941

Closed asklar closed 1 month ago

asklar commented 2 months ago

Actual behavior

IPropertyStoreCapabilities::IsPropertyWritable returns S_OK or S_FALSE However it is projected as returning void

Expected behavior

ideally return true/false

AArnott commented 1 month ago

Per the docs for this API, this API qualifies for the CanReturnMultipleSuccessValuesAttribute. That needs to be applied in the metadata.

AArnott commented 1 month ago

In the meantime, @asklar, you can use the NativeMethods.json file to add this method to the preserveSig methods so that you get the HRESULT back.

riverar commented 1 month ago

Fixed for next release. As Andrew mentioned, an easy short term workaround is to disable CsWin32 signature transformation for this method, as such:

{
    "$schema": "https://aka.ms/CsWin32.schema.json",
    "comInterop": {
        "preserveSigMethods": [
            "IPropertyStoreCapabilities.IsPropertyWritable"
        ]
    }
}