Skip to content

Conversation

@Sergio0694
Copy link
Contributor

@Sergio0694 Sergio0694 commented May 1, 2025

This doesn't actually require to be null-terminated, and it was quite confusing.

See https://devblogs.microsoft.com/oldnewthing/20160615-00/?p=93675:

"WindowsCreateString creates an HSTRING from a UTF-16LE-encoded buffer and a specified length. The buffer does not require a terminating null."

@prmerger-automator
Copy link

@Sergio0694 : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the documentation for the sourceString parameter in the WindowsCreateString function to clarify that the input buffer does not need to be null-terminated, addressing confusion in the original documentation.

  • Corrects misleading documentation that implied the input string must be null-terminated
  • Adds clarification about UTF-16LE encoding and the function's behavior regarding null termination
  • References Microsoft documentation to support the correction

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@GrantMeStrength GrantMeStrength merged commit 0c7fcf1 into MicrosoftDocs:docs Sep 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants