Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WriteConsole parameter annotation is wrong #299

Open
jay opened this issue Oct 15, 2023 · 0 comments
Open

WriteConsole parameter annotation is wrong #299

jay opened this issue Oct 15, 2023 · 0 comments

Comments

@jay
Copy link

jay commented Oct 15, 2023

WriteConsole parameter lpNumberOfCharsWritten has the annotation _Out_opt_ (out optional) in the documentation but curl/curl#12131 reports that the parameter is mandatory for Windows XP. I checked the Windows 7 SDK and the parameter is annotated as mandatory __out. However, I wrote the code where curl calls WriteConsole in Windows 7 and the function does not fail when the parameter is NULL. So at some earlier point it was not optional.

Reported-by: [email protected]

/cc @lordmulder


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

jay pushed a commit to curl/curl that referenced this issue Oct 15, 2023
- Pass missing parameter for 'lpNumberOfCharsWritten' to WriteConsoleW()
  function.

Apparently this parameter was *not* optional on older Windows versions.

Issue observed on Windows XP SP2. Issue not observed on Windows 7 SP1.
So at some point between those two Microsoft changed the behavior.

Prior to this change, on those versions if parameter is NULL then the
function call fails with error ERROR_INVALID_ACCESS.

Regression since af3f4e4.

Ref: MicrosoftDocs/Console-Docs#299

Fixes #12131
Closes #12130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant