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

Windows: fix syscall.ERROR_MORE_DATA #67

Closed
wants to merge 3 commits into from

Conversation

neilalexander
Copy link
Contributor

@neilalexander neilalexander commented Jul 19, 2019

The syscall.ERROR_MORE_DATA code is not a true error condition on Windows and shouldn't be treated as such when performing reads/writes. This PR now correctly handles this condition, reading the rest of the available buffer before returning.

@neilalexander neilalexander changed the title Windows: ignore syscall.ERROR_MORE_DATA Windows: fix syscall.ERROR_MORE_DATA Jul 20, 2019
@Vort
Copy link

Vort commented Aug 5, 2019

This fix may be not correct.

@neilalexander
Copy link
Contributor Author

I'm actually not convinced it is anymore either. I think someone who knows Windows better than me should really take a look at this.

@songgao
Copy link
Owner

songgao commented Aug 11, 2019

According to https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regenumvaluea , ERROR_MORE_DATA seems to mean the data available for read is larger than the asked size, in this case I assume is the size of the buffer that's passed into the Read. If that's the case, it seem this error should just be returned and caller should use a buffer that's large enough.

@neilalexander
Copy link
Contributor Author

I'm closing this PR because I am hopelessly useless with the Win32 API and I don't think this actually resolves the problem. I think you are perhaps right about input buffer sizes.

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

Successfully merging this pull request may close these issues.

None yet

3 participants