microsoft / microsoft/windows-rs

`windows-strings` additional string types

Open
#3,810 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Rust
Stars
12.8k
Forks
665
Avg merge
7h 9m
Merged PRs (30d)
70

Description

### Suggestion

With recent improvements to windows-rs we've been able to get rid of most of our bespoke RAII helpers, but we still have 2 which could be of general interest to others:
- An owned string type for interacting with strings from APIs that use CoTaskMemoAlloc'ed strings
- An owned string type for UNICODE_STRINGs. This could be satisfied if there was a specialization of `Owned` for this struct, though of course an actual string struct would have benefits like conventional string methods.

The first especially is all over COM, and given that underlying C data type is just PWSTR it would be great to have representation in the type system. The ideal case is of course to have method signatures directly interact with string types matching the allocation strategy, but if this is not possible due to missing API metadata, just having a standardized helper that could immediately take string ownership would be a great first step.

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by locating the existing bespoke RAII helpers and windows-rs string and ownership abstractions, then determine how CoTaskMemAlloc'ed strings and UNICODE_STRINGs should be represented; done means agreeing on and implementing the required owned string APIs.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.