microsoft / win32metadata

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

IPropertyStoreCapabilities has no way to return its value #1941

Closed asklar closed 4 months ago

asklar commented 5 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 4 months ago

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

AArnott commented 4 months 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 4 months 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"
        ]
    }
}