Skip to content

IWICBitmapSource.CopyPixels last parameter should allow byte* and/or Span<byte> #909

@harborsiem

Description

@harborsiem

Actual behavior

HRESULT Windows.Win32.Graphics.Imaging.IWICBitmapSource.CopyPixels(WICRect* prc, uint cbStride, uint cbBufferSize, byte[] pbBuffer).
I think the byte array is wrong here, because the user have no information about the size of the array before calling CopyPixels.
Also the extended versions for this call seems to be wrong.

Expected behavior

unsafe HRESULT Windows.Win32.Graphics.Imaging.IWICBitmapSource.CopyPixels(WICRect* prc, uint cbStride, uint cbBufferSize, byte* pbBuffer).

Repro steps

  1. NativeMethods.txt content:
IWICBitmapSource
  1. NativeMethods.json content (if present):
  "$schema": "https://aka.ms/CsWin32.schema.json",
  "emitSingleFile": true,
  "public": true,
  "comInterop": {
    "useIntPtrForComOutPointers": true,
    "preserveSigMethods": [
      "IWICBitmapSource",
    ]
  },
  "useSafeHandles": false
  1. Any of your own code that should be shared?

Context

  • CsWin32 version: 0.2.219-beta
  • Win32Metadata version (if explicitly set by project):
  • Target Framework: [e.g. netstandard2.0]
  • LangVersion (if explicitly set by project): [e.g. 9]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions