Skip to content

Wrong translation of SAL Annotations #18

@pyscripter

Description

@pyscripter

Windows header files have SAL annotations that make the indent of the code explicit. An example of such annotation is Out_writes_bytes. See the Annotating function parameters and return values topic. The SAL annotations should be ignored.

Example: In d2d1svg.h you have:

    STDMETHOD(GetAttributeValue)(
        _In_ PCWSTR name,
        D2D1_SVG_ATTRIBUTE_POD_TYPE type,
        _Out_writes_bytes_(valueSizeInBytes) void *value,
        UINT32 valueSizeInBytes 
        ) PURE;

This is translated as:

  function GetAttributeValue(Name: PWideChar; AType: TD2D1_SVG_ATTRIBUTE_POD_TYPE; out Value: PByte;
            valueSizeInBytes: UINT32): HResult; stdcall; overload;

This should be:

function GetAttributeValue(Name: PWideChar; AType: TD2D1_SVG_ATTRIBUTE_POD_TYPE; Value: Pointer;
            valueSizeInBytes: UINT32): HResult; stdcall; overload;

The above has been tested and it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions