Skip to content

Replace calls to Marshal.PtrToStringUni methods with Utf16StringMarshaller #118988

@xtqqczze

Description

@xtqqczze
  • Replace calls to Marshal.PtrToStringUni and Marshal.StringToCoTaskMemUni with calls of equivalent methods on Utf16StringMarshaller throughout the repository.
  • Improve type consistency by updating method signatures and fields to use ushort* instead of IntPtr for UTF-16 string pointers, removing unnecessary (IntPtr) casts.
  • Add unsafe modifiers to fix unsafe context issues when using unmanaged pointers as appropriate.
  • Do not change interop tests.
  • Preserve original Utf16StringMarshaller.cs

cc: @copilot, @jkotas

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions