microsoft / microsoft/CsWin32

Add `IsNull` property to `PWSTR` types.

Open
#1,659 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
2.5k
Forks
124
Avg merge
1d 3h
Merged PRs (30d)
9

Description

Is your feature request related to a problem? Please describe.

Currently if I need to check if the underlying value is null, I need to use an unsafe block to access the raw pointer, or I need to use an extension method to get me an IntPtr and then check if it's != IntPtr.Zero.

Describe the solution you'd like

Add an .IsNull property like most other pointer wrappers have.

Describe alternatives you've considered

My own extension property or method.

Additional context

N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names PWSTR types but no source file or test. Locate the existing pointer-wrapper implementations and their IsNull members, then identify the PWSTR entry point; done means PWSTR exposes a matching IsNull property without unsafe caller code and the relevant tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
operating-systems
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.